vibe-coding-master 0.3.12 → 0.3.14
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 +2 -2
- package/dist/backend/codex-sandbox-mode.js +28 -0
- package/dist/backend/server.js +2 -1
- package/dist/backend/services/codex-translation-service.js +279 -17
- package/dist/backend/services/session-service.js +34 -5
- package/dist/backend/services/translation-service.js +4 -1
- package/dist/backend/templates/harness/codex-review.js +9 -0
- package/dist-frontend/assets/{index-C7Nb1xPJ.js → index-BraXqj3h.js} +39 -39
- package/dist-frontend/assets/index-C83pgMtr.css +32 -0
- package/dist-frontend/index.html +2 -2
- package/docs/codex-review-gates.md +6 -4
- package/docs/codex-translation-plan.md +138 -94
- package/package.json +1 -1
- package/dist-frontend/assets/index-B13y-ZM8.css +0 -32
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var I0=Object.defineProperty;var U0=(n,r,s)=>r in n?I0(n,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[r]=s;var Yp=(n,r,s)=>U0(n,typeof r!="symbol"?r+"":r,s);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const v of d)if(v.type==="childList")for(const f of v.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function s(d){const v={};return d.integrity&&(v.integrity=d.integrity),d.referrerPolicy&&(v.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?v.credentials="include":d.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function o(d){if(d.ep)return;d.ep=!0;const v=s(d);fetch(d.href,v)}})();function lg(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Wc={exports:{}},Vs={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@ var H0=Object.defineProperty;var I0=(n,r,s)=>r in n?H0(n,r,{enumerable:!0,config
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Wp;function
|
|
9
|
+
*/var Wp;function P0(){if(Wp)return Vs;Wp=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(o,d,v){var f=null;if(v!==void 0&&(f=""+v),d.key!==void 0&&(f=""+d.key),"key"in d){v={};for(var a in d)a!=="key"&&(v[a]=d[a])}else v=d;return d=v.ref,{$$typeof:n,type:o,key:f,ref:d!==void 0?d:null,props:v}}return Vs.Fragment=r,Vs.jsx=s,Vs.jsxs=s,Vs}var Kp;function F0(){return Kp||(Kp=1,Wc.exports=P0()),Wc.exports}var N=F0(),Kc={exports:{}},ze={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react.production.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ var H0=Object.defineProperty;var I0=(n,r,s)=>r in n?H0(n,r,{enumerable:!0,config
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Xp;function
|
|
17
|
+
*/var Xp;function q0(){if(Xp)return ze;Xp=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),f=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),u=Symbol.for("react.activity"),S=Symbol.iterator;function C(j){return j===null||typeof j!="object"?null:(j=S&&j[S]||j["@@iterator"],typeof j=="function"?j:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,b={};function _(j,V,I){this.props=j,this.context=V,this.refs=b,this.updater=I||A}_.prototype.isReactComponent={},_.prototype.setState=function(j,V){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,V,"setState")},_.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function g(){}g.prototype=_.prototype;function y(j,V,I){this.props=j,this.context=V,this.refs=b,this.updater=I||A}var k=y.prototype=new g;k.constructor=y,x(k,_.prototype),k.isPureReactComponent=!0;var M=Array.isArray;function D(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function R(j,V,I){var ne=I.ref;return{$$typeof:n,type:j,key:V,ref:ne!==void 0?ne:null,props:I}}function B(j,V){return R(j.type,V,j.props)}function H(j){return typeof j=="object"&&j!==null&&j.$$typeof===n}function P(j){var V={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(I){return V[I]})}var F=/\/+/g;function $(j,V){return typeof j=="object"&&j!==null&&j.key!=null?P(""+j.key):V.toString(36)}function W(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(D,D):(j.status="pending",j.then(function(V){j.status==="pending"&&(j.status="fulfilled",j.value=V)},function(V){j.status==="pending"&&(j.status="rejected",j.reason=V)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function G(j,V,I,ne,_e){var me=typeof j;(me==="undefined"||me==="boolean")&&(j=null);var Q=!1;if(j===null)Q=!0;else switch(me){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(j.$$typeof){case n:case r:Q=!0;break;case p:return Q=j._init,G(Q(j._payload),V,I,ne,_e)}}if(Q)return _e=_e(j),Q=ne===""?"."+$(j,0):ne,M(_e)?(I="",Q!=null&&(I=Q.replace(F,"$&/")+"/"),G(_e,V,I,"",function(Y){return Y})):_e!=null&&(H(_e)&&(_e=B(_e,I+(_e.key==null||j&&j.key===_e.key?"":(""+_e.key).replace(F,"$&/")+"/")+Q)),V.push(_e)),1;Q=0;var q=ne===""?".":ne+":";if(M(j))for(var J=0;J<j.length;J++)ne=j[J],me=q+$(ne,J),Q+=G(ne,V,I,me,_e);else if(J=C(j),typeof J=="function")for(j=J.call(j),J=0;!(ne=j.next()).done;)ne=ne.value,me=q+$(ne,J++),Q+=G(ne,V,I,me,_e);else if(me==="object"){if(typeof j.then=="function")return G(W(j),V,I,ne,_e);throw V=String(j),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return Q}function X(j,V,I){if(j==null)return j;var ne=[],_e=0;return G(j,ne,"","",function(me){return V.call(I,me,_e++)}),ne}function te(j){if(j._status===-1){var V=j._result;V=V(),V.then(function(I){(j._status===0||j._status===-1)&&(j._status=1,j._result=I)},function(I){(j._status===0||j._status===-1)&&(j._status=2,j._result=I)}),j._status===-1&&(j._status=0,j._result=V)}if(j._status===1)return j._result.default;throw j._result}var z=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},O={map:X,forEach:function(j,V,I){X(j,function(){V.apply(this,arguments)},I)},count:function(j){var V=0;return X(j,function(){V++}),V},toArray:function(j){return X(j,function(V){return V})||[]},only:function(j){if(!H(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return ze.Activity=u,ze.Children=O,ze.Component=_,ze.Fragment=s,ze.Profiler=d,ze.PureComponent=y,ze.StrictMode=o,ze.Suspense=c,ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,ze.__COMPILER_RUNTIME={__proto__:null,c:function(j){return T.H.useMemoCache(j)}},ze.cache=function(j){return function(){return j.apply(null,arguments)}},ze.cacheSignal=function(){return null},ze.cloneElement=function(j,V,I){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var ne=x({},j.props),_e=j.key;if(V!=null)for(me in V.key!==void 0&&(_e=""+V.key),V)!E.call(V,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&V.ref===void 0||(ne[me]=V[me]);var me=arguments.length-2;if(me===1)ne.children=I;else if(1<me){for(var Q=Array(me),q=0;q<me;q++)Q[q]=arguments[q+2];ne.children=Q}return R(j.type,_e,ne)},ze.createContext=function(j){return j={$$typeof:f,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:v,_context:j},j},ze.createElement=function(j,V,I){var ne,_e={},me=null;if(V!=null)for(ne in V.key!==void 0&&(me=""+V.key),V)E.call(V,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(_e[ne]=V[ne]);var Q=arguments.length-2;if(Q===1)_e.children=I;else if(1<Q){for(var q=Array(Q),J=0;J<Q;J++)q[J]=arguments[J+2];_e.children=q}if(j&&j.defaultProps)for(ne in Q=j.defaultProps,Q)_e[ne]===void 0&&(_e[ne]=Q[ne]);return R(j,me,_e)},ze.createRef=function(){return{current:null}},ze.forwardRef=function(j){return{$$typeof:a,render:j}},ze.isValidElement=H,ze.lazy=function(j){return{$$typeof:p,_payload:{_status:-1,_result:j},_init:te}},ze.memo=function(j,V){return{$$typeof:h,type:j,compare:V===void 0?null:V}},ze.startTransition=function(j){var V=T.T,I={};T.T=I;try{var ne=j(),_e=T.S;_e!==null&&_e(I,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(D,z)}catch(me){z(me)}finally{V!==null&&I.types!==null&&(V.types=I.types),T.T=V}},ze.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},ze.use=function(j){return T.H.use(j)},ze.useActionState=function(j,V,I){return T.H.useActionState(j,V,I)},ze.useCallback=function(j,V){return T.H.useCallback(j,V)},ze.useContext=function(j){return T.H.useContext(j)},ze.useDebugValue=function(){},ze.useDeferredValue=function(j,V){return T.H.useDeferredValue(j,V)},ze.useEffect=function(j,V){return T.H.useEffect(j,V)},ze.useEffectEvent=function(j){return T.H.useEffectEvent(j)},ze.useId=function(){return T.H.useId()},ze.useImperativeHandle=function(j,V,I){return T.H.useImperativeHandle(j,V,I)},ze.useInsertionEffect=function(j,V){return T.H.useInsertionEffect(j,V)},ze.useLayoutEffect=function(j,V){return T.H.useLayoutEffect(j,V)},ze.useMemo=function(j,V){return T.H.useMemo(j,V)},ze.useOptimistic=function(j,V){return T.H.useOptimistic(j,V)},ze.useReducer=function(j,V,I){return T.H.useReducer(j,V,I)},ze.useRef=function(j){return T.H.useRef(j)},ze.useState=function(j){return T.H.useState(j)},ze.useSyncExternalStore=function(j,V,I){return T.H.useSyncExternalStore(j,V,I)},ze.useTransition=function(){return T.H.useTransition()},ze.version="19.2.6",ze}var Qp;function Ou(){return Qp||(Qp=1,Kc.exports=q0()),Kc.exports}var ce=Ou(),Xc={exports:{}},Gs={},Qc={exports:{}},Zc={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ var H0=Object.defineProperty;var I0=(n,r,s)=>r in n?H0(n,r,{enumerable:!0,config
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var Zp;function
|
|
25
|
+
*/var Zp;function V0(){return Zp||(Zp=1,(function(n){function r(G,X){var te=G.length;G.push(X);e:for(;0<te;){var z=te-1>>>1,O=G[z];if(0<d(O,X))G[z]=X,G[te]=O,te=z;else break e}}function s(G){return G.length===0?null:G[0]}function o(G){if(G.length===0)return null;var X=G[0],te=G.pop();if(te!==X){G[0]=te;e:for(var z=0,O=G.length,j=O>>>1;z<j;){var V=2*(z+1)-1,I=G[V],ne=V+1,_e=G[ne];if(0>d(I,te))ne<O&&0>d(_e,I)?(G[z]=_e,G[ne]=te,z=ne):(G[z]=I,G[V]=te,z=V);else if(ne<O&&0>d(_e,te))G[z]=_e,G[ne]=te,z=ne;else break e}}return X}function d(G,X){var te=G.sortIndex-X.sortIndex;return te!==0?te:G.id-X.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var v=performance;n.unstable_now=function(){return v.now()}}else{var f=Date,a=f.now();n.unstable_now=function(){return f.now()-a}}var c=[],h=[],p=1,u=null,S=3,C=!1,A=!1,x=!1,b=!1,_=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function k(G){for(var X=s(h);X!==null;){if(X.callback===null)o(h);else if(X.startTime<=G)o(h),X.sortIndex=X.expirationTime,r(c,X);else break;X=s(h)}}function M(G){if(x=!1,k(G),!A)if(s(c)!==null)A=!0,D||(D=!0,P());else{var X=s(h);X!==null&&W(M,X.startTime-G)}}var D=!1,T=-1,E=5,R=-1;function B(){return b?!0:!(n.unstable_now()-R<E)}function H(){if(b=!1,D){var G=n.unstable_now();R=G;var X=!0;try{e:{A=!1,x&&(x=!1,g(T),T=-1),C=!0;var te=S;try{t:{for(k(G),u=s(c);u!==null&&!(u.expirationTime>G&&B());){var z=u.callback;if(typeof z=="function"){u.callback=null,S=u.priorityLevel;var O=z(u.expirationTime<=G);if(G=n.unstable_now(),typeof O=="function"){u.callback=O,k(G),X=!0;break t}u===s(c)&&o(c),k(G)}else o(c);u=s(c)}if(u!==null)X=!0;else{var j=s(h);j!==null&&W(M,j.startTime-G),X=!1}}break e}finally{u=null,S=te,C=!1}X=void 0}}finally{X?P():D=!1}}}var P;if(typeof y=="function")P=function(){y(H)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,$=F.port2;F.port1.onmessage=H,P=function(){$.postMessage(null)}}else P=function(){_(H,0)};function W(G,X){T=_(function(){G(n.unstable_now())},X)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(G){G.callback=null},n.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<G?Math.floor(1e3/G):5},n.unstable_getCurrentPriorityLevel=function(){return S},n.unstable_next=function(G){switch(S){case 1:case 2:case 3:var X=3;break;default:X=S}var te=S;S=X;try{return G()}finally{S=te}},n.unstable_requestPaint=function(){b=!0},n.unstable_runWithPriority=function(G,X){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var te=S;S=G;try{return X()}finally{S=te}},n.unstable_scheduleCallback=function(G,X,te){var z=n.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?z+te:z):te=z,G){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=te+O,G={id:p++,callback:X,priorityLevel:G,startTime:te,expirationTime:O,sortIndex:-1},te>z?(G.sortIndex=te,r(h,G),s(c)===null&&G===s(h)&&(x?(g(T),T=-1):x=!0,W(M,te-z))):(G.sortIndex=O,r(c,G),A||C||(A=!0,D||(D=!0,P()))),G},n.unstable_shouldYield=B,n.unstable_wrapCallback=function(G){var X=S;return function(){var te=S;S=X;try{return G.apply(this,arguments)}finally{S=te}}}})(Zc)),Zc}var Jp;function G0(){return Jp||(Jp=1,Qc.exports=V0()),Qc.exports}var Jc={exports:{}},Pt={};/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.js
|
|
28
28
|
*
|
|
@@ -30,7 +30,7 @@ var H0=Object.defineProperty;var I0=(n,r,s)=>r in n?H0(n,r,{enumerable:!0,config
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var em;function
|
|
33
|
+
*/var em;function $0(){if(em)return Pt;em=1;var n=Ou();function r(c){var h="https://react.dev/errors/"+c;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+c+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var o={d:{f:s,r:function(){throw Error(r(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},d=Symbol.for("react.portal");function v(c,h,p){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:u==null?null:""+u,children:c,containerInfo:h,implementation:p}}var f=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(c,h){if(c==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Pt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Pt.createPortal=function(c,h){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(r(299));return v(c,h,null,p)},Pt.flushSync=function(c){var h=f.T,p=o.p;try{if(f.T=null,o.p=2,c)return c()}finally{f.T=h,o.p=p,o.d.f()}},Pt.preconnect=function(c,h){typeof c=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(c,h))},Pt.prefetchDNS=function(c){typeof c=="string"&&o.d.D(c)},Pt.preinit=function(c,h){if(typeof c=="string"&&h&&typeof h.as=="string"){var p=h.as,u=a(p,h.crossOrigin),S=typeof h.integrity=="string"?h.integrity:void 0,C=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?o.d.S(c,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:u,integrity:S,fetchPriority:C}):p==="script"&&o.d.X(c,{crossOrigin:u,integrity:S,fetchPriority:C,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Pt.preinitModule=function(c,h){if(typeof c=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=a(h.as,h.crossOrigin);o.d.M(c,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(c)},Pt.preload=function(c,h){if(typeof c=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,u=a(p,h.crossOrigin);o.d.L(c,p,{crossOrigin:u,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})}},Pt.preloadModule=function(c,h){if(typeof c=="string")if(h){var p=a(h.as,h.crossOrigin);o.d.m(c,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(c)},Pt.requestFormReset=function(c){o.d.r(c)},Pt.unstable_batchedUpdates=function(c,h){return c(h)},Pt.useFormState=function(c,h,p){return f.H.useFormState(c,h,p)},Pt.useFormStatus=function(){return f.H.useHostTransitionStatus()},Pt.version="19.2.6",Pt}var tm;function Y0(){if(tm)return Jc.exports;tm=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Jc.exports=$0(),Jc.exports}/**
|
|
34
34
|
* @license React
|
|
35
35
|
* react-dom-client.production.js
|
|
36
36
|
*
|
|
@@ -38,55 +38,55 @@ var H0=Object.defineProperty;var I0=(n,r,s)=>r in n?H0(n,r,{enumerable:!0,config
|
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the MIT license found in the
|
|
40
40
|
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var nm;function
|
|
41
|
+
*/var nm;function W0(){if(nm)return Gs;nm=1;var n=G0(),r=Ou(),s=Y0();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function v(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function a(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(v(e)!==e)throw Error(o(188))}function h(e){var t=e.alternate;if(!t){if(t=v(e),t===null)throw Error(o(188));return t!==e?null:e}for(var i=e,l=t;;){var m=i.return;if(m===null)break;var w=m.alternate;if(w===null){if(l=m.return,l!==null){i=l;continue}break}if(m.child===w.child){for(w=m.child;w;){if(w===i)return c(m),e;if(w===l)return c(m),t;w=w.sibling}throw Error(o(188))}if(i.return!==l.return)i=m,l=w;else{for(var L=!1,U=m.child;U;){if(U===i){L=!0,i=m,l=w;break}if(U===l){L=!0,l=m,i=w;break}U=U.sibling}if(!L){for(U=w.child;U;){if(U===i){L=!0,i=w,l=m;break}if(U===l){L=!0,l=w,i=m;break}U=U.sibling}if(!L)throw Error(o(189))}}if(i.alternate!==l)throw Error(o(190))}if(i.tag!==3)throw Error(o(188));return i.stateNode.current===i?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var u=Object.assign,S=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),y=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function P(e){return e===null||typeof e!="object"?null:(e=H&&e[H]||e["@@iterator"],typeof e=="function"?e:null)}var F=Symbol.for("react.client.reference");function $(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===F?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case x:return"Fragment";case _:return"Profiler";case b:return"StrictMode";case M:return"Suspense";case D:return"SuspenseList";case R:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case A:return"Portal";case y:return e.displayName||"Context";case g:return(e._context.displayName||"Context")+".Consumer";case k:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case T:return t=e.displayName||null,t!==null?t:$(e.type)||"Memo";case E:t=e._payload,e=e._init;try{return $(e(t))}catch{}}return null}var W=Array.isArray,G=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},z=[],O=-1;function j(e){return{current:e}}function V(e){0>O||(e.current=z[O],z[O]=null,O--)}function I(e,t){O++,z[O]=e.current,e.current=t}var ne=j(null),_e=j(null),me=j(null),Q=j(null);function q(e,t){switch(I(me,t),I(_e,e),I(ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=gp(t),e=_p(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V(ne),I(ne,e)}function J(){V(ne),V(_e),V(me)}function Y(e){e.memoizedState!==null&&I(Q,e);var t=ne.current,i=_p(t,e.type);t!==i&&(I(_e,e),I(ne,i))}function he(e){_e.current===e&&(V(ne),V(_e)),Q.current===e&&(V(Q),Us._currentValue=te)}var de,be;function Pe(e){if(de===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);de=t&&t[1]||"",be=-1<i.stack.indexOf(`
|
|
42
42
|
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+de+e+be}var
|
|
43
|
+
`+de+e+be}var Fe=!1;function We(e,t){if(!e||Fe)return"";Fe=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(oe){var se=oe}Reflect.construct(e,[],ge)}else{try{ge.call()}catch(oe){se=oe}e.call(ge.prototype)}}else{try{throw Error()}catch(oe){se=oe}(ge=e())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(oe){if(oe&&se&&typeof oe.stack=="string")return[oe.stack,se.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=l.DetermineComponentFrameRoot(),L=w[0],U=w[1];if(L&&U){var K=L.split(`
|
|
44
44
|
`),re=U.split(`
|
|
45
|
-
`);for(m=l=0;l<
|
|
46
|
-
`+
|
|
45
|
+
`);for(m=l=0;l<K.length&&!K[l].includes("DetermineComponentFrameRoot");)l++;for(;m<re.length&&!re[m].includes("DetermineComponentFrameRoot");)m++;if(l===K.length||m===re.length)for(l=K.length-1,m=re.length-1;1<=l&&0<=m&&K[l]!==re[m];)m--;for(;1<=l&&0<=m;l--,m--)if(K[l]!==re[m]){if(l!==1||m!==1)do if(l--,m--,0>m||K[l]!==re[m]){var fe=`
|
|
46
|
+
`+K[l].replace(" at new "," at ");return e.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",e.displayName)),fe}while(1<=l&&0<=m);break}}}finally{Fe=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?Pe(i):""}function De(e,t){switch(e.tag){case 26:case 27:case 5:return Pe(e.type);case 16:return Pe("Lazy");case 13:return e.child!==t&&t!==null?Pe("Suspense Fallback"):Pe("Suspense");case 19:return Pe("SuspenseList");case 0:case 15:return We(e.type,!1);case 11:return We(e.type.render,!1);case 1:return We(e.type,!0);case 31:return Pe("Activity");default:return""}}function Rt(e){try{var t="",i=null;do t+=De(e,i),i=e,e=e.return;while(e);return t}catch(l){return`
|
|
47
47
|
Error generating stack: `+l.message+`
|
|
48
|
-
`+l.stack}}var ht=Object.prototype.hasOwnProperty,Lt=n.unstable_scheduleCallback,it=n.unstable_cancelCallback,kt=n.unstable_shouldYield,ae=n.unstable_requestPaint,at=n.unstable_now,Ze=n.unstable_getCurrentPriorityLevel,ue=n.unstable_ImmediatePriority,Se=n.unstable_UserBlockingPriority,Ce=n.unstable_NormalPriority,De=n.unstable_LowPriority,Ne=n.unstable_IdlePriority,_t=n.log,Fe=n.unstable_setDisableYieldValue,bt=null,rt=null;function Ct(e){if(typeof _t=="function"&&Fe(e),rt&&typeof rt.setStrictMode=="function")try{rt.setStrictMode(bt,e)}catch{}}var tt=Math.clz32?Math.clz32:es,ln=Math.log,Yt=Math.LN2;function es(e){return e>>>=0,e===0?32:31-(ln(e)/Yt|0)|0}var _n=256,Rn=262144,an=4194304;function ve(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Me(e,t,i){var l=e.pendingLanes;if(l===0)return 0;var m=0,C=e.suspendedLanes,L=e.pingedLanes;e=e.warmLanes;var U=l&134217727;return U!==0?(l=U&~C,l!==0?m=ve(l):(L&=U,L!==0?m=ve(L):i||(i=U&~e,i!==0&&(m=ve(i))))):(U=l&~C,U!==0?m=ve(U):L!==0?m=ve(L):i||(i=l&~e,i!==0&&(m=ve(i)))),m===0?0:t!==0&&t!==m&&(t&C)===0&&(C=m&-m,i=t&-t,C>=i||C===32&&(i&4194048)!==0)?t:m}function Be(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function vn(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 He(){var e=an;return an<<=1,(an&62914560)===0&&(an=4194304),e}function Fn(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Mn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function za(e,t,i,l,m,C){var L=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var U=e.entanglements,W=e.expirationTimes,re=e.hiddenUpdates;for(i=L&~i;0<i;){var fe=31-tt(i),me=1<<fe;U[fe]=0,W[fe]=-1;var se=re[fe];if(se!==null)for(re[fe]=null,fe=0;fe<se.length;fe++){var oe=se[fe];oe!==null&&(oe.lane&=-536870913)}i&=~me}l!==0&&al(e,l,0),C!==0&&m===0&&e.tag!==0&&(e.suspendedLanes|=C&~(L&~t))}function al(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-tt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|i&261930}function sr(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var l=31-tt(i),m=1<<l;m&t|e[l]&t&&(e[l]|=t),i&=~m}}function ts(e,t){var i=t&-t;return i=(i&42)!==0?1:le(i),(i&(e.suspendedLanes|t))!==0?0:i}function le(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function we(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function wt(){var e=X.p;return e!==0?e:(e=window.event,e===void 0?32:Up(e.type))}function zt(e,t){var i=X.p;try{return X.p=e,t()}finally{X.p=i}}var oi=Math.random().toString(36).slice(2),Ht="__reactFiber$"+oi,Xt="__reactProps$"+oi,lr="__reactContainer$"+oi,Ha="__reactEvents$"+oi,A_="__reactListeners$"+oi,T_="__reactHandles$"+oi,nh="__reactResources$"+oi,ns="__reactMarker$"+oi;function Ia(e){delete e[Ht],delete e[Xt],delete e[Ha],delete e[A_],delete e[T_]}function ar(e){var t=e[Ht];if(t)return t;for(var i=e.parentNode;i;){if(t=i[lr]||i[Ht]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=xp(e);e!==null;){if(i=e[Ht])return i;e=xp(e)}return t}e=i,i=e.parentNode}return null}function or(e){if(e=e[Ht]||e[lr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function is(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function cr(e){var t=e[nh];return t||(t=e[nh]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Bt(e){e[ns]=!0}var ih=new Set,rh={};function Ii(e,t){ur(e,t),ur(e+"Capture",t)}function ur(e,t){for(rh[e]=t,e=0;e<t.length;e++)ih.add(t[e])}var D_=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]*$"),sh={},lh={};function R_(e){return ht.call(lh,e)?!0:ht.call(sh,e)?!1:D_.test(e)?lh[e]=!0:(sh[e]=!0,!1)}function ol(e,t,i){if(R_(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function cl(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function qn(e,t,i,l){if(l===null)e.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+l)}}function yn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ah(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function M_(e,t,i){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var m=l.get,C=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return m.call(this)},set:function(L){i=""+L,C.call(this,L)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return i},setValue:function(L){i=""+L},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ua(e){if(!e._valueTracker){var t=ah(e)?"checked":"value";e._valueTracker=M_(e,t,""+e[t])}}function oh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),l="";return e&&(l=ah(e)?e.checked?"true":"false":e.value),e=l,e!==i?(t.setValue(e),!0):!1}function ul(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var L_=/[\n"\\]/g;function Sn(e){return e.replace(L_,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Pa(e,t,i,l,m,C,L,U){e.name="",L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?e.type=L:e.removeAttribute("type"),t!=null?L==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+yn(t)):e.value!==""+yn(t)&&(e.value=""+yn(t)):L!=="submit"&&L!=="reset"||e.removeAttribute("value"),t!=null?Fa(e,L,yn(t)):i!=null?Fa(e,L,yn(i)):l!=null&&e.removeAttribute("value"),m==null&&C!=null&&(e.defaultChecked=!!C),m!=null&&(e.checked=m&&typeof m!="function"&&typeof m!="symbol"),U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?e.name=""+yn(U):e.removeAttribute("name")}function ch(e,t,i,l,m,C,L,U){if(C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(e.type=C),t!=null||i!=null){if(!(C!=="submit"&&C!=="reset"||t!=null)){Ua(e);return}i=i!=null?""+yn(i):"",t=t!=null?""+yn(t):i,U||t===e.value||(e.value=t),e.defaultValue=t}l=l??m,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=U?e.checked:!!l,e.defaultChecked=!!l,L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"&&(e.name=L),Ua(e)}function Fa(e,t,i){t==="number"&&ul(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function hr(e,t,i,l){if(e=e.options,t){t={};for(var m=0;m<i.length;m++)t["$"+i[m]]=!0;for(i=0;i<e.length;i++)m=t.hasOwnProperty("$"+e[i].value),e[i].selected!==m&&(e[i].selected=m),m&&l&&(e[i].defaultSelected=!0)}else{for(i=""+yn(i),t=null,m=0;m<e.length;m++){if(e[m].value===i){e[m].selected=!0,l&&(e[m].defaultSelected=!0);return}t!==null||e[m].disabled||(t=e[m])}t!==null&&(t.selected=!0)}}function uh(e,t,i){if(t!=null&&(t=""+yn(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+yn(i):""}function hh(e,t,i,l){if(t==null){if(l!=null){if(i!=null)throw Error(o(92));if(K(l)){if(1<l.length)throw Error(o(93));l=l[0]}i=l}i==null&&(i=""),t=i}i=yn(t),e.defaultValue=i,l=e.textContent,l===i&&l!==""&&l!==null&&(e.value=l),Ua(e)}function fr(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var O_=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 fh(e,t,i){var l=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,i):typeof i!="number"||i===0||O_.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function dh(e,t,i){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,i!=null){for(var l in i)!i.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var m in t)l=t[m],t.hasOwnProperty(m)&&i[m]!==l&&fh(e,m,l)}else for(var C in t)t.hasOwnProperty(C)&&fh(e,C,t[C])}function qa(e){if(e.indexOf("-")===-1)return!1;switch(e){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 B_=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"]]),N_=/^[\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 hl(e){return N_.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Vn(){}var Va=null;function Ga(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var dr=null,pr=null;function ph(e){var t=or(e);if(t&&(e=t.stateNode)){var i=e[Xt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Pa(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Sn(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var l=i[t];if(l!==e&&l.form===e.form){var m=l[Xt]||null;if(!m)throw Error(o(90));Pa(l,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(t=0;t<i.length;t++)l=i[t],l.form===e.form&&oh(l)}break e;case"textarea":uh(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&hr(e,!!i.multiple,t,!1)}}}var $a=!1;function mh(e,t,i){if($a)return e(t,i);$a=!0;try{var l=e(t);return l}finally{if($a=!1,(dr!==null||pr!==null)&&(Zl(),dr&&(t=dr,e=pr,pr=dr=null,ph(t),e)))for(t=0;t<e.length;t++)ph(e[t])}}function rs(e,t){var i=e.stateNode;if(i===null)return null;var l=i[Xt]||null;if(l===null)return null;i=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(o(231,t,typeof i));return i}var Gn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ya=!1;if(Gn)try{var ss={};Object.defineProperty(ss,"passive",{get:function(){Ya=!0}}),window.addEventListener("test",ss,ss),window.removeEventListener("test",ss,ss)}catch{Ya=!1}var ci=null,Wa=null,fl=null;function gh(){if(fl)return fl;var e,t=Wa,i=t.length,l,m="value"in ci?ci.value:ci.textContent,C=m.length;for(e=0;e<i&&t[e]===m[e];e++);var L=i-e;for(l=1;l<=L&&t[i-l]===m[C-l];l++);return fl=m.slice(e,1<l?1-l:void 0)}function dl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function pl(){return!0}function _h(){return!1}function Qt(e){function t(i,l,m,C,L){this._reactName=i,this._targetInst=m,this.type=l,this.nativeEvent=C,this.target=L,this.currentTarget=null;for(var U in e)e.hasOwnProperty(U)&&(i=e[U],this[U]=i?i(C):C[U]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?pl:_h,this.isPropagationStopped=_h,this}return u(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=pl)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=pl)},persist:function(){},isPersistent:pl}),t}var Ui={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ml=Qt(Ui),ls=u({},Ui,{view:0,detail:0}),j_=Qt(ls),Ka,Xa,as,gl=u({},ls,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Za,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==as&&(as&&e.type==="mousemove"?(Ka=e.screenX-as.screenX,Xa=e.screenY-as.screenY):Xa=Ka=0,as=e),Ka)},movementY:function(e){return"movementY"in e?e.movementY:Xa}}),vh=Qt(gl),z_=u({},gl,{dataTransfer:0}),H_=Qt(z_),I_=u({},ls,{relatedTarget:0}),Qa=Qt(I_),U_=u({},Ui,{animationName:0,elapsedTime:0,pseudoElement:0}),P_=Qt(U_),F_=u({},Ui,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),q_=Qt(F_),V_=u({},Ui,{data:0}),yh=Qt(V_),G_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$_={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"},Y_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function W_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Y_[e])?!!t[e]:!1}function Za(){return W_}var K_=u({},ls,{key:function(e){if(e.key){var t=G_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=dl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Za,charCode:function(e){return e.type==="keypress"?dl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?dl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),X_=Qt(K_),Q_=u({},gl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sh=Qt(Q_),Z_=u({},ls,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Za}),J_=Qt(Z_),ev=u({},Ui,{propertyName:0,elapsedTime:0,pseudoElement:0}),tv=Qt(ev),nv=u({},gl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),iv=Qt(nv),rv=u({},Ui,{newState:0,oldState:0}),sv=Qt(rv),lv=[9,13,27,32],Ja=Gn&&"CompositionEvent"in window,os=null;Gn&&"documentMode"in document&&(os=document.documentMode);var av=Gn&&"TextEvent"in window&&!os,bh=Gn&&(!Ja||os&&8<os&&11>=os),Ch=" ",wh=!1;function xh(e,t){switch(e){case"keyup":return lv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Eh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var mr=!1;function ov(e,t){switch(e){case"compositionend":return Eh(t);case"keypress":return t.which!==32?null:(wh=!0,Ch);case"textInput":return e=t.data,e===Ch&&wh?null:e;default:return null}}function cv(e,t){if(mr)return e==="compositionend"||!Ja&&xh(e,t)?(e=gh(),fl=Wa=ci=null,mr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return bh&&t.locale!=="ko"?null:t.data;default:return null}}var uv={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 kh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!uv[e.type]:t==="textarea"}function Ah(e,t,i,l){dr?pr?pr.push(l):pr=[l]:dr=l,t=sa(t,"onChange"),0<t.length&&(i=new ml("onChange","change",null,i,l),e.push({event:i,listeners:t}))}var cs=null,us=null;function hv(e){up(e,0)}function _l(e){var t=is(e);if(oh(t))return e}function Th(e,t){if(e==="change")return t}var Dh=!1;if(Gn){var eo;if(Gn){var to="oninput"in document;if(!to){var Rh=document.createElement("div");Rh.setAttribute("oninput","return;"),to=typeof Rh.oninput=="function"}eo=to}else eo=!1;Dh=eo&&(!document.documentMode||9<document.documentMode)}function Mh(){cs&&(cs.detachEvent("onpropertychange",Lh),us=cs=null)}function Lh(e){if(e.propertyName==="value"&&_l(us)){var t=[];Ah(t,us,e,Ga(e)),mh(hv,t)}}function fv(e,t,i){e==="focusin"?(Mh(),cs=t,us=i,cs.attachEvent("onpropertychange",Lh)):e==="focusout"&&Mh()}function dv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return _l(us)}function pv(e,t){if(e==="click")return _l(t)}function mv(e,t){if(e==="input"||e==="change")return _l(t)}function gv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var on=typeof Object.is=="function"?Object.is:gv;function hs(e,t){if(on(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),l=Object.keys(t);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var m=i[l];if(!ht.call(t,m)||!on(e[m],t[m]))return!1}return!0}function Oh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Bh(e,t){var i=Oh(e);e=0;for(var l;i;){if(i.nodeType===3){if(l=e+i.textContent.length,e<=t&&l>=t)return{node:i,offset:t-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Oh(i)}}function Nh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ul(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=ul(e.document)}return t}function no(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var _v=Gn&&"documentMode"in document&&11>=document.documentMode,gr=null,io=null,fs=null,ro=!1;function zh(e,t,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;ro||gr==null||gr!==ul(l)||(l=gr,"selectionStart"in l&&no(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),fs&&hs(fs,l)||(fs=l,l=sa(io,"onSelect"),0<l.length&&(t=new ml("onSelect","select",null,t,i),e.push({event:t,listeners:l}),t.target=gr)))}function Pi(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var _r={animationend:Pi("Animation","AnimationEnd"),animationiteration:Pi("Animation","AnimationIteration"),animationstart:Pi("Animation","AnimationStart"),transitionrun:Pi("Transition","TransitionRun"),transitionstart:Pi("Transition","TransitionStart"),transitioncancel:Pi("Transition","TransitionCancel"),transitionend:Pi("Transition","TransitionEnd")},so={},Hh={};Gn&&(Hh=document.createElement("div").style,"AnimationEvent"in window||(delete _r.animationend.animation,delete _r.animationiteration.animation,delete _r.animationstart.animation),"TransitionEvent"in window||delete _r.transitionend.transition);function Fi(e){if(so[e])return so[e];if(!_r[e])return e;var t=_r[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Hh)return so[e]=t[i];return e}var Ih=Fi("animationend"),Uh=Fi("animationiteration"),Ph=Fi("animationstart"),vv=Fi("transitionrun"),yv=Fi("transitionstart"),Sv=Fi("transitioncancel"),Fh=Fi("transitionend"),qh=new Map,lo="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(" ");lo.push("scrollEnd");function Ln(e,t){qh.set(e,t),Ii(t,[e])}var vl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},bn=[],vr=0,ao=0;function yl(){for(var e=vr,t=ao=vr=0;t<e;){var i=bn[t];bn[t++]=null;var l=bn[t];bn[t++]=null;var m=bn[t];bn[t++]=null;var C=bn[t];if(bn[t++]=null,l!==null&&m!==null){var L=l.pending;L===null?m.next=m:(m.next=L.next,L.next=m),l.pending=m}C!==0&&Vh(i,m,C)}}function Sl(e,t,i,l){bn[vr++]=e,bn[vr++]=t,bn[vr++]=i,bn[vr++]=l,ao|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function oo(e,t,i,l){return Sl(e,t,i,l),bl(e)}function qi(e,t){return Sl(e,null,null,t),bl(e)}function Vh(e,t,i){e.lanes|=i;var l=e.alternate;l!==null&&(l.lanes|=i);for(var m=!1,C=e.return;C!==null;)C.childLanes|=i,l=C.alternate,l!==null&&(l.childLanes|=i),C.tag===22&&(e=C.stateNode,e===null||e._visibility&1||(m=!0)),e=C,C=C.return;return e.tag===3?(C=e.stateNode,m&&t!==null&&(m=31-tt(i),e=C.hiddenUpdates,l=e[m],l===null?e[m]=[t]:l.push(t),t.lane=i|536870912),C):null}function bl(e){if(50<Bs)throw Bs=0,vc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var yr={};function bv(e,t,i,l){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cn(e,t,i,l){return new bv(e,t,i,l)}function co(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $n(e,t){var i=e.alternate;return i===null?(i=cn(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function Gh(e,t){e.flags&=65011714;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Cl(e,t,i,l,m,C){var L=0;if(l=e,typeof e=="function")co(e)&&(L=1);else if(typeof e=="string")L=k0(e,i,ne.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case R:return e=cn(31,i,t,m),e.elementType=R,e.lanes=C,e;case x:return Vi(i.children,m,C,t);case b:L=8,m|=24;break;case _:return e=cn(12,i,t,m|2),e.elementType=_,e.lanes=C,e;case M:return e=cn(13,i,t,m),e.elementType=M,e.lanes=C,e;case D:return e=cn(19,i,t,m),e.elementType=D,e.lanes=C,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case y:L=10;break e;case g:L=9;break e;case k:L=11;break e;case T:L=14;break e;case E:L=16,l=null;break e}L=29,i=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=cn(L,i,t,m),t.elementType=e,t.type=l,t.lanes=C,t}function Vi(e,t,i,l){return e=cn(7,e,l,t),e.lanes=i,e}function uo(e,t,i){return e=cn(6,e,null,t),e.lanes=i,e}function $h(e){var t=cn(18,null,null,0);return t.stateNode=e,t}function ho(e,t,i){return t=cn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Yh=new WeakMap;function Cn(e,t){if(typeof e=="object"&&e!==null){var i=Yh.get(e);return i!==void 0?i:(t={value:e,source:t,stack:jt(t)},Yh.set(e,t),t)}return{value:e,source:t,stack:jt(t)}}var Sr=[],br=0,wl=null,ds=0,wn=[],xn=0,ui=null,jn=1,zn="";function Yn(e,t){Sr[br++]=ds,Sr[br++]=wl,wl=e,ds=t}function Wh(e,t,i){wn[xn++]=jn,wn[xn++]=zn,wn[xn++]=ui,ui=e;var l=jn;e=zn;var m=32-tt(l)-1;l&=~(1<<m),i+=1;var C=32-tt(t)+m;if(30<C){var L=m-m%5;C=(l&(1<<L)-1).toString(32),l>>=L,m-=L,jn=1<<32-tt(t)+m|i<<m|l,zn=C+e}else jn=1<<C|i<<m|l,zn=e}function fo(e){e.return!==null&&(Yn(e,1),Wh(e,1,0))}function po(e){for(;e===wl;)wl=Sr[--br],Sr[br]=null,ds=Sr[--br],Sr[br]=null;for(;e===ui;)ui=wn[--xn],wn[xn]=null,zn=wn[--xn],wn[xn]=null,jn=wn[--xn],wn[xn]=null}function Kh(e,t){wn[xn++]=jn,wn[xn++]=zn,wn[xn++]=ui,jn=t.id,zn=t.overflow,ui=e}var It=null,mt=null,Xe=!1,hi=null,En=!1,mo=Error(o(519));function fi(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ps(Cn(t,e)),mo}function Xh(e){var t=e.stateNode,i=e.type,l=e.memoizedProps;switch(t[Ht]=e,t[Xt]=l,i){case"dialog":Ge("cancel",t),Ge("close",t);break;case"iframe":case"object":case"embed":Ge("load",t);break;case"video":case"audio":for(i=0;i<js.length;i++)Ge(js[i],t);break;case"source":Ge("error",t);break;case"img":case"image":case"link":Ge("error",t),Ge("load",t);break;case"details":Ge("toggle",t);break;case"input":Ge("invalid",t),ch(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ge("invalid",t);break;case"textarea":Ge("invalid",t),hh(t,l.value,l.defaultValue,l.children)}i=l.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||l.suppressHydrationWarning===!0||pp(t.textContent,i)?(l.popover!=null&&(Ge("beforetoggle",t),Ge("toggle",t)),l.onScroll!=null&&Ge("scroll",t),l.onScrollEnd!=null&&Ge("scrollend",t),l.onClick!=null&&(t.onclick=Vn),t=!0):t=!1,t||fi(e,!0)}function Qh(e){for(It=e.return;It;)switch(It.tag){case 5:case 31:case 13:En=!1;return;case 27:case 3:En=!0;return;default:It=It.return}}function Cr(e){if(e!==It)return!1;if(!Xe)return Qh(e),Xe=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Oc(e.type,e.memoizedProps)),i=!i),i&&mt&&fi(e),Qh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));mt=wp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));mt=wp(e)}else t===27?(t=mt,ki(e.type)?(e=Hc,Hc=null,mt=e):mt=t):mt=It?An(e.stateNode.nextSibling):null;return!0}function Gi(){mt=It=null,Xe=!1}function go(){var e=hi;return e!==null&&(tn===null?tn=e:tn.push.apply(tn,e),hi=null),e}function ps(e){hi===null?hi=[e]:hi.push(e)}var _o=j(null),$i=null,Wn=null;function di(e,t,i){I(_o,t._currentValue),t._currentValue=i}function Kn(e){e._currentValue=_o.current,V(_o)}function vo(e,t,i){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===i)break;e=e.return}}function yo(e,t,i,l){var m=e.child;for(m!==null&&(m.return=e);m!==null;){var C=m.dependencies;if(C!==null){var L=m.child;C=C.firstContext;e:for(;C!==null;){var U=C;C=m;for(var W=0;W<t.length;W++)if(U.context===t[W]){C.lanes|=i,U=C.alternate,U!==null&&(U.lanes|=i),vo(C.return,i,e),l||(L=null);break e}C=U.next}}else if(m.tag===18){if(L=m.return,L===null)throw Error(o(341));L.lanes|=i,C=L.alternate,C!==null&&(C.lanes|=i),vo(L,i,e),L=null}else L=m.child;if(L!==null)L.return=m;else for(L=m;L!==null;){if(L===e){L=null;break}if(m=L.sibling,m!==null){m.return=L.return,L=m;break}L=L.return}m=L}}function wr(e,t,i,l){e=null;for(var m=t,C=!1;m!==null;){if(!C){if((m.flags&524288)!==0)C=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var L=m.alternate;if(L===null)throw Error(o(387));if(L=L.memoizedProps,L!==null){var U=m.type;on(m.pendingProps.value,L.value)||(e!==null?e.push(U):e=[U])}}else if(m===Q.current){if(L=m.alternate,L===null)throw Error(o(387));L.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(e!==null?e.push(Ps):e=[Ps])}m=m.return}e!==null&&yo(t,e,i,l),t.flags|=262144}function xl(e){for(e=e.firstContext;e!==null;){if(!on(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Yi(e){$i=e,Wn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ut(e){return Zh($i,e)}function El(e,t){return $i===null&&Yi(e),Zh(e,t)}function Zh(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Wn===null){if(e===null)throw Error(o(308));Wn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Wn=Wn.next=t;return i}var Cv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},wv=n.unstable_scheduleCallback,xv=n.unstable_NormalPriority,At={$$typeof:y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function So(){return{controller:new Cv,data:new Map,refCount:0}}function ms(e){e.refCount--,e.refCount===0&&wv(xv,function(){e.controller.abort()})}var gs=null,bo=0,xr=0,Er=null;function Ev(e,t){if(gs===null){var i=gs=[];bo=0,xr=xc(),Er={status:"pending",value:void 0,then:function(l){i.push(l)}}}return bo++,t.then(Jh,Jh),t}function Jh(){if(--bo===0&&gs!==null){Er!==null&&(Er.status="fulfilled");var e=gs;gs=null,xr=0,Er=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function kv(e,t){var i=[],l={status:"pending",value:null,reason:null,then:function(m){i.push(m)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var m=0;m<i.length;m++)(0,i[m])(t)},function(m){for(l.status="rejected",l.reason=m,m=0;m<i.length;m++)(0,i[m])(void 0)}),l}var ef=G.S;G.S=function(e,t){Hd=at(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Ev(e,t),ef!==null&&ef(e,t)};var Wi=j(null);function Co(){var e=Wi.current;return e!==null?e:ft.pooledCache}function kl(e,t){t===null?I(Wi,Wi.current):I(Wi,t.pool)}function tf(){var e=Co();return e===null?null:{parent:At._currentValue,pool:e}}var kr=Error(o(460)),wo=Error(o(474)),Al=Error(o(542)),Tl={then:function(){}};function nf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function rf(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Vn,Vn),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,lf(e),e;default:if(typeof t.status=="string")t.then(Vn,Vn);else{if(e=ft,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var m=t;m.status="fulfilled",m.value=l}},function(l){if(t.status==="pending"){var m=t;m.status="rejected",m.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,lf(e),e}throw Xi=t,kr}}function Ki(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Xi=i,kr):i}}var Xi=null;function sf(){if(Xi===null)throw Error(o(459));var e=Xi;return Xi=null,e}function lf(e){if(e===kr||e===Al)throw Error(o(483))}var Ar=null,_s=0;function Dl(e){var t=_s;return _s+=1,Ar===null&&(Ar=[]),rf(Ar,e,t)}function vs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Rl(e,t){throw t.$$typeof===S?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function af(e){function t(te,Z){if(e){var ie=te.deletions;ie===null?(te.deletions=[Z],te.flags|=16):ie.push(Z)}}function i(te,Z){if(!e)return null;for(;Z!==null;)t(te,Z),Z=Z.sibling;return null}function l(te){for(var Z=new Map;te!==null;)te.key!==null?Z.set(te.key,te):Z.set(te.index,te),te=te.sibling;return Z}function m(te,Z){return te=$n(te,Z),te.index=0,te.sibling=null,te}function C(te,Z,ie){return te.index=ie,e?(ie=te.alternate,ie!==null?(ie=ie.index,ie<Z?(te.flags|=67108866,Z):ie):(te.flags|=67108866,Z)):(te.flags|=1048576,Z)}function L(te){return e&&te.alternate===null&&(te.flags|=67108866),te}function U(te,Z,ie,pe){return Z===null||Z.tag!==6?(Z=uo(ie,te.mode,pe),Z.return=te,Z):(Z=m(Z,ie),Z.return=te,Z)}function W(te,Z,ie,pe){var Re=ie.type;return Re===x?fe(te,Z,ie.props.children,pe,ie.key):Z!==null&&(Z.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===E&&Ki(Re)===Z.type)?(Z=m(Z,ie.props),vs(Z,ie),Z.return=te,Z):(Z=Cl(ie.type,ie.key,ie.props,null,te.mode,pe),vs(Z,ie),Z.return=te,Z)}function re(te,Z,ie,pe){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==ie.containerInfo||Z.stateNode.implementation!==ie.implementation?(Z=ho(ie,te.mode,pe),Z.return=te,Z):(Z=m(Z,ie.children||[]),Z.return=te,Z)}function fe(te,Z,ie,pe,Re){return Z===null||Z.tag!==7?(Z=Vi(ie,te.mode,pe,Re),Z.return=te,Z):(Z=m(Z,ie),Z.return=te,Z)}function me(te,Z,ie){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=uo(""+Z,te.mode,ie),Z.return=te,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case w:return ie=Cl(Z.type,Z.key,Z.props,null,te.mode,ie),vs(ie,Z),ie.return=te,ie;case A:return Z=ho(Z,te.mode,ie),Z.return=te,Z;case E:return Z=Ki(Z),me(te,Z,ie)}if(K(Z)||F(Z))return Z=Vi(Z,te.mode,ie,null),Z.return=te,Z;if(typeof Z.then=="function")return me(te,Dl(Z),ie);if(Z.$$typeof===y)return me(te,El(te,Z),ie);Rl(te,Z)}return null}function se(te,Z,ie,pe){var Re=Z!==null?Z.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return Re!==null?null:U(te,Z,""+ie,pe);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case w:return ie.key===Re?W(te,Z,ie,pe):null;case A:return ie.key===Re?re(te,Z,ie,pe):null;case E:return ie=Ki(ie),se(te,Z,ie,pe)}if(K(ie)||F(ie))return Re!==null?null:fe(te,Z,ie,pe,null);if(typeof ie.then=="function")return se(te,Z,Dl(ie),pe);if(ie.$$typeof===y)return se(te,Z,El(te,ie),pe);Rl(te,ie)}return null}function oe(te,Z,ie,pe,Re){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return te=te.get(ie)||null,U(Z,te,""+pe,Re);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case w:return te=te.get(pe.key===null?ie:pe.key)||null,W(Z,te,pe,Re);case A:return te=te.get(pe.key===null?ie:pe.key)||null,re(Z,te,pe,Re);case E:return pe=Ki(pe),oe(te,Z,ie,pe,Re)}if(K(pe)||F(pe))return te=te.get(ie)||null,fe(Z,te,pe,Re,null);if(typeof pe.then=="function")return oe(te,Z,ie,Dl(pe),Re);if(pe.$$typeof===y)return oe(te,Z,ie,El(Z,pe),Re);Rl(Z,pe)}return null}function Ee(te,Z,ie,pe){for(var Re=null,Je=null,ke=Z,Ie=Z=0,We=null;ke!==null&&Ie<ie.length;Ie++){ke.index>Ie?(We=ke,ke=null):We=ke.sibling;var et=se(te,ke,ie[Ie],pe);if(et===null){ke===null&&(ke=We);break}e&&ke&&et.alternate===null&&t(te,ke),Z=C(et,Z,Ie),Je===null?Re=et:Je.sibling=et,Je=et,ke=We}if(Ie===ie.length)return i(te,ke),Xe&&Yn(te,Ie),Re;if(ke===null){for(;Ie<ie.length;Ie++)ke=me(te,ie[Ie],pe),ke!==null&&(Z=C(ke,Z,Ie),Je===null?Re=ke:Je.sibling=ke,Je=ke);return Xe&&Yn(te,Ie),Re}for(ke=l(ke);Ie<ie.length;Ie++)We=oe(ke,te,Ie,ie[Ie],pe),We!==null&&(e&&We.alternate!==null&&ke.delete(We.key===null?Ie:We.key),Z=C(We,Z,Ie),Je===null?Re=We:Je.sibling=We,Je=We);return e&&ke.forEach(function(Mi){return t(te,Mi)}),Xe&&Yn(te,Ie),Re}function Oe(te,Z,ie,pe){if(ie==null)throw Error(o(151));for(var Re=null,Je=null,ke=Z,Ie=Z=0,We=null,et=ie.next();ke!==null&&!et.done;Ie++,et=ie.next()){ke.index>Ie?(We=ke,ke=null):We=ke.sibling;var Mi=se(te,ke,et.value,pe);if(Mi===null){ke===null&&(ke=We);break}e&&ke&&Mi.alternate===null&&t(te,ke),Z=C(Mi,Z,Ie),Je===null?Re=Mi:Je.sibling=Mi,Je=Mi,ke=We}if(et.done)return i(te,ke),Xe&&Yn(te,Ie),Re;if(ke===null){for(;!et.done;Ie++,et=ie.next())et=me(te,et.value,pe),et!==null&&(Z=C(et,Z,Ie),Je===null?Re=et:Je.sibling=et,Je=et);return Xe&&Yn(te,Ie),Re}for(ke=l(ke);!et.done;Ie++,et=ie.next())et=oe(ke,te,Ie,et.value,pe),et!==null&&(e&&et.alternate!==null&&ke.delete(et.key===null?Ie:et.key),Z=C(et,Z,Ie),Je===null?Re=et:Je.sibling=et,Je=et);return e&&ke.forEach(function(z0){return t(te,z0)}),Xe&&Yn(te,Ie),Re}function ut(te,Z,ie,pe){if(typeof ie=="object"&&ie!==null&&ie.type===x&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case w:e:{for(var Re=ie.key;Z!==null;){if(Z.key===Re){if(Re=ie.type,Re===x){if(Z.tag===7){i(te,Z.sibling),pe=m(Z,ie.props.children),pe.return=te,te=pe;break e}}else if(Z.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===E&&Ki(Re)===Z.type){i(te,Z.sibling),pe=m(Z,ie.props),vs(pe,ie),pe.return=te,te=pe;break e}i(te,Z);break}else t(te,Z);Z=Z.sibling}ie.type===x?(pe=Vi(ie.props.children,te.mode,pe,ie.key),pe.return=te,te=pe):(pe=Cl(ie.type,ie.key,ie.props,null,te.mode,pe),vs(pe,ie),pe.return=te,te=pe)}return L(te);case A:e:{for(Re=ie.key;Z!==null;){if(Z.key===Re)if(Z.tag===4&&Z.stateNode.containerInfo===ie.containerInfo&&Z.stateNode.implementation===ie.implementation){i(te,Z.sibling),pe=m(Z,ie.children||[]),pe.return=te,te=pe;break e}else{i(te,Z);break}else t(te,Z);Z=Z.sibling}pe=ho(ie,te.mode,pe),pe.return=te,te=pe}return L(te);case E:return ie=Ki(ie),ut(te,Z,ie,pe)}if(K(ie))return Ee(te,Z,ie,pe);if(F(ie)){if(Re=F(ie),typeof Re!="function")throw Error(o(150));return ie=Re.call(ie),Oe(te,Z,ie,pe)}if(typeof ie.then=="function")return ut(te,Z,Dl(ie),pe);if(ie.$$typeof===y)return ut(te,Z,El(te,ie),pe);Rl(te,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,Z!==null&&Z.tag===6?(i(te,Z.sibling),pe=m(Z,ie),pe.return=te,te=pe):(i(te,Z),pe=uo(ie,te.mode,pe),pe.return=te,te=pe),L(te)):i(te,Z)}return function(te,Z,ie,pe){try{_s=0;var Re=ut(te,Z,ie,pe);return Ar=null,Re}catch(ke){if(ke===kr||ke===Al)throw ke;var Je=cn(29,ke,null,te.mode);return Je.lanes=pe,Je.return=te,Je}finally{}}}var Qi=af(!0),of=af(!1),pi=!1;function xo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Eo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function mi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function gi(e,t,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(nt&2)!==0){var m=l.pending;return m===null?t.next=t:(t.next=m.next,m.next=t),l.pending=t,t=bl(e),Vh(e,null,i),t}return Sl(e,l,t,i),bl(e)}function ys(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,sr(e,i)}}function ko(e,t){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var m=null,C=null;if(i=i.firstBaseUpdate,i!==null){do{var L={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};C===null?m=C=L:C=C.next=L,i=i.next}while(i!==null);C===null?m=C=t:C=C.next=t}else m=C=t;i={baseState:l.baseState,firstBaseUpdate:m,lastBaseUpdate:C,shared:l.shared,callbacks:l.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var Ao=!1;function Ss(){if(Ao){var e=Er;if(e!==null)throw e}}function bs(e,t,i,l){Ao=!1;var m=e.updateQueue;pi=!1;var C=m.firstBaseUpdate,L=m.lastBaseUpdate,U=m.shared.pending;if(U!==null){m.shared.pending=null;var W=U,re=W.next;W.next=null,L===null?C=re:L.next=re,L=W;var fe=e.alternate;fe!==null&&(fe=fe.updateQueue,U=fe.lastBaseUpdate,U!==L&&(U===null?fe.firstBaseUpdate=re:U.next=re,fe.lastBaseUpdate=W))}if(C!==null){var me=m.baseState;L=0,fe=re=W=null,U=C;do{var se=U.lane&-536870913,oe=se!==U.lane;if(oe?(Ye&se)===se:(l&se)===se){se!==0&&se===xr&&(Ao=!0),fe!==null&&(fe=fe.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var Ee=e,Oe=U;se=t;var ut=i;switch(Oe.tag){case 1:if(Ee=Oe.payload,typeof Ee=="function"){me=Ee.call(ut,me,se);break e}me=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=Oe.payload,se=typeof Ee=="function"?Ee.call(ut,me,se):Ee,se==null)break e;me=u({},me,se);break e;case 2:pi=!0}}se=U.callback,se!==null&&(e.flags|=64,oe&&(e.flags|=8192),oe=m.callbacks,oe===null?m.callbacks=[se]:oe.push(se))}else oe={lane:se,tag:U.tag,payload:U.payload,callback:U.callback,next:null},fe===null?(re=fe=oe,W=me):fe=fe.next=oe,L|=se;if(U=U.next,U===null){if(U=m.shared.pending,U===null)break;oe=U,U=oe.next,oe.next=null,m.lastBaseUpdate=oe,m.shared.pending=null}}while(!0);fe===null&&(W=me),m.baseState=W,m.firstBaseUpdate=re,m.lastBaseUpdate=fe,C===null&&(m.shared.lanes=0),bi|=L,e.lanes=L,e.memoizedState=me}}function cf(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function uf(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)cf(i[e],t)}var Tr=j(null),Ml=j(0);function hf(e,t){e=ri,I(Ml,e),I(Tr,t),ri=e|t.baseLanes}function To(){I(Ml,ri),I(Tr,Tr.current)}function Do(){ri=Ml.current,V(Tr),V(Ml)}var un=j(null),kn=null;function _i(e){var t=e.alternate;I(xt,xt.current&1),I(un,e),kn===null&&(t===null||Tr.current!==null||t.memoizedState!==null)&&(kn=e)}function Ro(e){I(xt,xt.current),I(un,e),kn===null&&(kn=e)}function ff(e){e.tag===22?(I(xt,xt.current),I(un,e),kn===null&&(kn=e)):vi()}function vi(){I(xt,xt.current),I(un,un.current)}function hn(e){V(un),kn===e&&(kn=null),V(xt)}var xt=j(0);function Ll(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||jc(i)||zc(i)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Xn=0,ze=null,ot=null,Tt=null,Ol=!1,Dr=!1,Zi=!1,Bl=0,Cs=0,Rr=null,Av=0;function yt(){throw Error(o(321))}function Mo(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!on(e[i],t[i]))return!1;return!0}function Lo(e,t,i,l,m,C){return Xn=C,ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,G.H=e===null||e.memoizedState===null?Kf:Yo,Zi=!1,C=i(l,m),Zi=!1,Dr&&(C=pf(t,i,l,m)),df(e),C}function df(e){G.H=Es;var t=ot!==null&&ot.next!==null;if(Xn=0,Tt=ot=ze=null,Ol=!1,Cs=0,Rr=null,t)throw Error(o(300));e===null||Dt||(e=e.dependencies,e!==null&&xl(e)&&(Dt=!0))}function pf(e,t,i,l){ze=e;var m=0;do{if(Dr&&(Rr=null),Cs=0,Dr=!1,25<=m)throw Error(o(301));if(m+=1,Tt=ot=null,e.updateQueue!=null){var C=e.updateQueue;C.lastEffect=null,C.events=null,C.stores=null,C.memoCache!=null&&(C.memoCache.index=0)}G.H=Xf,C=t(i,l)}while(Dr);return C}function Tv(){var e=G.H,t=e.useState()[0];return t=typeof t.then=="function"?ws(t):t,e=e.useState()[0],(ot!==null?ot.memoizedState:null)!==e&&(ze.flags|=1024),t}function Oo(){var e=Bl!==0;return Bl=0,e}function Bo(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function No(e){if(Ol){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ol=!1}Xn=0,Tt=ot=ze=null,Dr=!1,Cs=Bl=0,Rr=null}function Wt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?ze.memoizedState=Tt=e:Tt=Tt.next=e,Tt}function Et(){if(ot===null){var e=ze.alternate;e=e!==null?e.memoizedState:null}else e=ot.next;var t=Tt===null?ze.memoizedState:Tt.next;if(t!==null)Tt=t,ot=e;else{if(e===null)throw ze.alternate===null?Error(o(467)):Error(o(310));ot=e,e={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},Tt===null?ze.memoizedState=Tt=e:Tt=Tt.next=e}return Tt}function Nl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ws(e){var t=Cs;return Cs+=1,Rr===null&&(Rr=[]),e=rf(Rr,e,t),t=ze,(Tt===null?t.memoizedState:Tt.next)===null&&(t=t.alternate,G.H=t===null||t.memoizedState===null?Kf:Yo),e}function jl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ws(e);if(e.$$typeof===y)return Ut(e)}throw Error(o(438,String(e)))}function jo(e){var t=null,i=ze.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var l=ze.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(m){return m.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=Nl(),ze.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),l=0;l<e;l++)i[l]=N;return t.index++,i}function Qn(e,t){return typeof t=="function"?t(e):t}function zl(e){var t=Et();return zo(t,ot,e)}function zo(e,t,i){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=i;var m=e.baseQueue,C=l.pending;if(C!==null){if(m!==null){var L=m.next;m.next=C.next,C.next=L}t.baseQueue=m=C,l.pending=null}if(C=e.baseState,m===null)e.memoizedState=C;else{t=m.next;var U=L=null,W=null,re=t,fe=!1;do{var me=re.lane&-536870913;if(me!==re.lane?(Ye&me)===me:(Xn&me)===me){var se=re.revertLane;if(se===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),me===xr&&(fe=!0);else if((Xn&se)===se){re=re.next,se===xr&&(fe=!0);continue}else me={lane:0,revertLane:re.revertLane,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},W===null?(U=W=me,L=C):W=W.next=me,ze.lanes|=se,bi|=se;me=re.action,Zi&&i(C,me),C=re.hasEagerState?re.eagerState:i(C,me)}else se={lane:me,revertLane:re.revertLane,gesture:re.gesture,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},W===null?(U=W=se,L=C):W=W.next=se,ze.lanes|=me,bi|=me;re=re.next}while(re!==null&&re!==t);if(W===null?L=C:W.next=U,!on(C,e.memoizedState)&&(Dt=!0,fe&&(i=Er,i!==null)))throw i;e.memoizedState=C,e.baseState=L,e.baseQueue=W,l.lastRenderedState=C}return m===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Ho(e){var t=Et(),i=t.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=e;var l=i.dispatch,m=i.pending,C=t.memoizedState;if(m!==null){i.pending=null;var L=m=m.next;do C=e(C,L.action),L=L.next;while(L!==m);on(C,t.memoizedState)||(Dt=!0),t.memoizedState=C,t.baseQueue===null&&(t.baseState=C),i.lastRenderedState=C}return[C,l]}function mf(e,t,i){var l=ze,m=Et(),C=Xe;if(C){if(i===void 0)throw Error(o(407));i=i()}else i=t();var L=!on((ot||m).memoizedState,i);if(L&&(m.memoizedState=i,Dt=!0),m=m.queue,Po(vf.bind(null,l,m,e),[e]),m.getSnapshot!==t||L||Tt!==null&&Tt.memoizedState.tag&1){if(l.flags|=2048,Mr(9,{destroy:void 0},_f.bind(null,l,m,i,t),null),ft===null)throw Error(o(349));C||(Xn&127)!==0||gf(l,t,i)}return i}function gf(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=ze.updateQueue,t===null?(t=Nl(),ze.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function _f(e,t,i,l){t.value=i,t.getSnapshot=l,yf(t)&&Sf(e)}function vf(e,t,i){return i(function(){yf(t)&&Sf(e)})}function yf(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!on(e,i)}catch{return!0}}function Sf(e){var t=qi(e,2);t!==null&&nn(t,e,2)}function Io(e){var t=Wt();if(typeof e=="function"){var i=e;if(e=i(),Zi){Ct(!0);try{i()}finally{Ct(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qn,lastRenderedState:e},t}function bf(e,t,i,l){return e.baseState=i,zo(e,ot,typeof l=="function"?l:Qn)}function Dv(e,t,i,l,m){if(Ul(e))throw Error(o(485));if(e=t.action,e!==null){var C={payload:m,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(L){C.listeners.push(L)}};G.T!==null?i(!0):C.isTransition=!1,l(C),i=t.pending,i===null?(C.next=t.pending=C,Cf(t,C)):(C.next=i.next,t.pending=i.next=C)}}function Cf(e,t){var i=t.action,l=t.payload,m=e.state;if(t.isTransition){var C=G.T,L={};G.T=L;try{var U=i(m,l),W=G.S;W!==null&&W(L,U),wf(e,t,U)}catch(re){Uo(e,t,re)}finally{C!==null&&L.types!==null&&(C.types=L.types),G.T=C}}else try{C=i(m,l),wf(e,t,C)}catch(re){Uo(e,t,re)}}function wf(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(l){xf(e,t,l)},function(l){return Uo(e,t,l)}):xf(e,t,i)}function xf(e,t,i){t.status="fulfilled",t.value=i,Ef(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,Cf(e,i)))}function Uo(e,t,i){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=i,Ef(t),t=t.next;while(t!==l)}e.action=null}function Ef(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function kf(e,t){return t}function Af(e,t){if(Xe){var i=ft.formState;if(i!==null){e:{var l=ze;if(Xe){if(mt){t:{for(var m=mt,C=En;m.nodeType!==8;){if(!C){m=null;break t}if(m=An(m.nextSibling),m===null){m=null;break t}}C=m.data,m=C==="F!"||C==="F"?m:null}if(m){mt=An(m.nextSibling),l=m.data==="F!";break e}}fi(l)}l=!1}l&&(t=i[0])}}return i=Wt(),i.memoizedState=i.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:kf,lastRenderedState:t},i.queue=l,i=$f.bind(null,ze,l),l.dispatch=i,l=Io(!1),C=$o.bind(null,ze,!1,l.queue),l=Wt(),m={state:t,dispatch:null,action:e,pending:null},l.queue=m,i=Dv.bind(null,ze,m,C,i),m.dispatch=i,l.memoizedState=e,[t,i,!1]}function Tf(e){var t=Et();return Df(t,ot,e)}function Df(e,t,i){if(t=zo(e,t,kf)[0],e=zl(Qn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=ws(t)}catch(L){throw L===kr?Al:L}else l=t;t=Et();var m=t.queue,C=m.dispatch;return i!==t.memoizedState&&(ze.flags|=2048,Mr(9,{destroy:void 0},Rv.bind(null,m,i),null)),[l,C,e]}function Rv(e,t){e.action=t}function Rf(e){var t=Et(),i=ot;if(i!==null)return Df(t,i,e);Et(),t=t.memoizedState,i=Et();var l=i.queue.dispatch;return i.memoizedState=e,[t,l,!1]}function Mr(e,t,i,l){return e={tag:e,create:i,deps:l,inst:t,next:null},t=ze.updateQueue,t===null&&(t=Nl(),ze.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,t.lastEffect=e),e}function Mf(){return Et().memoizedState}function Hl(e,t,i,l){var m=Wt();ze.flags|=e,m.memoizedState=Mr(1|t,{destroy:void 0},i,l===void 0?null:l)}function Il(e,t,i,l){var m=Et();l=l===void 0?null:l;var C=m.memoizedState.inst;ot!==null&&l!==null&&Mo(l,ot.memoizedState.deps)?m.memoizedState=Mr(t,C,i,l):(ze.flags|=e,m.memoizedState=Mr(1|t,C,i,l))}function Lf(e,t){Hl(8390656,8,e,t)}function Po(e,t){Il(2048,8,e,t)}function Mv(e){ze.flags|=4;var t=ze.updateQueue;if(t===null)t=Nl(),ze.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Of(e){var t=Et().memoizedState;return Mv({ref:t,nextImpl:e}),function(){if((nt&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Bf(e,t){return Il(4,2,e,t)}function Nf(e,t){return Il(4,4,e,t)}function jf(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function zf(e,t,i){i=i!=null?i.concat([e]):null,Il(4,4,jf.bind(null,t,e),i)}function Fo(){}function Hf(e,t){var i=Et();t=t===void 0?null:t;var l=i.memoizedState;return t!==null&&Mo(t,l[1])?l[0]:(i.memoizedState=[e,t],e)}function If(e,t){var i=Et();t=t===void 0?null:t;var l=i.memoizedState;if(t!==null&&Mo(t,l[1]))return l[0];if(l=e(),Zi){Ct(!0);try{e()}finally{Ct(!1)}}return i.memoizedState=[l,t],l}function qo(e,t,i){return i===void 0||(Xn&1073741824)!==0&&(Ye&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=Ud(),ze.lanes|=e,bi|=e,i)}function Uf(e,t,i,l){return on(i,t)?i:Tr.current!==null?(e=qo(e,i,l),on(e,t)||(Dt=!0),e):(Xn&42)===0||(Xn&1073741824)!==0&&(Ye&261930)===0?(Dt=!0,e.memoizedState=i):(e=Ud(),ze.lanes|=e,bi|=e,t)}function Pf(e,t,i,l,m){var C=X.p;X.p=C!==0&&8>C?C:8;var L=G.T,U={};G.T=U,$o(e,!1,t,i);try{var W=m(),re=G.S;if(re!==null&&re(U,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var fe=kv(W,l);xs(e,t,fe,pn(e))}else xs(e,t,l,pn(e))}catch(me){xs(e,t,{then:function(){},status:"rejected",reason:me},pn())}finally{X.p=C,L!==null&&U.types!==null&&(L.types=U.types),G.T=L}}function Lv(){}function Vo(e,t,i,l){if(e.tag!==5)throw Error(o(476));var m=Ff(e).queue;Pf(e,m,t,ee,i===null?Lv:function(){return qf(e),i(l)})}function Ff(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qn,lastRenderedState:ee},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qn,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function qf(e){var t=Ff(e);t.next===null&&(t=e.alternate.memoizedState),xs(e,t.next.queue,{},pn())}function Go(){return Ut(Ps)}function Vf(){return Et().memoizedState}function Gf(){return Et().memoizedState}function Ov(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=pn();e=mi(i);var l=gi(t,e,i);l!==null&&(nn(l,t,i),ys(l,t,i)),t={cache:So()},e.payload=t;return}t=t.return}}function Bv(e,t,i){var l=pn();i={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Ul(e)?Yf(t,i):(i=oo(e,t,i,l),i!==null&&(nn(i,e,l),Wf(i,t,l)))}function $f(e,t,i){var l=pn();xs(e,t,i,l)}function xs(e,t,i,l){var m={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Ul(e))Yf(t,m);else{var C=e.alternate;if(e.lanes===0&&(C===null||C.lanes===0)&&(C=t.lastRenderedReducer,C!==null))try{var L=t.lastRenderedState,U=C(L,i);if(m.hasEagerState=!0,m.eagerState=U,on(U,L))return Sl(e,t,m,0),ft===null&&yl(),!1}catch{}finally{}if(i=oo(e,t,m,l),i!==null)return nn(i,e,l),Wf(i,t,l),!0}return!1}function $o(e,t,i,l){if(l={lane:2,revertLane:xc(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ul(e)){if(t)throw Error(o(479))}else t=oo(e,i,l,2),t!==null&&nn(t,e,2)}function Ul(e){var t=e.alternate;return e===ze||t!==null&&t===ze}function Yf(e,t){Dr=Ol=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Wf(e,t,i){if((i&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,sr(e,i)}}var Es={readContext:Ut,use:jl,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt,useHostTransitionStatus:yt,useFormState:yt,useActionState:yt,useOptimistic:yt,useMemoCache:yt,useCacheRefresh:yt};Es.useEffectEvent=yt;var Kf={readContext:Ut,use:jl,useCallback:function(e,t){return Wt().memoizedState=[e,t===void 0?null:t],e},useContext:Ut,useEffect:Lf,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,Hl(4194308,4,jf.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Hl(4194308,4,e,t)},useInsertionEffect:function(e,t){Hl(4,2,e,t)},useMemo:function(e,t){var i=Wt();t=t===void 0?null:t;var l=e();if(Zi){Ct(!0);try{e()}finally{Ct(!1)}}return i.memoizedState=[l,t],l},useReducer:function(e,t,i){var l=Wt();if(i!==void 0){var m=i(t);if(Zi){Ct(!0);try{i(t)}finally{Ct(!1)}}}else m=t;return l.memoizedState=l.baseState=m,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:m},l.queue=e,e=e.dispatch=Bv.bind(null,ze,e),[l.memoizedState,e]},useRef:function(e){var t=Wt();return e={current:e},t.memoizedState=e},useState:function(e){e=Io(e);var t=e.queue,i=$f.bind(null,ze,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Fo,useDeferredValue:function(e,t){var i=Wt();return qo(i,e,t)},useTransition:function(){var e=Io(!1);return e=Pf.bind(null,ze,e.queue,!0,!1),Wt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var l=ze,m=Wt();if(Xe){if(i===void 0)throw Error(o(407));i=i()}else{if(i=t(),ft===null)throw Error(o(349));(Ye&127)!==0||gf(l,t,i)}m.memoizedState=i;var C={value:i,getSnapshot:t};return m.queue=C,Lf(vf.bind(null,l,C,e),[e]),l.flags|=2048,Mr(9,{destroy:void 0},_f.bind(null,l,C,i,t),null),i},useId:function(){var e=Wt(),t=ft.identifierPrefix;if(Xe){var i=zn,l=jn;i=(l&~(1<<32-tt(l)-1)).toString(32)+i,t="_"+t+"R_"+i,i=Bl++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=Av++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Go,useFormState:Af,useActionState:Af,useOptimistic:function(e){var t=Wt();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=$o.bind(null,ze,!0,i),i.dispatch=t,[e,t]},useMemoCache:jo,useCacheRefresh:function(){return Wt().memoizedState=Ov.bind(null,ze)},useEffectEvent:function(e){var t=Wt(),i={impl:e};return t.memoizedState=i,function(){if((nt&2)!==0)throw Error(o(440));return i.impl.apply(void 0,arguments)}}},Yo={readContext:Ut,use:jl,useCallback:Hf,useContext:Ut,useEffect:Po,useImperativeHandle:zf,useInsertionEffect:Bf,useLayoutEffect:Nf,useMemo:If,useReducer:zl,useRef:Mf,useState:function(){return zl(Qn)},useDebugValue:Fo,useDeferredValue:function(e,t){var i=Et();return Uf(i,ot.memoizedState,e,t)},useTransition:function(){var e=zl(Qn)[0],t=Et().memoizedState;return[typeof e=="boolean"?e:ws(e),t]},useSyncExternalStore:mf,useId:Vf,useHostTransitionStatus:Go,useFormState:Tf,useActionState:Tf,useOptimistic:function(e,t){var i=Et();return bf(i,ot,e,t)},useMemoCache:jo,useCacheRefresh:Gf};Yo.useEffectEvent=Of;var Xf={readContext:Ut,use:jl,useCallback:Hf,useContext:Ut,useEffect:Po,useImperativeHandle:zf,useInsertionEffect:Bf,useLayoutEffect:Nf,useMemo:If,useReducer:Ho,useRef:Mf,useState:function(){return Ho(Qn)},useDebugValue:Fo,useDeferredValue:function(e,t){var i=Et();return ot===null?qo(i,e,t):Uf(i,ot.memoizedState,e,t)},useTransition:function(){var e=Ho(Qn)[0],t=Et().memoizedState;return[typeof e=="boolean"?e:ws(e),t]},useSyncExternalStore:mf,useId:Vf,useHostTransitionStatus:Go,useFormState:Rf,useActionState:Rf,useOptimistic:function(e,t){var i=Et();return ot!==null?bf(i,ot,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:jo,useCacheRefresh:Gf};Xf.useEffectEvent=Of;function Wo(e,t,i,l){t=e.memoizedState,i=i(l,t),i=i==null?t:u({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Ko={enqueueSetState:function(e,t,i){e=e._reactInternals;var l=pn(),m=mi(l);m.payload=t,i!=null&&(m.callback=i),t=gi(e,m,l),t!==null&&(nn(t,e,l),ys(t,e,l))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var l=pn(),m=mi(l);m.tag=1,m.payload=t,i!=null&&(m.callback=i),t=gi(e,m,l),t!==null&&(nn(t,e,l),ys(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=pn(),l=mi(i);l.tag=2,t!=null&&(l.callback=t),t=gi(e,l,i),t!==null&&(nn(t,e,i),ys(t,e,i))}};function Qf(e,t,i,l,m,C,L){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,C,L):t.prototype&&t.prototype.isPureReactComponent?!hs(i,l)||!hs(m,C):!0}function Zf(e,t,i,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,l),t.state!==e&&Ko.enqueueReplaceState(t,t.state,null)}function Ji(e,t){var i=t;if("ref"in t){i={};for(var l in t)l!=="ref"&&(i[l]=t[l])}if(e=e.defaultProps){i===t&&(i=u({},i));for(var m in e)i[m]===void 0&&(i[m]=e[m])}return i}function Jf(e){vl(e)}function ed(e){console.error(e)}function td(e){vl(e)}function Pl(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function nd(e,t,i){try{var l=e.onCaughtError;l(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Xo(e,t,i){return i=mi(i),i.tag=3,i.payload={element:null},i.callback=function(){Pl(e,t)},i}function id(e){return e=mi(e),e.tag=3,e}function rd(e,t,i,l){var m=i.type.getDerivedStateFromError;if(typeof m=="function"){var C=l.value;e.payload=function(){return m(C)},e.callback=function(){nd(t,i,l)}}var L=i.stateNode;L!==null&&typeof L.componentDidCatch=="function"&&(e.callback=function(){nd(t,i,l),typeof m!="function"&&(Ci===null?Ci=new Set([this]):Ci.add(this));var U=l.stack;this.componentDidCatch(l.value,{componentStack:U!==null?U:""})})}function Nv(e,t,i,l,m){if(i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=i.alternate,t!==null&&wr(t,i,m,!0),i=un.current,i!==null){switch(i.tag){case 31:case 13:return kn===null?Jl():i.alternate===null&&St===0&&(St=3),i.flags&=-257,i.flags|=65536,i.lanes=m,l===Tl?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([l]):t.add(l),bc(e,l,m)),!1;case 22:return i.flags|=65536,l===Tl?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([l]):i.add(l)),bc(e,l,m)),!1}throw Error(o(435,i.tag))}return bc(e,l,m),Jl(),!1}if(Xe)return t=un.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=m,l!==mo&&(e=Error(o(422),{cause:l}),ps(Cn(e,i)))):(l!==mo&&(t=Error(o(423),{cause:l}),ps(Cn(t,i))),e=e.current.alternate,e.flags|=65536,m&=-m,e.lanes|=m,l=Cn(l,i),m=Xo(e.stateNode,l,m),ko(e,m),St!==4&&(St=2)),!1;var C=Error(o(520),{cause:l});if(C=Cn(C,i),Os===null?Os=[C]:Os.push(C),St!==4&&(St=2),t===null)return!0;l=Cn(l,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=m&-m,i.lanes|=e,e=Xo(i.stateNode,l,e),ko(i,e),!1;case 1:if(t=i.type,C=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(Ci===null||!Ci.has(C))))return i.flags|=65536,m&=-m,i.lanes|=m,m=id(m),rd(m,e,i,l),ko(i,m),!1}i=i.return}while(i!==null);return!1}var Qo=Error(o(461)),Dt=!1;function Pt(e,t,i,l){t.child=e===null?of(t,null,i,l):Qi(t,e.child,i,l)}function sd(e,t,i,l,m){i=i.render;var C=t.ref;if("ref"in l){var L={};for(var U in l)U!=="ref"&&(L[U]=l[U])}else L=l;return Yi(t),l=Lo(e,t,i,L,C,m),U=Oo(),e!==null&&!Dt?(Bo(e,t,m),Zn(e,t,m)):(Xe&&U&&fo(t),t.flags|=1,Pt(e,t,l,m),t.child)}function ld(e,t,i,l,m){if(e===null){var C=i.type;return typeof C=="function"&&!co(C)&&C.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=C,ad(e,t,C,l,m)):(e=Cl(i.type,null,l,t,t.mode,m),e.ref=t.ref,e.return=t,t.child=e)}if(C=e.child,!sc(e,m)){var L=C.memoizedProps;if(i=i.compare,i=i!==null?i:hs,i(L,l)&&e.ref===t.ref)return Zn(e,t,m)}return t.flags|=1,e=$n(C,l),e.ref=t.ref,e.return=t,t.child=e}function ad(e,t,i,l,m){if(e!==null){var C=e.memoizedProps;if(hs(C,l)&&e.ref===t.ref)if(Dt=!1,t.pendingProps=l=C,sc(e,m))(e.flags&131072)!==0&&(Dt=!0);else return t.lanes=e.lanes,Zn(e,t,m)}return Zo(e,t,i,l,m)}function od(e,t,i,l){var m=l.children,C=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(C=C!==null?C.baseLanes|i:i,e!==null){for(l=t.child=e.child,m=0;l!==null;)m=m|l.lanes|l.childLanes,l=l.sibling;l=m&~C}else l=0,t.child=null;return cd(e,t,C,i,l)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&kl(t,C!==null?C.cachePool:null),C!==null?hf(t,C):To(),ff(t);else return l=t.lanes=536870912,cd(e,t,C!==null?C.baseLanes|i:i,i,l)}else C!==null?(kl(t,C.cachePool),hf(t,C),vi(),t.memoizedState=null):(e!==null&&kl(t,null),To(),vi());return Pt(e,t,m,i),t.child}function ks(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function cd(e,t,i,l,m){var C=Co();return C=C===null?null:{parent:At._currentValue,pool:C},t.memoizedState={baseLanes:i,cachePool:C},e!==null&&kl(t,null),To(),ff(t),e!==null&&wr(e,t,l,!0),t.childLanes=m,null}function Fl(e,t){return t=Vl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ud(e,t,i){return Qi(t,e.child,null,i),e=Fl(t,t.pendingProps),e.flags|=2,hn(t),t.memoizedState=null,e}function jv(e,t,i){var l=t.pendingProps,m=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Xe){if(l.mode==="hidden")return e=Fl(t,l),t.lanes=536870912,ks(null,e);if(Ro(t),(e=mt)?(e=Cp(e,En),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ui!==null?{id:jn,overflow:zn}:null,retryLane:536870912,hydrationErrors:null},i=$h(e),i.return=t,t.child=i,It=t,mt=null)):e=null,e===null)throw fi(t);return t.lanes=536870912,null}return Fl(t,l)}var C=e.memoizedState;if(C!==null){var L=C.dehydrated;if(Ro(t),m)if(t.flags&256)t.flags&=-257,t=ud(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Dt||wr(e,t,i,!1),m=(i&e.childLanes)!==0,Dt||m){if(l=ft,l!==null&&(L=ts(l,i),L!==0&&L!==C.retryLane))throw C.retryLane=L,qi(e,L),nn(l,e,L),Qo;Jl(),t=ud(e,t,i)}else e=C.treeContext,mt=An(L.nextSibling),It=t,Xe=!0,hi=null,En=!1,e!==null&&Kh(t,e),t=Fl(t,l),t.flags|=4096;return t}return e=$n(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ql(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(o(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Zo(e,t,i,l,m){return Yi(t),i=Lo(e,t,i,l,void 0,m),l=Oo(),e!==null&&!Dt?(Bo(e,t,m),Zn(e,t,m)):(Xe&&l&&fo(t),t.flags|=1,Pt(e,t,i,m),t.child)}function hd(e,t,i,l,m,C){return Yi(t),t.updateQueue=null,i=pf(t,l,i,m),df(e),l=Oo(),e!==null&&!Dt?(Bo(e,t,C),Zn(e,t,C)):(Xe&&l&&fo(t),t.flags|=1,Pt(e,t,i,C),t.child)}function fd(e,t,i,l,m){if(Yi(t),t.stateNode===null){var C=yr,L=i.contextType;typeof L=="object"&&L!==null&&(C=Ut(L)),C=new i(l,C),t.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,C.updater=Ko,t.stateNode=C,C._reactInternals=t,C=t.stateNode,C.props=l,C.state=t.memoizedState,C.refs={},xo(t),L=i.contextType,C.context=typeof L=="object"&&L!==null?Ut(L):yr,C.state=t.memoizedState,L=i.getDerivedStateFromProps,typeof L=="function"&&(Wo(t,i,L,l),C.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(L=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),L!==C.state&&Ko.enqueueReplaceState(C,C.state,null),bs(t,l,C,m),Ss(),C.state=t.memoizedState),typeof C.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){C=t.stateNode;var U=t.memoizedProps,W=Ji(i,U);C.props=W;var re=C.context,fe=i.contextType;L=yr,typeof fe=="object"&&fe!==null&&(L=Ut(fe));var me=i.getDerivedStateFromProps;fe=typeof me=="function"||typeof C.getSnapshotBeforeUpdate=="function",U=t.pendingProps!==U,fe||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(U||re!==L)&&Zf(t,C,l,L),pi=!1;var se=t.memoizedState;C.state=se,bs(t,l,C,m),Ss(),re=t.memoizedState,U||se!==re||pi?(typeof me=="function"&&(Wo(t,i,me,l),re=t.memoizedState),(W=pi||Qf(t,i,W,l,se,re,L))?(fe||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(t.flags|=4194308)):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=re),C.props=l,C.state=re,C.context=L,l=W):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{C=t.stateNode,Eo(e,t),L=t.memoizedProps,fe=Ji(i,L),C.props=fe,me=t.pendingProps,se=C.context,re=i.contextType,W=yr,typeof re=="object"&&re!==null&&(W=Ut(re)),U=i.getDerivedStateFromProps,(re=typeof U=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(L!==me||se!==W)&&Zf(t,C,l,W),pi=!1,se=t.memoizedState,C.state=se,bs(t,l,C,m),Ss();var oe=t.memoizedState;L!==me||se!==oe||pi||e!==null&&e.dependencies!==null&&xl(e.dependencies)?(typeof U=="function"&&(Wo(t,i,U,l),oe=t.memoizedState),(fe=pi||Qf(t,i,fe,l,se,oe,W)||e!==null&&e.dependencies!==null&&xl(e.dependencies))?(re||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(l,oe,W),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(l,oe,W)),typeof C.componentDidUpdate=="function"&&(t.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof C.componentDidUpdate!="function"||L===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||L===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=oe),C.props=l,C.state=oe,C.context=W,l=fe):(typeof C.componentDidUpdate!="function"||L===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||L===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),l=!1)}return C=l,ql(e,t),l=(t.flags&128)!==0,C||l?(C=t.stateNode,i=l&&typeof i.getDerivedStateFromError!="function"?null:C.render(),t.flags|=1,e!==null&&l?(t.child=Qi(t,e.child,null,m),t.child=Qi(t,null,i,m)):Pt(e,t,i,m),t.memoizedState=C.state,e=t.child):e=Zn(e,t,m),e}function dd(e,t,i,l){return Gi(),t.flags|=256,Pt(e,t,i,l),t.child}var Jo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ec(e){return{baseLanes:e,cachePool:tf()}}function tc(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=dn),e}function pd(e,t,i){var l=t.pendingProps,m=!1,C=(t.flags&128)!==0,L;if((L=C)||(L=e!==null&&e.memoizedState===null?!1:(xt.current&2)!==0),L&&(m=!0,t.flags&=-129),L=(t.flags&32)!==0,t.flags&=-33,e===null){if(Xe){if(m?_i(t):vi(),(e=mt)?(e=Cp(e,En),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ui!==null?{id:jn,overflow:zn}:null,retryLane:536870912,hydrationErrors:null},i=$h(e),i.return=t,t.child=i,It=t,mt=null)):e=null,e===null)throw fi(t);return zc(e)?t.lanes=32:t.lanes=536870912,null}var U=l.children;return l=l.fallback,m?(vi(),m=t.mode,U=Vl({mode:"hidden",children:U},m),l=Vi(l,m,i,null),U.return=t,l.return=t,U.sibling=l,t.child=U,l=t.child,l.memoizedState=ec(i),l.childLanes=tc(e,L,i),t.memoizedState=Jo,ks(null,l)):(_i(t),nc(t,U))}var W=e.memoizedState;if(W!==null&&(U=W.dehydrated,U!==null)){if(C)t.flags&256?(_i(t),t.flags&=-257,t=ic(e,t,i)):t.memoizedState!==null?(vi(),t.child=e.child,t.flags|=128,t=null):(vi(),U=l.fallback,m=t.mode,l=Vl({mode:"visible",children:l.children},m),U=Vi(U,m,i,null),U.flags|=2,l.return=t,U.return=t,l.sibling=U,t.child=l,Qi(t,e.child,null,i),l=t.child,l.memoizedState=ec(i),l.childLanes=tc(e,L,i),t.memoizedState=Jo,t=ks(null,l));else if(_i(t),zc(U)){if(L=U.nextSibling&&U.nextSibling.dataset,L)var re=L.dgst;L=re,l=Error(o(419)),l.stack="",l.digest=L,ps({value:l,source:null,stack:null}),t=ic(e,t,i)}else if(Dt||wr(e,t,i,!1),L=(i&e.childLanes)!==0,Dt||L){if(L=ft,L!==null&&(l=ts(L,i),l!==0&&l!==W.retryLane))throw W.retryLane=l,qi(e,l),nn(L,e,l),Qo;jc(U)||Jl(),t=ic(e,t,i)}else jc(U)?(t.flags|=192,t.child=e.child,t=null):(e=W.treeContext,mt=An(U.nextSibling),It=t,Xe=!0,hi=null,En=!1,e!==null&&Kh(t,e),t=nc(t,l.children),t.flags|=4096);return t}return m?(vi(),U=l.fallback,m=t.mode,W=e.child,re=W.sibling,l=$n(W,{mode:"hidden",children:l.children}),l.subtreeFlags=W.subtreeFlags&65011712,re!==null?U=$n(re,U):(U=Vi(U,m,i,null),U.flags|=2),U.return=t,l.return=t,l.sibling=U,t.child=l,ks(null,l),l=t.child,U=e.child.memoizedState,U===null?U=ec(i):(m=U.cachePool,m!==null?(W=At._currentValue,m=m.parent!==W?{parent:W,pool:W}:m):m=tf(),U={baseLanes:U.baseLanes|i,cachePool:m}),l.memoizedState=U,l.childLanes=tc(e,L,i),t.memoizedState=Jo,ks(e.child,l)):(_i(t),i=e.child,e=i.sibling,i=$n(i,{mode:"visible",children:l.children}),i.return=t,i.sibling=null,e!==null&&(L=t.deletions,L===null?(t.deletions=[e],t.flags|=16):L.push(e)),t.child=i,t.memoizedState=null,i)}function nc(e,t){return t=Vl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Vl(e,t){return e=cn(22,e,null,t),e.lanes=0,e}function ic(e,t,i){return Qi(t,e.child,null,i),e=nc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function md(e,t,i){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),vo(e.return,t,i)}function rc(e,t,i,l,m,C){var L=e.memoizedState;L===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:m,treeForkCount:C}:(L.isBackwards=t,L.rendering=null,L.renderingStartTime=0,L.last=l,L.tail=i,L.tailMode=m,L.treeForkCount=C)}function gd(e,t,i){var l=t.pendingProps,m=l.revealOrder,C=l.tail;l=l.children;var L=xt.current,U=(L&2)!==0;if(U?(L=L&1|2,t.flags|=128):L&=1,I(xt,L),Pt(e,t,l,i),l=Xe?ds:0,!U&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&md(e,i,t);else if(e.tag===19)md(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(m){case"forwards":for(i=t.child,m=null;i!==null;)e=i.alternate,e!==null&&Ll(e)===null&&(m=i),i=i.sibling;i=m,i===null?(m=t.child,t.child=null):(m=i.sibling,i.sibling=null),rc(t,!1,m,i,C,l);break;case"backwards":case"unstable_legacy-backwards":for(i=null,m=t.child,t.child=null;m!==null;){if(e=m.alternate,e!==null&&Ll(e)===null){t.child=m;break}e=m.sibling,m.sibling=i,i=m,m=e}rc(t,!0,i,null,C,l);break;case"together":rc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function Zn(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),bi|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(wr(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,i=$n(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=$n(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function sc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&xl(e)))}function zv(e,t,i){switch(t.tag){case 3:q(t,t.stateNode.containerInfo),di(t,At,e.memoizedState.cache),Gi();break;case 27:case 5:Y(t);break;case 4:q(t,t.stateNode.containerInfo);break;case 10:di(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ro(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(_i(t),t.flags|=128,null):(i&t.child.childLanes)!==0?pd(e,t,i):(_i(t),e=Zn(e,t,i),e!==null?e.sibling:null);_i(t);break;case 19:var m=(e.flags&128)!==0;if(l=(i&t.childLanes)!==0,l||(wr(e,t,i,!1),l=(i&t.childLanes)!==0),m){if(l)return gd(e,t,i);t.flags|=128}if(m=t.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),I(xt,xt.current),l)break;return null;case 22:return t.lanes=0,od(e,t,i,t.pendingProps);case 24:di(t,At,e.memoizedState.cache)}return Zn(e,t,i)}function _d(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Dt=!0;else{if(!sc(e,i)&&(t.flags&128)===0)return Dt=!1,zv(e,t,i);Dt=(e.flags&131072)!==0}else Dt=!1,Xe&&(t.flags&1048576)!==0&&Wh(t,ds,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Ki(t.elementType),t.type=e,typeof e=="function")co(e)?(l=Ji(e,l),t.tag=1,t=fd(null,t,e,l,i)):(t.tag=0,t=Zo(null,t,e,l,i));else{if(e!=null){var m=e.$$typeof;if(m===k){t.tag=11,t=sd(null,t,e,l,i);break e}else if(m===T){t.tag=14,t=ld(null,t,e,l,i);break e}}throw t=$(e)||e,Error(o(306,t,""))}}return t;case 0:return Zo(e,t,t.type,t.pendingProps,i);case 1:return l=t.type,m=Ji(l,t.pendingProps),fd(e,t,l,m,i);case 3:e:{if(q(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var C=t.memoizedState;m=C.element,Eo(e,t),bs(t,l,null,i);var L=t.memoizedState;if(l=L.cache,di(t,At,l),l!==C.cache&&yo(t,[At],i,!0),Ss(),l=L.element,C.isDehydrated)if(C={element:l,isDehydrated:!1,cache:L.cache},t.updateQueue.baseState=C,t.memoizedState=C,t.flags&256){t=dd(e,t,l,i);break e}else if(l!==m){m=Cn(Error(o(424)),t),ps(m),t=dd(e,t,l,i);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(mt=An(e.firstChild),It=t,Xe=!0,hi=null,En=!0,i=of(t,null,l,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(Gi(),l===m){t=Zn(e,t,i);break e}Pt(e,t,l,i)}t=t.child}return t;case 26:return ql(e,t),e===null?(i=Tp(t.type,null,t.pendingProps,null))?t.memoizedState=i:Xe||(i=t.type,e=t.pendingProps,l=la(ge.current).createElement(i),l[Ht]=t,l[Xt]=e,Ft(l,i,e),Bt(l),t.stateNode=l):t.memoizedState=Tp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Y(t),e===null&&Xe&&(l=t.stateNode=Ep(t.type,t.pendingProps,ge.current),It=t,En=!0,m=mt,ki(t.type)?(Hc=m,mt=An(l.firstChild)):mt=m),Pt(e,t,t.pendingProps.children,i),ql(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Xe&&((m=l=mt)&&(l=d0(l,t.type,t.pendingProps,En),l!==null?(t.stateNode=l,It=t,mt=An(l.firstChild),En=!1,m=!0):m=!1),m||fi(t)),Y(t),m=t.type,C=t.pendingProps,L=e!==null?e.memoizedProps:null,l=C.children,Oc(m,C)?l=null:L!==null&&Oc(m,L)&&(t.flags|=32),t.memoizedState!==null&&(m=Lo(e,t,Tv,null,null,i),Ps._currentValue=m),ql(e,t),Pt(e,t,l,i),t.child;case 6:return e===null&&Xe&&((e=i=mt)&&(i=p0(i,t.pendingProps,En),i!==null?(t.stateNode=i,It=t,mt=null,e=!0):e=!1),e||fi(t)),null;case 13:return pd(e,t,i);case 4:return q(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Qi(t,null,l,i):Pt(e,t,l,i),t.child;case 11:return sd(e,t,t.type,t.pendingProps,i);case 7:return Pt(e,t,t.pendingProps,i),t.child;case 8:return Pt(e,t,t.pendingProps.children,i),t.child;case 12:return Pt(e,t,t.pendingProps.children,i),t.child;case 10:return l=t.pendingProps,di(t,t.type,l.value),Pt(e,t,l.children,i),t.child;case 9:return m=t.type._context,l=t.pendingProps.children,Yi(t),m=Ut(m),l=l(m),t.flags|=1,Pt(e,t,l,i),t.child;case 14:return ld(e,t,t.type,t.pendingProps,i);case 15:return ad(e,t,t.type,t.pendingProps,i);case 19:return gd(e,t,i);case 31:return jv(e,t,i);case 22:return od(e,t,i,t.pendingProps);case 24:return Yi(t),l=Ut(At),e===null?(m=Co(),m===null&&(m=ft,C=So(),m.pooledCache=C,C.refCount++,C!==null&&(m.pooledCacheLanes|=i),m=C),t.memoizedState={parent:l,cache:m},xo(t),di(t,At,m)):((e.lanes&i)!==0&&(Eo(e,t),bs(t,null,null,i),Ss()),m=e.memoizedState,C=t.memoizedState,m.parent!==l?(m={parent:l,cache:l},t.memoizedState=m,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=m),di(t,At,l)):(l=C.cache,di(t,At,l),l!==m.cache&&yo(t,[At],i,!0))),Pt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Jn(e){e.flags|=4}function lc(e,t,i,l,m){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(m&335544128)===m)if(e.stateNode.complete)e.flags|=8192;else if(Vd())e.flags|=8192;else throw Xi=Tl,wo}else e.flags&=-16777217}function vd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Op(t))if(Vd())e.flags|=8192;else throw Xi=Tl,wo}function Gl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?He():536870912,e.lanes|=t,Nr|=t)}function As(e,t){if(!Xe)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function gt(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(t)for(var m=e.child;m!==null;)i|=m.lanes|m.childLanes,l|=m.subtreeFlags&65011712,l|=m.flags&65011712,m.return=e,m=m.sibling;else for(m=e.child;m!==null;)i|=m.lanes|m.childLanes,l|=m.subtreeFlags,l|=m.flags,m.return=e,m=m.sibling;return e.subtreeFlags|=l,e.childLanes=i,t}function Hv(e,t,i){var l=t.pendingProps;switch(po(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gt(t),null;case 1:return gt(t),null;case 3:return i=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Kn(At),J(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Cr(t)?Jn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,go())),gt(t),null;case 26:var m=t.type,C=t.memoizedState;return e===null?(Jn(t),C!==null?(gt(t),vd(t,C)):(gt(t),lc(t,m,null,l,i))):C?C!==e.memoizedState?(Jn(t),gt(t),vd(t,C)):(gt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&Jn(t),gt(t),lc(t,m,e,l,i)),null;case 27:if(he(t),i=ge.current,m=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Jn(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return gt(t),null}e=ne.current,Cr(t)?Xh(t):(e=Ep(m,l,i),t.stateNode=e,Jn(t))}return gt(t),null;case 5:if(he(t),m=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Jn(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return gt(t),null}if(C=ne.current,Cr(t))Xh(t);else{var L=la(ge.current);switch(C){case 1:C=L.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:C=L.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":C=L.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":C=L.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":C=L.createElement("div"),C.innerHTML="<script><\/script>",C=C.removeChild(C.firstChild);break;case"select":C=typeof l.is=="string"?L.createElement("select",{is:l.is}):L.createElement("select"),l.multiple?C.multiple=!0:l.size&&(C.size=l.size);break;default:C=typeof l.is=="string"?L.createElement(m,{is:l.is}):L.createElement(m)}}C[Ht]=t,C[Xt]=l;e:for(L=t.child;L!==null;){if(L.tag===5||L.tag===6)C.appendChild(L.stateNode);else if(L.tag!==4&&L.tag!==27&&L.child!==null){L.child.return=L,L=L.child;continue}if(L===t)break e;for(;L.sibling===null;){if(L.return===null||L.return===t)break e;L=L.return}L.sibling.return=L.return,L=L.sibling}t.stateNode=C;e:switch(Ft(C,m,l),m){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Jn(t)}}return gt(t),lc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Jn(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=ge.current,Cr(t)){if(e=t.stateNode,i=t.memoizedProps,l=null,m=It,m!==null)switch(m.tag){case 27:case 5:l=m.memoizedProps}e[Ht]=t,e=!!(e.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||pp(e.nodeValue,i)),e||fi(t,!0)}else e=la(e).createTextNode(l),e[Ht]=t,t.stateNode=e}return gt(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(l=Cr(t),i!==null){if(e===null){if(!l)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Ht]=t}else Gi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),e=!1}else i=go(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(hn(t),t):(hn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return gt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(m=Cr(t),l!==null&&l.dehydrated!==null){if(e===null){if(!m)throw Error(o(318));if(m=t.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(o(317));m[Ht]=t}else Gi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),m=!1}else m=go(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=m),m=!0;if(!m)return t.flags&256?(hn(t),t):(hn(t),null)}return hn(t),(t.flags&128)!==0?(t.lanes=i,t):(i=l!==null,e=e!==null&&e.memoizedState!==null,i&&(l=t.child,m=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(m=l.alternate.memoizedState.cachePool.pool),C=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(C=l.memoizedState.cachePool.pool),C!==m&&(l.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Gl(t,t.updateQueue),gt(t),null);case 4:return J(),e===null&&Tc(t.stateNode.containerInfo),gt(t),null;case 10:return Kn(t.type),gt(t),null;case 19:if(V(xt),l=t.memoizedState,l===null)return gt(t),null;if(m=(t.flags&128)!==0,C=l.rendering,C===null)if(m)As(l,!1);else{if(St!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(C=Ll(e),C!==null){for(t.flags|=128,As(l,!1),e=C.updateQueue,t.updateQueue=e,Gl(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)Gh(i,e),i=i.sibling;return I(xt,xt.current&1|2),Xe&&Yn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&at()>Xl&&(t.flags|=128,m=!0,As(l,!1),t.lanes=4194304)}else{if(!m)if(e=Ll(C),e!==null){if(t.flags|=128,m=!0,e=e.updateQueue,t.updateQueue=e,Gl(t,e),As(l,!0),l.tail===null&&l.tailMode==="hidden"&&!C.alternate&&!Xe)return gt(t),null}else 2*at()-l.renderingStartTime>Xl&&i!==536870912&&(t.flags|=128,m=!0,As(l,!1),t.lanes=4194304);l.isBackwards?(C.sibling=t.child,t.child=C):(e=l.last,e!==null?e.sibling=C:t.child=C,l.last=C)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=at(),e.sibling=null,i=xt.current,I(xt,m?i&1|2:i&1),Xe&&Yn(t,l.treeForkCount),e):(gt(t),null);case 22:case 23:return hn(t),Do(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(i&536870912)!==0&&(t.flags&128)===0&&(gt(t),t.subtreeFlags&6&&(t.flags|=8192)):gt(t),i=t.updateQueue,i!==null&&Gl(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==i&&(t.flags|=2048),e!==null&&V(Wi),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Kn(At),gt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Iv(e,t){switch(po(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Kn(At),J(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return he(t),null;case 31:if(t.memoizedState!==null){if(hn(t),t.alternate===null)throw Error(o(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(hn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(xt),null;case 4:return J(),null;case 10:return Kn(t.type),null;case 22:case 23:return hn(t),Do(),e!==null&&V(Wi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Kn(At),null;case 25:return null;default:return null}}function yd(e,t){switch(po(t),t.tag){case 3:Kn(At),J();break;case 26:case 27:case 5:he(t);break;case 4:J();break;case 31:t.memoizedState!==null&&hn(t);break;case 13:hn(t);break;case 19:V(xt);break;case 10:Kn(t.type);break;case 22:case 23:hn(t),Do(),e!==null&&V(Wi);break;case 24:Kn(At)}}function Ts(e,t){try{var i=t.updateQueue,l=i!==null?i.lastEffect:null;if(l!==null){var m=l.next;i=m;do{if((i.tag&e)===e){l=void 0;var C=i.create,L=i.inst;l=C(),L.destroy=l}i=i.next}while(i!==m)}}catch(U){lt(t,t.return,U)}}function yi(e,t,i){try{var l=t.updateQueue,m=l!==null?l.lastEffect:null;if(m!==null){var C=m.next;l=C;do{if((l.tag&e)===e){var L=l.inst,U=L.destroy;if(U!==void 0){L.destroy=void 0,m=t;var W=i,re=U;try{re()}catch(fe){lt(m,W,fe)}}}l=l.next}while(l!==C)}}catch(fe){lt(t,t.return,fe)}}function Sd(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{uf(t,i)}catch(l){lt(e,e.return,l)}}}function bd(e,t,i){i.props=Ji(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(l){lt(e,t,l)}}function Ds(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof i=="function"?e.refCleanup=i(l):i.current=l}}catch(m){lt(e,t,m)}}function Hn(e,t){var i=e.ref,l=e.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(m){lt(e,t,m)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(m){lt(e,t,m)}else i.current=null}function Cd(e){var t=e.type,i=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(m){lt(e,e.return,m)}}function ac(e,t,i){try{var l=e.stateNode;a0(l,e.type,i,t),l[Xt]=t}catch(m){lt(e,e.return,m)}}function wd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ki(e.type)||e.tag===4}function oc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||wd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ki(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cc(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Vn));else if(l!==4&&(l===27&&ki(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(cc(e,t,i),e=e.sibling;e!==null;)cc(e,t,i),e=e.sibling}function $l(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(l!==4&&(l===27&&ki(e.type)&&(i=e.stateNode),e=e.child,e!==null))for($l(e,t,i),e=e.sibling;e!==null;)$l(e,t,i),e=e.sibling}function xd(e){var t=e.stateNode,i=e.memoizedProps;try{for(var l=e.type,m=t.attributes;m.length;)t.removeAttributeNode(m[0]);Ft(t,l,i),t[Ht]=e,t[Xt]=i}catch(C){lt(e,e.return,C)}}var ei=!1,Rt=!1,uc=!1,Ed=typeof WeakSet=="function"?WeakSet:Set,Nt=null;function Uv(e,t){if(e=e.containerInfo,Mc=da,e=jh(e),no(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var m=l.anchorOffset,C=l.focusNode;l=l.focusOffset;try{i.nodeType,C.nodeType}catch{i=null;break e}var L=0,U=-1,W=-1,re=0,fe=0,me=e,se=null;t:for(;;){for(var oe;me!==i||m!==0&&me.nodeType!==3||(U=L+m),me!==C||l!==0&&me.nodeType!==3||(W=L+l),me.nodeType===3&&(L+=me.nodeValue.length),(oe=me.firstChild)!==null;)se=me,me=oe;for(;;){if(me===e)break t;if(se===i&&++re===m&&(U=L),se===C&&++fe===l&&(W=L),(oe=me.nextSibling)!==null)break;me=se,se=me.parentNode}me=oe}i=U===-1||W===-1?null:{start:U,end:W}}else i=null}i=i||{start:0,end:0}}else i=null;for(Lc={focusedElem:e,selectionRange:i},da=!1,Nt=t;Nt!==null;)if(t=Nt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Nt=e;else for(;Nt!==null;){switch(t=Nt,C=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)m=e[i],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&C!==null){e=void 0,i=t,m=C.memoizedProps,C=C.memoizedState,l=i.stateNode;try{var Ee=Ji(i.type,m);e=l.getSnapshotBeforeUpdate(Ee,C),l.__reactInternalSnapshotBeforeUpdate=e}catch(Oe){lt(i,i.return,Oe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)Nc(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Nc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Nt=e;break}Nt=t.return}}function kd(e,t,i){var l=i.flags;switch(i.tag){case 0:case 11:case 15:ni(e,i),l&4&&Ts(5,i);break;case 1:if(ni(e,i),l&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(L){lt(i,i.return,L)}else{var m=Ji(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(m,t,e.__reactInternalSnapshotBeforeUpdate)}catch(L){lt(i,i.return,L)}}l&64&&Sd(i),l&512&&Ds(i,i.return);break;case 3:if(ni(e,i),l&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{uf(e,t)}catch(L){lt(i,i.return,L)}}break;case 27:t===null&&l&4&&xd(i);case 26:case 5:ni(e,i),t===null&&l&4&&Cd(i),l&512&&Ds(i,i.return);break;case 12:ni(e,i);break;case 31:ni(e,i),l&4&&Dd(e,i);break;case 13:ni(e,i),l&4&&Rd(e,i),l&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=Kv.bind(null,i),m0(e,i))));break;case 22:if(l=i.memoizedState!==null||ei,!l){t=t!==null&&t.memoizedState!==null||Rt,m=ei;var C=Rt;ei=l,(Rt=t)&&!C?ii(e,i,(i.subtreeFlags&8772)!==0):ni(e,i),ei=m,Rt=C}break;case 30:break;default:ni(e,i)}}function Ad(e){var t=e.alternate;t!==null&&(e.alternate=null,Ad(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ia(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var vt=null,Zt=!1;function ti(e,t,i){for(i=i.child;i!==null;)Td(e,t,i),i=i.sibling}function Td(e,t,i){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(bt,i)}catch{}switch(i.tag){case 26:Rt||Hn(i,t),ti(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Rt||Hn(i,t);var l=vt,m=Zt;ki(i.type)&&(vt=i.stateNode,Zt=!1),ti(e,t,i),Hs(i.stateNode),vt=l,Zt=m;break;case 5:Rt||Hn(i,t);case 6:if(l=vt,m=Zt,vt=null,ti(e,t,i),vt=l,Zt=m,vt!==null)if(Zt)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(i.stateNode)}catch(C){lt(i,t,C)}else try{vt.removeChild(i.stateNode)}catch(C){lt(i,t,C)}break;case 18:vt!==null&&(Zt?(e=vt,Sp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),qr(e)):Sp(vt,i.stateNode));break;case 4:l=vt,m=Zt,vt=i.stateNode.containerInfo,Zt=!0,ti(e,t,i),vt=l,Zt=m;break;case 0:case 11:case 14:case 15:yi(2,i,t),Rt||yi(4,i,t),ti(e,t,i);break;case 1:Rt||(Hn(i,t),l=i.stateNode,typeof l.componentWillUnmount=="function"&&bd(i,t,l)),ti(e,t,i);break;case 21:ti(e,t,i);break;case 22:Rt=(l=Rt)||i.memoizedState!==null,ti(e,t,i),Rt=l;break;default:ti(e,t,i)}}function Dd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{qr(e)}catch(i){lt(t,t.return,i)}}}function Rd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{qr(e)}catch(i){lt(t,t.return,i)}}function Pv(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ed),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ed),t;default:throw Error(o(435,e.tag))}}function Yl(e,t){var i=Pv(e);t.forEach(function(l){if(!i.has(l)){i.add(l);var m=Xv.bind(null,e,l);l.then(m,m)}})}function Jt(e,t){var i=t.deletions;if(i!==null)for(var l=0;l<i.length;l++){var m=i[l],C=e,L=t,U=L;e:for(;U!==null;){switch(U.tag){case 27:if(ki(U.type)){vt=U.stateNode,Zt=!1;break e}break;case 5:vt=U.stateNode,Zt=!1;break e;case 3:case 4:vt=U.stateNode.containerInfo,Zt=!0;break e}U=U.return}if(vt===null)throw Error(o(160));Td(C,L,m),vt=null,Zt=!1,C=m.alternate,C!==null&&(C.return=null),m.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Md(t,e),t=t.sibling}var On=null;function Md(e,t){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Jt(t,e),en(e),l&4&&(yi(3,e,e.return),Ts(3,e),yi(5,e,e.return));break;case 1:Jt(t,e),en(e),l&512&&(Rt||i===null||Hn(i,i.return)),l&64&&ei&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?l:i.concat(l))));break;case 26:var m=On;if(Jt(t,e),en(e),l&512&&(Rt||i===null||Hn(i,i.return)),l&4){var C=i!==null?i.memoizedState:null;if(l=e.memoizedState,i===null)if(l===null)if(e.stateNode===null){e:{l=e.type,i=e.memoizedProps,m=m.ownerDocument||m;t:switch(l){case"title":C=m.getElementsByTagName("title")[0],(!C||C[ns]||C[Ht]||C.namespaceURI==="http://www.w3.org/2000/svg"||C.hasAttribute("itemprop"))&&(C=m.createElement(l),m.head.insertBefore(C,m.querySelector("head > title"))),Ft(C,l,i),C[Ht]=e,Bt(C),l=C;break e;case"link":var L=Mp("link","href",m).get(l+(i.href||""));if(L){for(var U=0;U<L.length;U++)if(C=L[U],C.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&C.getAttribute("rel")===(i.rel==null?null:i.rel)&&C.getAttribute("title")===(i.title==null?null:i.title)&&C.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){L.splice(U,1);break t}}C=m.createElement(l),Ft(C,l,i),m.head.appendChild(C);break;case"meta":if(L=Mp("meta","content",m).get(l+(i.content||""))){for(U=0;U<L.length;U++)if(C=L[U],C.getAttribute("content")===(i.content==null?null:""+i.content)&&C.getAttribute("name")===(i.name==null?null:i.name)&&C.getAttribute("property")===(i.property==null?null:i.property)&&C.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&C.getAttribute("charset")===(i.charSet==null?null:i.charSet)){L.splice(U,1);break t}}C=m.createElement(l),Ft(C,l,i),m.head.appendChild(C);break;default:throw Error(o(468,l))}C[Ht]=e,Bt(C),l=C}e.stateNode=l}else Lp(m,e.type,e.stateNode);else e.stateNode=Rp(m,l,e.memoizedProps);else C!==l?(C===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):C.count--,l===null?Lp(m,e.type,e.stateNode):Rp(m,l,e.memoizedProps)):l===null&&e.stateNode!==null&&ac(e,e.memoizedProps,i.memoizedProps)}break;case 27:Jt(t,e),en(e),l&512&&(Rt||i===null||Hn(i,i.return)),i!==null&&l&4&&ac(e,e.memoizedProps,i.memoizedProps);break;case 5:if(Jt(t,e),en(e),l&512&&(Rt||i===null||Hn(i,i.return)),e.flags&32){m=e.stateNode;try{fr(m,"")}catch(Ee){lt(e,e.return,Ee)}}l&4&&e.stateNode!=null&&(m=e.memoizedProps,ac(e,m,i!==null?i.memoizedProps:m)),l&1024&&(uc=!0);break;case 6:if(Jt(t,e),en(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,i=e.stateNode;try{i.nodeValue=l}catch(Ee){lt(e,e.return,Ee)}}break;case 3:if(ca=null,m=On,On=aa(t.containerInfo),Jt(t,e),On=m,en(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{qr(t.containerInfo)}catch(Ee){lt(e,e.return,Ee)}uc&&(uc=!1,Ld(e));break;case 4:l=On,On=aa(e.stateNode.containerInfo),Jt(t,e),en(e),On=l;break;case 12:Jt(t,e),en(e);break;case 31:Jt(t,e),en(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Yl(e,l)));break;case 13:Jt(t,e),en(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Kl=at()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Yl(e,l)));break;case 22:m=e.memoizedState!==null;var W=i!==null&&i.memoizedState!==null,re=ei,fe=Rt;if(ei=re||m,Rt=fe||W,Jt(t,e),Rt=fe,ei=re,en(e),l&8192)e:for(t=e.stateNode,t._visibility=m?t._visibility&-2:t._visibility|1,m&&(i===null||W||ei||Rt||er(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){W=i=t;try{if(C=W.stateNode,m)L=C.style,typeof L.setProperty=="function"?L.setProperty("display","none","important"):L.display="none";else{U=W.stateNode;var me=W.memoizedProps.style,se=me!=null&&me.hasOwnProperty("display")?me.display:null;U.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(Ee){lt(W,W.return,Ee)}}}else if(t.tag===6){if(i===null){W=t;try{W.stateNode.nodeValue=m?"":W.memoizedProps}catch(Ee){lt(W,W.return,Ee)}}}else if(t.tag===18){if(i===null){W=t;try{var oe=W.stateNode;m?bp(oe,!0):bp(W.stateNode,!1)}catch(Ee){lt(W,W.return,Ee)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(i=l.retryQueue,i!==null&&(l.retryQueue=null,Yl(e,i))));break;case 19:Jt(t,e),en(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Yl(e,l)));break;case 30:break;case 21:break;default:Jt(t,e),en(e)}}function en(e){var t=e.flags;if(t&2){try{for(var i,l=e.return;l!==null;){if(wd(l)){i=l;break}l=l.return}if(i==null)throw Error(o(160));switch(i.tag){case 27:var m=i.stateNode,C=oc(e);$l(e,C,m);break;case 5:var L=i.stateNode;i.flags&32&&(fr(L,""),i.flags&=-33);var U=oc(e);$l(e,U,L);break;case 3:case 4:var W=i.stateNode.containerInfo,re=oc(e);cc(e,re,W);break;default:throw Error(o(161))}}catch(fe){lt(e,e.return,fe)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ld(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ld(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ni(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)kd(e,t.alternate,t),t=t.sibling}function er(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:yi(4,t,t.return),er(t);break;case 1:Hn(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&bd(t,t.return,i),er(t);break;case 27:Hs(t.stateNode);case 26:case 5:Hn(t,t.return),er(t);break;case 22:t.memoizedState===null&&er(t);break;case 30:er(t);break;default:er(t)}e=e.sibling}}function ii(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,m=e,C=t,L=C.flags;switch(C.tag){case 0:case 11:case 15:ii(m,C,i),Ts(4,C);break;case 1:if(ii(m,C,i),l=C,m=l.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(re){lt(l,l.return,re)}if(l=C,m=l.updateQueue,m!==null){var U=l.stateNode;try{var W=m.shared.hiddenCallbacks;if(W!==null)for(m.shared.hiddenCallbacks=null,m=0;m<W.length;m++)cf(W[m],U)}catch(re){lt(l,l.return,re)}}i&&L&64&&Sd(C),Ds(C,C.return);break;case 27:xd(C);case 26:case 5:ii(m,C,i),i&&l===null&&L&4&&Cd(C),Ds(C,C.return);break;case 12:ii(m,C,i);break;case 31:ii(m,C,i),i&&L&4&&Dd(m,C);break;case 13:ii(m,C,i),i&&L&4&&Rd(m,C);break;case 22:C.memoizedState===null&&ii(m,C,i),Ds(C,C.return);break;case 30:break;default:ii(m,C,i)}t=t.sibling}}function hc(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&ms(i))}function fc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ms(e))}function Bn(e,t,i,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Od(e,t,i,l),t=t.sibling}function Od(e,t,i,l){var m=t.flags;switch(t.tag){case 0:case 11:case 15:Bn(e,t,i,l),m&2048&&Ts(9,t);break;case 1:Bn(e,t,i,l);break;case 3:Bn(e,t,i,l),m&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ms(e)));break;case 12:if(m&2048){Bn(e,t,i,l),e=t.stateNode;try{var C=t.memoizedProps,L=C.id,U=C.onPostCommit;typeof U=="function"&&U(L,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(W){lt(t,t.return,W)}}else Bn(e,t,i,l);break;case 31:Bn(e,t,i,l);break;case 13:Bn(e,t,i,l);break;case 23:break;case 22:C=t.stateNode,L=t.alternate,t.memoizedState!==null?C._visibility&2?Bn(e,t,i,l):Rs(e,t):C._visibility&2?Bn(e,t,i,l):(C._visibility|=2,Lr(e,t,i,l,(t.subtreeFlags&10256)!==0||!1)),m&2048&&hc(L,t);break;case 24:Bn(e,t,i,l),m&2048&&fc(t.alternate,t);break;default:Bn(e,t,i,l)}}function Lr(e,t,i,l,m){for(m=m&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var C=e,L=t,U=i,W=l,re=L.flags;switch(L.tag){case 0:case 11:case 15:Lr(C,L,U,W,m),Ts(8,L);break;case 23:break;case 22:var fe=L.stateNode;L.memoizedState!==null?fe._visibility&2?Lr(C,L,U,W,m):Rs(C,L):(fe._visibility|=2,Lr(C,L,U,W,m)),m&&re&2048&&hc(L.alternate,L);break;case 24:Lr(C,L,U,W,m),m&&re&2048&&fc(L.alternate,L);break;default:Lr(C,L,U,W,m)}t=t.sibling}}function Rs(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,l=t,m=l.flags;switch(l.tag){case 22:Rs(i,l),m&2048&&hc(l.alternate,l);break;case 24:Rs(i,l),m&2048&&fc(l.alternate,l);break;default:Rs(i,l)}t=t.sibling}}var Ms=8192;function Or(e,t,i){if(e.subtreeFlags&Ms)for(e=e.child;e!==null;)Bd(e,t,i),e=e.sibling}function Bd(e,t,i){switch(e.tag){case 26:Or(e,t,i),e.flags&Ms&&e.memoizedState!==null&&A0(i,On,e.memoizedState,e.memoizedProps);break;case 5:Or(e,t,i);break;case 3:case 4:var l=On;On=aa(e.stateNode.containerInfo),Or(e,t,i),On=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Ms,Ms=16777216,Or(e,t,i),Ms=l):Or(e,t,i));break;default:Or(e,t,i)}}function Nd(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ls(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var l=t[i];Nt=l,zd(l,e)}Nd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)jd(e),e=e.sibling}function jd(e){switch(e.tag){case 0:case 11:case 15:Ls(e),e.flags&2048&&yi(9,e,e.return);break;case 3:Ls(e);break;case 12:Ls(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Wl(e)):Ls(e);break;default:Ls(e)}}function Wl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var l=t[i];Nt=l,zd(l,e)}Nd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:yi(8,t,t.return),Wl(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Wl(t));break;default:Wl(t)}e=e.sibling}}function zd(e,t){for(;Nt!==null;){var i=Nt;switch(i.tag){case 0:case 11:case 15:yi(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var l=i.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:ms(i.memoizedState.cache)}if(l=i.child,l!==null)l.return=i,Nt=l;else e:for(i=e;Nt!==null;){l=Nt;var m=l.sibling,C=l.return;if(Ad(l),l===i){Nt=null;break e}if(m!==null){m.return=C,Nt=m;break e}Nt=C}}}var Fv={getCacheForType:function(e){var t=Ut(At),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Ut(At).controller.signal}},qv=typeof WeakMap=="function"?WeakMap:Map,nt=0,ft=null,Ve=null,Ye=0,st=0,fn=null,Si=!1,Br=!1,dc=!1,ri=0,St=0,bi=0,tr=0,pc=0,dn=0,Nr=0,Os=null,tn=null,mc=!1,Kl=0,Hd=0,Xl=1/0,Ql=null,Ci=null,Ot=0,wi=null,jr=null,si=0,gc=0,_c=null,Id=null,Bs=0,vc=null;function pn(){return(nt&2)!==0&&Ye!==0?Ye&-Ye:G.T!==null?xc():wt()}function Ud(){if(dn===0)if((Ye&536870912)===0||Xe){var e=Rn;Rn<<=1,(Rn&3932160)===0&&(Rn=262144),dn=e}else dn=536870912;return e=un.current,e!==null&&(e.flags|=32),dn}function nn(e,t,i){(e===ft&&(st===2||st===9)||e.cancelPendingCommit!==null)&&(zr(e,0),xi(e,Ye,dn,!1)),Mn(e,i),((nt&2)===0||e!==ft)&&(e===ft&&((nt&2)===0&&(tr|=i),St===4&&xi(e,Ye,dn,!1)),In(e))}function Pd(e,t,i){if((nt&6)!==0)throw Error(o(327));var l=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Be(e,t),m=l?$v(e,t):Sc(e,t,!0),C=l;do{if(m===0){Br&&!l&&xi(e,t,0,!1);break}else{if(i=e.current.alternate,C&&!Vv(i)){m=Sc(e,t,!1),C=!1;continue}if(m===2){if(C=t,e.errorRecoveryDisabledLanes&C)var L=0;else L=e.pendingLanes&-536870913,L=L!==0?L:L&536870912?536870912:0;if(L!==0){t=L;e:{var U=e;m=Os;var W=U.current.memoizedState.isDehydrated;if(W&&(zr(U,L).flags|=256),L=Sc(U,L,!1),L!==2){if(dc&&!W){U.errorRecoveryDisabledLanes|=C,tr|=C,m=4;break e}C=tn,tn=m,C!==null&&(tn===null?tn=C:tn.push.apply(tn,C))}m=L}if(C=!1,m!==2)continue}}if(m===1){zr(e,0),xi(e,t,0,!0);break}e:{switch(l=e,C=m,C){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:xi(l,t,dn,!Si);break e;case 2:tn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(m=Kl+300-at(),10<m)){if(xi(l,t,dn,!Si),Me(l,0,!0)!==0)break e;si=t,l.timeoutHandle=vp(Fd.bind(null,l,i,tn,Ql,mc,t,dn,tr,Nr,Si,C,"Throttled",-0,0),m);break e}Fd(l,i,tn,Ql,mc,t,dn,tr,Nr,Si,C,null,-0,0)}}break}while(!0);In(e)}function Fd(e,t,i,l,m,C,L,U,W,re,fe,me,se,oe){if(e.timeoutHandle=-1,me=t.subtreeFlags,me&8192||(me&16785408)===16785408){me={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Vn},Bd(t,C,me);var Ee=(C&62914560)===C?Kl-at():(C&4194048)===C?Hd-at():0;if(Ee=T0(me,Ee),Ee!==null){si=C,e.cancelPendingCommit=Ee(Xd.bind(null,e,t,C,i,l,m,L,U,W,fe,me,null,se,oe)),xi(e,C,L,!re);return}}Xd(e,t,C,i,l,m,L,U,W)}function Vv(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var l=0;l<i.length;l++){var m=i[l],C=m.getSnapshot;m=m.value;try{if(!on(C(),m))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function xi(e,t,i,l){t&=~pc,t&=~tr,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var m=t;0<m;){var C=31-tt(m),L=1<<C;l[C]=-1,m&=~L}i!==0&&al(e,i,t)}function Zl(){return(nt&6)===0?(Ns(0),!1):!0}function yc(){if(Ve!==null){if(st===0)var e=Ve.return;else e=Ve,Wn=$i=null,No(e),Ar=null,_s=0,e=Ve;for(;e!==null;)yd(e.alternate,e),e=e.return;Ve=null}}function zr(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,u0(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),si=0,yc(),ft=e,Ve=i=$n(e.current,null),Ye=t,st=0,fn=null,Si=!1,Br=Be(e,t),dc=!1,Nr=dn=pc=tr=bi=St=0,tn=Os=null,mc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var m=31-tt(l),C=1<<m;t|=e[m],l&=~C}return ri=t,yl(),i}function qd(e,t){ze=null,G.H=Es,t===kr||t===Al?(t=sf(),st=3):t===wo?(t=sf(),st=4):st=t===Qo?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,fn=t,Ve===null&&(St=1,Pl(e,Cn(t,e.current)))}function Vd(){var e=un.current;return e===null?!0:(Ye&4194048)===Ye?kn===null:(Ye&62914560)===Ye||(Ye&536870912)!==0?e===kn:!1}function Gd(){var e=G.H;return G.H=Es,e===null?Es:e}function $d(){var e=G.A;return G.A=Fv,e}function Jl(){St=4,Si||(Ye&4194048)!==Ye&&un.current!==null||(Br=!0),(bi&134217727)===0&&(tr&134217727)===0||ft===null||xi(ft,Ye,dn,!1)}function Sc(e,t,i){var l=nt;nt|=2;var m=Gd(),C=$d();(ft!==e||Ye!==t)&&(Ql=null,zr(e,t)),t=!1;var L=St;e:do try{if(st!==0&&Ve!==null){var U=Ve,W=fn;switch(st){case 8:yc(),L=6;break e;case 3:case 2:case 9:case 6:un.current===null&&(t=!0);var re=st;if(st=0,fn=null,Hr(e,U,W,re),i&&Br){L=0;break e}break;default:re=st,st=0,fn=null,Hr(e,U,W,re)}}Gv(),L=St;break}catch(fe){qd(e,fe)}while(!0);return t&&e.shellSuspendCounter++,Wn=$i=null,nt=l,G.H=m,G.A=C,Ve===null&&(ft=null,Ye=0,yl()),L}function Gv(){for(;Ve!==null;)Yd(Ve)}function $v(e,t){var i=nt;nt|=2;var l=Gd(),m=$d();ft!==e||Ye!==t?(Ql=null,Xl=at()+500,zr(e,t)):Br=Be(e,t);e:do try{if(st!==0&&Ve!==null){t=Ve;var C=fn;t:switch(st){case 1:st=0,fn=null,Hr(e,t,C,1);break;case 2:case 9:if(nf(C)){st=0,fn=null,Wd(t);break}t=function(){st!==2&&st!==9||ft!==e||(st=7),In(e)},C.then(t,t);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:nf(C)?(st=0,fn=null,Wd(t)):(st=0,fn=null,Hr(e,t,C,7));break;case 5:var L=null;switch(Ve.tag){case 26:L=Ve.memoizedState;case 5:case 27:var U=Ve;if(L?Op(L):U.stateNode.complete){st=0,fn=null;var W=U.sibling;if(W!==null)Ve=W;else{var re=U.return;re!==null?(Ve=re,ea(re)):Ve=null}break t}}st=0,fn=null,Hr(e,t,C,5);break;case 6:st=0,fn=null,Hr(e,t,C,6);break;case 8:yc(),St=6;break e;default:throw Error(o(462))}}Yv();break}catch(fe){qd(e,fe)}while(!0);return Wn=$i=null,G.H=l,G.A=m,nt=i,Ve!==null?0:(ft=null,Ye=0,yl(),St)}function Yv(){for(;Ve!==null&&!kt();)Yd(Ve)}function Yd(e){var t=_d(e.alternate,e,ri);e.memoizedProps=e.pendingProps,t===null?ea(e):Ve=t}function Wd(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=hd(i,t,t.pendingProps,t.type,void 0,Ye);break;case 11:t=hd(i,t,t.pendingProps,t.type.render,t.ref,Ye);break;case 5:No(t);default:yd(i,t),t=Ve=Gh(t,ri),t=_d(i,t,ri)}e.memoizedProps=e.pendingProps,t===null?ea(e):Ve=t}function Hr(e,t,i,l){Wn=$i=null,No(t),Ar=null,_s=0;var m=t.return;try{if(Nv(e,m,t,i,Ye)){St=1,Pl(e,Cn(i,e.current)),Ve=null;return}}catch(C){if(m!==null)throw Ve=m,C;St=1,Pl(e,Cn(i,e.current)),Ve=null;return}t.flags&32768?(Xe||l===1?e=!0:Br||(Ye&536870912)!==0?e=!1:(Si=e=!0,(l===2||l===9||l===3||l===6)&&(l=un.current,l!==null&&l.tag===13&&(l.flags|=16384))),Kd(t,e)):ea(t)}function ea(e){var t=e;do{if((t.flags&32768)!==0){Kd(t,Si);return}e=t.return;var i=Hv(t.alternate,t,ri);if(i!==null){Ve=i;return}if(t=t.sibling,t!==null){Ve=t;return}Ve=t=e}while(t!==null);St===0&&(St=5)}function Kd(e,t){do{var i=Iv(e.alternate,e);if(i!==null){i.flags&=32767,Ve=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Ve=e;return}Ve=e=i}while(e!==null);St=6,Ve=null}function Xd(e,t,i,l,m,C,L,U,W){e.cancelPendingCommit=null;do ta();while(Ot!==0);if((nt&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(C=t.lanes|t.childLanes,C|=ao,za(e,i,C,L,U,W),e===ft&&(Ve=ft=null,Ye=0),jr=t,wi=e,si=i,gc=C,_c=m,Id=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Qv(Ce,function(){return tp(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=G.T,G.T=null,m=X.p,X.p=2,L=nt,nt|=4;try{Uv(e,t,i)}finally{nt=L,X.p=m,G.T=l}}Ot=1,Qd(),Zd(),Jd()}}function Qd(){if(Ot===1){Ot=0;var e=wi,t=jr,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=G.T,G.T=null;var l=X.p;X.p=2;var m=nt;nt|=4;try{Md(t,e);var C=Lc,L=jh(e.containerInfo),U=C.focusedElem,W=C.selectionRange;if(L!==U&&U&&U.ownerDocument&&Nh(U.ownerDocument.documentElement,U)){if(W!==null&&no(U)){var re=W.start,fe=W.end;if(fe===void 0&&(fe=re),"selectionStart"in U)U.selectionStart=re,U.selectionEnd=Math.min(fe,U.value.length);else{var me=U.ownerDocument||document,se=me&&me.defaultView||window;if(se.getSelection){var oe=se.getSelection(),Ee=U.textContent.length,Oe=Math.min(W.start,Ee),ut=W.end===void 0?Oe:Math.min(W.end,Ee);!oe.extend&&Oe>ut&&(L=ut,ut=Oe,Oe=L);var te=Bh(U,Oe),Z=Bh(U,ut);if(te&&Z&&(oe.rangeCount!==1||oe.anchorNode!==te.node||oe.anchorOffset!==te.offset||oe.focusNode!==Z.node||oe.focusOffset!==Z.offset)){var ie=me.createRange();ie.setStart(te.node,te.offset),oe.removeAllRanges(),Oe>ut?(oe.addRange(ie),oe.extend(Z.node,Z.offset)):(ie.setEnd(Z.node,Z.offset),oe.addRange(ie))}}}}for(me=[],oe=U;oe=oe.parentNode;)oe.nodeType===1&&me.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof U.focus=="function"&&U.focus(),U=0;U<me.length;U++){var pe=me[U];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}da=!!Mc,Lc=Mc=null}finally{nt=m,X.p=l,G.T=i}}e.current=t,Ot=2}}function Zd(){if(Ot===2){Ot=0;var e=wi,t=jr,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=G.T,G.T=null;var l=X.p;X.p=2;var m=nt;nt|=4;try{kd(e,t.alternate,t)}finally{nt=m,X.p=l,G.T=i}}Ot=3}}function Jd(){if(Ot===4||Ot===3){Ot=0,ae();var e=wi,t=jr,i=si,l=Id;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ot=5:(Ot=0,jr=wi=null,ep(e,e.pendingLanes));var m=e.pendingLanes;if(m===0&&(Ci=null),we(i),t=t.stateNode,rt&&typeof rt.onCommitFiberRoot=="function")try{rt.onCommitFiberRoot(bt,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=G.T,m=X.p,X.p=2,G.T=null;try{for(var C=e.onRecoverableError,L=0;L<l.length;L++){var U=l[L];C(U.value,{componentStack:U.stack})}}finally{G.T=t,X.p=m}}(si&3)!==0&&ta(),In(e),m=e.pendingLanes,(i&261930)!==0&&(m&42)!==0?e===vc?Bs++:(Bs=0,vc=e):Bs=0,Ns(0)}}function ep(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ms(t)))}function ta(){return Qd(),Zd(),Jd(),tp()}function tp(){if(Ot!==5)return!1;var e=wi,t=gc;gc=0;var i=we(si),l=G.T,m=X.p;try{X.p=32>i?32:i,G.T=null,i=_c,_c=null;var C=wi,L=si;if(Ot=0,jr=wi=null,si=0,(nt&6)!==0)throw Error(o(331));var U=nt;if(nt|=4,jd(C.current),Od(C,C.current,L,i),nt=U,Ns(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(bt,C)}catch{}return!0}finally{X.p=m,G.T=l,ep(e,t)}}function np(e,t,i){t=Cn(i,t),t=Xo(e.stateNode,t,2),e=gi(e,t,2),e!==null&&(Mn(e,2),In(e))}function lt(e,t,i){if(e.tag===3)np(e,e,i);else for(;t!==null;){if(t.tag===3){np(t,e,i);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ci===null||!Ci.has(l))){e=Cn(i,e),i=id(2),l=gi(t,i,2),l!==null&&(rd(i,l,t,e),Mn(l,2),In(l));break}}t=t.return}}function bc(e,t,i){var l=e.pingCache;if(l===null){l=e.pingCache=new qv;var m=new Set;l.set(t,m)}else m=l.get(t),m===void 0&&(m=new Set,l.set(t,m));m.has(i)||(dc=!0,m.add(i),e=Wv.bind(null,e,t,i),t.then(e,e))}function Wv(e,t,i){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,ft===e&&(Ye&i)===i&&(St===4||St===3&&(Ye&62914560)===Ye&&300>at()-Kl?(nt&2)===0&&zr(e,0):pc|=i,Nr===Ye&&(Nr=0)),In(e)}function ip(e,t){t===0&&(t=He()),e=qi(e,t),e!==null&&(Mn(e,t),In(e))}function Kv(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),ip(e,i)}function Xv(e,t){var i=0;switch(e.tag){case 31:case 13:var l=e.stateNode,m=e.memoizedState;m!==null&&(i=m.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),ip(e,i)}function Qv(e,t){return Lt(e,t)}var na=null,Ir=null,Cc=!1,ia=!1,wc=!1,Ei=0;function In(e){e!==Ir&&e.next===null&&(Ir===null?na=Ir=e:Ir=Ir.next=e),ia=!0,Cc||(Cc=!0,Jv())}function Ns(e,t){if(!wc&&ia){wc=!0;do for(var i=!1,l=na;l!==null;){if(e!==0){var m=l.pendingLanes;if(m===0)var C=0;else{var L=l.suspendedLanes,U=l.pingedLanes;C=(1<<31-tt(42|e)+1)-1,C&=m&~(L&~U),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(i=!0,ap(l,C))}else C=Ye,C=Me(l,l===ft?C:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(C&3)===0||Be(l,C)||(i=!0,ap(l,C));l=l.next}while(i);wc=!1}}function Zv(){rp()}function rp(){ia=Cc=!1;var e=0;Ei!==0&&c0()&&(e=Ei);for(var t=at(),i=null,l=na;l!==null;){var m=l.next,C=sp(l,t);C===0?(l.next=null,i===null?na=m:i.next=m,m===null&&(Ir=i)):(i=l,(e!==0||(C&3)!==0)&&(ia=!0)),l=m}Ot!==0&&Ot!==5||Ns(e),Ei!==0&&(Ei=0)}function sp(e,t){for(var i=e.suspendedLanes,l=e.pingedLanes,m=e.expirationTimes,C=e.pendingLanes&-62914561;0<C;){var L=31-tt(C),U=1<<L,W=m[L];W===-1?((U&i)===0||(U&l)!==0)&&(m[L]=vn(U,t)):W<=t&&(e.expiredLanes|=U),C&=~U}if(t=ft,i=Ye,i=Me(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,i===0||e===t&&(st===2||st===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&it(l),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Be(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(l!==null&&it(l),we(i)){case 2:case 8:i=Se;break;case 32:i=Ce;break;case 268435456:i=Ne;break;default:i=Ce}return l=lp.bind(null,e),i=Lt(i,l),e.callbackPriority=t,e.callbackNode=i,t}return l!==null&&l!==null&&it(l),e.callbackPriority=2,e.callbackNode=null,2}function lp(e,t){if(Ot!==0&&Ot!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(ta()&&e.callbackNode!==i)return null;var l=Ye;return l=Me(e,e===ft?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Pd(e,l,t),sp(e,at()),e.callbackNode!=null&&e.callbackNode===i?lp.bind(null,e):null)}function ap(e,t){if(ta())return null;Pd(e,t,!0)}function Jv(){h0(function(){(nt&6)!==0?Lt(ue,Zv):rp()})}function xc(){if(Ei===0){var e=xr;e===0&&(e=_n,_n<<=1,(_n&261888)===0&&(_n=256)),Ei=e}return Ei}function op(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:hl(""+e)}function cp(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function e0(e,t,i,l,m){if(t==="submit"&&i&&i.stateNode===m){var C=op((m[Xt]||null).action),L=l.submitter;L&&(t=(t=L[Xt]||null)?op(t.formAction):L.getAttribute("formAction"),t!==null&&(C=t,L=null));var U=new ml("action","action",null,l,m);e.push({event:U,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ei!==0){var W=L?cp(m,L):new FormData(m);Vo(i,{pending:!0,data:W,method:m.method,action:C},null,W)}}else typeof C=="function"&&(U.preventDefault(),W=L?cp(m,L):new FormData(m),Vo(i,{pending:!0,data:W,method:m.method,action:C},C,W))},currentTarget:m}]})}}for(var Ec=0;Ec<lo.length;Ec++){var kc=lo[Ec],t0=kc.toLowerCase(),n0=kc[0].toUpperCase()+kc.slice(1);Ln(t0,"on"+n0)}Ln(Ih,"onAnimationEnd"),Ln(Uh,"onAnimationIteration"),Ln(Ph,"onAnimationStart"),Ln("dblclick","onDoubleClick"),Ln("focusin","onFocus"),Ln("focusout","onBlur"),Ln(vv,"onTransitionRun"),Ln(yv,"onTransitionStart"),Ln(Sv,"onTransitionCancel"),Ln(Fh,"onTransitionEnd"),ur("onMouseEnter",["mouseout","mouseover"]),ur("onMouseLeave",["mouseout","mouseover"]),ur("onPointerEnter",["pointerout","pointerover"]),ur("onPointerLeave",["pointerout","pointerover"]),Ii("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ii("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ii("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ii("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ii("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ii("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var js="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(" "),i0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(js));function up(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var l=e[i],m=l.event;l=l.listeners;e:{var C=void 0;if(t)for(var L=l.length-1;0<=L;L--){var U=l[L],W=U.instance,re=U.currentTarget;if(U=U.listener,W!==C&&m.isPropagationStopped())break e;C=U,m.currentTarget=re;try{C(m)}catch(fe){vl(fe)}m.currentTarget=null,C=W}else for(L=0;L<l.length;L++){if(U=l[L],W=U.instance,re=U.currentTarget,U=U.listener,W!==C&&m.isPropagationStopped())break e;C=U,m.currentTarget=re;try{C(m)}catch(fe){vl(fe)}m.currentTarget=null,C=W}}}}function Ge(e,t){var i=t[Ha];i===void 0&&(i=t[Ha]=new Set);var l=e+"__bubble";i.has(l)||(hp(t,e,2,!1),i.add(l))}function Ac(e,t,i){var l=0;t&&(l|=4),hp(i,e,l,t)}var ra="_reactListening"+Math.random().toString(36).slice(2);function Tc(e){if(!e[ra]){e[ra]=!0,ih.forEach(function(i){i!=="selectionchange"&&(i0.has(i)||Ac(i,!1,e),Ac(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ra]||(t[ra]=!0,Ac("selectionchange",!1,t))}}function hp(e,t,i,l){switch(Up(t)){case 2:var m=M0;break;case 8:m=L0;break;default:m=qc}i=m.bind(null,t,i,e),m=void 0,!Ya||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(m=!0),l?m!==void 0?e.addEventListener(t,i,{capture:!0,passive:m}):e.addEventListener(t,i,!0):m!==void 0?e.addEventListener(t,i,{passive:m}):e.addEventListener(t,i,!1)}function Dc(e,t,i,l,m){var C=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var L=l.tag;if(L===3||L===4){var U=l.stateNode.containerInfo;if(U===m)break;if(L===4)for(L=l.return;L!==null;){var W=L.tag;if((W===3||W===4)&&L.stateNode.containerInfo===m)return;L=L.return}for(;U!==null;){if(L=ar(U),L===null)return;if(W=L.tag,W===5||W===6||W===26||W===27){l=C=L;continue e}U=U.parentNode}}l=l.return}mh(function(){var re=C,fe=Ga(i),me=[];e:{var se=qh.get(e);if(se!==void 0){var oe=ml,Ee=e;switch(e){case"keypress":if(dl(i)===0)break e;case"keydown":case"keyup":oe=X_;break;case"focusin":Ee="focus",oe=Qa;break;case"focusout":Ee="blur",oe=Qa;break;case"beforeblur":case"afterblur":oe=Qa;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=vh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=H_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=J_;break;case Ih:case Uh:case Ph:oe=P_;break;case Fh:oe=tv;break;case"scroll":case"scrollend":oe=j_;break;case"wheel":oe=iv;break;case"copy":case"cut":case"paste":oe=q_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=Sh;break;case"toggle":case"beforetoggle":oe=sv}var Oe=(t&4)!==0,ut=!Oe&&(e==="scroll"||e==="scrollend"),te=Oe?se!==null?se+"Capture":null:se;Oe=[];for(var Z=re,ie;Z!==null;){var pe=Z;if(ie=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||ie===null||te===null||(pe=rs(Z,te),pe!=null&&Oe.push(zs(Z,pe,ie))),ut)break;Z=Z.return}0<Oe.length&&(se=new oe(se,Ee,null,i,fe),me.push({event:se,listeners:Oe}))}}if((t&7)===0){e:{if(se=e==="mouseover"||e==="pointerover",oe=e==="mouseout"||e==="pointerout",se&&i!==Va&&(Ee=i.relatedTarget||i.fromElement)&&(ar(Ee)||Ee[lr]))break e;if((oe||se)&&(se=fe.window===fe?fe:(se=fe.ownerDocument)?se.defaultView||se.parentWindow:window,oe?(Ee=i.relatedTarget||i.toElement,oe=re,Ee=Ee?ar(Ee):null,Ee!==null&&(ut=v(Ee),Oe=Ee.tag,Ee!==ut||Oe!==5&&Oe!==27&&Oe!==6)&&(Ee=null)):(oe=null,Ee=re),oe!==Ee)){if(Oe=vh,pe="onMouseLeave",te="onMouseEnter",Z="mouse",(e==="pointerout"||e==="pointerover")&&(Oe=Sh,pe="onPointerLeave",te="onPointerEnter",Z="pointer"),ut=oe==null?se:is(oe),ie=Ee==null?se:is(Ee),se=new Oe(pe,Z+"leave",oe,i,fe),se.target=ut,se.relatedTarget=ie,pe=null,ar(fe)===re&&(Oe=new Oe(te,Z+"enter",Ee,i,fe),Oe.target=ie,Oe.relatedTarget=ut,pe=Oe),ut=pe,oe&&Ee)t:{for(Oe=r0,te=oe,Z=Ee,ie=0,pe=te;pe;pe=Oe(pe))ie++;pe=0;for(var Re=Z;Re;Re=Oe(Re))pe++;for(;0<ie-pe;)te=Oe(te),ie--;for(;0<pe-ie;)Z=Oe(Z),pe--;for(;ie--;){if(te===Z||Z!==null&&te===Z.alternate){Oe=te;break t}te=Oe(te),Z=Oe(Z)}Oe=null}else Oe=null;oe!==null&&fp(me,se,oe,Oe,!1),Ee!==null&&ut!==null&&fp(me,ut,Ee,Oe,!0)}}e:{if(se=re?is(re):window,oe=se.nodeName&&se.nodeName.toLowerCase(),oe==="select"||oe==="input"&&se.type==="file")var Je=Th;else if(kh(se))if(Dh)Je=mv;else{Je=dv;var ke=fv}else oe=se.nodeName,!oe||oe.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?re&&qa(re.elementType)&&(Je=Th):Je=pv;if(Je&&(Je=Je(e,re))){Ah(me,Je,i,fe);break e}ke&&ke(e,se,re),e==="focusout"&&re&&se.type==="number"&&re.memoizedProps.value!=null&&Fa(se,"number",se.value)}switch(ke=re?is(re):window,e){case"focusin":(kh(ke)||ke.contentEditable==="true")&&(gr=ke,io=re,fs=null);break;case"focusout":fs=io=gr=null;break;case"mousedown":ro=!0;break;case"contextmenu":case"mouseup":case"dragend":ro=!1,zh(me,i,fe);break;case"selectionchange":if(_v)break;case"keydown":case"keyup":zh(me,i,fe)}var Ie;if(Ja)e:{switch(e){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else mr?xh(e,i)&&(We="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(We="onCompositionStart");We&&(bh&&i.locale!=="ko"&&(mr||We!=="onCompositionStart"?We==="onCompositionEnd"&&mr&&(Ie=gh()):(ci=fe,Wa="value"in ci?ci.value:ci.textContent,mr=!0)),ke=sa(re,We),0<ke.length&&(We=new yh(We,e,null,i,fe),me.push({event:We,listeners:ke}),Ie?We.data=Ie:(Ie=Eh(i),Ie!==null&&(We.data=Ie)))),(Ie=av?ov(e,i):cv(e,i))&&(We=sa(re,"onBeforeInput"),0<We.length&&(ke=new yh("onBeforeInput","beforeinput",null,i,fe),me.push({event:ke,listeners:We}),ke.data=Ie)),e0(me,e,re,i,fe)}up(me,t)})}function zs(e,t,i){return{instance:e,listener:t,currentTarget:i}}function sa(e,t){for(var i=t+"Capture",l=[];e!==null;){var m=e,C=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||C===null||(m=rs(e,i),m!=null&&l.unshift(zs(e,m,C)),m=rs(e,t),m!=null&&l.push(zs(e,m,C))),e.tag===3)return l;e=e.return}return[]}function r0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function fp(e,t,i,l,m){for(var C=t._reactName,L=[];i!==null&&i!==l;){var U=i,W=U.alternate,re=U.stateNode;if(U=U.tag,W!==null&&W===l)break;U!==5&&U!==26&&U!==27||re===null||(W=re,m?(re=rs(i,C),re!=null&&L.unshift(zs(i,re,W))):m||(re=rs(i,C),re!=null&&L.push(zs(i,re,W)))),i=i.return}L.length!==0&&e.push({event:t,listeners:L})}var s0=/\r\n?/g,l0=/\u0000|\uFFFD/g;function dp(e){return(typeof e=="string"?e:""+e).replace(s0,`
|
|
49
|
-
`).replace(l0,"")}function pp(e,t){return t=dp(t),dp(e)===t}function ct(e,t,i,l,m,C){switch(i){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||fr(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&fr(e,""+l);break;case"className":cl(e,"class",l);break;case"tabIndex":cl(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":cl(e,i,l);break;case"style":dh(e,l,C);break;case"data":if(t!=="object"){cl(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=hl(""+l),e.setAttribute(i,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(i,"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 C=="function"&&(i==="formAction"?(t!=="input"&&ct(e,t,"name",m.name,m,null),ct(e,t,"formEncType",m.formEncType,m,null),ct(e,t,"formMethod",m.formMethod,m,null),ct(e,t,"formTarget",m.formTarget,m,null)):(ct(e,t,"encType",m.encType,m,null),ct(e,t,"method",m.method,m,null),ct(e,t,"target",m.target,m,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=hl(""+l),e.setAttribute(i,l);break;case"onClick":l!=null&&(e.onclick=Vn);break;case"onScroll":l!=null&&Ge("scroll",e);break;case"onScrollEnd":l!=null&&Ge("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(i=l.__html,i!=null){if(m.children!=null)throw Error(o(60));e.innerHTML=i}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}i=hl(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,""+l):e.removeAttribute(i);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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":l===!0?e.setAttribute(i,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,l):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(i,l):e.removeAttribute(i);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(i):e.setAttribute(i,l);break;case"popover":Ge("beforetoggle",e),Ge("toggle",e),ol(e,"popover",l);break;case"xlinkActuate":qn(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":qn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":qn(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":qn(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":qn(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":qn(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":qn(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":qn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":qn(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":ol(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=B_.get(i)||i,ol(e,i,l))}}function Rc(e,t,i,l,m,C){switch(i){case"style":dh(e,l,C);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(i=l.__html,i!=null){if(m.children!=null)throw Error(o(60));e.innerHTML=i}}break;case"children":typeof l=="string"?fr(e,l):(typeof l=="number"||typeof l=="bigint")&&fr(e,""+l);break;case"onScroll":l!=null&&Ge("scroll",e);break;case"onScrollEnd":l!=null&&Ge("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Vn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!rh.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(m=i.endsWith("Capture"),t=i.slice(2,m?i.length-7:void 0),C=e[Xt]||null,C=C!=null?C[i]:null,typeof C=="function"&&e.removeEventListener(t,C,m),typeof l=="function")){typeof C!="function"&&C!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,l,m);break e}i in e?e[i]=l:l===!0?e.setAttribute(i,""):ol(e,i,l)}}}function Ft(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ge("error",e),Ge("load",e);var l=!1,m=!1,C;for(C in i)if(i.hasOwnProperty(C)){var L=i[C];if(L!=null)switch(C){case"src":l=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ct(e,t,C,L,i,null)}}m&&ct(e,t,"srcSet",i.srcSet,i,null),l&&ct(e,t,"src",i.src,i,null);return;case"input":Ge("invalid",e);var U=C=L=m=null,W=null,re=null;for(l in i)if(i.hasOwnProperty(l)){var fe=i[l];if(fe!=null)switch(l){case"name":m=fe;break;case"type":L=fe;break;case"checked":W=fe;break;case"defaultChecked":re=fe;break;case"value":C=fe;break;case"defaultValue":U=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(o(137,t));break;default:ct(e,t,l,fe,i,null)}}ch(e,C,U,W,re,L,m,!1);return;case"select":Ge("invalid",e),l=L=C=null;for(m in i)if(i.hasOwnProperty(m)&&(U=i[m],U!=null))switch(m){case"value":C=U;break;case"defaultValue":L=U;break;case"multiple":l=U;default:ct(e,t,m,U,i,null)}t=C,i=L,e.multiple=!!l,t!=null?hr(e,!!l,t,!1):i!=null&&hr(e,!!l,i,!0);return;case"textarea":Ge("invalid",e),C=m=l=null;for(L in i)if(i.hasOwnProperty(L)&&(U=i[L],U!=null))switch(L){case"value":l=U;break;case"defaultValue":m=U;break;case"children":C=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(o(91));break;default:ct(e,t,L,U,i,null)}hh(e,l,m,C);return;case"option":for(W in i)if(i.hasOwnProperty(W)&&(l=i[W],l!=null))switch(W){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:ct(e,t,W,l,i,null)}return;case"dialog":Ge("beforetoggle",e),Ge("toggle",e),Ge("cancel",e),Ge("close",e);break;case"iframe":case"object":Ge("load",e);break;case"video":case"audio":for(l=0;l<js.length;l++)Ge(js[l],e);break;case"image":Ge("error",e),Ge("load",e);break;case"details":Ge("toggle",e);break;case"embed":case"source":case"link":Ge("error",e),Ge("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(re in i)if(i.hasOwnProperty(re)&&(l=i[re],l!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ct(e,t,re,l,i,null)}return;default:if(qa(t)){for(fe in i)i.hasOwnProperty(fe)&&(l=i[fe],l!==void 0&&Rc(e,t,fe,l,i,void 0));return}}for(U in i)i.hasOwnProperty(U)&&(l=i[U],l!=null&&ct(e,t,U,l,i,null))}function a0(e,t,i,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,C=null,L=null,U=null,W=null,re=null,fe=null;for(oe in i){var me=i[oe];if(i.hasOwnProperty(oe)&&me!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":W=me;default:l.hasOwnProperty(oe)||ct(e,t,oe,null,l,me)}}for(var se in l){var oe=l[se];if(me=i[se],l.hasOwnProperty(se)&&(oe!=null||me!=null))switch(se){case"type":C=oe;break;case"name":m=oe;break;case"checked":re=oe;break;case"defaultChecked":fe=oe;break;case"value":L=oe;break;case"defaultValue":U=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(o(137,t));break;default:oe!==me&&ct(e,t,se,oe,l,me)}}Pa(e,L,U,W,re,fe,C,m);return;case"select":oe=L=U=se=null;for(C in i)if(W=i[C],i.hasOwnProperty(C)&&W!=null)switch(C){case"value":break;case"multiple":oe=W;default:l.hasOwnProperty(C)||ct(e,t,C,null,l,W)}for(m in l)if(C=l[m],W=i[m],l.hasOwnProperty(m)&&(C!=null||W!=null))switch(m){case"value":se=C;break;case"defaultValue":U=C;break;case"multiple":L=C;default:C!==W&&ct(e,t,m,C,l,W)}t=U,i=L,l=oe,se!=null?hr(e,!!i,se,!1):!!l!=!!i&&(t!=null?hr(e,!!i,t,!0):hr(e,!!i,i?[]:"",!1));return;case"textarea":oe=se=null;for(U in i)if(m=i[U],i.hasOwnProperty(U)&&m!=null&&!l.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:ct(e,t,U,null,l,m)}for(L in l)if(m=l[L],C=i[L],l.hasOwnProperty(L)&&(m!=null||C!=null))switch(L){case"value":se=m;break;case"defaultValue":oe=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(o(91));break;default:m!==C&&ct(e,t,L,m,l,C)}uh(e,se,oe);return;case"option":for(var Ee in i)if(se=i[Ee],i.hasOwnProperty(Ee)&&se!=null&&!l.hasOwnProperty(Ee))switch(Ee){case"selected":e.selected=!1;break;default:ct(e,t,Ee,null,l,se)}for(W in l)if(se=l[W],oe=i[W],l.hasOwnProperty(W)&&se!==oe&&(se!=null||oe!=null))switch(W){case"selected":e.selected=se&&typeof se!="function"&&typeof se!="symbol";break;default:ct(e,t,W,se,l,oe)}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 Oe in i)se=i[Oe],i.hasOwnProperty(Oe)&&se!=null&&!l.hasOwnProperty(Oe)&&ct(e,t,Oe,null,l,se);for(re in l)if(se=l[re],oe=i[re],l.hasOwnProperty(re)&&se!==oe&&(se!=null||oe!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(o(137,t));break;default:ct(e,t,re,se,l,oe)}return;default:if(qa(t)){for(var ut in i)se=i[ut],i.hasOwnProperty(ut)&&se!==void 0&&!l.hasOwnProperty(ut)&&Rc(e,t,ut,void 0,l,se);for(fe in l)se=l[fe],oe=i[fe],!l.hasOwnProperty(fe)||se===oe||se===void 0&&oe===void 0||Rc(e,t,fe,se,l,oe);return}}for(var te in i)se=i[te],i.hasOwnProperty(te)&&se!=null&&!l.hasOwnProperty(te)&&ct(e,t,te,null,l,se);for(me in l)se=l[me],oe=i[me],!l.hasOwnProperty(me)||se===oe||se==null&&oe==null||ct(e,t,me,se,l,oe)}function mp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function o0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),l=0;l<i.length;l++){var m=i[l],C=m.transferSize,L=m.initiatorType,U=m.duration;if(C&&U&&mp(L)){for(L=0,U=m.responseEnd,l+=1;l<i.length;l++){var W=i[l],re=W.startTime;if(re>U)break;var fe=W.transferSize,me=W.initiatorType;fe&&mp(me)&&(W=W.responseEnd,L+=fe*(W<U?1:(U-re)/(W-re)))}if(--l,t+=8*(C+L)/(m.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Mc=null,Lc=null;function la(e){return e.nodeType===9?e:e.ownerDocument}function gp(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function _p(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Oc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Bc=null;function c0(){var e=window.event;return e&&e.type==="popstate"?e===Bc?!1:(Bc=e,!0):(Bc=null,!1)}var vp=typeof setTimeout=="function"?setTimeout:void 0,u0=typeof clearTimeout=="function"?clearTimeout:void 0,yp=typeof Promise=="function"?Promise:void 0,h0=typeof queueMicrotask=="function"?queueMicrotask:typeof yp<"u"?function(e){return yp.resolve(null).then(e).catch(f0)}:vp;function f0(e){setTimeout(function(){throw e})}function ki(e){return e==="head"}function Sp(e,t){var i=t,l=0;do{var m=i.nextSibling;if(e.removeChild(i),m&&m.nodeType===8)if(i=m.data,i==="/$"||i==="/&"){if(l===0){e.removeChild(m),qr(t);return}l--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")l++;else if(i==="html")Hs(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Hs(i);for(var C=i.firstChild;C;){var L=C.nextSibling,U=C.nodeName;C[ns]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&C.rel.toLowerCase()==="stylesheet"||i.removeChild(C),C=L}}else i==="body"&&Hs(e.ownerDocument.body);i=m}while(i);qr(t)}function bp(e,t){var i=e;e=0;do{var l=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),l&&l.nodeType===8)if(i=l.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=l}while(i)}function Nc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Nc(i),Ia(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function d0(e,t,i,l){for(;e.nodeType===1;){var m=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[ns])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(C=e.getAttribute("rel"),C==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(C!==m.rel||e.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||e.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||e.getAttribute("title")!==(m.title==null?null:m.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(C=e.getAttribute("src"),(C!==(m.src==null?null:m.src)||e.getAttribute("type")!==(m.type==null?null:m.type)||e.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&C&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var C=m.name==null?null:""+m.name;if(m.type==="hidden"&&e.getAttribute("name")===C)return e}else return e;if(e=An(e.nextSibling),e===null)break}return null}function p0(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=An(e.nextSibling),e===null))return null;return e}function Cp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=An(e.nextSibling),e===null))return null;return e}function jc(e){return e.data==="$?"||e.data==="$~"}function zc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function m0(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var l=function(){t(),i.removeEventListener("DOMContentLoaded",l)};i.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function An(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Hc=null;function wp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return An(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function xp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function Ep(e,t,i){switch(t=la(i),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Hs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ia(e)}var Tn=new Map,kp=new Set;function aa(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var li=X.d;X.d={f:g0,r:_0,D:v0,C:y0,L:S0,m:b0,X:w0,S:C0,M:x0};function g0(){var e=li.f(),t=Zl();return e||t}function _0(e){var t=or(e);t!==null&&t.tag===5&&t.type==="form"?qf(t):li.r(e)}var Ur=typeof document>"u"?null:document;function Ap(e,t,i){var l=Ur;if(l&&typeof t=="string"&&t){var m=Sn(t);m='link[rel="'+e+'"][href="'+m+'"]',typeof i=="string"&&(m+='[crossorigin="'+i+'"]'),kp.has(m)||(kp.add(m),e={rel:e,crossOrigin:i,href:t},l.querySelector(m)===null&&(t=l.createElement("link"),Ft(t,"link",e),Bt(t),l.head.appendChild(t)))}}function v0(e){li.D(e),Ap("dns-prefetch",e,null)}function y0(e,t){li.C(e,t),Ap("preconnect",e,t)}function S0(e,t,i){li.L(e,t,i);var l=Ur;if(l&&e&&t){var m='link[rel="preload"][as="'+Sn(t)+'"]';t==="image"&&i&&i.imageSrcSet?(m+='[imagesrcset="'+Sn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(m+='[imagesizes="'+Sn(i.imageSizes)+'"]')):m+='[href="'+Sn(e)+'"]';var C=m;switch(t){case"style":C=Pr(e);break;case"script":C=Fr(e)}Tn.has(C)||(e=u({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Tn.set(C,e),l.querySelector(m)!==null||t==="style"&&l.querySelector(Is(C))||t==="script"&&l.querySelector(Us(C))||(t=l.createElement("link"),Ft(t,"link",e),Bt(t),l.head.appendChild(t)))}}function b0(e,t){li.m(e,t);var i=Ur;if(i&&e){var l=t&&typeof t.as=="string"?t.as:"script",m='link[rel="modulepreload"][as="'+Sn(l)+'"][href="'+Sn(e)+'"]',C=m;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":C=Fr(e)}if(!Tn.has(C)&&(e=u({rel:"modulepreload",href:e},t),Tn.set(C,e),i.querySelector(m)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Us(C)))return}l=i.createElement("link"),Ft(l,"link",e),Bt(l),i.head.appendChild(l)}}}function C0(e,t,i){li.S(e,t,i);var l=Ur;if(l&&e){var m=cr(l).hoistableStyles,C=Pr(e);t=t||"default";var L=m.get(C);if(!L){var U={loading:0,preload:null};if(L=l.querySelector(Is(C)))U.loading=5;else{e=u({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Tn.get(C))&&Ic(e,i);var W=L=l.createElement("link");Bt(W),Ft(W,"link",e),W._p=new Promise(function(re,fe){W.onload=re,W.onerror=fe}),W.addEventListener("load",function(){U.loading|=1}),W.addEventListener("error",function(){U.loading|=2}),U.loading|=4,oa(L,t,l)}L={type:"stylesheet",instance:L,count:1,state:U},m.set(C,L)}}}function w0(e,t){li.X(e,t);var i=Ur;if(i&&e){var l=cr(i).hoistableScripts,m=Fr(e),C=l.get(m);C||(C=i.querySelector(Us(m)),C||(e=u({src:e,async:!0},t),(t=Tn.get(m))&&Uc(e,t),C=i.createElement("script"),Bt(C),Ft(C,"link",e),i.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},l.set(m,C))}}function x0(e,t){li.M(e,t);var i=Ur;if(i&&e){var l=cr(i).hoistableScripts,m=Fr(e),C=l.get(m);C||(C=i.querySelector(Us(m)),C||(e=u({src:e,async:!0,type:"module"},t),(t=Tn.get(m))&&Uc(e,t),C=i.createElement("script"),Bt(C),Ft(C,"link",e),i.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},l.set(m,C))}}function Tp(e,t,i,l){var m=(m=ge.current)?aa(m):null;if(!m)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Pr(i.href),i=cr(m).hoistableStyles,l=i.get(t),l||(l={type:"style",instance:null,count:0,state:null},i.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Pr(i.href);var C=cr(m).hoistableStyles,L=C.get(e);if(L||(m=m.ownerDocument||m,L={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},C.set(e,L),(C=m.querySelector(Is(e)))&&!C._p&&(L.instance=C,L.state.loading=5),Tn.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Tn.set(e,i),C||E0(m,e,i,L.state))),t&&l===null)throw Error(o(528,""));return L}if(t&&l!==null)throw Error(o(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Fr(i),i=cr(m).hoistableScripts,l=i.get(t),l||(l={type:"script",instance:null,count:0,state:null},i.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Pr(e){return'href="'+Sn(e)+'"'}function Is(e){return'link[rel="stylesheet"]['+e+"]"}function Dp(e){return u({},e,{"data-precedence":e.precedence,precedence:null})}function E0(e,t,i,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Ft(t,"link",i),Bt(t),e.head.appendChild(t))}function Fr(e){return'[src="'+Sn(e)+'"]'}function Us(e){return"script[async]"+e}function Rp(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Sn(i.href)+'"]');if(l)return t.instance=l,Bt(l),l;var m=u({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Bt(l),Ft(l,"style",m),oa(l,i.precedence,e),t.instance=l;case"stylesheet":m=Pr(i.href);var C=e.querySelector(Is(m));if(C)return t.state.loading|=4,t.instance=C,Bt(C),C;l=Dp(i),(m=Tn.get(m))&&Ic(l,m),C=(e.ownerDocument||e).createElement("link"),Bt(C);var L=C;return L._p=new Promise(function(U,W){L.onload=U,L.onerror=W}),Ft(C,"link",l),t.state.loading|=4,oa(C,i.precedence,e),t.instance=C;case"script":return C=Fr(i.src),(m=e.querySelector(Us(C)))?(t.instance=m,Bt(m),m):(l=i,(m=Tn.get(C))&&(l=u({},i),Uc(l,m)),e=e.ownerDocument||e,m=e.createElement("script"),Bt(m),Ft(m,"link",l),e.head.appendChild(m),t.instance=m);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,oa(l,i.precedence,e));return t.instance}function oa(e,t,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=l.length?l[l.length-1]:null,C=m,L=0;L<l.length;L++){var U=l[L];if(U.dataset.precedence===t)C=U;else if(C!==m)break}C?C.parentNode.insertBefore(e,C.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Ic(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Uc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ca=null;function Mp(e,t,i){if(ca===null){var l=new Map,m=ca=new Map;m.set(i,l)}else m=ca,l=m.get(i),l||(l=new Map,m.set(i,l));if(l.has(e))return l;for(l.set(e,null),i=i.getElementsByTagName(e),m=0;m<i.length;m++){var C=i[m];if(!(C[ns]||C[Ht]||e==="link"&&C.getAttribute("rel")==="stylesheet")&&C.namespaceURI!=="http://www.w3.org/2000/svg"){var L=C.getAttribute(t)||"";L=e+L;var U=l.get(L);U?U.push(C):l.set(L,[C])}}return l}function Lp(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function k0(e,t,i){if(i===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Op(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function A0(e,t,i,l){if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var m=Pr(l.href),C=t.querySelector(Is(m));if(C){t=C._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ua.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=C,Bt(C);return}C=t.ownerDocument||t,l=Dp(l),(m=Tn.get(m))&&Ic(l,m),C=C.createElement("link"),Bt(C);var L=C;L._p=new Promise(function(U,W){L.onload=U,L.onerror=W}),Ft(C,"link",l),i.instance=C}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=ua.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Pc=0;function T0(e,t){return e.stylesheets&&e.count===0&&fa(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var l=setTimeout(function(){if(e.stylesheets&&fa(e,e.stylesheets),e.unsuspend){var C=e.unsuspend;e.unsuspend=null,C()}},6e4+t);0<e.imgBytes&&Pc===0&&(Pc=62500*o0());var m=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fa(e,e.stylesheets),e.unsuspend)){var C=e.unsuspend;e.unsuspend=null,C()}},(e.imgBytes>Pc?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(m)}}:null}function ua(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fa(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ha=null;function fa(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ha=new Map,t.forEach(D0,e),ha=null,ua.call(e))}function D0(e,t){if(!(t.state.loading&4)){var i=ha.get(e);if(i)var l=i.get(null);else{i=new Map,ha.set(e,i);for(var m=e.querySelectorAll("link[data-precedence],style[data-precedence]"),C=0;C<m.length;C++){var L=m[C];(L.nodeName==="LINK"||L.getAttribute("media")!=="not all")&&(i.set(L.dataset.precedence,L),l=L)}l&&i.set(null,l)}m=t.instance,L=m.getAttribute("data-precedence"),C=i.get(L)||l,C===l&&i.set(null,m),i.set(L,m),this.count++,l=ua.bind(this),m.addEventListener("load",l),m.addEventListener("error",l),C?C.parentNode.insertBefore(m,C.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(m,e.firstChild)),t.state.loading|=4}}var Ps={$$typeof:y,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function R0(e,t,i,l,m,C,L,U,W){this.tag=1,this.containerInfo=e,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=Fn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fn(0),this.hiddenUpdates=Fn(null),this.identifierPrefix=l,this.onUncaughtError=m,this.onCaughtError=C,this.onRecoverableError=L,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function Bp(e,t,i,l,m,C,L,U,W,re,fe,me){return e=new R0(e,t,i,L,W,re,fe,me,U),t=1,C===!0&&(t|=24),C=cn(3,null,null,t),e.current=C,C.stateNode=e,t=So(),t.refCount++,e.pooledCache=t,t.refCount++,C.memoizedState={element:l,isDehydrated:i,cache:t},xo(C),e}function Np(e){return e?(e=yr,e):yr}function jp(e,t,i,l,m,C){m=Np(m),l.context===null?l.context=m:l.pendingContext=m,l=mi(t),l.payload={element:i},C=C===void 0?null:C,C!==null&&(l.callback=C),i=gi(e,l,t),i!==null&&(nn(i,e,t),ys(i,e,t))}function zp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Fc(e,t){zp(e,t),(e=e.alternate)&&zp(e,t)}function Hp(e){if(e.tag===13||e.tag===31){var t=qi(e,67108864);t!==null&&nn(t,e,67108864),Fc(e,67108864)}}function Ip(e){if(e.tag===13||e.tag===31){var t=pn();t=le(t);var i=qi(e,t);i!==null&&nn(i,e,t),Fc(e,t)}}var da=!0;function M0(e,t,i,l){var m=G.T;G.T=null;var C=X.p;try{X.p=2,qc(e,t,i,l)}finally{X.p=C,G.T=m}}function L0(e,t,i,l){var m=G.T;G.T=null;var C=X.p;try{X.p=8,qc(e,t,i,l)}finally{X.p=C,G.T=m}}function qc(e,t,i,l){if(da){var m=Vc(l);if(m===null)Dc(e,t,l,pa,i),Pp(e,l);else if(B0(m,e,t,i,l))l.stopPropagation();else if(Pp(e,l),t&4&&-1<O0.indexOf(e)){for(;m!==null;){var C=or(m);if(C!==null)switch(C.tag){case 3:if(C=C.stateNode,C.current.memoizedState.isDehydrated){var L=ve(C.pendingLanes);if(L!==0){var U=C;for(U.pendingLanes|=2,U.entangledLanes|=2;L;){var W=1<<31-tt(L);U.entanglements[1]|=W,L&=~W}In(C),(nt&6)===0&&(Xl=at()+500,Ns(0))}}break;case 31:case 13:U=qi(C,2),U!==null&&nn(U,C,2),Zl(),Fc(C,2)}if(C=Vc(l),C===null&&Dc(e,t,l,pa,i),C===m)break;m=C}m!==null&&l.stopPropagation()}else Dc(e,t,l,null,i)}}function Vc(e){return e=Ga(e),Gc(e)}var pa=null;function Gc(e){if(pa=null,e=ar(e),e!==null){var t=v(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=f(t),e!==null)return e;e=null}else if(i===31){if(e=a(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return pa=e,null}function Up(e){switch(e){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(Ze()){case ue:return 2;case Se:return 8;case Ce:case De:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var $c=!1,Ai=null,Ti=null,Di=null,Fs=new Map,qs=new Map,Ri=[],O0="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 Pp(e,t){switch(e){case"focusin":case"focusout":Ai=null;break;case"dragenter":case"dragleave":Ti=null;break;case"mouseover":case"mouseout":Di=null;break;case"pointerover":case"pointerout":Fs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":qs.delete(t.pointerId)}}function Vs(e,t,i,l,m,C){return e===null||e.nativeEvent!==C?(e={blockedOn:t,domEventName:i,eventSystemFlags:l,nativeEvent:C,targetContainers:[m]},t!==null&&(t=or(t),t!==null&&Hp(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,m!==null&&t.indexOf(m)===-1&&t.push(m),e)}function B0(e,t,i,l,m){switch(t){case"focusin":return Ai=Vs(Ai,e,t,i,l,m),!0;case"dragenter":return Ti=Vs(Ti,e,t,i,l,m),!0;case"mouseover":return Di=Vs(Di,e,t,i,l,m),!0;case"pointerover":var C=m.pointerId;return Fs.set(C,Vs(Fs.get(C)||null,e,t,i,l,m)),!0;case"gotpointercapture":return C=m.pointerId,qs.set(C,Vs(qs.get(C)||null,e,t,i,l,m)),!0}return!1}function Fp(e){var t=ar(e.target);if(t!==null){var i=v(t);if(i!==null){if(t=i.tag,t===13){if(t=f(i),t!==null){e.blockedOn=t,zt(e.priority,function(){Ip(i)});return}}else if(t===31){if(t=a(i),t!==null){e.blockedOn=t,zt(e.priority,function(){Ip(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ma(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Vc(e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);Va=l,i.target.dispatchEvent(l),Va=null}else return t=or(i),t!==null&&Hp(t),e.blockedOn=i,!1;t.shift()}return!0}function qp(e,t,i){ma(e)&&i.delete(t)}function N0(){$c=!1,Ai!==null&&ma(Ai)&&(Ai=null),Ti!==null&&ma(Ti)&&(Ti=null),Di!==null&&ma(Di)&&(Di=null),Fs.forEach(qp),qs.forEach(qp)}function ga(e,t){e.blockedOn===t&&(e.blockedOn=null,$c||($c=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,N0)))}var _a=null;function Vp(e){_a!==e&&(_a=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){_a===e&&(_a=null);for(var t=0;t<e.length;t+=3){var i=e[t],l=e[t+1],m=e[t+2];if(typeof l!="function"){if(Gc(l||i)===null)continue;break}var C=or(i);C!==null&&(e.splice(t,3),t-=3,Vo(C,{pending:!0,data:m,method:i.method,action:l},l,m))}}))}function qr(e){function t(W){return ga(W,e)}Ai!==null&&ga(Ai,e),Ti!==null&&ga(Ti,e),Di!==null&&ga(Di,e),Fs.forEach(t),qs.forEach(t);for(var i=0;i<Ri.length;i++){var l=Ri[i];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ri.length&&(i=Ri[0],i.blockedOn===null);)Fp(i),i.blockedOn===null&&Ri.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(l=0;l<i.length;l+=3){var m=i[l],C=i[l+1],L=m[Xt]||null;if(typeof C=="function")L||Vp(i);else if(L){var U=null;if(C&&C.hasAttribute("formAction")){if(m=C,L=C[Xt]||null)U=L.formAction;else if(Gc(m)!==null)continue}else U=L.action;typeof U=="function"?i[l+1]=U:(i.splice(l,3),l-=3),Vp(i)}}}function Gp(){function e(C){C.canIntercept&&C.info==="react-transition"&&C.intercept({handler:function(){return new Promise(function(L){return m=L})},focusReset:"manual",scroll:"manual"})}function t(){m!==null&&(m(),m=null),l||setTimeout(i,20)}function i(){if(!l&&!navigation.transition){var C=navigation.currentEntry;C&&C.url!=null&&navigation.navigate(C.url,{state:C.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,m=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),m!==null&&(m(),m=null)}}}function Yc(e){this._internalRoot=e}va.prototype.render=Yc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var i=t.current,l=pn();jp(i,l,e,t,null,null)},va.prototype.unmount=Yc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;jp(e.current,2,null,e,null,null),Zl(),t[lr]=null}};function va(e){this._internalRoot=e}va.prototype.unstable_scheduleHydration=function(e){if(e){var t=wt();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Ri.length&&t!==0&&t<Ri[i].priority;i++);Ri.splice(i,0,e),i===0&&Fp(e)}};var $p=r.version;if($p!=="19.2.6")throw Error(o(527,$p,"19.2.6"));X.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=h(t),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var j0={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ya=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ya.isDisabled&&ya.supportsFiber)try{bt=ya.inject(j0),rt=ya}catch{}}return $s.createRoot=function(e,t){if(!d(e))throw Error(o(299));var i=!1,l="",m=Jf,C=ed,L=td;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(m=t.onUncaughtError),t.onCaughtError!==void 0&&(C=t.onCaughtError),t.onRecoverableError!==void 0&&(L=t.onRecoverableError)),t=Bp(e,1,!1,null,null,i,l,null,m,C,L,Gp),e[lr]=t.current,Tc(e),new Yc(t)},$s.hydrateRoot=function(e,t,i){if(!d(e))throw Error(o(299));var l=!1,m="",C=Jf,L=ed,U=td,W=null;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(m=i.identifierPrefix),i.onUncaughtError!==void 0&&(C=i.onUncaughtError),i.onCaughtError!==void 0&&(L=i.onCaughtError),i.onRecoverableError!==void 0&&(U=i.onRecoverableError),i.formState!==void 0&&(W=i.formState)),t=Bp(e,1,!0,t,i??null,l,m,W,C,L,U,Gp),t.context=Np(null),i=t.current,l=pn(),l=le(l),m=mi(l),m.callback=null,gi(i,m,l),i=l,t.current.lanes=i,Mn(t,i),In(t),e[lr]=t.current,Tc(e),new va(t)},$s.version="19.2.6",$s}var im;function W0(){if(im)return Xc.exports;im=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Xc.exports=Y0(),Xc.exports}var K0=W0();const Qr=function(n,r){let d=n;const v=Qs[r];let f=null,a=0,c=null;const h=[],p={},u=function(T,E){a=d*4+17,f=(function(R){const N=new Array(R);for(let z=0;z<R;z+=1){N[z]=new Array(R);for(let F=0;F<R;F+=1)N[z][F]=null}return N})(a),S(0,0),S(a-7,0),S(0,a-7),x(),A(),_(T,E),d>=7&&b(T),c==null&&(c=k(d,v,h)),g(c,E)},S=function(T,E){for(let R=-1;R<=7;R+=1)if(!(T+R<=-1||a<=T+R))for(let N=-1;N<=7;N+=1)E+N<=-1||a<=E+N||(0<=R&&R<=6&&(N==0||N==6)||0<=N&&N<=6&&(R==0||R==6)||2<=R&&R<=4&&2<=N&&N<=4?f[T+R][E+N]=!0:f[T+R][E+N]=!1)},w=function(){let T=0,E=0;for(let R=0;R<8;R+=1){u(!0,R);const N=Oi.getLostPoint(p);(R==0||T>N)&&(T=N,E=R)}return E},A=function(){for(let T=8;T<a-8;T+=1)f[T][6]==null&&(f[T][6]=T%2==0);for(let T=8;T<a-8;T+=1)f[6][T]==null&&(f[6][T]=T%2==0)},x=function(){const T=Oi.getPatternPosition(d);for(let E=0;E<T.length;E+=1)for(let R=0;R<T.length;R+=1){const N=T[E],z=T[R];if(f[N][z]==null)for(let F=-2;F<=2;F+=1)for(let P=-2;P<=2;P+=1)F==-2||F==2||P==-2||P==2||F==0&&P==0?f[N+F][z+P]=!0:f[N+F][z+P]=!1}},b=function(T){const E=Oi.getBCHTypeNumber(d);for(let R=0;R<18;R+=1){const N=!T&&(E>>R&1)==1;f[Math.floor(R/3)][R%3+a-8-3]=N}for(let R=0;R<18;R+=1){const N=!T&&(E>>R&1)==1;f[R%3+a-8-3][Math.floor(R/3)]=N}},_=function(T,E){const R=v<<3|E,N=Oi.getBCHTypeInfo(R);for(let z=0;z<15;z+=1){const F=!T&&(N>>z&1)==1;z<6?f[z][8]=F:z<8?f[z+1][8]=F:f[a-15+z][8]=F}for(let z=0;z<15;z+=1){const F=!T&&(N>>z&1)==1;z<8?f[8][a-z-1]=F:z<9?f[8][15-z-1+1]=F:f[8][15-z-1]=F}f[a-8][8]=!T},g=function(T,E){let R=-1,N=a-1,z=7,F=0;const P=Oi.getMaskFunction(E);for(let $=a-1;$>0;$-=2)for($==6&&($-=1);;){for(let K=0;K<2;K+=1)if(f[N][$-K]==null){let G=!1;F<T.length&&(G=(T[F]>>>z&1)==1),P(N,$-K)&&(G=!G),f[N][$-K]=G,z-=1,z==-1&&(F+=1,z=7)}if(N+=R,N<0||a<=N){N-=R,R=-R;break}}},y=function(T,E){let R=0,N=0,z=0;const F=new Array(E.length),P=new Array(E.length);for(let X=0;X<E.length;X+=1){const ee=E[X].dataCount,H=E[X].totalCount-ee;N=Math.max(N,ee),z=Math.max(z,H),F[X]=new Array(ee);for(let I=0;I<F[X].length;I+=1)F[X][I]=255&T.getBuffer()[I+R];R+=ee;const O=Oi.getErrorCorrectPolynomial(H),V=tl(F[X],O.getLength()-1).mod(O);P[X]=new Array(O.getLength()-1);for(let I=0;I<P[X].length;I+=1){const ne=I+V.getLength()-P[X].length;P[X][I]=ne>=0?V.getAt(ne):0}}let $=0;for(let X=0;X<E.length;X+=1)$+=E[X].totalCount;const K=new Array($);let G=0;for(let X=0;X<N;X+=1)for(let ee=0;ee<E.length;ee+=1)X<F[ee].length&&(K[G]=F[ee][X],G+=1);for(let X=0;X<z;X+=1)for(let ee=0;ee<E.length;ee+=1)X<P[ee].length&&(K[G]=P[ee][X],G+=1);return K},k=function(T,E,R){const N=rm.getRSBlocks(T,E),z=sm();for(let P=0;P<R.length;P+=1){const $=R[P];z.put($.getMode(),4),z.put($.getLength(),Oi.getLengthInBits($.getMode(),T)),$.write(z)}let F=0;for(let P=0;P<N.length;P+=1)F+=N[P].dataCount;if(z.getLengthInBits()>F*8)throw"code length overflow. ("+z.getLengthInBits()+">"+F*8+")";for(z.getLengthInBits()+4<=F*8&&z.put(0,4);z.getLengthInBits()%8!=0;)z.putBit(!1);for(;!(z.getLengthInBits()>=F*8||(z.put(236,8),z.getLengthInBits()>=F*8));)z.put(17,8);return y(z,N)};p.addData=function(T,E){E=E||"Byte";let R=null;switch(E){case"Numeric":R=X0(T);break;case"Alphanumeric":R=Q0(T);break;case"Byte":R=Z0(T);break;case"Kanji":R=J0(T);break;default:throw"mode:"+E}h.push(R),c=null},p.isDark=function(T,E){if(T<0||a<=T||E<0||a<=E)throw T+","+E;return f[T][E]},p.getModuleCount=function(){return a},p.make=function(){if(d<1){let T=1;for(;T<40;T++){const E=rm.getRSBlocks(T,v),R=sm();for(let z=0;z<h.length;z++){const F=h[z];R.put(F.getMode(),4),R.put(F.getLength(),Oi.getLengthInBits(F.getMode(),T)),F.write(R)}let N=0;for(let z=0;z<E.length;z++)N+=E[z].dataCount;if(R.getLengthInBits()<=N*8)break}d=T}u(!1,w())},p.createTableTag=function(T,E){T=T||2,E=typeof E>"u"?T*4:E;let R="";R+='<table style="',R+=" border-width: 0px; border-style: none;",R+=" border-collapse: collapse;",R+=" padding: 0px; margin: "+E+"px;",R+='">',R+="<tbody>";for(let N=0;N<p.getModuleCount();N+=1){R+="<tr>";for(let z=0;z<p.getModuleCount();z+=1)R+='<td style="',R+=" border-width: 0px; border-style: none;",R+=" border-collapse: collapse;",R+=" padding: 0px; margin: 0px;",R+=" width: "+T+"px;",R+=" height: "+T+"px;",R+=" background-color: ",R+=p.isDark(N,z)?"#000000":"#ffffff",R+=";",R+='"/>';R+="</tr>"}return R+="</tbody>",R+="</table>",R},p.createSvgTag=function(T,E,R,N){let z={};typeof arguments[0]=="object"&&(z=arguments[0],T=z.cellSize,E=z.margin,R=z.alt,N=z.title),T=T||2,E=typeof E>"u"?T*4:E,R=typeof R=="string"?{text:R}:R||{},R.text=R.text||null,R.id=R.text?R.id||"qrcode-description":null,N=typeof N=="string"?{text:N}:N||{},N.text=N.text||null,N.id=N.text?N.id||"qrcode-title":null;const F=p.getModuleCount()*T+E*2;let P,$,K,G,X="",ee;for(ee="l"+T+",0 0,"+T+" -"+T+",0 0,-"+T+"z ",X+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',X+=z.scalable?"":' width="'+F+'px" height="'+F+'px"',X+=' viewBox="0 0 '+F+" "+F+'" ',X+=' preserveAspectRatio="xMinYMin meet"',X+=N.text||R.text?' role="img" aria-labelledby="'+M([N.id,R.id].join(" ").trim())+'"':"",X+=">",X+=N.text?'<title id="'+M(N.id)+'">'+M(N.text)+"</title>":"",X+=R.text?'<description id="'+M(R.id)+'">'+M(R.text)+"</description>":"",X+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',X+='<path d="',K=0;K<p.getModuleCount();K+=1)for(G=K*T+E,P=0;P<p.getModuleCount();P+=1)p.isDark(K,P)&&($=P*T+E,X+="M"+$+","+G+ee);return X+='" stroke="transparent" fill="black"/>',X+="</svg>",X},p.createDataURL=function(T,E){T=T||2,E=typeof E>"u"?T*4:E;const R=p.getModuleCount()*T+E*2,N=E,z=R-E;return i1(R,R,function(F,P){if(N<=F&&F<z&&N<=P&&P<z){const $=Math.floor((F-N)/T),K=Math.floor((P-N)/T);return p.isDark(K,$)?0:1}else return 1})},p.createImgTag=function(T,E,R){T=T||2,E=typeof E>"u"?T*4:E;const N=p.getModuleCount()*T+E*2;let z="";return z+="<img",z+=' src="',z+=p.createDataURL(T,E),z+='"',z+=' width="',z+=N,z+='"',z+=' height="',z+=N,z+='"',R&&(z+=' alt="',z+=M(R),z+='"'),z+="/>",z};const M=function(T){let E="";for(let R=0;R<T.length;R+=1){const N=T.charAt(R);switch(N){case"<":E+="<";break;case">":E+=">";break;case"&":E+="&";break;case'"':E+=""";break;default:E+=N;break}}return E},D=function(T){T=typeof T>"u"?2:T;const R=p.getModuleCount()*1+T*2,N=T,z=R-T;let F,P,$,K,G;const X={"██":"█","█ ":"▀"," █":"▄"," ":" "},ee={"██":"▀","█ ":"▀"," █":" "," ":" "};let H="";for(F=0;F<R;F+=2){for($=Math.floor((F-N)/1),K=Math.floor((F+1-N)/1),P=0;P<R;P+=1)G="█",N<=P&&P<z&&N<=F&&F<z&&p.isDark($,Math.floor((P-N)/1))&&(G=" "),N<=P&&P<z&&N<=F+1&&F+1<z&&p.isDark(K,Math.floor((P-N)/1))?G+=" ":G+="█",H+=T<1&&F+1>=z?ee[G]:X[G];H+=`
|
|
50
|
-
`}return R%2&&T>0?
|
|
51
|
-
`}return ee.substring(0,ee.length-1)},p.renderTo2dContext=function(T,E){E=E||2;const R=p.getModuleCount();for(let N=0;N<R;N++)for(let z=0;z<R;z++)T.fillStyle=p.isDark(N,z)?"black":"white",T.fillRect(z*E,N*E,E,E)},p};Qr.stringToBytes=function(n){const r=[];for(let s=0;s<n.length;s+=1){const o=n.charCodeAt(s);r.push(o&255)}return r};Qr.createStringToBytes=function(n,r){const s=(function(){const d=t1(n),v=function(){const c=d.read();if(c==-1)throw"eof";return c};let f=0;const a={};for(;;){const c=d.read();if(c==-1)break;const h=v(),p=v(),u=v(),S=String.fromCharCode(c<<8|h),w=p<<8|u;a[S]=w,f+=1}if(f!=r)throw f+" != "+r;return a})(),o=63;return function(d){const v=[];for(let f=0;f<d.length;f+=1){const a=d.charCodeAt(f);if(a<128)v.push(a);else{const c=s[d.charAt(f)];typeof c=="number"?(c&255)==c?v.push(c):(v.push(c>>>8),v.push(c&255)):v.push(o)}}return v}};const Vt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Qs={L:1,M:0,Q:3,H:2},Li={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Oi=(function(){const n=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],r=1335,s=7973,o=21522,d={},v=function(f){let a=0;for(;f!=0;)a+=1,f>>>=1;return a};return d.getBCHTypeInfo=function(f){let a=f<<10;for(;v(a)-v(r)>=0;)a^=r<<v(a)-v(r);return(f<<10|a)^o},d.getBCHTypeNumber=function(f){let a=f<<12;for(;v(a)-v(s)>=0;)a^=s<<v(a)-v(s);return f<<12|a},d.getPatternPosition=function(f){return n[f-1]},d.getMaskFunction=function(f){switch(f){case Li.PATTERN000:return function(a,c){return(a+c)%2==0};case Li.PATTERN001:return function(a,c){return a%2==0};case Li.PATTERN010:return function(a,c){return c%3==0};case Li.PATTERN011:return function(a,c){return(a+c)%3==0};case Li.PATTERN100:return function(a,c){return(Math.floor(a/2)+Math.floor(c/3))%2==0};case Li.PATTERN101:return function(a,c){return a*c%2+a*c%3==0};case Li.PATTERN110:return function(a,c){return(a*c%2+a*c%3)%2==0};case Li.PATTERN111:return function(a,c){return(a*c%3+(a+c)%2)%2==0};default:throw"bad maskPattern:"+f}},d.getErrorCorrectPolynomial=function(f){let a=tl([1],0);for(let c=0;c<f;c+=1)a=a.multiply(tl([1,ji.gexp(c)],0));return a},d.getLengthInBits=function(f,a){if(1<=a&&a<10)switch(f){case Vt.MODE_NUMBER:return 10;case Vt.MODE_ALPHA_NUM:return 9;case Vt.MODE_8BIT_BYTE:return 8;case Vt.MODE_KANJI:return 8;default:throw"mode:"+f}else if(a<27)switch(f){case Vt.MODE_NUMBER:return 12;case Vt.MODE_ALPHA_NUM:return 11;case Vt.MODE_8BIT_BYTE:return 16;case Vt.MODE_KANJI:return 10;default:throw"mode:"+f}else if(a<41)switch(f){case Vt.MODE_NUMBER:return 14;case Vt.MODE_ALPHA_NUM:return 13;case Vt.MODE_8BIT_BYTE:return 16;case Vt.MODE_KANJI:return 12;default:throw"mode:"+f}else throw"type:"+a},d.getLostPoint=function(f){const a=f.getModuleCount();let c=0;for(let u=0;u<a;u+=1)for(let S=0;S<a;S+=1){let w=0;const A=f.isDark(u,S);for(let x=-1;x<=1;x+=1)if(!(u+x<0||a<=u+x))for(let b=-1;b<=1;b+=1)S+b<0||a<=S+b||x==0&&b==0||A==f.isDark(u+x,S+b)&&(w+=1);w>5&&(c+=3+w-5)}for(let u=0;u<a-1;u+=1)for(let S=0;S<a-1;S+=1){let w=0;f.isDark(u,S)&&(w+=1),f.isDark(u+1,S)&&(w+=1),f.isDark(u,S+1)&&(w+=1),f.isDark(u+1,S+1)&&(w+=1),(w==0||w==4)&&(c+=3)}for(let u=0;u<a;u+=1)for(let S=0;S<a-6;S+=1)f.isDark(u,S)&&!f.isDark(u,S+1)&&f.isDark(u,S+2)&&f.isDark(u,S+3)&&f.isDark(u,S+4)&&!f.isDark(u,S+5)&&f.isDark(u,S+6)&&(c+=40);for(let u=0;u<a;u+=1)for(let S=0;S<a-6;S+=1)f.isDark(S,u)&&!f.isDark(S+1,u)&&f.isDark(S+2,u)&&f.isDark(S+3,u)&&f.isDark(S+4,u)&&!f.isDark(S+5,u)&&f.isDark(S+6,u)&&(c+=40);let h=0;for(let u=0;u<a;u+=1)for(let S=0;S<a;S+=1)f.isDark(S,u)&&(h+=1);const p=Math.abs(100*h/a/a-50)/5;return c+=p*10,c},d})(),ji=(function(){const n=new Array(256),r=new Array(256);for(let o=0;o<8;o+=1)n[o]=1<<o;for(let o=8;o<256;o+=1)n[o]=n[o-4]^n[o-5]^n[o-6]^n[o-8];for(let o=0;o<255;o+=1)r[n[o]]=o;const s={};return s.glog=function(o){if(o<1)throw"glog("+o+")";return r[o]},s.gexp=function(o){for(;o<0;)o+=255;for(;o>=256;)o-=255;return n[o]},s})(),tl=function(n,r){if(typeof n.length>"u")throw n.length+"/"+r;const s=(function(){let d=0;for(;d<n.length&&n[d]==0;)d+=1;const v=new Array(n.length-d+r);for(let f=0;f<n.length-d;f+=1)v[f]=n[f+d];return v})(),o={};return o.getAt=function(d){return s[d]},o.getLength=function(){return s.length},o.multiply=function(d){const v=new Array(o.getLength()+d.getLength()-1);for(let f=0;f<o.getLength();f+=1)for(let a=0;a<d.getLength();a+=1)v[f+a]^=ji.gexp(ji.glog(o.getAt(f))+ji.glog(d.getAt(a)));return tl(v,0)},o.mod=function(d){if(o.getLength()-d.getLength()<0)return o;const v=ji.glog(o.getAt(0))-ji.glog(d.getAt(0)),f=new Array(o.getLength());for(let a=0;a<o.getLength();a+=1)f[a]=o.getAt(a);for(let a=0;a<d.getLength();a+=1)f[a]^=ji.gexp(ji.glog(d.getAt(a))+v);return tl(f,0).mod(d)},o},rm=(function(){const n=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],r=function(d,v){const f={};return f.totalCount=d,f.dataCount=v,f},s={},o=function(d,v){switch(v){case Qs.L:return n[(d-1)*4+0];case Qs.M:return n[(d-1)*4+1];case Qs.Q:return n[(d-1)*4+2];case Qs.H:return n[(d-1)*4+3];default:return}};return s.getRSBlocks=function(d,v){const f=o(d,v);if(typeof f>"u")throw"bad rs block @ typeNumber:"+d+"/errorCorrectionLevel:"+v;const a=f.length/3,c=[];for(let h=0;h<a;h+=1){const p=f[h*3+0],u=f[h*3+1],S=f[h*3+2];for(let w=0;w<p;w+=1)c.push(r(u,S))}return c},s})(),sm=function(){const n=[];let r=0;const s={};return s.getBuffer=function(){return n},s.getAt=function(o){const d=Math.floor(o/8);return(n[d]>>>7-o%8&1)==1},s.put=function(o,d){for(let v=0;v<d;v+=1)s.putBit((o>>>d-v-1&1)==1)},s.getLengthInBits=function(){return r},s.putBit=function(o){const d=Math.floor(r/8);n.length<=d&&n.push(0),o&&(n[d]|=128>>>r%8),r+=1},s},X0=function(n){const r=Vt.MODE_NUMBER,s=n,o={};o.getMode=function(){return r},o.getLength=function(f){return s.length},o.write=function(f){const a=s;let c=0;for(;c+2<a.length;)f.put(d(a.substring(c,c+3)),10),c+=3;c<a.length&&(a.length-c==1?f.put(d(a.substring(c,c+1)),4):a.length-c==2&&f.put(d(a.substring(c,c+2)),7))};const d=function(f){let a=0;for(let c=0;c<f.length;c+=1)a=a*10+v(f.charAt(c));return a},v=function(f){if("0"<=f&&f<="9")return f.charCodeAt(0)-48;throw"illegal char :"+f};return o},Q0=function(n){const r=Vt.MODE_ALPHA_NUM,s=n,o={};o.getMode=function(){return r},o.getLength=function(v){return s.length},o.write=function(v){const f=s;let a=0;for(;a+1<f.length;)v.put(d(f.charAt(a))*45+d(f.charAt(a+1)),11),a+=2;a<f.length&&v.put(d(f.charAt(a)),6)};const d=function(v){if("0"<=v&&v<="9")return v.charCodeAt(0)-48;if("A"<=v&&v<="Z")return v.charCodeAt(0)-65+10;switch(v){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+v}};return o},Z0=function(n){const r=Vt.MODE_8BIT_BYTE,s=Qr.stringToBytes(n),o={};return o.getMode=function(){return r},o.getLength=function(d){return s.length},o.write=function(d){for(let v=0;v<s.length;v+=1)d.put(s[v],8)},o},J0=function(n){const r=Vt.MODE_KANJI,s=Qr.stringToBytes;(function(v,f){const a=s(v);if(a.length!=2||(a[0]<<8|a[1])!=f)throw"sjis not supported."})("友",38726);const o=s(n),d={};return d.getMode=function(){return r},d.getLength=function(v){return~~(o.length/2)},d.write=function(v){const f=o;let a=0;for(;a+1<f.length;){let c=(255&f[a])<<8|255&f[a+1];if(33088<=c&&c<=40956)c-=33088;else if(57408<=c&&c<=60351)c-=49472;else throw"illegal char at "+(a+1)+"/"+c;c=(c>>>8&255)*192+(c&255),v.put(c,13),a+=2}if(a<f.length)throw"illegal char at "+(a+1)},d},lg=function(){const n=[],r={};return r.writeByte=function(s){n.push(s&255)},r.writeShort=function(s){r.writeByte(s),r.writeByte(s>>>8)},r.writeBytes=function(s,o,d){o=o||0,d=d||s.length;for(let v=0;v<d;v+=1)r.writeByte(s[v+o])},r.writeString=function(s){for(let o=0;o<s.length;o+=1)r.writeByte(s.charCodeAt(o))},r.toByteArray=function(){return n},r.toString=function(){let s="";s+="[";for(let o=0;o<n.length;o+=1)o>0&&(s+=","),s+=n[o];return s+="]",s},r},e1=function(){let n=0,r=0,s=0,o="";const d={},v=function(a){o+=String.fromCharCode(f(a&63))},f=function(a){if(a<0)throw"n:"+a;if(a<26)return 65+a;if(a<52)return 97+(a-26);if(a<62)return 48+(a-52);if(a==62)return 43;if(a==63)return 47;throw"n:"+a};return d.writeByte=function(a){for(n=n<<8|a&255,r+=8,s+=1;r>=6;)v(n>>>r-6),r-=6},d.flush=function(){if(r>0&&(v(n<<6-r),n=0,r=0),s%3!=0){const a=3-s%3;for(let c=0;c<a;c+=1)o+="="}},d.toString=function(){return o},d},t1=function(n){const r=n;let s=0,o=0,d=0;const v={};v.read=function(){for(;d<8;){if(s>=r.length){if(d==0)return-1;throw"unexpected end of file./"+d}const c=r.charAt(s);if(s+=1,c=="=")return d=0,-1;if(c.match(/^\s$/))continue;o=o<<6|f(c.charCodeAt(0)),d+=6}const a=o>>>d-8&255;return d-=8,a};const f=function(a){if(65<=a&&a<=90)return a-65;if(97<=a&&a<=122)return a-97+26;if(48<=a&&a<=57)return a-48+52;if(a==43)return 62;if(a==47)return 63;throw"c:"+a};return v},n1=function(n,r){const s=n,o=r,d=new Array(n*r),v={};v.setPixel=function(h,p,u){d[p*s+h]=u},v.write=function(h){h.writeString("GIF87a"),h.writeShort(s),h.writeShort(o),h.writeByte(128),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(255),h.writeByte(255),h.writeByte(255),h.writeString(","),h.writeShort(0),h.writeShort(0),h.writeShort(s),h.writeShort(o),h.writeByte(0);const p=2,u=a(p);h.writeByte(p);let S=0;for(;u.length-S>255;)h.writeByte(255),h.writeBytes(u,S,255),S+=255;h.writeByte(u.length-S),h.writeBytes(u,S,u.length-S),h.writeByte(0),h.writeString(";")};const f=function(h){const p=h;let u=0,S=0;const w={};return w.write=function(A,x){if(A>>>x)throw"length over";for(;u+x>=8;)p.writeByte(255&(A<<u|S)),x-=8-u,A>>>=8-u,S=0,u=0;S=A<<u|S,u=u+x},w.flush=function(){u>0&&p.writeByte(S)},w},a=function(h){const p=1<<h,u=(1<<h)+1;let S=h+1;const w=c();for(let g=0;g<p;g+=1)w.add(String.fromCharCode(g));w.add(String.fromCharCode(p)),w.add(String.fromCharCode(u));const A=lg(),x=f(A);x.write(p,S);let b=0,_=String.fromCharCode(d[b]);for(b+=1;b<d.length;){const g=String.fromCharCode(d[b]);b+=1,w.contains(_+g)?_=_+g:(x.write(w.indexOf(_),S),w.size()<4095&&(w.size()==1<<S&&(S+=1),w.add(_+g)),_=g)}return x.write(w.indexOf(_),S),x.write(u,S),x.flush(),A.toByteArray()},c=function(){const h={};let p=0;const u={};return u.add=function(S){if(u.contains(S))throw"dup key:"+S;h[S]=p,p+=1},u.size=function(){return p},u.indexOf=function(S){return h[S]},u.contains=function(S){return typeof h[S]<"u"},u};return v},i1=function(n,r,s){const o=n1(n,r);for(let a=0;a<r;a+=1)for(let c=0;c<n;c+=1)o.setPixel(c,a,s(c,a));const d=lg();o.write(d);const v=e1(),f=d.toByteArray();for(let a=0;a<f.length;a+=1)v.writeByte(f[a]);return v.flush(),"data:image/gif;base64,"+v};Qr.stringToBytes;const Wr=[{name:"project-manager",label:"Project Manager",commandAgent:"project-manager",dispatchable:!1},{name:"architect",label:"Architect",commandAgent:"architect",dispatchable:!0},{name:"coder",label:"Coder",commandAgent:"coder",dispatchable:!0},{name:"reviewer",label:"Reviewer",commandAgent:"reviewer",dispatchable:!0}],ag={name:"codex-reviewer",label:"Codex Reviewer",commandAgent:"codex-reviewer",dispatchable:!1},og={name:"codex-translator",label:"Codex Translator",commandAgent:"codex-translator",dispatchable:!1},cg=[ag,og],Bu=[...Wr,...cg],r1=Wr.map(n=>n.name),s1=cg.map(n=>n.name);Bu.map(n=>n.name);Bu.filter(n=>n.dispatchable).map(n=>n.name);function Nu(n){return s1.includes(n)}function l1(){const n={};for(const r of r1)n[r]={permissionMode:"default",model:"default",effort:"default"};return{version:1,roles:n,autoOrchestration:!0,translationEnabled:!0}}function a1({sidebar:n,children:r}){const[s,o]=ce.useState(!1);return B.jsxs("div",{className:s?"app-shell is-sidebar-collapsed":"app-shell",children:[B.jsxs("aside",{className:"app-sidebar",children:[B.jsx("button",{className:"sidebar-toggle",type:"button","aria-label":s?"Expand sidebar":"Collapse sidebar",title:s?"Expand sidebar":"Collapse sidebar",onClick:()=>o(d=>!d)}),B.jsx("div",{className:"sidebar-content",children:n})]}),B.jsx("main",{className:"app-main",children:r})]})}function o1(n,r){return n.find(s=>s.taskSlug===r)??n[0]??null}const xe={getAppPreferences(){return Te("/api/settings/preferences")},updateAppPreferences(n){return Te("/api/settings/preferences",{method:"PUT",body:JSON.stringify(n)})},getRuntimeDiagnostics(){return Te("/api/diagnostics/runtime")},getCurrentProject(){return Te("/api/projects/current")},pullCurrentProject(){return Te("/api/projects/current/pull",{method:"POST"})},getRecentRepositoryPaths(){return Te("/api/projects/recent")},connectProject(n){return Te("/api/projects/connect",{method:"POST",body:JSON.stringify(n)})},listTasks(){return Te("/api/tasks")},createTask(n){return Te("/api/tasks",{method:"POST",body:JSON.stringify(n)})},cleanupTask(n,r={}){return Te(`/api/tasks/${encodeURIComponent(n)}/cleanup`,{method:"POST",body:JSON.stringify(r)})},getHarnessStatus(){return Te("/api/projects/harness")},applyHarness(){return Te("/api/projects/harness/apply",{method:"POST"})},getHarnessBootstrapStatus(){return Te("/api/projects/harness/bootstrap")},startHarnessBootstrap(n={}){return Te("/api/projects/harness/bootstrap/start",{method:"POST",body:JSON.stringify(n)})},getTaskStatus(n){return Te(`/api/tasks/${encodeURIComponent(n)}/status`)},listSessions(n){return Te(`/api/tasks/${encodeURIComponent(n)}/sessions`)},startRoleSession(n,r,s={}){return Te(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/start`,{method:"POST",body:JSON.stringify(s)})},stopRoleSession(n,r){return Te(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/stop`,{method:"POST"})},restartRoleSession(n,r,s={}){return Te(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/restart`,{method:"POST",body:JSON.stringify(s)})},resumeRoleSession(n,r,s={}){return Te(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/resume`,{method:"POST",body:JSON.stringify(s)})},dispatchRoleCommand(n,r){return Te(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/dispatch`,{method:"POST"})},listMessages(n){return Te(`/api/tasks/${encodeURIComponent(n)}/messages`)},markAllMessagesDone(n){return Te(`/api/tasks/${encodeURIComponent(n)}/messages/mark-all-done`,{method:"POST"})},deleteMessageHistory(n){return Te(`/api/tasks/${encodeURIComponent(n)}/messages/history`,{method:"DELETE"})},getOrchestrationState(n){return Te(`/api/tasks/${encodeURIComponent(n)}/orchestration`)},updateOrchestrationState(n,r){return Te(`/api/tasks/${encodeURIComponent(n)}/orchestration`,{method:"PUT",body:JSON.stringify(r)})},getSessionRoundState(n){return Te(`/api/tasks/${encodeURIComponent(n)}/round`)},getCodexReviewState(n){return Te(`/api/tasks/${encodeURIComponent(n)}/codex-review`)},updateCodexReviewSettings(n,r){return Te(`/api/tasks/${encodeURIComponent(n)}/codex-review/settings`,{method:"PUT",body:JSON.stringify(r)})},requestCodexReviewGate(n,r){return Te(`/api/tasks/${encodeURIComponent(n)}/codex-review/${r}/request`,{method:"POST"})},retryCodexReviewGate(n,r){return Te(`/api/tasks/${encodeURIComponent(n)}/codex-review/${r}/retry`,{method:"POST"})},skipCodexReviewGate(n,r,s){return Te(`/api/tasks/${encodeURIComponent(n)}/codex-review/${r}/skip`,{method:"POST",body:JSON.stringify(s)})},overrideCodexReviewGate(n,r,s){return Te(`/api/tasks/${encodeURIComponent(n)}/codex-review/${r}/override`,{method:"POST",body:JSON.stringify(s)})},getCodexReviewReport(n,r){return Te(`/api/tasks/${encodeURIComponent(n)}/codex-review/${r}/report`)},getTranslationSettings(){return Te("/api/translation/settings")},updateTranslationSettings(n){return Te("/api/translation/settings",{method:"PUT",body:JSON.stringify(n)})},getTranslationPrompts(){return Te("/api/translation/prompts")},testTranslationProvider(){return Te("/api/translation/test",{method:"POST"})},startTranslationSession(n,r){return Te(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/start`,{method:"POST"})},pollTranslationSession(n,r,s){const o=new URLSearchParams({after:String(r)});return s!==void 0&&o.set("limit",String(s)),Te(`/api/translation/sessions/${encodeURIComponent(n)}/events?${o.toString()}`)},translateUserInput(n,r,s){return Te(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/input`,{method:"POST",body:JSON.stringify(s)})},sendTranslatedInput(n,r,s){return Te(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/send`,{method:"POST",body:JSON.stringify(s)})},clearTranslationSession(n){return Te(`/api/translation/sessions/${encodeURIComponent(n)}/clear`,{method:"POST"})},stopTranslationSession(n){return Te(`/api/translation/sessions/${encodeURIComponent(n)}/stop`,{method:"POST"})},retryTranslation(n,r){return Te(`/api/translation/sessions/${encodeURIComponent(n)}/retry/${encodeURIComponent(r)}`,{method:"POST"})},ignoreTranslationFailures(n){return Te(`/api/translation/sessions/${encodeURIComponent(n)}/failures/ignore`,{method:"POST"})},retryTranslationFailures(n){return Te(`/api/translation/sessions/${encodeURIComponent(n)}/failures/retry`,{method:"POST"})},getCodexTranslationState(){return Te("/api/translation/codex/state")},browseCodexTranslationSourceFiles(n={}){const r=new URLSearchParams;n.path&&r.set("path",n.path),n.query&&r.set("query",n.query),n.limit!==void 0&&r.set("limit",String(n.limit));const s=r.toString()?`?${r.toString()}`:"";return Te(`/api/translation/codex/source-files${s}`)},createCodexFileTranslation(n){return Te("/api/translation/codex/files",{method:"POST",body:JSON.stringify(n)})},readCodexFileTranslation(n){return Te(`/api/translation/codex/files/${encodeURIComponent(n)}`)},createCodexBootstrap(n){return Te("/api/translation/codex/bootstrap",{method:"POST",body:JSON.stringify(n)})},promoteCodexTranslation(n,r){return Te(`/api/translation/codex/files/${encodeURIComponent(n)}/promote`,{method:"POST",body:JSON.stringify({targetPath:r})})},getGatewayStatus(){return Te("/api/gateway/status")},updateGatewaySettings(n){return Te("/api/gateway/settings",{method:"PUT",body:JSON.stringify(n)})},startGatewayQrLogin(){return Te("/api/gateway/qr/start",{method:"POST"})},checkGatewayQrLogin(n={}){return Te("/api/gateway/qr/check",{method:"POST",body:JSON.stringify(n)})},resetGatewayBinding(){return Te("/api/gateway/binding/reset",{method:"POST"})}};async function Te(n,r={}){var d,v,f;const s=new Headers(r.headers);r.body!==void 0&&r.body!==null&&!s.has("content-type")&&s.set("content-type","application/json");const o=await fetch(n,{...r,headers:s});if(!o.ok){const a=await o.json().catch(()=>null),c=(d=a==null?void 0:a.error)!=null&&d.hint?`${a.error.message} ${a.error.hint}`:((v=a==null?void 0:a.error)==null?void 0:v.message)??`Request failed: ${o.status}`,h=(f=a==null?void 0:a.error)==null?void 0:f.runtime,p=h?` [backend ${h.version??"unknown"} pid=${h.pid??"unknown"} cwd=${h.cwd??"unknown"}]`:"";throw new Error(`${c}${p}`)}return o.json()}const c1={role:"codex-reviewer",permissionMode:"default",model:"gpt-5.5",effort:"xhigh"};function u1(n,r){const s=Wr.map(o=>({role:o.name,permissionMode:n.roles[o.name].permissionMode,model:n.roles[o.name].model,effort:n.roles[o.name].effort}));return r.codexReviewerEnabled&&s.push(c1),s}const h1=["architecture-plan","validation-adequacy","final-diff"];function f1({events:n,maxEvents:r=8,showHeader:s=!0}){const o=r===null?n:n.slice(-r);return B.jsxs("section",{className:"event-log",children:[s?B.jsx("h2",{children:"Events"}):null,n.length===0?B.jsx("p",{className:"muted",children:"No terminal events yet."}):B.jsx("ol",{children:o.map((d,v)=>B.jsx("li",{children:d},`${d}-${v}`))})]})}var eu={exports:{}},lm;function d1(){return lm||(lm=1,(function(n,r){(function(s,o){n.exports=o()})(self,(()=>(()=>{var s={};return(()=>{var o=s;Object.defineProperty(o,"__esModule",{value:!0}),o.FitAddon=void 0,o.FitAddon=class{activate(d){this._terminal=d}dispose(){}fit(){const d=this.proposeDimensions();if(!d||!this._terminal||isNaN(d.cols)||isNaN(d.rows))return;const v=this._terminal._core;this._terminal.rows===d.rows&&this._terminal.cols===d.cols||(v._renderService.clear(),this._terminal.resize(d.cols,d.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const d=this._terminal._core,v=d._renderService.dimensions;if(v.css.cell.width===0||v.css.cell.height===0)return;const f=this._terminal.options.scrollback===0?0:d.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(a.getPropertyValue("height")),h=Math.max(0,parseInt(a.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),u=c-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),S=h-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-f;return{cols:Math.max(2,Math.floor(S/v.css.cell.width)),rows:Math.max(1,Math.floor(u/v.css.cell.height))}}}})(),s})()))})(eu)),eu.exports}var p1=d1(),tu={exports:{}},am;function m1(){return am||(am=1,(function(n,r){(function(s,o){n.exports=o()})(self,(()=>(()=>{var s={6:(f,a)=>{function c(p){try{const u=new URL(p),S=u.password&&u.username?`${u.protocol}//${u.username}:${u.password}@${u.host}`:u.username?`${u.protocol}//${u.username}@${u.host}`:`${u.protocol}//${u.host}`;return p.toLocaleLowerCase().startsWith(S.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(p,u,S,w={}){this._terminal=p,this._regex=u,this._handler=S,this._options=w}provideLinks(p,u){const S=h.computeLink(p,this._regex,this._terminal,this._handler);u(this._addCallbacks(S))}_addCallbacks(p){return p.map((u=>(u.leave=this._options.leave,u.hover=(S,w)=>{if(this._options.hover){const{range:A}=u;this._options.hover(S,w,A)}},u)))}};class h{static computeLink(u,S,w,A){const x=new RegExp(S.source,(S.flags||"")+"g"),[b,_]=h._getWindowedLineStrings(u-1,w),g=b.join("");let y;const k=[];for(;y=x.exec(g);){const M=y[0];if(!c(M))continue;const[D,T]=h._mapStrIdx(w,_,0,y.index),[E,R]=h._mapStrIdx(w,D,T,M.length);if(D===-1||T===-1||E===-1||R===-1)continue;const N={start:{x:T+1,y:D+1},end:{x:R,y:E+1}};k.push({range:N,text:M,activate:A})}return k}static _getWindowedLineStrings(u,S){let w,A=u,x=u,b=0,_="";const g=[];if(w=S.buffer.active.getLine(u)){const y=w.translateToString(!0);if(w.isWrapped&&y[0]!==" "){for(b=0;(w=S.buffer.active.getLine(--A))&&b<2048&&(_=w.translateToString(!0),b+=_.length,g.push(_),w.isWrapped&&_.indexOf(" ")===-1););g.reverse()}for(g.push(y),b=0;(w=S.buffer.active.getLine(++x))&&w.isWrapped&&b<2048&&(_=w.translateToString(!0),b+=_.length,g.push(_),_.indexOf(" ")===-1););}return[g,A]}static _mapStrIdx(u,S,w,A){const x=u.buffer.active,b=x.getNullCell();let _=w;for(;A;){const g=x.getLine(S);if(!g)return[-1,-1];for(let y=_;y<g.length;++y){g.getCell(y,b);const k=b.getChars();if(b.getWidth()&&(A-=k.length||1,y===g.length-1&&k==="")){const M=x.getLine(S+1);M&&M.isWrapped&&(M.getCell(0,b),b.getWidth()===2&&(A+=1))}if(A<0)return[S,y]}S++,_=0}return[S,_]}}a.LinkComputer=h}},o={};function d(f){var a=o[f];if(a!==void 0)return a.exports;var c=o[f]={exports:{}};return s[f](c,c.exports,d),c.exports}var v={};return(()=>{var f=v;Object.defineProperty(f,"__esModule",{value:!0}),f.WebLinksAddon=void 0;const a=d(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function h(p,u){const S=window.open();if(S){try{S.opener=null}catch{}S.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}f.WebLinksAddon=class{constructor(p=h,u={}){this._handler=p,this._options=u}activate(p){this._terminal=p;const u=this._options,S=u.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,S,this._handler,u))}dispose(){var p;(p=this._linkProvider)==null||p.dispose()}}})(),v})()))})(tu)),tu.exports}var g1=m1(),nu={exports:{}},om;function _1(){return om||(om=1,(function(n,r){(function(s,o){n.exports=o()})(globalThis,(()=>(()=>{var s={4567:function(f,a,c){var h=this&&this.__decorate||function(g,y,k,M){var D,T=arguments.length,E=T<3?y:M===null?M=Object.getOwnPropertyDescriptor(y,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(g,y,k,M);else for(var R=g.length-1;R>=0;R--)(D=g[R])&&(E=(T<3?D(E):T>3?D(y,k,E):D(y,k))||E);return T>3&&E&&Object.defineProperty(y,k,E),E},p=this&&this.__param||function(g,y){return function(k,M){y(k,M,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const u=c(9042),S=c(9924),w=c(844),A=c(4725),x=c(2585),b=c(3656);let _=a.AccessibilityManager=class extends w.Disposable{constructor(g,y,k,M){super(),this._terminal=g,this._coreBrowserService=k,this._renderService=M,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let D=0;D<this._terminal.rows;D++)this._rowElements[D]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[D]);if(this._topBoundaryFocusListener=D=>this._handleBoundaryFocus(D,0),this._bottomBoundaryFocusListener=D=>this._handleBoundaryFocus(D,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new S.TimeBasedDebouncer(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((D=>this._handleResize(D.rows)))),this.register(this._terminal.onRender((D=>this._refreshRows(D.start,D.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((D=>this._handleChar(D)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
52
|
-
`)))),this.register(this._terminal.onA11yTab((D=>this._handleTab(D)))),this.register(this._terminal.onKey((D=>this._handleKey(D.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,b.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,
|
|
53
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(g){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(g)||this._charsToConsume.push(g)}_refreshRows(g,y){this._liveRegionDebouncer.refresh(g,y,this._terminal.rows)}_renderRows(g,y){const k=this._terminal.buffer,M=k.lines.length.toString();for(let D=g;D<=y;D++){const T=k.lines.get(k.ydisp+D),E=[],R=(T==null?void 0:T.translateToString(!0,void 0,void 0,E))||"",N=(k.ydisp+D+1).toString(),z=this._rowElements[D];z&&(R.length===0?(z.innerText=" ",this._rowColumns.set(z,[0,1])):(z.textContent=R,this._rowColumns.set(z,E)),z.setAttribute("aria-posinset",N),z.setAttribute("aria-setsize",M))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(g,y){const k=g.target,M=this._rowElements[y===0?1:this._rowElements.length-2];if(k.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||g.relatedTarget!==M)return;let D,T;if(y===0?(D=k,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(D=this._rowElements.shift(),T=k,this._rowContainer.removeChild(D)),D.removeEventListener("focus",this._topBoundaryFocusListener),T.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const E=this._createAccessibilityTreeNode();this._rowElements.unshift(E),this._rowContainer.insertAdjacentElement("afterbegin",E)}else{const E=this._createAccessibilityTreeNode();this._rowElements.push(E),this._rowContainer.appendChild(E)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),g.preventDefault(),g.stopImmediatePropagation()}_handleSelectionChange(){var R;if(this._rowElements.length===0)return;const g=document.getSelection();if(!g)return;if(g.isCollapsed)return void(this._rowContainer.contains(g.anchorNode)&&this._terminal.clearSelection());if(!g.anchorNode||!g.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:g.anchorNode,offset:g.anchorOffset},k={node:g.focusNode,offset:g.focusOffset};if((y.node.compareDocumentPosition(k.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===k.node&&y.offset>k.offset)&&([y,k]=[k,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const M=this._rowElements.slice(-1)[0];if(k.node.compareDocumentPosition(M)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(k={node:M,offset:((R=M.textContent)==null?void 0:R.length)??0}),!this._rowContainer.contains(k.node))return;const D=({node:N,offset:z})=>{const F=N instanceof Text?N.parentNode:N;let P=parseInt(F==null?void 0:F.getAttribute("aria-posinset"),10)-1;if(isNaN(P))return console.warn("row is invalid. Race condition?"),null;const $=this._rowColumns.get(F);if(!$)return console.warn("columns is null. Race condition?"),null;let K=z<$.length?$[z]:$.slice(-1)[0]+1;return K>=this._terminal.cols&&(++P,K=0),{row:P,column:K}},T=D(y),E=D(k);if(T&&E){if(T.row>E.row||T.row===E.row&&T.column>=E.column)throw new Error("invalid range");this._terminal.select(T.column,T.row,(E.row-T.row)*this._terminal.cols-T.column+E.column)}}_handleResize(g){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);for(;this._rowElements.length>g;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const g=this._coreBrowserService.mainDocument.createElement("div");return g.setAttribute("role","listitem"),g.tabIndex=-1,this._refreshRowDimensions(g),g}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let g=0;g<this._terminal.rows;g++)this._refreshRowDimensions(this._rowElements[g])}}_refreshRowDimensions(g){g.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=_=h([p(1,x.IInstantiationService),p(2,A.ICoreBrowserService),p(3,A.IRenderService)],_)},3614:(f,a)=>{function c(S){return S.replace(/\r?\n/g,"\r")}function h(S,w){return w?"\x1B[200~"+S+"\x1B[201~":S}function p(S,w,A,x){S=h(S=c(S),A.decPrivateModes.bracketedPasteMode&&x.rawOptions.ignoreBracketedPasteMode!==!0),A.triggerDataEvent(S,!0),w.value=""}function u(S,w,A){const x=A.getBoundingClientRect(),b=S.clientX-x.left-10,_=S.clientY-x.top-10;w.style.width="20px",w.style.height="20px",w.style.left=`${b}px`,w.style.top=`${_}px`,w.style.zIndex="1000",w.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=c,a.bracketTextForPaste=h,a.copyHandler=function(S,w){S.clipboardData&&S.clipboardData.setData("text/plain",w.selectionText),S.preventDefault()},a.handlePasteEvent=function(S,w,A,x){S.stopPropagation(),S.clipboardData&&p(S.clipboardData.getData("text/plain"),w,A,x)},a.paste=p,a.moveTextAreaUnderMouseCursor=u,a.rightClickHandler=function(S,w,A,x,b){u(S,w,A),b&&x.rightClickSelect(S),w.value=x.selectionText,w.select()}},7239:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const h=c(1505);a.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(p,u,S){this._css.set(p,u,S)}getCss(p,u){return this._css.get(p,u)}setColor(p,u,S){this._color.set(p,u,S)}getColor(p,u){return this._color.get(p,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(c,h,p,u){c.addEventListener(h,p,u);let S=!1;return{dispose:()=>{S||(S=!0,c.removeEventListener(h,p,u))}}}},3551:function(f,a,c){var h=this&&this.__decorate||function(_,g,y,k){var M,D=arguments.length,T=D<3?g:k===null?k=Object.getOwnPropertyDescriptor(g,y):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(_,g,y,k);else for(var E=_.length-1;E>=0;E--)(M=_[E])&&(T=(D<3?M(T):D>3?M(g,y,T):M(g,y))||T);return D>3&&T&&Object.defineProperty(g,y,T),T},p=this&&this.__param||function(_,g){return function(y,k){g(y,k,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const u=c(3656),S=c(8460),w=c(844),A=c(2585),x=c(4725);let b=a.Linkifier=class extends w.Disposable{get currentLink(){return this._currentLink}constructor(_,g,y,k,M){super(),this._element=_,this._mouseService=g,this._renderService=y,this._bufferService=k,this._linkProviderService=M,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new S.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new S.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,w.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,w.toDisposable)((()=>{var D;this._lastMouseEvent=void 0,(D=this._activeProviderReplies)==null||D.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(_){this._lastMouseEvent=_;const g=this._positionFromMouseEvent(_,this._element,this._mouseService);if(!g)return;this._isMouseOut=!1;const y=_.composedPath();for(let k=0;k<y.length;k++){const M=y[k];if(M.classList.contains("xterm"))break;if(M.classList.contains("xterm-hover"))return}this._lastBufferCell&&g.x===this._lastBufferCell.x&&g.y===this._lastBufferCell.y||(this._handleHover(g),this._lastBufferCell=g)}_handleHover(_){if(this._activeLine!==_.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(_,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,_)||(this._clearCurrentLink(),this._askForLink(_,!0))}_askForLink(_,g){var k,M;this._activeProviderReplies&&g||((k=this._activeProviderReplies)==null||k.forEach((D=>{D==null||D.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=_.y);let y=!1;for(const[D,T]of this._linkProviderService.linkProviders.entries())g?(M=this._activeProviderReplies)!=null&&M.get(D)&&(y=this._checkLinkProviderResult(D,_,y)):T.provideLinks(_.y,(E=>{var N,z;if(this._isMouseOut)return;const R=E==null?void 0:E.map((F=>({link:F})));(N=this._activeProviderReplies)==null||N.set(D,R),y=this._checkLinkProviderResult(D,_,y),((z=this._activeProviderReplies)==null?void 0:z.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(_.y,this._activeProviderReplies)}))}_removeIntersectingLinks(_,g){const y=new Set;for(let k=0;k<g.size;k++){const M=g.get(k);if(M)for(let D=0;D<M.length;D++){const T=M[D],E=T.link.range.start.y<_?0:T.link.range.start.x,R=T.link.range.end.y>_?this._bufferService.cols:T.link.range.end.x;for(let N=E;N<=R;N++){if(y.has(N)){M.splice(D--,1);break}y.add(N)}}}}_checkLinkProviderResult(_,g,y){var D;if(!this._activeProviderReplies)return y;const k=this._activeProviderReplies.get(_);let M=!1;for(let T=0;T<_;T++)this._activeProviderReplies.has(T)&&!this._activeProviderReplies.get(T)||(M=!0);if(!M&&k){const T=k.find((E=>this._linkAtPosition(E.link,g)));T&&(y=!0,this._handleNewLink(T))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let T=0;T<this._activeProviderReplies.size;T++){const E=(D=this._activeProviderReplies.get(T))==null?void 0:D.find((R=>this._linkAtPosition(R.link,g)));if(E){y=!0,this._handleNewLink(E);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(_){if(!this._currentLink)return;const g=this._positionFromMouseEvent(_,this._element,this._mouseService);g&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,g)&&this._currentLink.link.activate(_,this._currentLink.link.text)}_clearCurrentLink(_,g){this._currentLink&&this._lastMouseEvent&&(!_||!g||this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=g)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,w.disposeArray)(this._linkCacheDisposables))}_handleNewLink(_){if(!this._lastMouseEvent)return;const g=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);g&&this._linkAtPosition(_.link,g)&&(this._currentLink=_,this._currentLink.state={decorations:{underline:_.link.decorations===void 0||_.link.decorations.underline,pointerCursor:_.link.decorations===void 0||_.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,_.link,this._lastMouseEvent),_.link.decorations={},Object.defineProperties(_.link.decorations,{pointerCursor:{get:()=>{var y,k;return(k=(y=this._currentLink)==null?void 0:y.state)==null?void 0:k.decorations.pointerCursor},set:y=>{var k;(k=this._currentLink)!=null&&k.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>{var y,k;return(k=(y=this._currentLink)==null?void 0:y.state)==null?void 0:k.decorations.underline},set:y=>{var k,M,D;(k=this._currentLink)!=null&&k.state&&((D=(M=this._currentLink)==null?void 0:M.state)==null?void 0:D.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(_.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const k=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,M=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=k&&this._currentLink.link.range.end.y<=M&&(this._clearCurrentLink(k,M),this._lastMouseEvent)){const D=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);D&&this._askForLink(D,!1)}}))))}_linkHover(_,g,y){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!0),this._currentLink.state.decorations.pointerCursor&&_.classList.add("xterm-cursor-pointer")),g.hover&&g.hover(y,g.text)}_fireUnderlineEvent(_,g){const y=_.range,k=this._bufferService.buffer.ydisp,M=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-k-1,y.end.x,y.end.y-k-1,void 0);(g?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(M)}_linkLeave(_,g,y){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!1),this._currentLink.state.decorations.pointerCursor&&_.classList.remove("xterm-cursor-pointer")),g.leave&&g.leave(y,g.text)}_linkAtPosition(_,g){const y=_.range.start.y*this._bufferService.cols+_.range.start.x,k=_.range.end.y*this._bufferService.cols+_.range.end.x,M=g.y*this._bufferService.cols+g.x;return y<=M&&M<=k}_positionFromMouseEvent(_,g,y){const k=y.getCoords(_,g,this._bufferService.cols,this._bufferService.rows);if(k)return{x:k[0],y:k[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(_,g,y,k,M){return{x1:_,y1:g,x2:y,y2:k,cols:this._bufferService.cols,fg:M}}};a.Linkifier=b=h([p(1,x.IMouseService),p(2,x.IRenderService),p(3,A.IBufferService),p(4,x.ILinkProviderService)],b)},9042:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(f,a,c){var h=this&&this.__decorate||function(x,b,_,g){var y,k=arguments.length,M=k<3?b:g===null?g=Object.getOwnPropertyDescriptor(b,_):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,b,_,g);else for(var D=x.length-1;D>=0;D--)(y=x[D])&&(M=(k<3?y(M):k>3?y(b,_,M):y(b,_))||M);return k>3&&M&&Object.defineProperty(b,_,M),M},p=this&&this.__param||function(x,b){return function(_,g){b(_,g,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const u=c(511),S=c(2585);let w=a.OscLinkProvider=class{constructor(x,b,_){this._bufferService=x,this._optionsService=b,this._oscLinkService=_}provideLinks(x,b){var R;const _=this._bufferService.buffer.lines.get(x-1);if(!_)return void b(void 0);const g=[],y=this._optionsService.rawOptions.linkHandler,k=new u.CellData,M=_.getTrimmedLength();let D=-1,T=-1,E=!1;for(let N=0;N<M;N++)if(T!==-1||_.hasContent(N)){if(_.loadCell(N,k),k.hasExtendedAttrs()&&k.extended.urlId){if(T===-1){T=N,D=k.extended.urlId;continue}E=k.extended.urlId!==D}else T!==-1&&(E=!0);if(E||T!==-1&&N===M-1){const z=(R=this._oscLinkService.getLinkData(D))==null?void 0:R.uri;if(z){const F={start:{x:T+1,y:x},end:{x:N+(E||N!==M-1?0:1),y:x}};let P=!1;if(!(y!=null&&y.allowNonHttpProtocols))try{const $=new URL(z);["http:","https:"].includes($.protocol)||(P=!0)}catch{P=!0}P||g.push({text:z,range:F,activate:($,K)=>y?y.activate($,K,F):A(0,K),hover:($,K)=>{var G;return(G=y==null?void 0:y.hover)==null?void 0:G.call(y,$,K,F)},leave:($,K)=>{var G;return(G=y==null?void 0:y.leave)==null?void 0:G.call(y,$,K,F)}})}E=!1,k.hasExtendedAttrs()&&k.extended.urlId?(T=N,D=k.extended.urlId):(T=-1,D=-1)}}b(g)}};function A(x,b){if(confirm(`Do you want to navigate to ${b}?
|
|
48
|
+
`+l.stack}}var ot=Object.prototype.hasOwnProperty,Tt=n.unstable_scheduleCallback,nt=n.unstable_cancelCallback,Mt=n.unstable_shouldYield,ae=n.unstable_requestPaint,tt=n.unstable_now,Je=n.unstable_getCurrentPriorityLevel,ue=n.unstable_ImmediatePriority,Se=n.unstable_UserBlockingPriority,we=n.unstable_NormalPriority,Me=n.unstable_LowPriority,je=n.unstable_IdlePriority,ht=n.log,ve=n.unstable_setDisableYieldValue,ke=null,Re=null;function yt(e){if(typeof ht=="function"&&ve(e),Re&&typeof Re.setStrictMode=="function")try{Re.setStrictMode(ke,e)}catch{}}var Ne=Math.clz32?Math.clz32:ja,Yt=Math.log,Bt=Math.LN2;function ja(e){return e>>>=0,e===0?32:31-(Yt(e)/Bt|0)|0}var Dn=256,jn=262144,zn=4194304;function xn(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function nr(e,t,i){var l=e.pendingLanes;if(l===0)return 0;var m=0,w=e.suspendedLanes,L=e.pingedLanes;e=e.warmLanes;var U=l&134217727;return U!==0?(l=U&~w,l!==0?m=xn(l):(L&=U,L!==0?m=xn(L):i||(i=U&~e,i!==0&&(m=xn(i))))):(U=l&~w,U!==0?m=xn(U):L!==0?m=xn(L):i||(i=l&~e,i!==0&&(m=xn(i)))),m===0?0:t!==0&&t!==m&&(t&w)===0&&(w=m&-m,i=t&-t,w>=i||w===32&&(i&4194048)!==0)?t:m}function Hn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Zr(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 mt(){var e=zn;return zn<<=1,(zn&62914560)===0&&(zn=4194304),e}function Jr(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Ni(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function za(e,t,i,l,m,w){var L=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var U=e.entanglements,K=e.expirationTimes,re=e.hiddenUpdates;for(i=L&~i;0<i;){var fe=31-Ne(i),ge=1<<fe;U[fe]=0,K[fe]=-1;var se=re[fe];if(se!==null)for(re[fe]=null,fe=0;fe<se.length;fe++){var oe=se[fe];oe!==null&&(oe.lane&=-536870913)}i&=~ge}l!==0&&ll(e,l,0),w!==0&&m===0&&e.tag!==0&&(e.suspendedLanes|=w&~(L&~t))}function ll(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-Ne(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|i&261930}function ir(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var l=31-Ne(i),m=1<<l;m&t|e[l]&t&&(e[l]|=t),i&=~m}}function es(e,t){var i=t&-t;return i=(i&42)!==0?1:le(i),(i&(e.suspendedLanes|t))!==0?0:i}function le(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ce(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function St(){var e=X.p;return e!==0?e:(e=window.event,e===void 0?32:Up(e.type))}function Nt(e,t){var i=X.p;try{return X.p=e,t()}finally{X.p=i}}var ri=Math.random().toString(36).slice(2),jt="__reactFiber$"+ri,Wt="__reactProps$"+ri,rr="__reactContainer$"+ri,Ha="__reactEvents$"+ri,T_="__reactListeners$"+ri,D_="__reactHandles$"+ri,nh="__reactResources$"+ri,ts="__reactMarker$"+ri;function Ia(e){delete e[jt],delete e[Wt],delete e[Ha],delete e[T_],delete e[D_]}function sr(e){var t=e[jt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[rr]||i[jt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=xp(e);e!==null;){if(i=e[jt])return i;e=xp(e)}return t}e=i,i=e.parentNode}return null}function lr(e){if(e=e[jt]||e[rr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ns(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function ar(e){var t=e[nh];return t||(t=e[nh]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Lt(e){e[ts]=!0}var ih=new Set,rh={};function ji(e,t){or(e,t),or(e+"Capture",t)}function or(e,t){for(rh[e]=t,e=0;e<t.length;e++)ih.add(t[e])}var R_=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]*$"),sh={},lh={};function M_(e){return ot.call(lh,e)?!0:ot.call(sh,e)?!1:R_.test(e)?lh[e]=!0:(sh[e]=!0,!1)}function al(e,t,i){if(M_(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function ol(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function In(e,t,i,l){if(l===null)e.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+l)}}function dn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ah(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function L_(e,t,i){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var m=l.get,w=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return m.call(this)},set:function(L){i=""+L,w.call(this,L)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return i},setValue:function(L){i=""+L},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ua(e){if(!e._valueTracker){var t=ah(e)?"checked":"value";e._valueTracker=L_(e,t,""+e[t])}}function oh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),l="";return e&&(l=ah(e)?e.checked?"true":"false":e.value),e=l,e!==i?(t.setValue(e),!0):!1}function cl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var O_=/[\n"\\]/g;function pn(e){return e.replace(O_,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Pa(e,t,i,l,m,w,L,U){e.name="",L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?e.type=L:e.removeAttribute("type"),t!=null?L==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+dn(t)):e.value!==""+dn(t)&&(e.value=""+dn(t)):L!=="submit"&&L!=="reset"||e.removeAttribute("value"),t!=null?Fa(e,L,dn(t)):i!=null?Fa(e,L,dn(i)):l!=null&&e.removeAttribute("value"),m==null&&w!=null&&(e.defaultChecked=!!w),m!=null&&(e.checked=m&&typeof m!="function"&&typeof m!="symbol"),U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?e.name=""+dn(U):e.removeAttribute("name")}function ch(e,t,i,l,m,w,L,U){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(e.type=w),t!=null||i!=null){if(!(w!=="submit"&&w!=="reset"||t!=null)){Ua(e);return}i=i!=null?""+dn(i):"",t=t!=null?""+dn(t):i,U||t===e.value||(e.value=t),e.defaultValue=t}l=l??m,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=U?e.checked:!!l,e.defaultChecked=!!l,L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"&&(e.name=L),Ua(e)}function Fa(e,t,i){t==="number"&&cl(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function cr(e,t,i,l){if(e=e.options,t){t={};for(var m=0;m<i.length;m++)t["$"+i[m]]=!0;for(i=0;i<e.length;i++)m=t.hasOwnProperty("$"+e[i].value),e[i].selected!==m&&(e[i].selected=m),m&&l&&(e[i].defaultSelected=!0)}else{for(i=""+dn(i),t=null,m=0;m<e.length;m++){if(e[m].value===i){e[m].selected=!0,l&&(e[m].defaultSelected=!0);return}t!==null||e[m].disabled||(t=e[m])}t!==null&&(t.selected=!0)}}function uh(e,t,i){if(t!=null&&(t=""+dn(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+dn(i):""}function hh(e,t,i,l){if(t==null){if(l!=null){if(i!=null)throw Error(o(92));if(W(l)){if(1<l.length)throw Error(o(93));l=l[0]}i=l}i==null&&(i=""),t=i}i=dn(t),e.defaultValue=i,l=e.textContent,l===i&&l!==""&&l!==null&&(e.value=l),Ua(e)}function ur(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var B_=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 fh(e,t,i){var l=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,i):typeof i!="number"||i===0||B_.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function dh(e,t,i){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,i!=null){for(var l in i)!i.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var m in t)l=t[m],t.hasOwnProperty(m)&&i[m]!==l&&fh(e,m,l)}else for(var w in t)t.hasOwnProperty(w)&&fh(e,w,t[w])}function qa(e){if(e.indexOf("-")===-1)return!1;switch(e){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 N_=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"]]),j_=/^[\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 ul(e){return j_.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Un(){}var Va=null;function Ga(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var hr=null,fr=null;function ph(e){var t=lr(e);if(t&&(e=t.stateNode)){var i=e[Wt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Pa(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+pn(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var l=i[t];if(l!==e&&l.form===e.form){var m=l[Wt]||null;if(!m)throw Error(o(90));Pa(l,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(t=0;t<i.length;t++)l=i[t],l.form===e.form&&oh(l)}break e;case"textarea":uh(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&cr(e,!!i.multiple,t,!1)}}}var $a=!1;function mh(e,t,i){if($a)return e(t,i);$a=!0;try{var l=e(t);return l}finally{if($a=!1,(hr!==null||fr!==null)&&(Ql(),hr&&(t=hr,e=fr,fr=hr=null,ph(t),e)))for(t=0;t<e.length;t++)ph(e[t])}}function is(e,t){var i=e.stateNode;if(i===null)return null;var l=i[Wt]||null;if(l===null)return null;i=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(o(231,t,typeof i));return i}var Pn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ya=!1;if(Pn)try{var rs={};Object.defineProperty(rs,"passive",{get:function(){Ya=!0}}),window.addEventListener("test",rs,rs),window.removeEventListener("test",rs,rs)}catch{Ya=!1}var si=null,Wa=null,hl=null;function gh(){if(hl)return hl;var e,t=Wa,i=t.length,l,m="value"in si?si.value:si.textContent,w=m.length;for(e=0;e<i&&t[e]===m[e];e++);var L=i-e;for(l=1;l<=L&&t[i-l]===m[w-l];l++);return hl=m.slice(e,1<l?1-l:void 0)}function fl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function dl(){return!0}function _h(){return!1}function Kt(e){function t(i,l,m,w,L){this._reactName=i,this._targetInst=m,this.type=l,this.nativeEvent=w,this.target=L,this.currentTarget=null;for(var U in e)e.hasOwnProperty(U)&&(i=e[U],this[U]=i?i(w):w[U]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?dl:_h,this.isPropagationStopped=_h,this}return u(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=dl)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=dl)},persist:function(){},isPersistent:dl}),t}var zi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pl=Kt(zi),ss=u({},zi,{view:0,detail:0}),z_=Kt(ss),Ka,Xa,ls,ml=u({},ss,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Za,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ls&&(ls&&e.type==="mousemove"?(Ka=e.screenX-ls.screenX,Xa=e.screenY-ls.screenY):Xa=Ka=0,ls=e),Ka)},movementY:function(e){return"movementY"in e?e.movementY:Xa}}),vh=Kt(ml),H_=u({},ml,{dataTransfer:0}),I_=Kt(H_),U_=u({},ss,{relatedTarget:0}),Qa=Kt(U_),P_=u({},zi,{animationName:0,elapsedTime:0,pseudoElement:0}),F_=Kt(P_),q_=u({},zi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),V_=Kt(q_),G_=u({},zi,{data:0}),yh=Kt(G_),$_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Y_={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"},W_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function K_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=W_[e])?!!t[e]:!1}function Za(){return K_}var X_=u({},ss,{key:function(e){if(e.key){var t=$_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=fl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Y_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Za,charCode:function(e){return e.type==="keypress"?fl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?fl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Q_=Kt(X_),Z_=u({},ml,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sh=Kt(Z_),J_=u({},ss,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Za}),ev=Kt(J_),tv=u({},zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),nv=Kt(tv),iv=u({},ml,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),rv=Kt(iv),sv=u({},zi,{newState:0,oldState:0}),lv=Kt(sv),av=[9,13,27,32],Ja=Pn&&"CompositionEvent"in window,as=null;Pn&&"documentMode"in document&&(as=document.documentMode);var ov=Pn&&"TextEvent"in window&&!as,bh=Pn&&(!Ja||as&&8<as&&11>=as),Ch=" ",wh=!1;function xh(e,t){switch(e){case"keyup":return av.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Eh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var dr=!1;function cv(e,t){switch(e){case"compositionend":return Eh(t);case"keypress":return t.which!==32?null:(wh=!0,Ch);case"textInput":return e=t.data,e===Ch&&wh?null:e;default:return null}}function uv(e,t){if(dr)return e==="compositionend"||!Ja&&xh(e,t)?(e=gh(),hl=Wa=si=null,dr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return bh&&t.locale!=="ko"?null:t.data;default:return null}}var hv={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 kh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!hv[e.type]:t==="textarea"}function Ah(e,t,i,l){hr?fr?fr.push(l):fr=[l]:hr=l,t=ra(t,"onChange"),0<t.length&&(i=new pl("onChange","change",null,i,l),e.push({event:i,listeners:t}))}var os=null,cs=null;function fv(e){up(e,0)}function gl(e){var t=ns(e);if(oh(t))return e}function Th(e,t){if(e==="change")return t}var Dh=!1;if(Pn){var eo;if(Pn){var to="oninput"in document;if(!to){var Rh=document.createElement("div");Rh.setAttribute("oninput","return;"),to=typeof Rh.oninput=="function"}eo=to}else eo=!1;Dh=eo&&(!document.documentMode||9<document.documentMode)}function Mh(){os&&(os.detachEvent("onpropertychange",Lh),cs=os=null)}function Lh(e){if(e.propertyName==="value"&&gl(cs)){var t=[];Ah(t,cs,e,Ga(e)),mh(fv,t)}}function dv(e,t,i){e==="focusin"?(Mh(),os=t,cs=i,os.attachEvent("onpropertychange",Lh)):e==="focusout"&&Mh()}function pv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return gl(cs)}function mv(e,t){if(e==="click")return gl(t)}function gv(e,t){if(e==="input"||e==="change")return gl(t)}function _v(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var rn=typeof Object.is=="function"?Object.is:_v;function us(e,t){if(rn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),l=Object.keys(t);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var m=i[l];if(!ot.call(t,m)||!rn(e[m],t[m]))return!1}return!0}function Oh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Bh(e,t){var i=Oh(e);e=0;for(var l;i;){if(i.nodeType===3){if(l=e+i.textContent.length,e<=t&&l>=t)return{node:i,offset:t-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Oh(i)}}function Nh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=cl(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=cl(e.document)}return t}function no(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var vv=Pn&&"documentMode"in document&&11>=document.documentMode,pr=null,io=null,hs=null,ro=!1;function zh(e,t,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;ro||pr==null||pr!==cl(l)||(l=pr,"selectionStart"in l&&no(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),hs&&us(hs,l)||(hs=l,l=ra(io,"onSelect"),0<l.length&&(t=new pl("onSelect","select",null,t,i),e.push({event:t,listeners:l}),t.target=pr)))}function Hi(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var mr={animationend:Hi("Animation","AnimationEnd"),animationiteration:Hi("Animation","AnimationIteration"),animationstart:Hi("Animation","AnimationStart"),transitionrun:Hi("Transition","TransitionRun"),transitionstart:Hi("Transition","TransitionStart"),transitioncancel:Hi("Transition","TransitionCancel"),transitionend:Hi("Transition","TransitionEnd")},so={},Hh={};Pn&&(Hh=document.createElement("div").style,"AnimationEvent"in window||(delete mr.animationend.animation,delete mr.animationiteration.animation,delete mr.animationstart.animation),"TransitionEvent"in window||delete mr.transitionend.transition);function Ii(e){if(so[e])return so[e];if(!mr[e])return e;var t=mr[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Hh)return so[e]=t[i];return e}var Ih=Ii("animationend"),Uh=Ii("animationiteration"),Ph=Ii("animationstart"),yv=Ii("transitionrun"),Sv=Ii("transitionstart"),bv=Ii("transitioncancel"),Fh=Ii("transitionend"),qh=new Map,lo="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(" ");lo.push("scrollEnd");function En(e,t){qh.set(e,t),ji(t,[e])}var _l=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},mn=[],gr=0,ao=0;function vl(){for(var e=gr,t=ao=gr=0;t<e;){var i=mn[t];mn[t++]=null;var l=mn[t];mn[t++]=null;var m=mn[t];mn[t++]=null;var w=mn[t];if(mn[t++]=null,l!==null&&m!==null){var L=l.pending;L===null?m.next=m:(m.next=L.next,L.next=m),l.pending=m}w!==0&&Vh(i,m,w)}}function yl(e,t,i,l){mn[gr++]=e,mn[gr++]=t,mn[gr++]=i,mn[gr++]=l,ao|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function oo(e,t,i,l){return yl(e,t,i,l),Sl(e)}function Ui(e,t){return yl(e,null,null,t),Sl(e)}function Vh(e,t,i){e.lanes|=i;var l=e.alternate;l!==null&&(l.lanes|=i);for(var m=!1,w=e.return;w!==null;)w.childLanes|=i,l=w.alternate,l!==null&&(l.childLanes|=i),w.tag===22&&(e=w.stateNode,e===null||e._visibility&1||(m=!0)),e=w,w=w.return;return e.tag===3?(w=e.stateNode,m&&t!==null&&(m=31-Ne(i),e=w.hiddenUpdates,l=e[m],l===null?e[m]=[t]:l.push(t),t.lane=i|536870912),w):null}function Sl(e){if(50<Os)throw Os=0,vc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var _r={};function Cv(e,t,i,l){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sn(e,t,i,l){return new Cv(e,t,i,l)}function co(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fn(e,t){var i=e.alternate;return i===null?(i=sn(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function Gh(e,t){e.flags&=65011714;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function bl(e,t,i,l,m,w){var L=0;if(l=e,typeof e=="function")co(e)&&(L=1);else if(typeof e=="string")L=A0(e,i,ne.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case R:return e=sn(31,i,t,m),e.elementType=R,e.lanes=w,e;case x:return Pi(i.children,m,w,t);case b:L=8,m|=24;break;case _:return e=sn(12,i,t,m|2),e.elementType=_,e.lanes=w,e;case M:return e=sn(13,i,t,m),e.elementType=M,e.lanes=w,e;case D:return e=sn(19,i,t,m),e.elementType=D,e.lanes=w,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case y:L=10;break e;case g:L=9;break e;case k:L=11;break e;case T:L=14;break e;case E:L=16,l=null;break e}L=29,i=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=sn(L,i,t,m),t.elementType=e,t.type=l,t.lanes=w,t}function Pi(e,t,i,l){return e=sn(7,e,l,t),e.lanes=i,e}function uo(e,t,i){return e=sn(6,e,null,t),e.lanes=i,e}function $h(e){var t=sn(18,null,null,0);return t.stateNode=e,t}function ho(e,t,i){return t=sn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Yh=new WeakMap;function gn(e,t){if(typeof e=="object"&&e!==null){var i=Yh.get(e);return i!==void 0?i:(t={value:e,source:t,stack:Rt(t)},Yh.set(e,t),t)}return{value:e,source:t,stack:Rt(t)}}var vr=[],yr=0,Cl=null,fs=0,_n=[],vn=0,li=null,Rn=1,Mn="";function qn(e,t){vr[yr++]=fs,vr[yr++]=Cl,Cl=e,fs=t}function Wh(e,t,i){_n[vn++]=Rn,_n[vn++]=Mn,_n[vn++]=li,li=e;var l=Rn;e=Mn;var m=32-Ne(l)-1;l&=~(1<<m),i+=1;var w=32-Ne(t)+m;if(30<w){var L=m-m%5;w=(l&(1<<L)-1).toString(32),l>>=L,m-=L,Rn=1<<32-Ne(t)+m|i<<m|l,Mn=w+e}else Rn=1<<w|i<<m|l,Mn=e}function fo(e){e.return!==null&&(qn(e,1),Wh(e,1,0))}function po(e){for(;e===Cl;)Cl=vr[--yr],vr[yr]=null,fs=vr[--yr],vr[yr]=null;for(;e===li;)li=_n[--vn],_n[vn]=null,Mn=_n[--vn],_n[vn]=null,Rn=_n[--vn],_n[vn]=null}function Kh(e,t){_n[vn++]=Rn,_n[vn++]=Mn,_n[vn++]=li,Rn=t.id,Mn=t.overflow,li=e}var zt=null,dt=null,Ke=!1,ai=null,yn=!1,mo=Error(o(519));function oi(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ds(gn(t,e)),mo}function Xh(e){var t=e.stateNode,i=e.type,l=e.memoizedProps;switch(t[jt]=e,t[Wt]=l,i){case"dialog":Ve("cancel",t),Ve("close",t);break;case"iframe":case"object":case"embed":Ve("load",t);break;case"video":case"audio":for(i=0;i<Ns.length;i++)Ve(Ns[i],t);break;case"source":Ve("error",t);break;case"img":case"image":case"link":Ve("error",t),Ve("load",t);break;case"details":Ve("toggle",t);break;case"input":Ve("invalid",t),ch(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ve("invalid",t);break;case"textarea":Ve("invalid",t),hh(t,l.value,l.defaultValue,l.children)}i=l.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||l.suppressHydrationWarning===!0||pp(t.textContent,i)?(l.popover!=null&&(Ve("beforetoggle",t),Ve("toggle",t)),l.onScroll!=null&&Ve("scroll",t),l.onScrollEnd!=null&&Ve("scrollend",t),l.onClick!=null&&(t.onclick=Un),t=!0):t=!1,t||oi(e,!0)}function Qh(e){for(zt=e.return;zt;)switch(zt.tag){case 5:case 31:case 13:yn=!1;return;case 27:case 3:yn=!0;return;default:zt=zt.return}}function Sr(e){if(e!==zt)return!1;if(!Ke)return Qh(e),Ke=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Oc(e.type,e.memoizedProps)),i=!i),i&&dt&&oi(e),Qh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));dt=wp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));dt=wp(e)}else t===27?(t=dt,Ci(e.type)?(e=Hc,Hc=null,dt=e):dt=t):dt=zt?bn(e.stateNode.nextSibling):null;return!0}function Fi(){dt=zt=null,Ke=!1}function go(){var e=ai;return e!==null&&(Jt===null?Jt=e:Jt.push.apply(Jt,e),ai=null),e}function ds(e){ai===null?ai=[e]:ai.push(e)}var _o=j(null),qi=null,Vn=null;function ci(e,t,i){I(_o,t._currentValue),t._currentValue=i}function Gn(e){e._currentValue=_o.current,V(_o)}function vo(e,t,i){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===i)break;e=e.return}}function yo(e,t,i,l){var m=e.child;for(m!==null&&(m.return=e);m!==null;){var w=m.dependencies;if(w!==null){var L=m.child;w=w.firstContext;e:for(;w!==null;){var U=w;w=m;for(var K=0;K<t.length;K++)if(U.context===t[K]){w.lanes|=i,U=w.alternate,U!==null&&(U.lanes|=i),vo(w.return,i,e),l||(L=null);break e}w=U.next}}else if(m.tag===18){if(L=m.return,L===null)throw Error(o(341));L.lanes|=i,w=L.alternate,w!==null&&(w.lanes|=i),vo(L,i,e),L=null}else L=m.child;if(L!==null)L.return=m;else for(L=m;L!==null;){if(L===e){L=null;break}if(m=L.sibling,m!==null){m.return=L.return,L=m;break}L=L.return}m=L}}function br(e,t,i,l){e=null;for(var m=t,w=!1;m!==null;){if(!w){if((m.flags&524288)!==0)w=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var L=m.alternate;if(L===null)throw Error(o(387));if(L=L.memoizedProps,L!==null){var U=m.type;rn(m.pendingProps.value,L.value)||(e!==null?e.push(U):e=[U])}}else if(m===Q.current){if(L=m.alternate,L===null)throw Error(o(387));L.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(e!==null?e.push(Us):e=[Us])}m=m.return}e!==null&&yo(t,e,i,l),t.flags|=262144}function wl(e){for(e=e.firstContext;e!==null;){if(!rn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Vi(e){qi=e,Vn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ht(e){return Zh(qi,e)}function xl(e,t){return qi===null&&Vi(e),Zh(e,t)}function Zh(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Vn===null){if(e===null)throw Error(o(308));Vn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Vn=Vn.next=t;return i}var wv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},xv=n.unstable_scheduleCallback,Ev=n.unstable_NormalPriority,wt={$$typeof:y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function So(){return{controller:new wv,data:new Map,refCount:0}}function ps(e){e.refCount--,e.refCount===0&&xv(Ev,function(){e.controller.abort()})}var ms=null,bo=0,Cr=0,wr=null;function kv(e,t){if(ms===null){var i=ms=[];bo=0,Cr=xc(),wr={status:"pending",value:void 0,then:function(l){i.push(l)}}}return bo++,t.then(Jh,Jh),t}function Jh(){if(--bo===0&&ms!==null){wr!==null&&(wr.status="fulfilled");var e=ms;ms=null,Cr=0,wr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Av(e,t){var i=[],l={status:"pending",value:null,reason:null,then:function(m){i.push(m)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var m=0;m<i.length;m++)(0,i[m])(t)},function(m){for(l.status="rejected",l.reason=m,m=0;m<i.length;m++)(0,i[m])(void 0)}),l}var ef=G.S;G.S=function(e,t){Hd=tt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&kv(e,t),ef!==null&&ef(e,t)};var Gi=j(null);function Co(){var e=Gi.current;return e!==null?e:ct.pooledCache}function El(e,t){t===null?I(Gi,Gi.current):I(Gi,t.pool)}function tf(){var e=Co();return e===null?null:{parent:wt._currentValue,pool:e}}var xr=Error(o(460)),wo=Error(o(474)),kl=Error(o(542)),Al={then:function(){}};function nf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function rf(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Un,Un),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,lf(e),e;default:if(typeof t.status=="string")t.then(Un,Un);else{if(e=ct,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var m=t;m.status="fulfilled",m.value=l}},function(l){if(t.status==="pending"){var m=t;m.status="rejected",m.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,lf(e),e}throw Yi=t,xr}}function $i(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Yi=i,xr):i}}var Yi=null;function sf(){if(Yi===null)throw Error(o(459));var e=Yi;return Yi=null,e}function lf(e){if(e===xr||e===kl)throw Error(o(483))}var Er=null,gs=0;function Tl(e){var t=gs;return gs+=1,Er===null&&(Er=[]),rf(Er,e,t)}function _s(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Dl(e,t){throw t.$$typeof===S?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function af(e){function t(ee,Z){if(e){var ie=ee.deletions;ie===null?(ee.deletions=[Z],ee.flags|=16):ie.push(Z)}}function i(ee,Z){if(!e)return null;for(;Z!==null;)t(ee,Z),Z=Z.sibling;return null}function l(ee){for(var Z=new Map;ee!==null;)ee.key!==null?Z.set(ee.key,ee):Z.set(ee.index,ee),ee=ee.sibling;return Z}function m(ee,Z){return ee=Fn(ee,Z),ee.index=0,ee.sibling=null,ee}function w(ee,Z,ie){return ee.index=ie,e?(ie=ee.alternate,ie!==null?(ie=ie.index,ie<Z?(ee.flags|=67108866,Z):ie):(ee.flags|=67108866,Z)):(ee.flags|=1048576,Z)}function L(ee){return e&&ee.alternate===null&&(ee.flags|=67108866),ee}function U(ee,Z,ie,pe){return Z===null||Z.tag!==6?(Z=uo(ie,ee.mode,pe),Z.return=ee,Z):(Z=m(Z,ie),Z.return=ee,Z)}function K(ee,Z,ie,pe){var Le=ie.type;return Le===x?fe(ee,Z,ie.props.children,pe,ie.key):Z!==null&&(Z.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===E&&$i(Le)===Z.type)?(Z=m(Z,ie.props),_s(Z,ie),Z.return=ee,Z):(Z=bl(ie.type,ie.key,ie.props,null,ee.mode,pe),_s(Z,ie),Z.return=ee,Z)}function re(ee,Z,ie,pe){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==ie.containerInfo||Z.stateNode.implementation!==ie.implementation?(Z=ho(ie,ee.mode,pe),Z.return=ee,Z):(Z=m(Z,ie.children||[]),Z.return=ee,Z)}function fe(ee,Z,ie,pe,Le){return Z===null||Z.tag!==7?(Z=Pi(ie,ee.mode,pe,Le),Z.return=ee,Z):(Z=m(Z,ie),Z.return=ee,Z)}function ge(ee,Z,ie){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=uo(""+Z,ee.mode,ie),Z.return=ee,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case C:return ie=bl(Z.type,Z.key,Z.props,null,ee.mode,ie),_s(ie,Z),ie.return=ee,ie;case A:return Z=ho(Z,ee.mode,ie),Z.return=ee,Z;case E:return Z=$i(Z),ge(ee,Z,ie)}if(W(Z)||P(Z))return Z=Pi(Z,ee.mode,ie,null),Z.return=ee,Z;if(typeof Z.then=="function")return ge(ee,Tl(Z),ie);if(Z.$$typeof===y)return ge(ee,xl(ee,Z),ie);Dl(ee,Z)}return null}function se(ee,Z,ie,pe){var Le=Z!==null?Z.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return Le!==null?null:U(ee,Z,""+ie,pe);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case C:return ie.key===Le?K(ee,Z,ie,pe):null;case A:return ie.key===Le?re(ee,Z,ie,pe):null;case E:return ie=$i(ie),se(ee,Z,ie,pe)}if(W(ie)||P(ie))return Le!==null?null:fe(ee,Z,ie,pe,null);if(typeof ie.then=="function")return se(ee,Z,Tl(ie),pe);if(ie.$$typeof===y)return se(ee,Z,xl(ee,ie),pe);Dl(ee,ie)}return null}function oe(ee,Z,ie,pe,Le){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return ee=ee.get(ie)||null,U(Z,ee,""+pe,Le);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case C:return ee=ee.get(pe.key===null?ie:pe.key)||null,K(Z,ee,pe,Le);case A:return ee=ee.get(pe.key===null?ie:pe.key)||null,re(Z,ee,pe,Le);case E:return pe=$i(pe),oe(ee,Z,ie,pe,Le)}if(W(pe)||P(pe))return ee=ee.get(ie)||null,fe(Z,ee,pe,Le,null);if(typeof pe.then=="function")return oe(ee,Z,ie,Tl(pe),Le);if(pe.$$typeof===y)return oe(ee,Z,ie,xl(Z,pe),Le);Dl(Z,pe)}return null}function Ee(ee,Z,ie,pe){for(var Le=null,Qe=null,Ae=Z,Ie=Z=0,Ye=null;Ae!==null&&Ie<ie.length;Ie++){Ae.index>Ie?(Ye=Ae,Ae=null):Ye=Ae.sibling;var Ze=se(ee,Ae,ie[Ie],pe);if(Ze===null){Ae===null&&(Ae=Ye);break}e&&Ae&&Ze.alternate===null&&t(ee,Ae),Z=w(Ze,Z,Ie),Qe===null?Le=Ze:Qe.sibling=Ze,Qe=Ze,Ae=Ye}if(Ie===ie.length)return i(ee,Ae),Ke&&qn(ee,Ie),Le;if(Ae===null){for(;Ie<ie.length;Ie++)Ae=ge(ee,ie[Ie],pe),Ae!==null&&(Z=w(Ae,Z,Ie),Qe===null?Le=Ae:Qe.sibling=Ae,Qe=Ae);return Ke&&qn(ee,Ie),Le}for(Ae=l(Ae);Ie<ie.length;Ie++)Ye=oe(Ae,ee,Ie,ie[Ie],pe),Ye!==null&&(e&&Ye.alternate!==null&&Ae.delete(Ye.key===null?Ie:Ye.key),Z=w(Ye,Z,Ie),Qe===null?Le=Ye:Qe.sibling=Ye,Qe=Ye);return e&&Ae.forEach(function(Ai){return t(ee,Ai)}),Ke&&qn(ee,Ie),Le}function Be(ee,Z,ie,pe){if(ie==null)throw Error(o(151));for(var Le=null,Qe=null,Ae=Z,Ie=Z=0,Ye=null,Ze=ie.next();Ae!==null&&!Ze.done;Ie++,Ze=ie.next()){Ae.index>Ie?(Ye=Ae,Ae=null):Ye=Ae.sibling;var Ai=se(ee,Ae,Ze.value,pe);if(Ai===null){Ae===null&&(Ae=Ye);break}e&&Ae&&Ai.alternate===null&&t(ee,Ae),Z=w(Ai,Z,Ie),Qe===null?Le=Ai:Qe.sibling=Ai,Qe=Ai,Ae=Ye}if(Ze.done)return i(ee,Ae),Ke&&qn(ee,Ie),Le;if(Ae===null){for(;!Ze.done;Ie++,Ze=ie.next())Ze=ge(ee,Ze.value,pe),Ze!==null&&(Z=w(Ze,Z,Ie),Qe===null?Le=Ze:Qe.sibling=Ze,Qe=Ze);return Ke&&qn(ee,Ie),Le}for(Ae=l(Ae);!Ze.done;Ie++,Ze=ie.next())Ze=oe(Ae,ee,Ie,Ze.value,pe),Ze!==null&&(e&&Ze.alternate!==null&&Ae.delete(Ze.key===null?Ie:Ze.key),Z=w(Ze,Z,Ie),Qe===null?Le=Ze:Qe.sibling=Ze,Qe=Ze);return e&&Ae.forEach(function(H0){return t(ee,H0)}),Ke&&qn(ee,Ie),Le}function at(ee,Z,ie,pe){if(typeof ie=="object"&&ie!==null&&ie.type===x&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case C:e:{for(var Le=ie.key;Z!==null;){if(Z.key===Le){if(Le=ie.type,Le===x){if(Z.tag===7){i(ee,Z.sibling),pe=m(Z,ie.props.children),pe.return=ee,ee=pe;break e}}else if(Z.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===E&&$i(Le)===Z.type){i(ee,Z.sibling),pe=m(Z,ie.props),_s(pe,ie),pe.return=ee,ee=pe;break e}i(ee,Z);break}else t(ee,Z);Z=Z.sibling}ie.type===x?(pe=Pi(ie.props.children,ee.mode,pe,ie.key),pe.return=ee,ee=pe):(pe=bl(ie.type,ie.key,ie.props,null,ee.mode,pe),_s(pe,ie),pe.return=ee,ee=pe)}return L(ee);case A:e:{for(Le=ie.key;Z!==null;){if(Z.key===Le)if(Z.tag===4&&Z.stateNode.containerInfo===ie.containerInfo&&Z.stateNode.implementation===ie.implementation){i(ee,Z.sibling),pe=m(Z,ie.children||[]),pe.return=ee,ee=pe;break e}else{i(ee,Z);break}else t(ee,Z);Z=Z.sibling}pe=ho(ie,ee.mode,pe),pe.return=ee,ee=pe}return L(ee);case E:return ie=$i(ie),at(ee,Z,ie,pe)}if(W(ie))return Ee(ee,Z,ie,pe);if(P(ie)){if(Le=P(ie),typeof Le!="function")throw Error(o(150));return ie=Le.call(ie),Be(ee,Z,ie,pe)}if(typeof ie.then=="function")return at(ee,Z,Tl(ie),pe);if(ie.$$typeof===y)return at(ee,Z,xl(ee,ie),pe);Dl(ee,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,Z!==null&&Z.tag===6?(i(ee,Z.sibling),pe=m(Z,ie),pe.return=ee,ee=pe):(i(ee,Z),pe=uo(ie,ee.mode,pe),pe.return=ee,ee=pe),L(ee)):i(ee,Z)}return function(ee,Z,ie,pe){try{gs=0;var Le=at(ee,Z,ie,pe);return Er=null,Le}catch(Ae){if(Ae===xr||Ae===kl)throw Ae;var Qe=sn(29,Ae,null,ee.mode);return Qe.lanes=pe,Qe.return=ee,Qe}finally{}}}var Wi=af(!0),of=af(!1),ui=!1;function xo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Eo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function hi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function fi(e,t,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(et&2)!==0){var m=l.pending;return m===null?t.next=t:(t.next=m.next,m.next=t),l.pending=t,t=Sl(e),Vh(e,null,i),t}return yl(e,l,t,i),Sl(e)}function vs(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,ir(e,i)}}function ko(e,t){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var m=null,w=null;if(i=i.firstBaseUpdate,i!==null){do{var L={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};w===null?m=w=L:w=w.next=L,i=i.next}while(i!==null);w===null?m=w=t:w=w.next=t}else m=w=t;i={baseState:l.baseState,firstBaseUpdate:m,lastBaseUpdate:w,shared:l.shared,callbacks:l.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var Ao=!1;function ys(){if(Ao){var e=wr;if(e!==null)throw e}}function Ss(e,t,i,l){Ao=!1;var m=e.updateQueue;ui=!1;var w=m.firstBaseUpdate,L=m.lastBaseUpdate,U=m.shared.pending;if(U!==null){m.shared.pending=null;var K=U,re=K.next;K.next=null,L===null?w=re:L.next=re,L=K;var fe=e.alternate;fe!==null&&(fe=fe.updateQueue,U=fe.lastBaseUpdate,U!==L&&(U===null?fe.firstBaseUpdate=re:U.next=re,fe.lastBaseUpdate=K))}if(w!==null){var ge=m.baseState;L=0,fe=re=K=null,U=w;do{var se=U.lane&-536870913,oe=se!==U.lane;if(oe?($e&se)===se:(l&se)===se){se!==0&&se===Cr&&(Ao=!0),fe!==null&&(fe=fe.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var Ee=e,Be=U;se=t;var at=i;switch(Be.tag){case 1:if(Ee=Be.payload,typeof Ee=="function"){ge=Ee.call(at,ge,se);break e}ge=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=Be.payload,se=typeof Ee=="function"?Ee.call(at,ge,se):Ee,se==null)break e;ge=u({},ge,se);break e;case 2:ui=!0}}se=U.callback,se!==null&&(e.flags|=64,oe&&(e.flags|=8192),oe=m.callbacks,oe===null?m.callbacks=[se]:oe.push(se))}else oe={lane:se,tag:U.tag,payload:U.payload,callback:U.callback,next:null},fe===null?(re=fe=oe,K=ge):fe=fe.next=oe,L|=se;if(U=U.next,U===null){if(U=m.shared.pending,U===null)break;oe=U,U=oe.next,oe.next=null,m.lastBaseUpdate=oe,m.shared.pending=null}}while(!0);fe===null&&(K=ge),m.baseState=K,m.firstBaseUpdate=re,m.lastBaseUpdate=fe,w===null&&(m.shared.lanes=0),_i|=L,e.lanes=L,e.memoizedState=ge}}function cf(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function uf(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)cf(i[e],t)}var kr=j(null),Rl=j(0);function hf(e,t){e=ei,I(Rl,e),I(kr,t),ei=e|t.baseLanes}function To(){I(Rl,ei),I(kr,kr.current)}function Do(){ei=Rl.current,V(kr),V(Rl)}var ln=j(null),Sn=null;function di(e){var t=e.alternate;I(bt,bt.current&1),I(ln,e),Sn===null&&(t===null||kr.current!==null||t.memoizedState!==null)&&(Sn=e)}function Ro(e){I(bt,bt.current),I(ln,e),Sn===null&&(Sn=e)}function ff(e){e.tag===22?(I(bt,bt.current),I(ln,e),Sn===null&&(Sn=e)):pi()}function pi(){I(bt,bt.current),I(ln,ln.current)}function an(e){V(ln),Sn===e&&(Sn=null),V(bt)}var bt=j(0);function Ml(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||jc(i)||zc(i)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var $n=0,He=null,st=null,xt=null,Ll=!1,Ar=!1,Ki=!1,Ol=0,bs=0,Tr=null,Tv=0;function _t(){throw Error(o(321))}function Mo(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!rn(e[i],t[i]))return!1;return!0}function Lo(e,t,i,l,m,w){return $n=w,He=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,G.H=e===null||e.memoizedState===null?Kf:Yo,Ki=!1,w=i(l,m),Ki=!1,Ar&&(w=pf(t,i,l,m)),df(e),w}function df(e){G.H=xs;var t=st!==null&&st.next!==null;if($n=0,xt=st=He=null,Ll=!1,bs=0,Tr=null,t)throw Error(o(300));e===null||Et||(e=e.dependencies,e!==null&&wl(e)&&(Et=!0))}function pf(e,t,i,l){He=e;var m=0;do{if(Ar&&(Tr=null),bs=0,Ar=!1,25<=m)throw Error(o(301));if(m+=1,xt=st=null,e.updateQueue!=null){var w=e.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}G.H=Xf,w=t(i,l)}while(Ar);return w}function Dv(){var e=G.H,t=e.useState()[0];return t=typeof t.then=="function"?Cs(t):t,e=e.useState()[0],(st!==null?st.memoizedState:null)!==e&&(He.flags|=1024),t}function Oo(){var e=Ol!==0;return Ol=0,e}function Bo(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function No(e){if(Ll){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ll=!1}$n=0,xt=st=He=null,Ar=!1,bs=Ol=0,Tr=null}function Gt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xt===null?He.memoizedState=xt=e:xt=xt.next=e,xt}function Ct(){if(st===null){var e=He.alternate;e=e!==null?e.memoizedState:null}else e=st.next;var t=xt===null?He.memoizedState:xt.next;if(t!==null)xt=t,st=e;else{if(e===null)throw He.alternate===null?Error(o(467)):Error(o(310));st=e,e={memoizedState:st.memoizedState,baseState:st.baseState,baseQueue:st.baseQueue,queue:st.queue,next:null},xt===null?He.memoizedState=xt=e:xt=xt.next=e}return xt}function Bl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Cs(e){var t=bs;return bs+=1,Tr===null&&(Tr=[]),e=rf(Tr,e,t),t=He,(xt===null?t.memoizedState:xt.next)===null&&(t=t.alternate,G.H=t===null||t.memoizedState===null?Kf:Yo),e}function Nl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Cs(e);if(e.$$typeof===y)return Ht(e)}throw Error(o(438,String(e)))}function jo(e){var t=null,i=He.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var l=He.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(m){return m.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=Bl(),He.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),l=0;l<e;l++)i[l]=B;return t.index++,i}function Yn(e,t){return typeof t=="function"?t(e):t}function jl(e){var t=Ct();return zo(t,st,e)}function zo(e,t,i){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=i;var m=e.baseQueue,w=l.pending;if(w!==null){if(m!==null){var L=m.next;m.next=w.next,w.next=L}t.baseQueue=m=w,l.pending=null}if(w=e.baseState,m===null)e.memoizedState=w;else{t=m.next;var U=L=null,K=null,re=t,fe=!1;do{var ge=re.lane&-536870913;if(ge!==re.lane?($e&ge)===ge:($n&ge)===ge){var se=re.revertLane;if(se===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),ge===Cr&&(fe=!0);else if(($n&se)===se){re=re.next,se===Cr&&(fe=!0);continue}else ge={lane:0,revertLane:re.revertLane,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},K===null?(U=K=ge,L=w):K=K.next=ge,He.lanes|=se,_i|=se;ge=re.action,Ki&&i(w,ge),w=re.hasEagerState?re.eagerState:i(w,ge)}else se={lane:ge,revertLane:re.revertLane,gesture:re.gesture,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},K===null?(U=K=se,L=w):K=K.next=se,He.lanes|=ge,_i|=ge;re=re.next}while(re!==null&&re!==t);if(K===null?L=w:K.next=U,!rn(w,e.memoizedState)&&(Et=!0,fe&&(i=wr,i!==null)))throw i;e.memoizedState=w,e.baseState=L,e.baseQueue=K,l.lastRenderedState=w}return m===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Ho(e){var t=Ct(),i=t.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=e;var l=i.dispatch,m=i.pending,w=t.memoizedState;if(m!==null){i.pending=null;var L=m=m.next;do w=e(w,L.action),L=L.next;while(L!==m);rn(w,t.memoizedState)||(Et=!0),t.memoizedState=w,t.baseQueue===null&&(t.baseState=w),i.lastRenderedState=w}return[w,l]}function mf(e,t,i){var l=He,m=Ct(),w=Ke;if(w){if(i===void 0)throw Error(o(407));i=i()}else i=t();var L=!rn((st||m).memoizedState,i);if(L&&(m.memoizedState=i,Et=!0),m=m.queue,Po(vf.bind(null,l,m,e),[e]),m.getSnapshot!==t||L||xt!==null&&xt.memoizedState.tag&1){if(l.flags|=2048,Dr(9,{destroy:void 0},_f.bind(null,l,m,i,t),null),ct===null)throw Error(o(349));w||($n&127)!==0||gf(l,t,i)}return i}function gf(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=He.updateQueue,t===null?(t=Bl(),He.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function _f(e,t,i,l){t.value=i,t.getSnapshot=l,yf(t)&&Sf(e)}function vf(e,t,i){return i(function(){yf(t)&&Sf(e)})}function yf(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!rn(e,i)}catch{return!0}}function Sf(e){var t=Ui(e,2);t!==null&&en(t,e,2)}function Io(e){var t=Gt();if(typeof e=="function"){var i=e;if(e=i(),Ki){yt(!0);try{i()}finally{yt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yn,lastRenderedState:e},t}function bf(e,t,i,l){return e.baseState=i,zo(e,st,typeof l=="function"?l:Yn)}function Rv(e,t,i,l,m){if(Il(e))throw Error(o(485));if(e=t.action,e!==null){var w={payload:m,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(L){w.listeners.push(L)}};G.T!==null?i(!0):w.isTransition=!1,l(w),i=t.pending,i===null?(w.next=t.pending=w,Cf(t,w)):(w.next=i.next,t.pending=i.next=w)}}function Cf(e,t){var i=t.action,l=t.payload,m=e.state;if(t.isTransition){var w=G.T,L={};G.T=L;try{var U=i(m,l),K=G.S;K!==null&&K(L,U),wf(e,t,U)}catch(re){Uo(e,t,re)}finally{w!==null&&L.types!==null&&(w.types=L.types),G.T=w}}else try{w=i(m,l),wf(e,t,w)}catch(re){Uo(e,t,re)}}function wf(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(l){xf(e,t,l)},function(l){return Uo(e,t,l)}):xf(e,t,i)}function xf(e,t,i){t.status="fulfilled",t.value=i,Ef(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,Cf(e,i)))}function Uo(e,t,i){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=i,Ef(t),t=t.next;while(t!==l)}e.action=null}function Ef(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function kf(e,t){return t}function Af(e,t){if(Ke){var i=ct.formState;if(i!==null){e:{var l=He;if(Ke){if(dt){t:{for(var m=dt,w=yn;m.nodeType!==8;){if(!w){m=null;break t}if(m=bn(m.nextSibling),m===null){m=null;break t}}w=m.data,m=w==="F!"||w==="F"?m:null}if(m){dt=bn(m.nextSibling),l=m.data==="F!";break e}}oi(l)}l=!1}l&&(t=i[0])}}return i=Gt(),i.memoizedState=i.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:kf,lastRenderedState:t},i.queue=l,i=$f.bind(null,He,l),l.dispatch=i,l=Io(!1),w=$o.bind(null,He,!1,l.queue),l=Gt(),m={state:t,dispatch:null,action:e,pending:null},l.queue=m,i=Rv.bind(null,He,m,w,i),m.dispatch=i,l.memoizedState=e,[t,i,!1]}function Tf(e){var t=Ct();return Df(t,st,e)}function Df(e,t,i){if(t=zo(e,t,kf)[0],e=jl(Yn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Cs(t)}catch(L){throw L===xr?kl:L}else l=t;t=Ct();var m=t.queue,w=m.dispatch;return i!==t.memoizedState&&(He.flags|=2048,Dr(9,{destroy:void 0},Mv.bind(null,m,i),null)),[l,w,e]}function Mv(e,t){e.action=t}function Rf(e){var t=Ct(),i=st;if(i!==null)return Df(t,i,e);Ct(),t=t.memoizedState,i=Ct();var l=i.queue.dispatch;return i.memoizedState=e,[t,l,!1]}function Dr(e,t,i,l){return e={tag:e,create:i,deps:l,inst:t,next:null},t=He.updateQueue,t===null&&(t=Bl(),He.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,t.lastEffect=e),e}function Mf(){return Ct().memoizedState}function zl(e,t,i,l){var m=Gt();He.flags|=e,m.memoizedState=Dr(1|t,{destroy:void 0},i,l===void 0?null:l)}function Hl(e,t,i,l){var m=Ct();l=l===void 0?null:l;var w=m.memoizedState.inst;st!==null&&l!==null&&Mo(l,st.memoizedState.deps)?m.memoizedState=Dr(t,w,i,l):(He.flags|=e,m.memoizedState=Dr(1|t,w,i,l))}function Lf(e,t){zl(8390656,8,e,t)}function Po(e,t){Hl(2048,8,e,t)}function Lv(e){He.flags|=4;var t=He.updateQueue;if(t===null)t=Bl(),He.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Of(e){var t=Ct().memoizedState;return Lv({ref:t,nextImpl:e}),function(){if((et&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Bf(e,t){return Hl(4,2,e,t)}function Nf(e,t){return Hl(4,4,e,t)}function jf(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function zf(e,t,i){i=i!=null?i.concat([e]):null,Hl(4,4,jf.bind(null,t,e),i)}function Fo(){}function Hf(e,t){var i=Ct();t=t===void 0?null:t;var l=i.memoizedState;return t!==null&&Mo(t,l[1])?l[0]:(i.memoizedState=[e,t],e)}function If(e,t){var i=Ct();t=t===void 0?null:t;var l=i.memoizedState;if(t!==null&&Mo(t,l[1]))return l[0];if(l=e(),Ki){yt(!0);try{e()}finally{yt(!1)}}return i.memoizedState=[l,t],l}function qo(e,t,i){return i===void 0||($n&1073741824)!==0&&($e&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=Ud(),He.lanes|=e,_i|=e,i)}function Uf(e,t,i,l){return rn(i,t)?i:kr.current!==null?(e=qo(e,i,l),rn(e,t)||(Et=!0),e):($n&42)===0||($n&1073741824)!==0&&($e&261930)===0?(Et=!0,e.memoizedState=i):(e=Ud(),He.lanes|=e,_i|=e,t)}function Pf(e,t,i,l,m){var w=X.p;X.p=w!==0&&8>w?w:8;var L=G.T,U={};G.T=U,$o(e,!1,t,i);try{var K=m(),re=G.S;if(re!==null&&re(U,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var fe=Av(K,l);ws(e,t,fe,un(e))}else ws(e,t,l,un(e))}catch(ge){ws(e,t,{then:function(){},status:"rejected",reason:ge},un())}finally{X.p=w,L!==null&&U.types!==null&&(L.types=U.types),G.T=L}}function Ov(){}function Vo(e,t,i,l){if(e.tag!==5)throw Error(o(476));var m=Ff(e).queue;Pf(e,m,t,te,i===null?Ov:function(){return qf(e),i(l)})}function Ff(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yn,lastRenderedState:te},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yn,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function qf(e){var t=Ff(e);t.next===null&&(t=e.alternate.memoizedState),ws(e,t.next.queue,{},un())}function Go(){return Ht(Us)}function Vf(){return Ct().memoizedState}function Gf(){return Ct().memoizedState}function Bv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=un();e=hi(i);var l=fi(t,e,i);l!==null&&(en(l,t,i),vs(l,t,i)),t={cache:So()},e.payload=t;return}t=t.return}}function Nv(e,t,i){var l=un();i={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Il(e)?Yf(t,i):(i=oo(e,t,i,l),i!==null&&(en(i,e,l),Wf(i,t,l)))}function $f(e,t,i){var l=un();ws(e,t,i,l)}function ws(e,t,i,l){var m={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Il(e))Yf(t,m);else{var w=e.alternate;if(e.lanes===0&&(w===null||w.lanes===0)&&(w=t.lastRenderedReducer,w!==null))try{var L=t.lastRenderedState,U=w(L,i);if(m.hasEagerState=!0,m.eagerState=U,rn(U,L))return yl(e,t,m,0),ct===null&&vl(),!1}catch{}finally{}if(i=oo(e,t,m,l),i!==null)return en(i,e,l),Wf(i,t,l),!0}return!1}function $o(e,t,i,l){if(l={lane:2,revertLane:xc(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Il(e)){if(t)throw Error(o(479))}else t=oo(e,i,l,2),t!==null&&en(t,e,2)}function Il(e){var t=e.alternate;return e===He||t!==null&&t===He}function Yf(e,t){Ar=Ll=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Wf(e,t,i){if((i&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,ir(e,i)}}var xs={readContext:Ht,use:Nl,useCallback:_t,useContext:_t,useEffect:_t,useImperativeHandle:_t,useLayoutEffect:_t,useInsertionEffect:_t,useMemo:_t,useReducer:_t,useRef:_t,useState:_t,useDebugValue:_t,useDeferredValue:_t,useTransition:_t,useSyncExternalStore:_t,useId:_t,useHostTransitionStatus:_t,useFormState:_t,useActionState:_t,useOptimistic:_t,useMemoCache:_t,useCacheRefresh:_t};xs.useEffectEvent=_t;var Kf={readContext:Ht,use:Nl,useCallback:function(e,t){return Gt().memoizedState=[e,t===void 0?null:t],e},useContext:Ht,useEffect:Lf,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,zl(4194308,4,jf.bind(null,t,e),i)},useLayoutEffect:function(e,t){return zl(4194308,4,e,t)},useInsertionEffect:function(e,t){zl(4,2,e,t)},useMemo:function(e,t){var i=Gt();t=t===void 0?null:t;var l=e();if(Ki){yt(!0);try{e()}finally{yt(!1)}}return i.memoizedState=[l,t],l},useReducer:function(e,t,i){var l=Gt();if(i!==void 0){var m=i(t);if(Ki){yt(!0);try{i(t)}finally{yt(!1)}}}else m=t;return l.memoizedState=l.baseState=m,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:m},l.queue=e,e=e.dispatch=Nv.bind(null,He,e),[l.memoizedState,e]},useRef:function(e){var t=Gt();return e={current:e},t.memoizedState=e},useState:function(e){e=Io(e);var t=e.queue,i=$f.bind(null,He,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Fo,useDeferredValue:function(e,t){var i=Gt();return qo(i,e,t)},useTransition:function(){var e=Io(!1);return e=Pf.bind(null,He,e.queue,!0,!1),Gt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var l=He,m=Gt();if(Ke){if(i===void 0)throw Error(o(407));i=i()}else{if(i=t(),ct===null)throw Error(o(349));($e&127)!==0||gf(l,t,i)}m.memoizedState=i;var w={value:i,getSnapshot:t};return m.queue=w,Lf(vf.bind(null,l,w,e),[e]),l.flags|=2048,Dr(9,{destroy:void 0},_f.bind(null,l,w,i,t),null),i},useId:function(){var e=Gt(),t=ct.identifierPrefix;if(Ke){var i=Mn,l=Rn;i=(l&~(1<<32-Ne(l)-1)).toString(32)+i,t="_"+t+"R_"+i,i=Ol++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=Tv++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Go,useFormState:Af,useActionState:Af,useOptimistic:function(e){var t=Gt();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=$o.bind(null,He,!0,i),i.dispatch=t,[e,t]},useMemoCache:jo,useCacheRefresh:function(){return Gt().memoizedState=Bv.bind(null,He)},useEffectEvent:function(e){var t=Gt(),i={impl:e};return t.memoizedState=i,function(){if((et&2)!==0)throw Error(o(440));return i.impl.apply(void 0,arguments)}}},Yo={readContext:Ht,use:Nl,useCallback:Hf,useContext:Ht,useEffect:Po,useImperativeHandle:zf,useInsertionEffect:Bf,useLayoutEffect:Nf,useMemo:If,useReducer:jl,useRef:Mf,useState:function(){return jl(Yn)},useDebugValue:Fo,useDeferredValue:function(e,t){var i=Ct();return Uf(i,st.memoizedState,e,t)},useTransition:function(){var e=jl(Yn)[0],t=Ct().memoizedState;return[typeof e=="boolean"?e:Cs(e),t]},useSyncExternalStore:mf,useId:Vf,useHostTransitionStatus:Go,useFormState:Tf,useActionState:Tf,useOptimistic:function(e,t){var i=Ct();return bf(i,st,e,t)},useMemoCache:jo,useCacheRefresh:Gf};Yo.useEffectEvent=Of;var Xf={readContext:Ht,use:Nl,useCallback:Hf,useContext:Ht,useEffect:Po,useImperativeHandle:zf,useInsertionEffect:Bf,useLayoutEffect:Nf,useMemo:If,useReducer:Ho,useRef:Mf,useState:function(){return Ho(Yn)},useDebugValue:Fo,useDeferredValue:function(e,t){var i=Ct();return st===null?qo(i,e,t):Uf(i,st.memoizedState,e,t)},useTransition:function(){var e=Ho(Yn)[0],t=Ct().memoizedState;return[typeof e=="boolean"?e:Cs(e),t]},useSyncExternalStore:mf,useId:Vf,useHostTransitionStatus:Go,useFormState:Rf,useActionState:Rf,useOptimistic:function(e,t){var i=Ct();return st!==null?bf(i,st,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:jo,useCacheRefresh:Gf};Xf.useEffectEvent=Of;function Wo(e,t,i,l){t=e.memoizedState,i=i(l,t),i=i==null?t:u({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Ko={enqueueSetState:function(e,t,i){e=e._reactInternals;var l=un(),m=hi(l);m.payload=t,i!=null&&(m.callback=i),t=fi(e,m,l),t!==null&&(en(t,e,l),vs(t,e,l))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var l=un(),m=hi(l);m.tag=1,m.payload=t,i!=null&&(m.callback=i),t=fi(e,m,l),t!==null&&(en(t,e,l),vs(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=un(),l=hi(i);l.tag=2,t!=null&&(l.callback=t),t=fi(e,l,i),t!==null&&(en(t,e,i),vs(t,e,i))}};function Qf(e,t,i,l,m,w,L){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,w,L):t.prototype&&t.prototype.isPureReactComponent?!us(i,l)||!us(m,w):!0}function Zf(e,t,i,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,l),t.state!==e&&Ko.enqueueReplaceState(t,t.state,null)}function Xi(e,t){var i=t;if("ref"in t){i={};for(var l in t)l!=="ref"&&(i[l]=t[l])}if(e=e.defaultProps){i===t&&(i=u({},i));for(var m in e)i[m]===void 0&&(i[m]=e[m])}return i}function Jf(e){_l(e)}function ed(e){console.error(e)}function td(e){_l(e)}function Ul(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function nd(e,t,i){try{var l=e.onCaughtError;l(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Xo(e,t,i){return i=hi(i),i.tag=3,i.payload={element:null},i.callback=function(){Ul(e,t)},i}function id(e){return e=hi(e),e.tag=3,e}function rd(e,t,i,l){var m=i.type.getDerivedStateFromError;if(typeof m=="function"){var w=l.value;e.payload=function(){return m(w)},e.callback=function(){nd(t,i,l)}}var L=i.stateNode;L!==null&&typeof L.componentDidCatch=="function"&&(e.callback=function(){nd(t,i,l),typeof m!="function"&&(vi===null?vi=new Set([this]):vi.add(this));var U=l.stack;this.componentDidCatch(l.value,{componentStack:U!==null?U:""})})}function jv(e,t,i,l,m){if(i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=i.alternate,t!==null&&br(t,i,m,!0),i=ln.current,i!==null){switch(i.tag){case 31:case 13:return Sn===null?Zl():i.alternate===null&&vt===0&&(vt=3),i.flags&=-257,i.flags|=65536,i.lanes=m,l===Al?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([l]):t.add(l),bc(e,l,m)),!1;case 22:return i.flags|=65536,l===Al?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([l]):i.add(l)),bc(e,l,m)),!1}throw Error(o(435,i.tag))}return bc(e,l,m),Zl(),!1}if(Ke)return t=ln.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=m,l!==mo&&(e=Error(o(422),{cause:l}),ds(gn(e,i)))):(l!==mo&&(t=Error(o(423),{cause:l}),ds(gn(t,i))),e=e.current.alternate,e.flags|=65536,m&=-m,e.lanes|=m,l=gn(l,i),m=Xo(e.stateNode,l,m),ko(e,m),vt!==4&&(vt=2)),!1;var w=Error(o(520),{cause:l});if(w=gn(w,i),Ls===null?Ls=[w]:Ls.push(w),vt!==4&&(vt=2),t===null)return!0;l=gn(l,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=m&-m,i.lanes|=e,e=Xo(i.stateNode,l,e),ko(i,e),!1;case 1:if(t=i.type,w=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(vi===null||!vi.has(w))))return i.flags|=65536,m&=-m,i.lanes|=m,m=id(m),rd(m,e,i,l),ko(i,m),!1}i=i.return}while(i!==null);return!1}var Qo=Error(o(461)),Et=!1;function It(e,t,i,l){t.child=e===null?of(t,null,i,l):Wi(t,e.child,i,l)}function sd(e,t,i,l,m){i=i.render;var w=t.ref;if("ref"in l){var L={};for(var U in l)U!=="ref"&&(L[U]=l[U])}else L=l;return Vi(t),l=Lo(e,t,i,L,w,m),U=Oo(),e!==null&&!Et?(Bo(e,t,m),Wn(e,t,m)):(Ke&&U&&fo(t),t.flags|=1,It(e,t,l,m),t.child)}function ld(e,t,i,l,m){if(e===null){var w=i.type;return typeof w=="function"&&!co(w)&&w.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=w,ad(e,t,w,l,m)):(e=bl(i.type,null,l,t,t.mode,m),e.ref=t.ref,e.return=t,t.child=e)}if(w=e.child,!sc(e,m)){var L=w.memoizedProps;if(i=i.compare,i=i!==null?i:us,i(L,l)&&e.ref===t.ref)return Wn(e,t,m)}return t.flags|=1,e=Fn(w,l),e.ref=t.ref,e.return=t,t.child=e}function ad(e,t,i,l,m){if(e!==null){var w=e.memoizedProps;if(us(w,l)&&e.ref===t.ref)if(Et=!1,t.pendingProps=l=w,sc(e,m))(e.flags&131072)!==0&&(Et=!0);else return t.lanes=e.lanes,Wn(e,t,m)}return Zo(e,t,i,l,m)}function od(e,t,i,l){var m=l.children,w=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(w=w!==null?w.baseLanes|i:i,e!==null){for(l=t.child=e.child,m=0;l!==null;)m=m|l.lanes|l.childLanes,l=l.sibling;l=m&~w}else l=0,t.child=null;return cd(e,t,w,i,l)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&El(t,w!==null?w.cachePool:null),w!==null?hf(t,w):To(),ff(t);else return l=t.lanes=536870912,cd(e,t,w!==null?w.baseLanes|i:i,i,l)}else w!==null?(El(t,w.cachePool),hf(t,w),pi(),t.memoizedState=null):(e!==null&&El(t,null),To(),pi());return It(e,t,m,i),t.child}function Es(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function cd(e,t,i,l,m){var w=Co();return w=w===null?null:{parent:wt._currentValue,pool:w},t.memoizedState={baseLanes:i,cachePool:w},e!==null&&El(t,null),To(),ff(t),e!==null&&br(e,t,l,!0),t.childLanes=m,null}function Pl(e,t){return t=ql({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ud(e,t,i){return Wi(t,e.child,null,i),e=Pl(t,t.pendingProps),e.flags|=2,an(t),t.memoizedState=null,e}function zv(e,t,i){var l=t.pendingProps,m=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ke){if(l.mode==="hidden")return e=Pl(t,l),t.lanes=536870912,Es(null,e);if(Ro(t),(e=dt)?(e=Cp(e,yn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:li!==null?{id:Rn,overflow:Mn}:null,retryLane:536870912,hydrationErrors:null},i=$h(e),i.return=t,t.child=i,zt=t,dt=null)):e=null,e===null)throw oi(t);return t.lanes=536870912,null}return Pl(t,l)}var w=e.memoizedState;if(w!==null){var L=w.dehydrated;if(Ro(t),m)if(t.flags&256)t.flags&=-257,t=ud(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Et||br(e,t,i,!1),m=(i&e.childLanes)!==0,Et||m){if(l=ct,l!==null&&(L=es(l,i),L!==0&&L!==w.retryLane))throw w.retryLane=L,Ui(e,L),en(l,e,L),Qo;Zl(),t=ud(e,t,i)}else e=w.treeContext,dt=bn(L.nextSibling),zt=t,Ke=!0,ai=null,yn=!1,e!==null&&Kh(t,e),t=Pl(t,l),t.flags|=4096;return t}return e=Fn(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Fl(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(o(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Zo(e,t,i,l,m){return Vi(t),i=Lo(e,t,i,l,void 0,m),l=Oo(),e!==null&&!Et?(Bo(e,t,m),Wn(e,t,m)):(Ke&&l&&fo(t),t.flags|=1,It(e,t,i,m),t.child)}function hd(e,t,i,l,m,w){return Vi(t),t.updateQueue=null,i=pf(t,l,i,m),df(e),l=Oo(),e!==null&&!Et?(Bo(e,t,w),Wn(e,t,w)):(Ke&&l&&fo(t),t.flags|=1,It(e,t,i,w),t.child)}function fd(e,t,i,l,m){if(Vi(t),t.stateNode===null){var w=_r,L=i.contextType;typeof L=="object"&&L!==null&&(w=Ht(L)),w=new i(l,w),t.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Ko,t.stateNode=w,w._reactInternals=t,w=t.stateNode,w.props=l,w.state=t.memoizedState,w.refs={},xo(t),L=i.contextType,w.context=typeof L=="object"&&L!==null?Ht(L):_r,w.state=t.memoizedState,L=i.getDerivedStateFromProps,typeof L=="function"&&(Wo(t,i,L,l),w.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(L=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),L!==w.state&&Ko.enqueueReplaceState(w,w.state,null),Ss(t,l,w,m),ys(),w.state=t.memoizedState),typeof w.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){w=t.stateNode;var U=t.memoizedProps,K=Xi(i,U);w.props=K;var re=w.context,fe=i.contextType;L=_r,typeof fe=="object"&&fe!==null&&(L=Ht(fe));var ge=i.getDerivedStateFromProps;fe=typeof ge=="function"||typeof w.getSnapshotBeforeUpdate=="function",U=t.pendingProps!==U,fe||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(U||re!==L)&&Zf(t,w,l,L),ui=!1;var se=t.memoizedState;w.state=se,Ss(t,l,w,m),ys(),re=t.memoizedState,U||se!==re||ui?(typeof ge=="function"&&(Wo(t,i,ge,l),re=t.memoizedState),(K=ui||Qf(t,i,K,l,se,re,L))?(fe||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(t.flags|=4194308)):(typeof w.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=re),w.props=l,w.state=re,w.context=L,l=K):(typeof w.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{w=t.stateNode,Eo(e,t),L=t.memoizedProps,fe=Xi(i,L),w.props=fe,ge=t.pendingProps,se=w.context,re=i.contextType,K=_r,typeof re=="object"&&re!==null&&(K=Ht(re)),U=i.getDerivedStateFromProps,(re=typeof U=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(L!==ge||se!==K)&&Zf(t,w,l,K),ui=!1,se=t.memoizedState,w.state=se,Ss(t,l,w,m),ys();var oe=t.memoizedState;L!==ge||se!==oe||ui||e!==null&&e.dependencies!==null&&wl(e.dependencies)?(typeof U=="function"&&(Wo(t,i,U,l),oe=t.memoizedState),(fe=ui||Qf(t,i,fe,l,se,oe,K)||e!==null&&e.dependencies!==null&&wl(e.dependencies))?(re||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(l,oe,K),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(l,oe,K)),typeof w.componentDidUpdate=="function"&&(t.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof w.componentDidUpdate!="function"||L===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||L===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=oe),w.props=l,w.state=oe,w.context=K,l=fe):(typeof w.componentDidUpdate!="function"||L===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||L===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),l=!1)}return w=l,Fl(e,t),l=(t.flags&128)!==0,w||l?(w=t.stateNode,i=l&&typeof i.getDerivedStateFromError!="function"?null:w.render(),t.flags|=1,e!==null&&l?(t.child=Wi(t,e.child,null,m),t.child=Wi(t,null,i,m)):It(e,t,i,m),t.memoizedState=w.state,e=t.child):e=Wn(e,t,m),e}function dd(e,t,i,l){return Fi(),t.flags|=256,It(e,t,i,l),t.child}var Jo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ec(e){return{baseLanes:e,cachePool:tf()}}function tc(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=cn),e}function pd(e,t,i){var l=t.pendingProps,m=!1,w=(t.flags&128)!==0,L;if((L=w)||(L=e!==null&&e.memoizedState===null?!1:(bt.current&2)!==0),L&&(m=!0,t.flags&=-129),L=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ke){if(m?di(t):pi(),(e=dt)?(e=Cp(e,yn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:li!==null?{id:Rn,overflow:Mn}:null,retryLane:536870912,hydrationErrors:null},i=$h(e),i.return=t,t.child=i,zt=t,dt=null)):e=null,e===null)throw oi(t);return zc(e)?t.lanes=32:t.lanes=536870912,null}var U=l.children;return l=l.fallback,m?(pi(),m=t.mode,U=ql({mode:"hidden",children:U},m),l=Pi(l,m,i,null),U.return=t,l.return=t,U.sibling=l,t.child=U,l=t.child,l.memoizedState=ec(i),l.childLanes=tc(e,L,i),t.memoizedState=Jo,Es(null,l)):(di(t),nc(t,U))}var K=e.memoizedState;if(K!==null&&(U=K.dehydrated,U!==null)){if(w)t.flags&256?(di(t),t.flags&=-257,t=ic(e,t,i)):t.memoizedState!==null?(pi(),t.child=e.child,t.flags|=128,t=null):(pi(),U=l.fallback,m=t.mode,l=ql({mode:"visible",children:l.children},m),U=Pi(U,m,i,null),U.flags|=2,l.return=t,U.return=t,l.sibling=U,t.child=l,Wi(t,e.child,null,i),l=t.child,l.memoizedState=ec(i),l.childLanes=tc(e,L,i),t.memoizedState=Jo,t=Es(null,l));else if(di(t),zc(U)){if(L=U.nextSibling&&U.nextSibling.dataset,L)var re=L.dgst;L=re,l=Error(o(419)),l.stack="",l.digest=L,ds({value:l,source:null,stack:null}),t=ic(e,t,i)}else if(Et||br(e,t,i,!1),L=(i&e.childLanes)!==0,Et||L){if(L=ct,L!==null&&(l=es(L,i),l!==0&&l!==K.retryLane))throw K.retryLane=l,Ui(e,l),en(L,e,l),Qo;jc(U)||Zl(),t=ic(e,t,i)}else jc(U)?(t.flags|=192,t.child=e.child,t=null):(e=K.treeContext,dt=bn(U.nextSibling),zt=t,Ke=!0,ai=null,yn=!1,e!==null&&Kh(t,e),t=nc(t,l.children),t.flags|=4096);return t}return m?(pi(),U=l.fallback,m=t.mode,K=e.child,re=K.sibling,l=Fn(K,{mode:"hidden",children:l.children}),l.subtreeFlags=K.subtreeFlags&65011712,re!==null?U=Fn(re,U):(U=Pi(U,m,i,null),U.flags|=2),U.return=t,l.return=t,l.sibling=U,t.child=l,Es(null,l),l=t.child,U=e.child.memoizedState,U===null?U=ec(i):(m=U.cachePool,m!==null?(K=wt._currentValue,m=m.parent!==K?{parent:K,pool:K}:m):m=tf(),U={baseLanes:U.baseLanes|i,cachePool:m}),l.memoizedState=U,l.childLanes=tc(e,L,i),t.memoizedState=Jo,Es(e.child,l)):(di(t),i=e.child,e=i.sibling,i=Fn(i,{mode:"visible",children:l.children}),i.return=t,i.sibling=null,e!==null&&(L=t.deletions,L===null?(t.deletions=[e],t.flags|=16):L.push(e)),t.child=i,t.memoizedState=null,i)}function nc(e,t){return t=ql({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ql(e,t){return e=sn(22,e,null,t),e.lanes=0,e}function ic(e,t,i){return Wi(t,e.child,null,i),e=nc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function md(e,t,i){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),vo(e.return,t,i)}function rc(e,t,i,l,m,w){var L=e.memoizedState;L===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:m,treeForkCount:w}:(L.isBackwards=t,L.rendering=null,L.renderingStartTime=0,L.last=l,L.tail=i,L.tailMode=m,L.treeForkCount=w)}function gd(e,t,i){var l=t.pendingProps,m=l.revealOrder,w=l.tail;l=l.children;var L=bt.current,U=(L&2)!==0;if(U?(L=L&1|2,t.flags|=128):L&=1,I(bt,L),It(e,t,l,i),l=Ke?fs:0,!U&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&md(e,i,t);else if(e.tag===19)md(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(m){case"forwards":for(i=t.child,m=null;i!==null;)e=i.alternate,e!==null&&Ml(e)===null&&(m=i),i=i.sibling;i=m,i===null?(m=t.child,t.child=null):(m=i.sibling,i.sibling=null),rc(t,!1,m,i,w,l);break;case"backwards":case"unstable_legacy-backwards":for(i=null,m=t.child,t.child=null;m!==null;){if(e=m.alternate,e!==null&&Ml(e)===null){t.child=m;break}e=m.sibling,m.sibling=i,i=m,m=e}rc(t,!0,i,null,w,l);break;case"together":rc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function Wn(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),_i|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(br(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,i=Fn(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Fn(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function sc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&wl(e)))}function Hv(e,t,i){switch(t.tag){case 3:q(t,t.stateNode.containerInfo),ci(t,wt,e.memoizedState.cache),Fi();break;case 27:case 5:Y(t);break;case 4:q(t,t.stateNode.containerInfo);break;case 10:ci(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ro(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(di(t),t.flags|=128,null):(i&t.child.childLanes)!==0?pd(e,t,i):(di(t),e=Wn(e,t,i),e!==null?e.sibling:null);di(t);break;case 19:var m=(e.flags&128)!==0;if(l=(i&t.childLanes)!==0,l||(br(e,t,i,!1),l=(i&t.childLanes)!==0),m){if(l)return gd(e,t,i);t.flags|=128}if(m=t.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),I(bt,bt.current),l)break;return null;case 22:return t.lanes=0,od(e,t,i,t.pendingProps);case 24:ci(t,wt,e.memoizedState.cache)}return Wn(e,t,i)}function _d(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Et=!0;else{if(!sc(e,i)&&(t.flags&128)===0)return Et=!1,Hv(e,t,i);Et=(e.flags&131072)!==0}else Et=!1,Ke&&(t.flags&1048576)!==0&&Wh(t,fs,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=$i(t.elementType),t.type=e,typeof e=="function")co(e)?(l=Xi(e,l),t.tag=1,t=fd(null,t,e,l,i)):(t.tag=0,t=Zo(null,t,e,l,i));else{if(e!=null){var m=e.$$typeof;if(m===k){t.tag=11,t=sd(null,t,e,l,i);break e}else if(m===T){t.tag=14,t=ld(null,t,e,l,i);break e}}throw t=$(e)||e,Error(o(306,t,""))}}return t;case 0:return Zo(e,t,t.type,t.pendingProps,i);case 1:return l=t.type,m=Xi(l,t.pendingProps),fd(e,t,l,m,i);case 3:e:{if(q(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var w=t.memoizedState;m=w.element,Eo(e,t),Ss(t,l,null,i);var L=t.memoizedState;if(l=L.cache,ci(t,wt,l),l!==w.cache&&yo(t,[wt],i,!0),ys(),l=L.element,w.isDehydrated)if(w={element:l,isDehydrated:!1,cache:L.cache},t.updateQueue.baseState=w,t.memoizedState=w,t.flags&256){t=dd(e,t,l,i);break e}else if(l!==m){m=gn(Error(o(424)),t),ds(m),t=dd(e,t,l,i);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(dt=bn(e.firstChild),zt=t,Ke=!0,ai=null,yn=!0,i=of(t,null,l,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(Fi(),l===m){t=Wn(e,t,i);break e}It(e,t,l,i)}t=t.child}return t;case 26:return Fl(e,t),e===null?(i=Tp(t.type,null,t.pendingProps,null))?t.memoizedState=i:Ke||(i=t.type,e=t.pendingProps,l=sa(me.current).createElement(i),l[jt]=t,l[Wt]=e,Ut(l,i,e),Lt(l),t.stateNode=l):t.memoizedState=Tp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Y(t),e===null&&Ke&&(l=t.stateNode=Ep(t.type,t.pendingProps,me.current),zt=t,yn=!0,m=dt,Ci(t.type)?(Hc=m,dt=bn(l.firstChild)):dt=m),It(e,t,t.pendingProps.children,i),Fl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ke&&((m=l=dt)&&(l=p0(l,t.type,t.pendingProps,yn),l!==null?(t.stateNode=l,zt=t,dt=bn(l.firstChild),yn=!1,m=!0):m=!1),m||oi(t)),Y(t),m=t.type,w=t.pendingProps,L=e!==null?e.memoizedProps:null,l=w.children,Oc(m,w)?l=null:L!==null&&Oc(m,L)&&(t.flags|=32),t.memoizedState!==null&&(m=Lo(e,t,Dv,null,null,i),Us._currentValue=m),Fl(e,t),It(e,t,l,i),t.child;case 6:return e===null&&Ke&&((e=i=dt)&&(i=m0(i,t.pendingProps,yn),i!==null?(t.stateNode=i,zt=t,dt=null,e=!0):e=!1),e||oi(t)),null;case 13:return pd(e,t,i);case 4:return q(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Wi(t,null,l,i):It(e,t,l,i),t.child;case 11:return sd(e,t,t.type,t.pendingProps,i);case 7:return It(e,t,t.pendingProps,i),t.child;case 8:return It(e,t,t.pendingProps.children,i),t.child;case 12:return It(e,t,t.pendingProps.children,i),t.child;case 10:return l=t.pendingProps,ci(t,t.type,l.value),It(e,t,l.children,i),t.child;case 9:return m=t.type._context,l=t.pendingProps.children,Vi(t),m=Ht(m),l=l(m),t.flags|=1,It(e,t,l,i),t.child;case 14:return ld(e,t,t.type,t.pendingProps,i);case 15:return ad(e,t,t.type,t.pendingProps,i);case 19:return gd(e,t,i);case 31:return zv(e,t,i);case 22:return od(e,t,i,t.pendingProps);case 24:return Vi(t),l=Ht(wt),e===null?(m=Co(),m===null&&(m=ct,w=So(),m.pooledCache=w,w.refCount++,w!==null&&(m.pooledCacheLanes|=i),m=w),t.memoizedState={parent:l,cache:m},xo(t),ci(t,wt,m)):((e.lanes&i)!==0&&(Eo(e,t),Ss(t,null,null,i),ys()),m=e.memoizedState,w=t.memoizedState,m.parent!==l?(m={parent:l,cache:l},t.memoizedState=m,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=m),ci(t,wt,l)):(l=w.cache,ci(t,wt,l),l!==m.cache&&yo(t,[wt],i,!0))),It(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Kn(e){e.flags|=4}function lc(e,t,i,l,m){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(m&335544128)===m)if(e.stateNode.complete)e.flags|=8192;else if(Vd())e.flags|=8192;else throw Yi=Al,wo}else e.flags&=-16777217}function vd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Op(t))if(Vd())e.flags|=8192;else throw Yi=Al,wo}function Vl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?mt():536870912,e.lanes|=t,Or|=t)}function ks(e,t){if(!Ke)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function pt(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(t)for(var m=e.child;m!==null;)i|=m.lanes|m.childLanes,l|=m.subtreeFlags&65011712,l|=m.flags&65011712,m.return=e,m=m.sibling;else for(m=e.child;m!==null;)i|=m.lanes|m.childLanes,l|=m.subtreeFlags,l|=m.flags,m.return=e,m=m.sibling;return e.subtreeFlags|=l,e.childLanes=i,t}function Iv(e,t,i){var l=t.pendingProps;switch(po(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pt(t),null;case 1:return pt(t),null;case 3:return i=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Gn(wt),J(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Sr(t)?Kn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,go())),pt(t),null;case 26:var m=t.type,w=t.memoizedState;return e===null?(Kn(t),w!==null?(pt(t),vd(t,w)):(pt(t),lc(t,m,null,l,i))):w?w!==e.memoizedState?(Kn(t),pt(t),vd(t,w)):(pt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&Kn(t),pt(t),lc(t,m,e,l,i)),null;case 27:if(he(t),i=me.current,m=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Kn(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return pt(t),null}e=ne.current,Sr(t)?Xh(t):(e=Ep(m,l,i),t.stateNode=e,Kn(t))}return pt(t),null;case 5:if(he(t),m=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Kn(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return pt(t),null}if(w=ne.current,Sr(t))Xh(t);else{var L=sa(me.current);switch(w){case 1:w=L.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:w=L.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":w=L.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":w=L.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":w=L.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof l.is=="string"?L.createElement("select",{is:l.is}):L.createElement("select"),l.multiple?w.multiple=!0:l.size&&(w.size=l.size);break;default:w=typeof l.is=="string"?L.createElement(m,{is:l.is}):L.createElement(m)}}w[jt]=t,w[Wt]=l;e:for(L=t.child;L!==null;){if(L.tag===5||L.tag===6)w.appendChild(L.stateNode);else if(L.tag!==4&&L.tag!==27&&L.child!==null){L.child.return=L,L=L.child;continue}if(L===t)break e;for(;L.sibling===null;){if(L.return===null||L.return===t)break e;L=L.return}L.sibling.return=L.return,L=L.sibling}t.stateNode=w;e:switch(Ut(w,m,l),m){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Kn(t)}}return pt(t),lc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Kn(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=me.current,Sr(t)){if(e=t.stateNode,i=t.memoizedProps,l=null,m=zt,m!==null)switch(m.tag){case 27:case 5:l=m.memoizedProps}e[jt]=t,e=!!(e.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||pp(e.nodeValue,i)),e||oi(t,!0)}else e=sa(e).createTextNode(l),e[jt]=t,t.stateNode=e}return pt(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(l=Sr(t),i!==null){if(e===null){if(!l)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[jt]=t}else Fi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pt(t),e=!1}else i=go(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(an(t),t):(an(t),null);if((t.flags&128)!==0)throw Error(o(558))}return pt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(m=Sr(t),l!==null&&l.dehydrated!==null){if(e===null){if(!m)throw Error(o(318));if(m=t.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(o(317));m[jt]=t}else Fi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pt(t),m=!1}else m=go(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=m),m=!0;if(!m)return t.flags&256?(an(t),t):(an(t),null)}return an(t),(t.flags&128)!==0?(t.lanes=i,t):(i=l!==null,e=e!==null&&e.memoizedState!==null,i&&(l=t.child,m=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(m=l.alternate.memoizedState.cachePool.pool),w=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(w=l.memoizedState.cachePool.pool),w!==m&&(l.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Vl(t,t.updateQueue),pt(t),null);case 4:return J(),e===null&&Tc(t.stateNode.containerInfo),pt(t),null;case 10:return Gn(t.type),pt(t),null;case 19:if(V(bt),l=t.memoizedState,l===null)return pt(t),null;if(m=(t.flags&128)!==0,w=l.rendering,w===null)if(m)ks(l,!1);else{if(vt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(w=Ml(e),w!==null){for(t.flags|=128,ks(l,!1),e=w.updateQueue,t.updateQueue=e,Vl(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)Gh(i,e),i=i.sibling;return I(bt,bt.current&1|2),Ke&&qn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&tt()>Kl&&(t.flags|=128,m=!0,ks(l,!1),t.lanes=4194304)}else{if(!m)if(e=Ml(w),e!==null){if(t.flags|=128,m=!0,e=e.updateQueue,t.updateQueue=e,Vl(t,e),ks(l,!0),l.tail===null&&l.tailMode==="hidden"&&!w.alternate&&!Ke)return pt(t),null}else 2*tt()-l.renderingStartTime>Kl&&i!==536870912&&(t.flags|=128,m=!0,ks(l,!1),t.lanes=4194304);l.isBackwards?(w.sibling=t.child,t.child=w):(e=l.last,e!==null?e.sibling=w:t.child=w,l.last=w)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=tt(),e.sibling=null,i=bt.current,I(bt,m?i&1|2:i&1),Ke&&qn(t,l.treeForkCount),e):(pt(t),null);case 22:case 23:return an(t),Do(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(i&536870912)!==0&&(t.flags&128)===0&&(pt(t),t.subtreeFlags&6&&(t.flags|=8192)):pt(t),i=t.updateQueue,i!==null&&Vl(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==i&&(t.flags|=2048),e!==null&&V(Gi),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Gn(wt),pt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Uv(e,t){switch(po(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Gn(wt),J(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return he(t),null;case 31:if(t.memoizedState!==null){if(an(t),t.alternate===null)throw Error(o(340));Fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(an(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(bt),null;case 4:return J(),null;case 10:return Gn(t.type),null;case 22:case 23:return an(t),Do(),e!==null&&V(Gi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Gn(wt),null;case 25:return null;default:return null}}function yd(e,t){switch(po(t),t.tag){case 3:Gn(wt),J();break;case 26:case 27:case 5:he(t);break;case 4:J();break;case 31:t.memoizedState!==null&&an(t);break;case 13:an(t);break;case 19:V(bt);break;case 10:Gn(t.type);break;case 22:case 23:an(t),Do(),e!==null&&V(Gi);break;case 24:Gn(wt)}}function As(e,t){try{var i=t.updateQueue,l=i!==null?i.lastEffect:null;if(l!==null){var m=l.next;i=m;do{if((i.tag&e)===e){l=void 0;var w=i.create,L=i.inst;l=w(),L.destroy=l}i=i.next}while(i!==m)}}catch(U){rt(t,t.return,U)}}function mi(e,t,i){try{var l=t.updateQueue,m=l!==null?l.lastEffect:null;if(m!==null){var w=m.next;l=w;do{if((l.tag&e)===e){var L=l.inst,U=L.destroy;if(U!==void 0){L.destroy=void 0,m=t;var K=i,re=U;try{re()}catch(fe){rt(m,K,fe)}}}l=l.next}while(l!==w)}}catch(fe){rt(t,t.return,fe)}}function Sd(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{uf(t,i)}catch(l){rt(e,e.return,l)}}}function bd(e,t,i){i.props=Xi(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(l){rt(e,t,l)}}function Ts(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof i=="function"?e.refCleanup=i(l):i.current=l}}catch(m){rt(e,t,m)}}function Ln(e,t){var i=e.ref,l=e.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(m){rt(e,t,m)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(m){rt(e,t,m)}else i.current=null}function Cd(e){var t=e.type,i=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(m){rt(e,e.return,m)}}function ac(e,t,i){try{var l=e.stateNode;o0(l,e.type,i,t),l[Wt]=t}catch(m){rt(e,e.return,m)}}function wd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ci(e.type)||e.tag===4}function oc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||wd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ci(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cc(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Un));else if(l!==4&&(l===27&&Ci(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(cc(e,t,i),e=e.sibling;e!==null;)cc(e,t,i),e=e.sibling}function Gl(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(l!==4&&(l===27&&Ci(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Gl(e,t,i),e=e.sibling;e!==null;)Gl(e,t,i),e=e.sibling}function xd(e){var t=e.stateNode,i=e.memoizedProps;try{for(var l=e.type,m=t.attributes;m.length;)t.removeAttributeNode(m[0]);Ut(t,l,i),t[jt]=e,t[Wt]=i}catch(w){rt(e,e.return,w)}}var Xn=!1,kt=!1,uc=!1,Ed=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function Pv(e,t){if(e=e.containerInfo,Mc=fa,e=jh(e),no(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var m=l.anchorOffset,w=l.focusNode;l=l.focusOffset;try{i.nodeType,w.nodeType}catch{i=null;break e}var L=0,U=-1,K=-1,re=0,fe=0,ge=e,se=null;t:for(;;){for(var oe;ge!==i||m!==0&&ge.nodeType!==3||(U=L+m),ge!==w||l!==0&&ge.nodeType!==3||(K=L+l),ge.nodeType===3&&(L+=ge.nodeValue.length),(oe=ge.firstChild)!==null;)se=ge,ge=oe;for(;;){if(ge===e)break t;if(se===i&&++re===m&&(U=L),se===w&&++fe===l&&(K=L),(oe=ge.nextSibling)!==null)break;ge=se,se=ge.parentNode}ge=oe}i=U===-1||K===-1?null:{start:U,end:K}}else i=null}i=i||{start:0,end:0}}else i=null;for(Lc={focusedElem:e,selectionRange:i},fa=!1,Ot=t;Ot!==null;)if(t=Ot,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ot=e;else for(;Ot!==null;){switch(t=Ot,w=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)m=e[i],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&w!==null){e=void 0,i=t,m=w.memoizedProps,w=w.memoizedState,l=i.stateNode;try{var Ee=Xi(i.type,m);e=l.getSnapshotBeforeUpdate(Ee,w),l.__reactInternalSnapshotBeforeUpdate=e}catch(Be){rt(i,i.return,Be)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)Nc(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Nc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Ot=e;break}Ot=t.return}}function kd(e,t,i){var l=i.flags;switch(i.tag){case 0:case 11:case 15:Zn(e,i),l&4&&As(5,i);break;case 1:if(Zn(e,i),l&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(L){rt(i,i.return,L)}else{var m=Xi(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(m,t,e.__reactInternalSnapshotBeforeUpdate)}catch(L){rt(i,i.return,L)}}l&64&&Sd(i),l&512&&Ts(i,i.return);break;case 3:if(Zn(e,i),l&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{uf(e,t)}catch(L){rt(i,i.return,L)}}break;case 27:t===null&&l&4&&xd(i);case 26:case 5:Zn(e,i),t===null&&l&4&&Cd(i),l&512&&Ts(i,i.return);break;case 12:Zn(e,i);break;case 31:Zn(e,i),l&4&&Dd(e,i);break;case 13:Zn(e,i),l&4&&Rd(e,i),l&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=Xv.bind(null,i),g0(e,i))));break;case 22:if(l=i.memoizedState!==null||Xn,!l){t=t!==null&&t.memoizedState!==null||kt,m=Xn;var w=kt;Xn=l,(kt=t)&&!w?Jn(e,i,(i.subtreeFlags&8772)!==0):Zn(e,i),Xn=m,kt=w}break;case 30:break;default:Zn(e,i)}}function Ad(e){var t=e.alternate;t!==null&&(e.alternate=null,Ad(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ia(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var gt=null,Xt=!1;function Qn(e,t,i){for(i=i.child;i!==null;)Td(e,t,i),i=i.sibling}function Td(e,t,i){if(Re&&typeof Re.onCommitFiberUnmount=="function")try{Re.onCommitFiberUnmount(ke,i)}catch{}switch(i.tag){case 26:kt||Ln(i,t),Qn(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:kt||Ln(i,t);var l=gt,m=Xt;Ci(i.type)&&(gt=i.stateNode,Xt=!1),Qn(e,t,i),zs(i.stateNode),gt=l,Xt=m;break;case 5:kt||Ln(i,t);case 6:if(l=gt,m=Xt,gt=null,Qn(e,t,i),gt=l,Xt=m,gt!==null)if(Xt)try{(gt.nodeType===9?gt.body:gt.nodeName==="HTML"?gt.ownerDocument.body:gt).removeChild(i.stateNode)}catch(w){rt(i,t,w)}else try{gt.removeChild(i.stateNode)}catch(w){rt(i,t,w)}break;case 18:gt!==null&&(Xt?(e=gt,Sp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Pr(e)):Sp(gt,i.stateNode));break;case 4:l=gt,m=Xt,gt=i.stateNode.containerInfo,Xt=!0,Qn(e,t,i),gt=l,Xt=m;break;case 0:case 11:case 14:case 15:mi(2,i,t),kt||mi(4,i,t),Qn(e,t,i);break;case 1:kt||(Ln(i,t),l=i.stateNode,typeof l.componentWillUnmount=="function"&&bd(i,t,l)),Qn(e,t,i);break;case 21:Qn(e,t,i);break;case 22:kt=(l=kt)||i.memoizedState!==null,Qn(e,t,i),kt=l;break;default:Qn(e,t,i)}}function Dd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Pr(e)}catch(i){rt(t,t.return,i)}}}function Rd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Pr(e)}catch(i){rt(t,t.return,i)}}function Fv(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ed),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ed),t;default:throw Error(o(435,e.tag))}}function $l(e,t){var i=Fv(e);t.forEach(function(l){if(!i.has(l)){i.add(l);var m=Qv.bind(null,e,l);l.then(m,m)}})}function Qt(e,t){var i=t.deletions;if(i!==null)for(var l=0;l<i.length;l++){var m=i[l],w=e,L=t,U=L;e:for(;U!==null;){switch(U.tag){case 27:if(Ci(U.type)){gt=U.stateNode,Xt=!1;break e}break;case 5:gt=U.stateNode,Xt=!1;break e;case 3:case 4:gt=U.stateNode.containerInfo,Xt=!0;break e}U=U.return}if(gt===null)throw Error(o(160));Td(w,L,m),gt=null,Xt=!1,w=m.alternate,w!==null&&(w.return=null),m.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Md(t,e),t=t.sibling}var kn=null;function Md(e,t){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Qt(t,e),Zt(e),l&4&&(mi(3,e,e.return),As(3,e),mi(5,e,e.return));break;case 1:Qt(t,e),Zt(e),l&512&&(kt||i===null||Ln(i,i.return)),l&64&&Xn&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?l:i.concat(l))));break;case 26:var m=kn;if(Qt(t,e),Zt(e),l&512&&(kt||i===null||Ln(i,i.return)),l&4){var w=i!==null?i.memoizedState:null;if(l=e.memoizedState,i===null)if(l===null)if(e.stateNode===null){e:{l=e.type,i=e.memoizedProps,m=m.ownerDocument||m;t:switch(l){case"title":w=m.getElementsByTagName("title")[0],(!w||w[ts]||w[jt]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=m.createElement(l),m.head.insertBefore(w,m.querySelector("head > title"))),Ut(w,l,i),w[jt]=e,Lt(w),l=w;break e;case"link":var L=Mp("link","href",m).get(l+(i.href||""));if(L){for(var U=0;U<L.length;U++)if(w=L[U],w.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&w.getAttribute("rel")===(i.rel==null?null:i.rel)&&w.getAttribute("title")===(i.title==null?null:i.title)&&w.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){L.splice(U,1);break t}}w=m.createElement(l),Ut(w,l,i),m.head.appendChild(w);break;case"meta":if(L=Mp("meta","content",m).get(l+(i.content||""))){for(U=0;U<L.length;U++)if(w=L[U],w.getAttribute("content")===(i.content==null?null:""+i.content)&&w.getAttribute("name")===(i.name==null?null:i.name)&&w.getAttribute("property")===(i.property==null?null:i.property)&&w.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&w.getAttribute("charset")===(i.charSet==null?null:i.charSet)){L.splice(U,1);break t}}w=m.createElement(l),Ut(w,l,i),m.head.appendChild(w);break;default:throw Error(o(468,l))}w[jt]=e,Lt(w),l=w}e.stateNode=l}else Lp(m,e.type,e.stateNode);else e.stateNode=Rp(m,l,e.memoizedProps);else w!==l?(w===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):w.count--,l===null?Lp(m,e.type,e.stateNode):Rp(m,l,e.memoizedProps)):l===null&&e.stateNode!==null&&ac(e,e.memoizedProps,i.memoizedProps)}break;case 27:Qt(t,e),Zt(e),l&512&&(kt||i===null||Ln(i,i.return)),i!==null&&l&4&&ac(e,e.memoizedProps,i.memoizedProps);break;case 5:if(Qt(t,e),Zt(e),l&512&&(kt||i===null||Ln(i,i.return)),e.flags&32){m=e.stateNode;try{ur(m,"")}catch(Ee){rt(e,e.return,Ee)}}l&4&&e.stateNode!=null&&(m=e.memoizedProps,ac(e,m,i!==null?i.memoizedProps:m)),l&1024&&(uc=!0);break;case 6:if(Qt(t,e),Zt(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,i=e.stateNode;try{i.nodeValue=l}catch(Ee){rt(e,e.return,Ee)}}break;case 3:if(oa=null,m=kn,kn=la(t.containerInfo),Qt(t,e),kn=m,Zt(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{Pr(t.containerInfo)}catch(Ee){rt(e,e.return,Ee)}uc&&(uc=!1,Ld(e));break;case 4:l=kn,kn=la(e.stateNode.containerInfo),Qt(t,e),Zt(e),kn=l;break;case 12:Qt(t,e),Zt(e);break;case 31:Qt(t,e),Zt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,$l(e,l)));break;case 13:Qt(t,e),Zt(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Wl=tt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,$l(e,l)));break;case 22:m=e.memoizedState!==null;var K=i!==null&&i.memoizedState!==null,re=Xn,fe=kt;if(Xn=re||m,kt=fe||K,Qt(t,e),kt=fe,Xn=re,Zt(e),l&8192)e:for(t=e.stateNode,t._visibility=m?t._visibility&-2:t._visibility|1,m&&(i===null||K||Xn||kt||Qi(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){K=i=t;try{if(w=K.stateNode,m)L=w.style,typeof L.setProperty=="function"?L.setProperty("display","none","important"):L.display="none";else{U=K.stateNode;var ge=K.memoizedProps.style,se=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;U.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(Ee){rt(K,K.return,Ee)}}}else if(t.tag===6){if(i===null){K=t;try{K.stateNode.nodeValue=m?"":K.memoizedProps}catch(Ee){rt(K,K.return,Ee)}}}else if(t.tag===18){if(i===null){K=t;try{var oe=K.stateNode;m?bp(oe,!0):bp(K.stateNode,!1)}catch(Ee){rt(K,K.return,Ee)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(i=l.retryQueue,i!==null&&(l.retryQueue=null,$l(e,i))));break;case 19:Qt(t,e),Zt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,$l(e,l)));break;case 30:break;case 21:break;default:Qt(t,e),Zt(e)}}function Zt(e){var t=e.flags;if(t&2){try{for(var i,l=e.return;l!==null;){if(wd(l)){i=l;break}l=l.return}if(i==null)throw Error(o(160));switch(i.tag){case 27:var m=i.stateNode,w=oc(e);Gl(e,w,m);break;case 5:var L=i.stateNode;i.flags&32&&(ur(L,""),i.flags&=-33);var U=oc(e);Gl(e,U,L);break;case 3:case 4:var K=i.stateNode.containerInfo,re=oc(e);cc(e,re,K);break;default:throw Error(o(161))}}catch(fe){rt(e,e.return,fe)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ld(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ld(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Zn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)kd(e,t.alternate,t),t=t.sibling}function Qi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:mi(4,t,t.return),Qi(t);break;case 1:Ln(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&bd(t,t.return,i),Qi(t);break;case 27:zs(t.stateNode);case 26:case 5:Ln(t,t.return),Qi(t);break;case 22:t.memoizedState===null&&Qi(t);break;case 30:Qi(t);break;default:Qi(t)}e=e.sibling}}function Jn(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,m=e,w=t,L=w.flags;switch(w.tag){case 0:case 11:case 15:Jn(m,w,i),As(4,w);break;case 1:if(Jn(m,w,i),l=w,m=l.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(re){rt(l,l.return,re)}if(l=w,m=l.updateQueue,m!==null){var U=l.stateNode;try{var K=m.shared.hiddenCallbacks;if(K!==null)for(m.shared.hiddenCallbacks=null,m=0;m<K.length;m++)cf(K[m],U)}catch(re){rt(l,l.return,re)}}i&&L&64&&Sd(w),Ts(w,w.return);break;case 27:xd(w);case 26:case 5:Jn(m,w,i),i&&l===null&&L&4&&Cd(w),Ts(w,w.return);break;case 12:Jn(m,w,i);break;case 31:Jn(m,w,i),i&&L&4&&Dd(m,w);break;case 13:Jn(m,w,i),i&&L&4&&Rd(m,w);break;case 22:w.memoizedState===null&&Jn(m,w,i),Ts(w,w.return);break;case 30:break;default:Jn(m,w,i)}t=t.sibling}}function hc(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&ps(i))}function fc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ps(e))}function An(e,t,i,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Od(e,t,i,l),t=t.sibling}function Od(e,t,i,l){var m=t.flags;switch(t.tag){case 0:case 11:case 15:An(e,t,i,l),m&2048&&As(9,t);break;case 1:An(e,t,i,l);break;case 3:An(e,t,i,l),m&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ps(e)));break;case 12:if(m&2048){An(e,t,i,l),e=t.stateNode;try{var w=t.memoizedProps,L=w.id,U=w.onPostCommit;typeof U=="function"&&U(L,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(K){rt(t,t.return,K)}}else An(e,t,i,l);break;case 31:An(e,t,i,l);break;case 13:An(e,t,i,l);break;case 23:break;case 22:w=t.stateNode,L=t.alternate,t.memoizedState!==null?w._visibility&2?An(e,t,i,l):Ds(e,t):w._visibility&2?An(e,t,i,l):(w._visibility|=2,Rr(e,t,i,l,(t.subtreeFlags&10256)!==0||!1)),m&2048&&hc(L,t);break;case 24:An(e,t,i,l),m&2048&&fc(t.alternate,t);break;default:An(e,t,i,l)}}function Rr(e,t,i,l,m){for(m=m&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var w=e,L=t,U=i,K=l,re=L.flags;switch(L.tag){case 0:case 11:case 15:Rr(w,L,U,K,m),As(8,L);break;case 23:break;case 22:var fe=L.stateNode;L.memoizedState!==null?fe._visibility&2?Rr(w,L,U,K,m):Ds(w,L):(fe._visibility|=2,Rr(w,L,U,K,m)),m&&re&2048&&hc(L.alternate,L);break;case 24:Rr(w,L,U,K,m),m&&re&2048&&fc(L.alternate,L);break;default:Rr(w,L,U,K,m)}t=t.sibling}}function Ds(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,l=t,m=l.flags;switch(l.tag){case 22:Ds(i,l),m&2048&&hc(l.alternate,l);break;case 24:Ds(i,l),m&2048&&fc(l.alternate,l);break;default:Ds(i,l)}t=t.sibling}}var Rs=8192;function Mr(e,t,i){if(e.subtreeFlags&Rs)for(e=e.child;e!==null;)Bd(e,t,i),e=e.sibling}function Bd(e,t,i){switch(e.tag){case 26:Mr(e,t,i),e.flags&Rs&&e.memoizedState!==null&&T0(i,kn,e.memoizedState,e.memoizedProps);break;case 5:Mr(e,t,i);break;case 3:case 4:var l=kn;kn=la(e.stateNode.containerInfo),Mr(e,t,i),kn=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Rs,Rs=16777216,Mr(e,t,i),Rs=l):Mr(e,t,i));break;default:Mr(e,t,i)}}function Nd(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ms(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var l=t[i];Ot=l,zd(l,e)}Nd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)jd(e),e=e.sibling}function jd(e){switch(e.tag){case 0:case 11:case 15:Ms(e),e.flags&2048&&mi(9,e,e.return);break;case 3:Ms(e);break;case 12:Ms(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Yl(e)):Ms(e);break;default:Ms(e)}}function Yl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var l=t[i];Ot=l,zd(l,e)}Nd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:mi(8,t,t.return),Yl(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Yl(t));break;default:Yl(t)}e=e.sibling}}function zd(e,t){for(;Ot!==null;){var i=Ot;switch(i.tag){case 0:case 11:case 15:mi(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var l=i.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:ps(i.memoizedState.cache)}if(l=i.child,l!==null)l.return=i,Ot=l;else e:for(i=e;Ot!==null;){l=Ot;var m=l.sibling,w=l.return;if(Ad(l),l===i){Ot=null;break e}if(m!==null){m.return=w,Ot=m;break e}Ot=w}}}var qv={getCacheForType:function(e){var t=Ht(wt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Ht(wt).controller.signal}},Vv=typeof WeakMap=="function"?WeakMap:Map,et=0,ct=null,qe=null,$e=0,it=0,on=null,gi=!1,Lr=!1,dc=!1,ei=0,vt=0,_i=0,Zi=0,pc=0,cn=0,Or=0,Ls=null,Jt=null,mc=!1,Wl=0,Hd=0,Kl=1/0,Xl=null,vi=null,Dt=0,yi=null,Br=null,ti=0,gc=0,_c=null,Id=null,Os=0,vc=null;function un(){return(et&2)!==0&&$e!==0?$e&-$e:G.T!==null?xc():St()}function Ud(){if(cn===0)if(($e&536870912)===0||Ke){var e=jn;jn<<=1,(jn&3932160)===0&&(jn=262144),cn=e}else cn=536870912;return e=ln.current,e!==null&&(e.flags|=32),cn}function en(e,t,i){(e===ct&&(it===2||it===9)||e.cancelPendingCommit!==null)&&(Nr(e,0),Si(e,$e,cn,!1)),Ni(e,i),((et&2)===0||e!==ct)&&(e===ct&&((et&2)===0&&(Zi|=i),vt===4&&Si(e,$e,cn,!1)),On(e))}function Pd(e,t,i){if((et&6)!==0)throw Error(o(327));var l=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Hn(e,t),m=l?Yv(e,t):Sc(e,t,!0),w=l;do{if(m===0){Lr&&!l&&Si(e,t,0,!1);break}else{if(i=e.current.alternate,w&&!Gv(i)){m=Sc(e,t,!1),w=!1;continue}if(m===2){if(w=t,e.errorRecoveryDisabledLanes&w)var L=0;else L=e.pendingLanes&-536870913,L=L!==0?L:L&536870912?536870912:0;if(L!==0){t=L;e:{var U=e;m=Ls;var K=U.current.memoizedState.isDehydrated;if(K&&(Nr(U,L).flags|=256),L=Sc(U,L,!1),L!==2){if(dc&&!K){U.errorRecoveryDisabledLanes|=w,Zi|=w,m=4;break e}w=Jt,Jt=m,w!==null&&(Jt===null?Jt=w:Jt.push.apply(Jt,w))}m=L}if(w=!1,m!==2)continue}}if(m===1){Nr(e,0),Si(e,t,0,!0);break}e:{switch(l=e,w=m,w){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Si(l,t,cn,!gi);break e;case 2:Jt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(m=Wl+300-tt(),10<m)){if(Si(l,t,cn,!gi),nr(l,0,!0)!==0)break e;ti=t,l.timeoutHandle=vp(Fd.bind(null,l,i,Jt,Xl,mc,t,cn,Zi,Or,gi,w,"Throttled",-0,0),m);break e}Fd(l,i,Jt,Xl,mc,t,cn,Zi,Or,gi,w,null,-0,0)}}break}while(!0);On(e)}function Fd(e,t,i,l,m,w,L,U,K,re,fe,ge,se,oe){if(e.timeoutHandle=-1,ge=t.subtreeFlags,ge&8192||(ge&16785408)===16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Un},Bd(t,w,ge);var Ee=(w&62914560)===w?Wl-tt():(w&4194048)===w?Hd-tt():0;if(Ee=D0(ge,Ee),Ee!==null){ti=w,e.cancelPendingCommit=Ee(Xd.bind(null,e,t,w,i,l,m,L,U,K,fe,ge,null,se,oe)),Si(e,w,L,!re);return}}Xd(e,t,w,i,l,m,L,U,K)}function Gv(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var l=0;l<i.length;l++){var m=i[l],w=m.getSnapshot;m=m.value;try{if(!rn(w(),m))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Si(e,t,i,l){t&=~pc,t&=~Zi,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var m=t;0<m;){var w=31-Ne(m),L=1<<w;l[w]=-1,m&=~L}i!==0&&ll(e,i,t)}function Ql(){return(et&6)===0?(Bs(0),!1):!0}function yc(){if(qe!==null){if(it===0)var e=qe.return;else e=qe,Vn=qi=null,No(e),Er=null,gs=0,e=qe;for(;e!==null;)yd(e.alternate,e),e=e.return;qe=null}}function Nr(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,h0(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),ti=0,yc(),ct=e,qe=i=Fn(e.current,null),$e=t,it=0,on=null,gi=!1,Lr=Hn(e,t),dc=!1,Or=cn=pc=Zi=_i=vt=0,Jt=Ls=null,mc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var m=31-Ne(l),w=1<<m;t|=e[m],l&=~w}return ei=t,vl(),i}function qd(e,t){He=null,G.H=xs,t===xr||t===kl?(t=sf(),it=3):t===wo?(t=sf(),it=4):it=t===Qo?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,on=t,qe===null&&(vt=1,Ul(e,gn(t,e.current)))}function Vd(){var e=ln.current;return e===null?!0:($e&4194048)===$e?Sn===null:($e&62914560)===$e||($e&536870912)!==0?e===Sn:!1}function Gd(){var e=G.H;return G.H=xs,e===null?xs:e}function $d(){var e=G.A;return G.A=qv,e}function Zl(){vt=4,gi||($e&4194048)!==$e&&ln.current!==null||(Lr=!0),(_i&134217727)===0&&(Zi&134217727)===0||ct===null||Si(ct,$e,cn,!1)}function Sc(e,t,i){var l=et;et|=2;var m=Gd(),w=$d();(ct!==e||$e!==t)&&(Xl=null,Nr(e,t)),t=!1;var L=vt;e:do try{if(it!==0&&qe!==null){var U=qe,K=on;switch(it){case 8:yc(),L=6;break e;case 3:case 2:case 9:case 6:ln.current===null&&(t=!0);var re=it;if(it=0,on=null,jr(e,U,K,re),i&&Lr){L=0;break e}break;default:re=it,it=0,on=null,jr(e,U,K,re)}}$v(),L=vt;break}catch(fe){qd(e,fe)}while(!0);return t&&e.shellSuspendCounter++,Vn=qi=null,et=l,G.H=m,G.A=w,qe===null&&(ct=null,$e=0,vl()),L}function $v(){for(;qe!==null;)Yd(qe)}function Yv(e,t){var i=et;et|=2;var l=Gd(),m=$d();ct!==e||$e!==t?(Xl=null,Kl=tt()+500,Nr(e,t)):Lr=Hn(e,t);e:do try{if(it!==0&&qe!==null){t=qe;var w=on;t:switch(it){case 1:it=0,on=null,jr(e,t,w,1);break;case 2:case 9:if(nf(w)){it=0,on=null,Wd(t);break}t=function(){it!==2&&it!==9||ct!==e||(it=7),On(e)},w.then(t,t);break e;case 3:it=7;break e;case 4:it=5;break e;case 7:nf(w)?(it=0,on=null,Wd(t)):(it=0,on=null,jr(e,t,w,7));break;case 5:var L=null;switch(qe.tag){case 26:L=qe.memoizedState;case 5:case 27:var U=qe;if(L?Op(L):U.stateNode.complete){it=0,on=null;var K=U.sibling;if(K!==null)qe=K;else{var re=U.return;re!==null?(qe=re,Jl(re)):qe=null}break t}}it=0,on=null,jr(e,t,w,5);break;case 6:it=0,on=null,jr(e,t,w,6);break;case 8:yc(),vt=6;break e;default:throw Error(o(462))}}Wv();break}catch(fe){qd(e,fe)}while(!0);return Vn=qi=null,G.H=l,G.A=m,et=i,qe!==null?0:(ct=null,$e=0,vl(),vt)}function Wv(){for(;qe!==null&&!Mt();)Yd(qe)}function Yd(e){var t=_d(e.alternate,e,ei);e.memoizedProps=e.pendingProps,t===null?Jl(e):qe=t}function Wd(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=hd(i,t,t.pendingProps,t.type,void 0,$e);break;case 11:t=hd(i,t,t.pendingProps,t.type.render,t.ref,$e);break;case 5:No(t);default:yd(i,t),t=qe=Gh(t,ei),t=_d(i,t,ei)}e.memoizedProps=e.pendingProps,t===null?Jl(e):qe=t}function jr(e,t,i,l){Vn=qi=null,No(t),Er=null,gs=0;var m=t.return;try{if(jv(e,m,t,i,$e)){vt=1,Ul(e,gn(i,e.current)),qe=null;return}}catch(w){if(m!==null)throw qe=m,w;vt=1,Ul(e,gn(i,e.current)),qe=null;return}t.flags&32768?(Ke||l===1?e=!0:Lr||($e&536870912)!==0?e=!1:(gi=e=!0,(l===2||l===9||l===3||l===6)&&(l=ln.current,l!==null&&l.tag===13&&(l.flags|=16384))),Kd(t,e)):Jl(t)}function Jl(e){var t=e;do{if((t.flags&32768)!==0){Kd(t,gi);return}e=t.return;var i=Iv(t.alternate,t,ei);if(i!==null){qe=i;return}if(t=t.sibling,t!==null){qe=t;return}qe=t=e}while(t!==null);vt===0&&(vt=5)}function Kd(e,t){do{var i=Uv(e.alternate,e);if(i!==null){i.flags&=32767,qe=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){qe=e;return}qe=e=i}while(e!==null);vt=6,qe=null}function Xd(e,t,i,l,m,w,L,U,K){e.cancelPendingCommit=null;do ea();while(Dt!==0);if((et&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(w=t.lanes|t.childLanes,w|=ao,za(e,i,w,L,U,K),e===ct&&(qe=ct=null,$e=0),Br=t,yi=e,ti=i,gc=w,_c=m,Id=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Zv(we,function(){return tp(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=G.T,G.T=null,m=X.p,X.p=2,L=et,et|=4;try{Pv(e,t,i)}finally{et=L,X.p=m,G.T=l}}Dt=1,Qd(),Zd(),Jd()}}function Qd(){if(Dt===1){Dt=0;var e=yi,t=Br,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=G.T,G.T=null;var l=X.p;X.p=2;var m=et;et|=4;try{Md(t,e);var w=Lc,L=jh(e.containerInfo),U=w.focusedElem,K=w.selectionRange;if(L!==U&&U&&U.ownerDocument&&Nh(U.ownerDocument.documentElement,U)){if(K!==null&&no(U)){var re=K.start,fe=K.end;if(fe===void 0&&(fe=re),"selectionStart"in U)U.selectionStart=re,U.selectionEnd=Math.min(fe,U.value.length);else{var ge=U.ownerDocument||document,se=ge&&ge.defaultView||window;if(se.getSelection){var oe=se.getSelection(),Ee=U.textContent.length,Be=Math.min(K.start,Ee),at=K.end===void 0?Be:Math.min(K.end,Ee);!oe.extend&&Be>at&&(L=at,at=Be,Be=L);var ee=Bh(U,Be),Z=Bh(U,at);if(ee&&Z&&(oe.rangeCount!==1||oe.anchorNode!==ee.node||oe.anchorOffset!==ee.offset||oe.focusNode!==Z.node||oe.focusOffset!==Z.offset)){var ie=ge.createRange();ie.setStart(ee.node,ee.offset),oe.removeAllRanges(),Be>at?(oe.addRange(ie),oe.extend(Z.node,Z.offset)):(ie.setEnd(Z.node,Z.offset),oe.addRange(ie))}}}}for(ge=[],oe=U;oe=oe.parentNode;)oe.nodeType===1&&ge.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof U.focus=="function"&&U.focus(),U=0;U<ge.length;U++){var pe=ge[U];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}fa=!!Mc,Lc=Mc=null}finally{et=m,X.p=l,G.T=i}}e.current=t,Dt=2}}function Zd(){if(Dt===2){Dt=0;var e=yi,t=Br,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=G.T,G.T=null;var l=X.p;X.p=2;var m=et;et|=4;try{kd(e,t.alternate,t)}finally{et=m,X.p=l,G.T=i}}Dt=3}}function Jd(){if(Dt===4||Dt===3){Dt=0,ae();var e=yi,t=Br,i=ti,l=Id;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Dt=5:(Dt=0,Br=yi=null,ep(e,e.pendingLanes));var m=e.pendingLanes;if(m===0&&(vi=null),Ce(i),t=t.stateNode,Re&&typeof Re.onCommitFiberRoot=="function")try{Re.onCommitFiberRoot(ke,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=G.T,m=X.p,X.p=2,G.T=null;try{for(var w=e.onRecoverableError,L=0;L<l.length;L++){var U=l[L];w(U.value,{componentStack:U.stack})}}finally{G.T=t,X.p=m}}(ti&3)!==0&&ea(),On(e),m=e.pendingLanes,(i&261930)!==0&&(m&42)!==0?e===vc?Os++:(Os=0,vc=e):Os=0,Bs(0)}}function ep(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ps(t)))}function ea(){return Qd(),Zd(),Jd(),tp()}function tp(){if(Dt!==5)return!1;var e=yi,t=gc;gc=0;var i=Ce(ti),l=G.T,m=X.p;try{X.p=32>i?32:i,G.T=null,i=_c,_c=null;var w=yi,L=ti;if(Dt=0,Br=yi=null,ti=0,(et&6)!==0)throw Error(o(331));var U=et;if(et|=4,jd(w.current),Od(w,w.current,L,i),et=U,Bs(0,!1),Re&&typeof Re.onPostCommitFiberRoot=="function")try{Re.onPostCommitFiberRoot(ke,w)}catch{}return!0}finally{X.p=m,G.T=l,ep(e,t)}}function np(e,t,i){t=gn(i,t),t=Xo(e.stateNode,t,2),e=fi(e,t,2),e!==null&&(Ni(e,2),On(e))}function rt(e,t,i){if(e.tag===3)np(e,e,i);else for(;t!==null;){if(t.tag===3){np(t,e,i);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(vi===null||!vi.has(l))){e=gn(i,e),i=id(2),l=fi(t,i,2),l!==null&&(rd(i,l,t,e),Ni(l,2),On(l));break}}t=t.return}}function bc(e,t,i){var l=e.pingCache;if(l===null){l=e.pingCache=new Vv;var m=new Set;l.set(t,m)}else m=l.get(t),m===void 0&&(m=new Set,l.set(t,m));m.has(i)||(dc=!0,m.add(i),e=Kv.bind(null,e,t,i),t.then(e,e))}function Kv(e,t,i){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,ct===e&&($e&i)===i&&(vt===4||vt===3&&($e&62914560)===$e&&300>tt()-Wl?(et&2)===0&&Nr(e,0):pc|=i,Or===$e&&(Or=0)),On(e)}function ip(e,t){t===0&&(t=mt()),e=Ui(e,t),e!==null&&(Ni(e,t),On(e))}function Xv(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),ip(e,i)}function Qv(e,t){var i=0;switch(e.tag){case 31:case 13:var l=e.stateNode,m=e.memoizedState;m!==null&&(i=m.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),ip(e,i)}function Zv(e,t){return Tt(e,t)}var ta=null,zr=null,Cc=!1,na=!1,wc=!1,bi=0;function On(e){e!==zr&&e.next===null&&(zr===null?ta=zr=e:zr=zr.next=e),na=!0,Cc||(Cc=!0,e0())}function Bs(e,t){if(!wc&&na){wc=!0;do for(var i=!1,l=ta;l!==null;){if(e!==0){var m=l.pendingLanes;if(m===0)var w=0;else{var L=l.suspendedLanes,U=l.pingedLanes;w=(1<<31-Ne(42|e)+1)-1,w&=m&~(L&~U),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(i=!0,ap(l,w))}else w=$e,w=nr(l,l===ct?w:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(w&3)===0||Hn(l,w)||(i=!0,ap(l,w));l=l.next}while(i);wc=!1}}function Jv(){rp()}function rp(){na=Cc=!1;var e=0;bi!==0&&u0()&&(e=bi);for(var t=tt(),i=null,l=ta;l!==null;){var m=l.next,w=sp(l,t);w===0?(l.next=null,i===null?ta=m:i.next=m,m===null&&(zr=i)):(i=l,(e!==0||(w&3)!==0)&&(na=!0)),l=m}Dt!==0&&Dt!==5||Bs(e),bi!==0&&(bi=0)}function sp(e,t){for(var i=e.suspendedLanes,l=e.pingedLanes,m=e.expirationTimes,w=e.pendingLanes&-62914561;0<w;){var L=31-Ne(w),U=1<<L,K=m[L];K===-1?((U&i)===0||(U&l)!==0)&&(m[L]=Zr(U,t)):K<=t&&(e.expiredLanes|=U),w&=~U}if(t=ct,i=$e,i=nr(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,i===0||e===t&&(it===2||it===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&nt(l),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Hn(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(l!==null&&nt(l),Ce(i)){case 2:case 8:i=Se;break;case 32:i=we;break;case 268435456:i=je;break;default:i=we}return l=lp.bind(null,e),i=Tt(i,l),e.callbackPriority=t,e.callbackNode=i,t}return l!==null&&l!==null&&nt(l),e.callbackPriority=2,e.callbackNode=null,2}function lp(e,t){if(Dt!==0&&Dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(ea()&&e.callbackNode!==i)return null;var l=$e;return l=nr(e,e===ct?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Pd(e,l,t),sp(e,tt()),e.callbackNode!=null&&e.callbackNode===i?lp.bind(null,e):null)}function ap(e,t){if(ea())return null;Pd(e,t,!0)}function e0(){f0(function(){(et&6)!==0?Tt(ue,Jv):rp()})}function xc(){if(bi===0){var e=Cr;e===0&&(e=Dn,Dn<<=1,(Dn&261888)===0&&(Dn=256)),bi=e}return bi}function op(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ul(""+e)}function cp(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function t0(e,t,i,l,m){if(t==="submit"&&i&&i.stateNode===m){var w=op((m[Wt]||null).action),L=l.submitter;L&&(t=(t=L[Wt]||null)?op(t.formAction):L.getAttribute("formAction"),t!==null&&(w=t,L=null));var U=new pl("action","action",null,l,m);e.push({event:U,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(bi!==0){var K=L?cp(m,L):new FormData(m);Vo(i,{pending:!0,data:K,method:m.method,action:w},null,K)}}else typeof w=="function"&&(U.preventDefault(),K=L?cp(m,L):new FormData(m),Vo(i,{pending:!0,data:K,method:m.method,action:w},w,K))},currentTarget:m}]})}}for(var Ec=0;Ec<lo.length;Ec++){var kc=lo[Ec],n0=kc.toLowerCase(),i0=kc[0].toUpperCase()+kc.slice(1);En(n0,"on"+i0)}En(Ih,"onAnimationEnd"),En(Uh,"onAnimationIteration"),En(Ph,"onAnimationStart"),En("dblclick","onDoubleClick"),En("focusin","onFocus"),En("focusout","onBlur"),En(yv,"onTransitionRun"),En(Sv,"onTransitionStart"),En(bv,"onTransitionCancel"),En(Fh,"onTransitionEnd"),or("onMouseEnter",["mouseout","mouseover"]),or("onMouseLeave",["mouseout","mouseover"]),or("onPointerEnter",["pointerout","pointerover"]),or("onPointerLeave",["pointerout","pointerover"]),ji("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ji("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ji("onBeforeInput",["compositionend","keypress","textInput","paste"]),ji("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ji("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ji("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ns="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(" "),r0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ns));function up(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var l=e[i],m=l.event;l=l.listeners;e:{var w=void 0;if(t)for(var L=l.length-1;0<=L;L--){var U=l[L],K=U.instance,re=U.currentTarget;if(U=U.listener,K!==w&&m.isPropagationStopped())break e;w=U,m.currentTarget=re;try{w(m)}catch(fe){_l(fe)}m.currentTarget=null,w=K}else for(L=0;L<l.length;L++){if(U=l[L],K=U.instance,re=U.currentTarget,U=U.listener,K!==w&&m.isPropagationStopped())break e;w=U,m.currentTarget=re;try{w(m)}catch(fe){_l(fe)}m.currentTarget=null,w=K}}}}function Ve(e,t){var i=t[Ha];i===void 0&&(i=t[Ha]=new Set);var l=e+"__bubble";i.has(l)||(hp(t,e,2,!1),i.add(l))}function Ac(e,t,i){var l=0;t&&(l|=4),hp(i,e,l,t)}var ia="_reactListening"+Math.random().toString(36).slice(2);function Tc(e){if(!e[ia]){e[ia]=!0,ih.forEach(function(i){i!=="selectionchange"&&(r0.has(i)||Ac(i,!1,e),Ac(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ia]||(t[ia]=!0,Ac("selectionchange",!1,t))}}function hp(e,t,i,l){switch(Up(t)){case 2:var m=L0;break;case 8:m=O0;break;default:m=qc}i=m.bind(null,t,i,e),m=void 0,!Ya||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(m=!0),l?m!==void 0?e.addEventListener(t,i,{capture:!0,passive:m}):e.addEventListener(t,i,!0):m!==void 0?e.addEventListener(t,i,{passive:m}):e.addEventListener(t,i,!1)}function Dc(e,t,i,l,m){var w=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var L=l.tag;if(L===3||L===4){var U=l.stateNode.containerInfo;if(U===m)break;if(L===4)for(L=l.return;L!==null;){var K=L.tag;if((K===3||K===4)&&L.stateNode.containerInfo===m)return;L=L.return}for(;U!==null;){if(L=sr(U),L===null)return;if(K=L.tag,K===5||K===6||K===26||K===27){l=w=L;continue e}U=U.parentNode}}l=l.return}mh(function(){var re=w,fe=Ga(i),ge=[];e:{var se=qh.get(e);if(se!==void 0){var oe=pl,Ee=e;switch(e){case"keypress":if(fl(i)===0)break e;case"keydown":case"keyup":oe=Q_;break;case"focusin":Ee="focus",oe=Qa;break;case"focusout":Ee="blur",oe=Qa;break;case"beforeblur":case"afterblur":oe=Qa;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=vh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=I_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=ev;break;case Ih:case Uh:case Ph:oe=F_;break;case Fh:oe=nv;break;case"scroll":case"scrollend":oe=z_;break;case"wheel":oe=rv;break;case"copy":case"cut":case"paste":oe=V_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=Sh;break;case"toggle":case"beforetoggle":oe=lv}var Be=(t&4)!==0,at=!Be&&(e==="scroll"||e==="scrollend"),ee=Be?se!==null?se+"Capture":null:se;Be=[];for(var Z=re,ie;Z!==null;){var pe=Z;if(ie=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||ie===null||ee===null||(pe=is(Z,ee),pe!=null&&Be.push(js(Z,pe,ie))),at)break;Z=Z.return}0<Be.length&&(se=new oe(se,Ee,null,i,fe),ge.push({event:se,listeners:Be}))}}if((t&7)===0){e:{if(se=e==="mouseover"||e==="pointerover",oe=e==="mouseout"||e==="pointerout",se&&i!==Va&&(Ee=i.relatedTarget||i.fromElement)&&(sr(Ee)||Ee[rr]))break e;if((oe||se)&&(se=fe.window===fe?fe:(se=fe.ownerDocument)?se.defaultView||se.parentWindow:window,oe?(Ee=i.relatedTarget||i.toElement,oe=re,Ee=Ee?sr(Ee):null,Ee!==null&&(at=v(Ee),Be=Ee.tag,Ee!==at||Be!==5&&Be!==27&&Be!==6)&&(Ee=null)):(oe=null,Ee=re),oe!==Ee)){if(Be=vh,pe="onMouseLeave",ee="onMouseEnter",Z="mouse",(e==="pointerout"||e==="pointerover")&&(Be=Sh,pe="onPointerLeave",ee="onPointerEnter",Z="pointer"),at=oe==null?se:ns(oe),ie=Ee==null?se:ns(Ee),se=new Be(pe,Z+"leave",oe,i,fe),se.target=at,se.relatedTarget=ie,pe=null,sr(fe)===re&&(Be=new Be(ee,Z+"enter",Ee,i,fe),Be.target=ie,Be.relatedTarget=at,pe=Be),at=pe,oe&&Ee)t:{for(Be=s0,ee=oe,Z=Ee,ie=0,pe=ee;pe;pe=Be(pe))ie++;pe=0;for(var Le=Z;Le;Le=Be(Le))pe++;for(;0<ie-pe;)ee=Be(ee),ie--;for(;0<pe-ie;)Z=Be(Z),pe--;for(;ie--;){if(ee===Z||Z!==null&&ee===Z.alternate){Be=ee;break t}ee=Be(ee),Z=Be(Z)}Be=null}else Be=null;oe!==null&&fp(ge,se,oe,Be,!1),Ee!==null&&at!==null&&fp(ge,at,Ee,Be,!0)}}e:{if(se=re?ns(re):window,oe=se.nodeName&&se.nodeName.toLowerCase(),oe==="select"||oe==="input"&&se.type==="file")var Qe=Th;else if(kh(se))if(Dh)Qe=gv;else{Qe=pv;var Ae=dv}else oe=se.nodeName,!oe||oe.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?re&&qa(re.elementType)&&(Qe=Th):Qe=mv;if(Qe&&(Qe=Qe(e,re))){Ah(ge,Qe,i,fe);break e}Ae&&Ae(e,se,re),e==="focusout"&&re&&se.type==="number"&&re.memoizedProps.value!=null&&Fa(se,"number",se.value)}switch(Ae=re?ns(re):window,e){case"focusin":(kh(Ae)||Ae.contentEditable==="true")&&(pr=Ae,io=re,hs=null);break;case"focusout":hs=io=pr=null;break;case"mousedown":ro=!0;break;case"contextmenu":case"mouseup":case"dragend":ro=!1,zh(ge,i,fe);break;case"selectionchange":if(vv)break;case"keydown":case"keyup":zh(ge,i,fe)}var Ie;if(Ja)e:{switch(e){case"compositionstart":var Ye="onCompositionStart";break e;case"compositionend":Ye="onCompositionEnd";break e;case"compositionupdate":Ye="onCompositionUpdate";break e}Ye=void 0}else dr?xh(e,i)&&(Ye="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ye="onCompositionStart");Ye&&(bh&&i.locale!=="ko"&&(dr||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&dr&&(Ie=gh()):(si=fe,Wa="value"in si?si.value:si.textContent,dr=!0)),Ae=ra(re,Ye),0<Ae.length&&(Ye=new yh(Ye,e,null,i,fe),ge.push({event:Ye,listeners:Ae}),Ie?Ye.data=Ie:(Ie=Eh(i),Ie!==null&&(Ye.data=Ie)))),(Ie=ov?cv(e,i):uv(e,i))&&(Ye=ra(re,"onBeforeInput"),0<Ye.length&&(Ae=new yh("onBeforeInput","beforeinput",null,i,fe),ge.push({event:Ae,listeners:Ye}),Ae.data=Ie)),t0(ge,e,re,i,fe)}up(ge,t)})}function js(e,t,i){return{instance:e,listener:t,currentTarget:i}}function ra(e,t){for(var i=t+"Capture",l=[];e!==null;){var m=e,w=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||w===null||(m=is(e,i),m!=null&&l.unshift(js(e,m,w)),m=is(e,t),m!=null&&l.push(js(e,m,w))),e.tag===3)return l;e=e.return}return[]}function s0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function fp(e,t,i,l,m){for(var w=t._reactName,L=[];i!==null&&i!==l;){var U=i,K=U.alternate,re=U.stateNode;if(U=U.tag,K!==null&&K===l)break;U!==5&&U!==26&&U!==27||re===null||(K=re,m?(re=is(i,w),re!=null&&L.unshift(js(i,re,K))):m||(re=is(i,w),re!=null&&L.push(js(i,re,K)))),i=i.return}L.length!==0&&e.push({event:t,listeners:L})}var l0=/\r\n?/g,a0=/\u0000|\uFFFD/g;function dp(e){return(typeof e=="string"?e:""+e).replace(l0,`
|
|
49
|
+
`).replace(a0,"")}function pp(e,t){return t=dp(t),dp(e)===t}function lt(e,t,i,l,m,w){switch(i){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||ur(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&ur(e,""+l);break;case"className":ol(e,"class",l);break;case"tabIndex":ol(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ol(e,i,l);break;case"style":dh(e,l,w);break;case"data":if(t!=="object"){ol(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=ul(""+l),e.setAttribute(i,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(i,"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 w=="function"&&(i==="formAction"?(t!=="input"&<(e,t,"name",m.name,m,null),lt(e,t,"formEncType",m.formEncType,m,null),lt(e,t,"formMethod",m.formMethod,m,null),lt(e,t,"formTarget",m.formTarget,m,null)):(lt(e,t,"encType",m.encType,m,null),lt(e,t,"method",m.method,m,null),lt(e,t,"target",m.target,m,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=ul(""+l),e.setAttribute(i,l);break;case"onClick":l!=null&&(e.onclick=Un);break;case"onScroll":l!=null&&Ve("scroll",e);break;case"onScrollEnd":l!=null&&Ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(i=l.__html,i!=null){if(m.children!=null)throw Error(o(60));e.innerHTML=i}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}i=ul(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,""+l):e.removeAttribute(i);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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":l===!0?e.setAttribute(i,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,l):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(i,l):e.removeAttribute(i);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(i):e.setAttribute(i,l);break;case"popover":Ve("beforetoggle",e),Ve("toggle",e),al(e,"popover",l);break;case"xlinkActuate":In(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":In(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":In(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":In(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":In(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":In(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":In(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":In(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":In(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":al(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=N_.get(i)||i,al(e,i,l))}}function Rc(e,t,i,l,m,w){switch(i){case"style":dh(e,l,w);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(i=l.__html,i!=null){if(m.children!=null)throw Error(o(60));e.innerHTML=i}}break;case"children":typeof l=="string"?ur(e,l):(typeof l=="number"||typeof l=="bigint")&&ur(e,""+l);break;case"onScroll":l!=null&&Ve("scroll",e);break;case"onScrollEnd":l!=null&&Ve("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Un);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!rh.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(m=i.endsWith("Capture"),t=i.slice(2,m?i.length-7:void 0),w=e[Wt]||null,w=w!=null?w[i]:null,typeof w=="function"&&e.removeEventListener(t,w,m),typeof l=="function")){typeof w!="function"&&w!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,l,m);break e}i in e?e[i]=l:l===!0?e.setAttribute(i,""):al(e,i,l)}}}function Ut(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",e),Ve("load",e);var l=!1,m=!1,w;for(w in i)if(i.hasOwnProperty(w)){var L=i[w];if(L!=null)switch(w){case"src":l=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:lt(e,t,w,L,i,null)}}m&<(e,t,"srcSet",i.srcSet,i,null),l&<(e,t,"src",i.src,i,null);return;case"input":Ve("invalid",e);var U=w=L=m=null,K=null,re=null;for(l in i)if(i.hasOwnProperty(l)){var fe=i[l];if(fe!=null)switch(l){case"name":m=fe;break;case"type":L=fe;break;case"checked":K=fe;break;case"defaultChecked":re=fe;break;case"value":w=fe;break;case"defaultValue":U=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(o(137,t));break;default:lt(e,t,l,fe,i,null)}}ch(e,w,U,K,re,L,m,!1);return;case"select":Ve("invalid",e),l=L=w=null;for(m in i)if(i.hasOwnProperty(m)&&(U=i[m],U!=null))switch(m){case"value":w=U;break;case"defaultValue":L=U;break;case"multiple":l=U;default:lt(e,t,m,U,i,null)}t=w,i=L,e.multiple=!!l,t!=null?cr(e,!!l,t,!1):i!=null&&cr(e,!!l,i,!0);return;case"textarea":Ve("invalid",e),w=m=l=null;for(L in i)if(i.hasOwnProperty(L)&&(U=i[L],U!=null))switch(L){case"value":l=U;break;case"defaultValue":m=U;break;case"children":w=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(o(91));break;default:lt(e,t,L,U,i,null)}hh(e,l,m,w);return;case"option":for(K in i)if(i.hasOwnProperty(K)&&(l=i[K],l!=null))switch(K){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:lt(e,t,K,l,i,null)}return;case"dialog":Ve("beforetoggle",e),Ve("toggle",e),Ve("cancel",e),Ve("close",e);break;case"iframe":case"object":Ve("load",e);break;case"video":case"audio":for(l=0;l<Ns.length;l++)Ve(Ns[l],e);break;case"image":Ve("error",e),Ve("load",e);break;case"details":Ve("toggle",e);break;case"embed":case"source":case"link":Ve("error",e),Ve("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(re in i)if(i.hasOwnProperty(re)&&(l=i[re],l!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:lt(e,t,re,l,i,null)}return;default:if(qa(t)){for(fe in i)i.hasOwnProperty(fe)&&(l=i[fe],l!==void 0&&Rc(e,t,fe,l,i,void 0));return}}for(U in i)i.hasOwnProperty(U)&&(l=i[U],l!=null&<(e,t,U,l,i,null))}function o0(e,t,i,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,w=null,L=null,U=null,K=null,re=null,fe=null;for(oe in i){var ge=i[oe];if(i.hasOwnProperty(oe)&&ge!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":K=ge;default:l.hasOwnProperty(oe)||lt(e,t,oe,null,l,ge)}}for(var se in l){var oe=l[se];if(ge=i[se],l.hasOwnProperty(se)&&(oe!=null||ge!=null))switch(se){case"type":w=oe;break;case"name":m=oe;break;case"checked":re=oe;break;case"defaultChecked":fe=oe;break;case"value":L=oe;break;case"defaultValue":U=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(o(137,t));break;default:oe!==ge&<(e,t,se,oe,l,ge)}}Pa(e,L,U,K,re,fe,w,m);return;case"select":oe=L=U=se=null;for(w in i)if(K=i[w],i.hasOwnProperty(w)&&K!=null)switch(w){case"value":break;case"multiple":oe=K;default:l.hasOwnProperty(w)||lt(e,t,w,null,l,K)}for(m in l)if(w=l[m],K=i[m],l.hasOwnProperty(m)&&(w!=null||K!=null))switch(m){case"value":se=w;break;case"defaultValue":U=w;break;case"multiple":L=w;default:w!==K&<(e,t,m,w,l,K)}t=U,i=L,l=oe,se!=null?cr(e,!!i,se,!1):!!l!=!!i&&(t!=null?cr(e,!!i,t,!0):cr(e,!!i,i?[]:"",!1));return;case"textarea":oe=se=null;for(U in i)if(m=i[U],i.hasOwnProperty(U)&&m!=null&&!l.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:lt(e,t,U,null,l,m)}for(L in l)if(m=l[L],w=i[L],l.hasOwnProperty(L)&&(m!=null||w!=null))switch(L){case"value":se=m;break;case"defaultValue":oe=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(o(91));break;default:m!==w&<(e,t,L,m,l,w)}uh(e,se,oe);return;case"option":for(var Ee in i)if(se=i[Ee],i.hasOwnProperty(Ee)&&se!=null&&!l.hasOwnProperty(Ee))switch(Ee){case"selected":e.selected=!1;break;default:lt(e,t,Ee,null,l,se)}for(K in l)if(se=l[K],oe=i[K],l.hasOwnProperty(K)&&se!==oe&&(se!=null||oe!=null))switch(K){case"selected":e.selected=se&&typeof se!="function"&&typeof se!="symbol";break;default:lt(e,t,K,se,l,oe)}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 Be in i)se=i[Be],i.hasOwnProperty(Be)&&se!=null&&!l.hasOwnProperty(Be)&<(e,t,Be,null,l,se);for(re in l)if(se=l[re],oe=i[re],l.hasOwnProperty(re)&&se!==oe&&(se!=null||oe!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(o(137,t));break;default:lt(e,t,re,se,l,oe)}return;default:if(qa(t)){for(var at in i)se=i[at],i.hasOwnProperty(at)&&se!==void 0&&!l.hasOwnProperty(at)&&Rc(e,t,at,void 0,l,se);for(fe in l)se=l[fe],oe=i[fe],!l.hasOwnProperty(fe)||se===oe||se===void 0&&oe===void 0||Rc(e,t,fe,se,l,oe);return}}for(var ee in i)se=i[ee],i.hasOwnProperty(ee)&&se!=null&&!l.hasOwnProperty(ee)&<(e,t,ee,null,l,se);for(ge in l)se=l[ge],oe=i[ge],!l.hasOwnProperty(ge)||se===oe||se==null&&oe==null||lt(e,t,ge,se,l,oe)}function mp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function c0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),l=0;l<i.length;l++){var m=i[l],w=m.transferSize,L=m.initiatorType,U=m.duration;if(w&&U&&mp(L)){for(L=0,U=m.responseEnd,l+=1;l<i.length;l++){var K=i[l],re=K.startTime;if(re>U)break;var fe=K.transferSize,ge=K.initiatorType;fe&&mp(ge)&&(K=K.responseEnd,L+=fe*(K<U?1:(U-re)/(K-re)))}if(--l,t+=8*(w+L)/(m.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Mc=null,Lc=null;function sa(e){return e.nodeType===9?e:e.ownerDocument}function gp(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function _p(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Oc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Bc=null;function u0(){var e=window.event;return e&&e.type==="popstate"?e===Bc?!1:(Bc=e,!0):(Bc=null,!1)}var vp=typeof setTimeout=="function"?setTimeout:void 0,h0=typeof clearTimeout=="function"?clearTimeout:void 0,yp=typeof Promise=="function"?Promise:void 0,f0=typeof queueMicrotask=="function"?queueMicrotask:typeof yp<"u"?function(e){return yp.resolve(null).then(e).catch(d0)}:vp;function d0(e){setTimeout(function(){throw e})}function Ci(e){return e==="head"}function Sp(e,t){var i=t,l=0;do{var m=i.nextSibling;if(e.removeChild(i),m&&m.nodeType===8)if(i=m.data,i==="/$"||i==="/&"){if(l===0){e.removeChild(m),Pr(t);return}l--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")l++;else if(i==="html")zs(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,zs(i);for(var w=i.firstChild;w;){var L=w.nextSibling,U=w.nodeName;w[ts]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&w.rel.toLowerCase()==="stylesheet"||i.removeChild(w),w=L}}else i==="body"&&zs(e.ownerDocument.body);i=m}while(i);Pr(t)}function bp(e,t){var i=e;e=0;do{var l=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),l&&l.nodeType===8)if(i=l.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=l}while(i)}function Nc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Nc(i),Ia(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function p0(e,t,i,l){for(;e.nodeType===1;){var m=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[ts])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(w=e.getAttribute("rel"),w==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(w!==m.rel||e.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||e.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||e.getAttribute("title")!==(m.title==null?null:m.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(w=e.getAttribute("src"),(w!==(m.src==null?null:m.src)||e.getAttribute("type")!==(m.type==null?null:m.type)||e.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&w&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var w=m.name==null?null:""+m.name;if(m.type==="hidden"&&e.getAttribute("name")===w)return e}else return e;if(e=bn(e.nextSibling),e===null)break}return null}function m0(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=bn(e.nextSibling),e===null))return null;return e}function Cp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=bn(e.nextSibling),e===null))return null;return e}function jc(e){return e.data==="$?"||e.data==="$~"}function zc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function g0(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var l=function(){t(),i.removeEventListener("DOMContentLoaded",l)};i.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function bn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Hc=null;function wp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return bn(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function xp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function Ep(e,t,i){switch(t=sa(i),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function zs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ia(e)}var Cn=new Map,kp=new Set;function la(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ni=X.d;X.d={f:_0,r:v0,D:y0,C:S0,L:b0,m:C0,X:x0,S:w0,M:E0};function _0(){var e=ni.f(),t=Ql();return e||t}function v0(e){var t=lr(e);t!==null&&t.tag===5&&t.type==="form"?qf(t):ni.r(e)}var Hr=typeof document>"u"?null:document;function Ap(e,t,i){var l=Hr;if(l&&typeof t=="string"&&t){var m=pn(t);m='link[rel="'+e+'"][href="'+m+'"]',typeof i=="string"&&(m+='[crossorigin="'+i+'"]'),kp.has(m)||(kp.add(m),e={rel:e,crossOrigin:i,href:t},l.querySelector(m)===null&&(t=l.createElement("link"),Ut(t,"link",e),Lt(t),l.head.appendChild(t)))}}function y0(e){ni.D(e),Ap("dns-prefetch",e,null)}function S0(e,t){ni.C(e,t),Ap("preconnect",e,t)}function b0(e,t,i){ni.L(e,t,i);var l=Hr;if(l&&e&&t){var m='link[rel="preload"][as="'+pn(t)+'"]';t==="image"&&i&&i.imageSrcSet?(m+='[imagesrcset="'+pn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(m+='[imagesizes="'+pn(i.imageSizes)+'"]')):m+='[href="'+pn(e)+'"]';var w=m;switch(t){case"style":w=Ir(e);break;case"script":w=Ur(e)}Cn.has(w)||(e=u({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Cn.set(w,e),l.querySelector(m)!==null||t==="style"&&l.querySelector(Hs(w))||t==="script"&&l.querySelector(Is(w))||(t=l.createElement("link"),Ut(t,"link",e),Lt(t),l.head.appendChild(t)))}}function C0(e,t){ni.m(e,t);var i=Hr;if(i&&e){var l=t&&typeof t.as=="string"?t.as:"script",m='link[rel="modulepreload"][as="'+pn(l)+'"][href="'+pn(e)+'"]',w=m;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=Ur(e)}if(!Cn.has(w)&&(e=u({rel:"modulepreload",href:e},t),Cn.set(w,e),i.querySelector(m)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Is(w)))return}l=i.createElement("link"),Ut(l,"link",e),Lt(l),i.head.appendChild(l)}}}function w0(e,t,i){ni.S(e,t,i);var l=Hr;if(l&&e){var m=ar(l).hoistableStyles,w=Ir(e);t=t||"default";var L=m.get(w);if(!L){var U={loading:0,preload:null};if(L=l.querySelector(Hs(w)))U.loading=5;else{e=u({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Cn.get(w))&&Ic(e,i);var K=L=l.createElement("link");Lt(K),Ut(K,"link",e),K._p=new Promise(function(re,fe){K.onload=re,K.onerror=fe}),K.addEventListener("load",function(){U.loading|=1}),K.addEventListener("error",function(){U.loading|=2}),U.loading|=4,aa(L,t,l)}L={type:"stylesheet",instance:L,count:1,state:U},m.set(w,L)}}}function x0(e,t){ni.X(e,t);var i=Hr;if(i&&e){var l=ar(i).hoistableScripts,m=Ur(e),w=l.get(m);w||(w=i.querySelector(Is(m)),w||(e=u({src:e,async:!0},t),(t=Cn.get(m))&&Uc(e,t),w=i.createElement("script"),Lt(w),Ut(w,"link",e),i.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},l.set(m,w))}}function E0(e,t){ni.M(e,t);var i=Hr;if(i&&e){var l=ar(i).hoistableScripts,m=Ur(e),w=l.get(m);w||(w=i.querySelector(Is(m)),w||(e=u({src:e,async:!0,type:"module"},t),(t=Cn.get(m))&&Uc(e,t),w=i.createElement("script"),Lt(w),Ut(w,"link",e),i.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},l.set(m,w))}}function Tp(e,t,i,l){var m=(m=me.current)?la(m):null;if(!m)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Ir(i.href),i=ar(m).hoistableStyles,l=i.get(t),l||(l={type:"style",instance:null,count:0,state:null},i.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Ir(i.href);var w=ar(m).hoistableStyles,L=w.get(e);if(L||(m=m.ownerDocument||m,L={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(e,L),(w=m.querySelector(Hs(e)))&&!w._p&&(L.instance=w,L.state.loading=5),Cn.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Cn.set(e,i),w||k0(m,e,i,L.state))),t&&l===null)throw Error(o(528,""));return L}if(t&&l!==null)throw Error(o(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ur(i),i=ar(m).hoistableScripts,l=i.get(t),l||(l={type:"script",instance:null,count:0,state:null},i.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Ir(e){return'href="'+pn(e)+'"'}function Hs(e){return'link[rel="stylesheet"]['+e+"]"}function Dp(e){return u({},e,{"data-precedence":e.precedence,precedence:null})}function k0(e,t,i,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Ut(t,"link",i),Lt(t),e.head.appendChild(t))}function Ur(e){return'[src="'+pn(e)+'"]'}function Is(e){return"script[async]"+e}function Rp(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+pn(i.href)+'"]');if(l)return t.instance=l,Lt(l),l;var m=u({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Lt(l),Ut(l,"style",m),aa(l,i.precedence,e),t.instance=l;case"stylesheet":m=Ir(i.href);var w=e.querySelector(Hs(m));if(w)return t.state.loading|=4,t.instance=w,Lt(w),w;l=Dp(i),(m=Cn.get(m))&&Ic(l,m),w=(e.ownerDocument||e).createElement("link"),Lt(w);var L=w;return L._p=new Promise(function(U,K){L.onload=U,L.onerror=K}),Ut(w,"link",l),t.state.loading|=4,aa(w,i.precedence,e),t.instance=w;case"script":return w=Ur(i.src),(m=e.querySelector(Is(w)))?(t.instance=m,Lt(m),m):(l=i,(m=Cn.get(w))&&(l=u({},i),Uc(l,m)),e=e.ownerDocument||e,m=e.createElement("script"),Lt(m),Ut(m,"link",l),e.head.appendChild(m),t.instance=m);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,aa(l,i.precedence,e));return t.instance}function aa(e,t,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=l.length?l[l.length-1]:null,w=m,L=0;L<l.length;L++){var U=l[L];if(U.dataset.precedence===t)w=U;else if(w!==m)break}w?w.parentNode.insertBefore(e,w.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Ic(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Uc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var oa=null;function Mp(e,t,i){if(oa===null){var l=new Map,m=oa=new Map;m.set(i,l)}else m=oa,l=m.get(i),l||(l=new Map,m.set(i,l));if(l.has(e))return l;for(l.set(e,null),i=i.getElementsByTagName(e),m=0;m<i.length;m++){var w=i[m];if(!(w[ts]||w[jt]||e==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var L=w.getAttribute(t)||"";L=e+L;var U=l.get(L);U?U.push(w):l.set(L,[w])}}return l}function Lp(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function A0(e,t,i){if(i===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Op(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function T0(e,t,i,l){if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var m=Ir(l.href),w=t.querySelector(Hs(m));if(w){t=w._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ca.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=w,Lt(w);return}w=t.ownerDocument||t,l=Dp(l),(m=Cn.get(m))&&Ic(l,m),w=w.createElement("link"),Lt(w);var L=w;L._p=new Promise(function(U,K){L.onload=U,L.onerror=K}),Ut(w,"link",l),i.instance=w}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=ca.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Pc=0;function D0(e,t){return e.stylesheets&&e.count===0&&ha(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var l=setTimeout(function(){if(e.stylesheets&&ha(e,e.stylesheets),e.unsuspend){var w=e.unsuspend;e.unsuspend=null,w()}},6e4+t);0<e.imgBytes&&Pc===0&&(Pc=62500*c0());var m=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ha(e,e.stylesheets),e.unsuspend)){var w=e.unsuspend;e.unsuspend=null,w()}},(e.imgBytes>Pc?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(m)}}:null}function ca(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ha(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ua=null;function ha(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ua=new Map,t.forEach(R0,e),ua=null,ca.call(e))}function R0(e,t){if(!(t.state.loading&4)){var i=ua.get(e);if(i)var l=i.get(null);else{i=new Map,ua.set(e,i);for(var m=e.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<m.length;w++){var L=m[w];(L.nodeName==="LINK"||L.getAttribute("media")!=="not all")&&(i.set(L.dataset.precedence,L),l=L)}l&&i.set(null,l)}m=t.instance,L=m.getAttribute("data-precedence"),w=i.get(L)||l,w===l&&i.set(null,m),i.set(L,m),this.count++,l=ca.bind(this),m.addEventListener("load",l),m.addEventListener("error",l),w?w.parentNode.insertBefore(m,w.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(m,e.firstChild)),t.state.loading|=4}}var Us={$$typeof:y,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function M0(e,t,i,l,m,w,L,U,K){this.tag=1,this.containerInfo=e,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=Jr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jr(0),this.hiddenUpdates=Jr(null),this.identifierPrefix=l,this.onUncaughtError=m,this.onCaughtError=w,this.onRecoverableError=L,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function Bp(e,t,i,l,m,w,L,U,K,re,fe,ge){return e=new M0(e,t,i,L,K,re,fe,ge,U),t=1,w===!0&&(t|=24),w=sn(3,null,null,t),e.current=w,w.stateNode=e,t=So(),t.refCount++,e.pooledCache=t,t.refCount++,w.memoizedState={element:l,isDehydrated:i,cache:t},xo(w),e}function Np(e){return e?(e=_r,e):_r}function jp(e,t,i,l,m,w){m=Np(m),l.context===null?l.context=m:l.pendingContext=m,l=hi(t),l.payload={element:i},w=w===void 0?null:w,w!==null&&(l.callback=w),i=fi(e,l,t),i!==null&&(en(i,e,t),vs(i,e,t))}function zp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Fc(e,t){zp(e,t),(e=e.alternate)&&zp(e,t)}function Hp(e){if(e.tag===13||e.tag===31){var t=Ui(e,67108864);t!==null&&en(t,e,67108864),Fc(e,67108864)}}function Ip(e){if(e.tag===13||e.tag===31){var t=un();t=le(t);var i=Ui(e,t);i!==null&&en(i,e,t),Fc(e,t)}}var fa=!0;function L0(e,t,i,l){var m=G.T;G.T=null;var w=X.p;try{X.p=2,qc(e,t,i,l)}finally{X.p=w,G.T=m}}function O0(e,t,i,l){var m=G.T;G.T=null;var w=X.p;try{X.p=8,qc(e,t,i,l)}finally{X.p=w,G.T=m}}function qc(e,t,i,l){if(fa){var m=Vc(l);if(m===null)Dc(e,t,l,da,i),Pp(e,l);else if(N0(m,e,t,i,l))l.stopPropagation();else if(Pp(e,l),t&4&&-1<B0.indexOf(e)){for(;m!==null;){var w=lr(m);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var L=xn(w.pendingLanes);if(L!==0){var U=w;for(U.pendingLanes|=2,U.entangledLanes|=2;L;){var K=1<<31-Ne(L);U.entanglements[1]|=K,L&=~K}On(w),(et&6)===0&&(Kl=tt()+500,Bs(0))}}break;case 31:case 13:U=Ui(w,2),U!==null&&en(U,w,2),Ql(),Fc(w,2)}if(w=Vc(l),w===null&&Dc(e,t,l,da,i),w===m)break;m=w}m!==null&&l.stopPropagation()}else Dc(e,t,l,null,i)}}function Vc(e){return e=Ga(e),Gc(e)}var da=null;function Gc(e){if(da=null,e=sr(e),e!==null){var t=v(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=f(t),e!==null)return e;e=null}else if(i===31){if(e=a(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return da=e,null}function Up(e){switch(e){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(Je()){case ue:return 2;case Se:return 8;case we:case Me:return 32;case je:return 268435456;default:return 32}default:return 32}}var $c=!1,wi=null,xi=null,Ei=null,Ps=new Map,Fs=new Map,ki=[],B0="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 Pp(e,t){switch(e){case"focusin":case"focusout":wi=null;break;case"dragenter":case"dragleave":xi=null;break;case"mouseover":case"mouseout":Ei=null;break;case"pointerover":case"pointerout":Ps.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fs.delete(t.pointerId)}}function qs(e,t,i,l,m,w){return e===null||e.nativeEvent!==w?(e={blockedOn:t,domEventName:i,eventSystemFlags:l,nativeEvent:w,targetContainers:[m]},t!==null&&(t=lr(t),t!==null&&Hp(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,m!==null&&t.indexOf(m)===-1&&t.push(m),e)}function N0(e,t,i,l,m){switch(t){case"focusin":return wi=qs(wi,e,t,i,l,m),!0;case"dragenter":return xi=qs(xi,e,t,i,l,m),!0;case"mouseover":return Ei=qs(Ei,e,t,i,l,m),!0;case"pointerover":var w=m.pointerId;return Ps.set(w,qs(Ps.get(w)||null,e,t,i,l,m)),!0;case"gotpointercapture":return w=m.pointerId,Fs.set(w,qs(Fs.get(w)||null,e,t,i,l,m)),!0}return!1}function Fp(e){var t=sr(e.target);if(t!==null){var i=v(t);if(i!==null){if(t=i.tag,t===13){if(t=f(i),t!==null){e.blockedOn=t,Nt(e.priority,function(){Ip(i)});return}}else if(t===31){if(t=a(i),t!==null){e.blockedOn=t,Nt(e.priority,function(){Ip(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function pa(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Vc(e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);Va=l,i.target.dispatchEvent(l),Va=null}else return t=lr(i),t!==null&&Hp(t),e.blockedOn=i,!1;t.shift()}return!0}function qp(e,t,i){pa(e)&&i.delete(t)}function j0(){$c=!1,wi!==null&&pa(wi)&&(wi=null),xi!==null&&pa(xi)&&(xi=null),Ei!==null&&pa(Ei)&&(Ei=null),Ps.forEach(qp),Fs.forEach(qp)}function ma(e,t){e.blockedOn===t&&(e.blockedOn=null,$c||($c=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,j0)))}var ga=null;function Vp(e){ga!==e&&(ga=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){ga===e&&(ga=null);for(var t=0;t<e.length;t+=3){var i=e[t],l=e[t+1],m=e[t+2];if(typeof l!="function"){if(Gc(l||i)===null)continue;break}var w=lr(i);w!==null&&(e.splice(t,3),t-=3,Vo(w,{pending:!0,data:m,method:i.method,action:l},l,m))}}))}function Pr(e){function t(K){return ma(K,e)}wi!==null&&ma(wi,e),xi!==null&&ma(xi,e),Ei!==null&&ma(Ei,e),Ps.forEach(t),Fs.forEach(t);for(var i=0;i<ki.length;i++){var l=ki[i];l.blockedOn===e&&(l.blockedOn=null)}for(;0<ki.length&&(i=ki[0],i.blockedOn===null);)Fp(i),i.blockedOn===null&&ki.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(l=0;l<i.length;l+=3){var m=i[l],w=i[l+1],L=m[Wt]||null;if(typeof w=="function")L||Vp(i);else if(L){var U=null;if(w&&w.hasAttribute("formAction")){if(m=w,L=w[Wt]||null)U=L.formAction;else if(Gc(m)!==null)continue}else U=L.action;typeof U=="function"?i[l+1]=U:(i.splice(l,3),l-=3),Vp(i)}}}function Gp(){function e(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(L){return m=L})},focusReset:"manual",scroll:"manual"})}function t(){m!==null&&(m(),m=null),l||setTimeout(i,20)}function i(){if(!l&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,m=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),m!==null&&(m(),m=null)}}}function Yc(e){this._internalRoot=e}_a.prototype.render=Yc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var i=t.current,l=un();jp(i,l,e,t,null,null)},_a.prototype.unmount=Yc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;jp(e.current,2,null,e,null,null),Ql(),t[rr]=null}};function _a(e){this._internalRoot=e}_a.prototype.unstable_scheduleHydration=function(e){if(e){var t=St();e={blockedOn:null,target:e,priority:t};for(var i=0;i<ki.length&&t!==0&&t<ki[i].priority;i++);ki.splice(i,0,e),i===0&&Fp(e)}};var $p=r.version;if($p!=="19.2.6")throw Error(o(527,$p,"19.2.6"));X.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=h(t),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var z0={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var va=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!va.isDisabled&&va.supportsFiber)try{ke=va.inject(z0),Re=va}catch{}}return Gs.createRoot=function(e,t){if(!d(e))throw Error(o(299));var i=!1,l="",m=Jf,w=ed,L=td;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(m=t.onUncaughtError),t.onCaughtError!==void 0&&(w=t.onCaughtError),t.onRecoverableError!==void 0&&(L=t.onRecoverableError)),t=Bp(e,1,!1,null,null,i,l,null,m,w,L,Gp),e[rr]=t.current,Tc(e),new Yc(t)},Gs.hydrateRoot=function(e,t,i){if(!d(e))throw Error(o(299));var l=!1,m="",w=Jf,L=ed,U=td,K=null;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(m=i.identifierPrefix),i.onUncaughtError!==void 0&&(w=i.onUncaughtError),i.onCaughtError!==void 0&&(L=i.onCaughtError),i.onRecoverableError!==void 0&&(U=i.onRecoverableError),i.formState!==void 0&&(K=i.formState)),t=Bp(e,1,!0,t,i??null,l,m,K,w,L,U,Gp),t.context=Np(null),i=t.current,l=un(),l=le(l),m=hi(l),m.callback=null,fi(i,m,l),i=l,t.current.lanes=i,Ni(t,i),On(t),e[rr]=t.current,Tc(e),new _a(t)},Gs.version="19.2.6",Gs}var im;function K0(){if(im)return Xc.exports;im=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Xc.exports=W0(),Xc.exports}var X0=K0();const Kr=function(n,r){let d=n;const v=Xs[r];let f=null,a=0,c=null;const h=[],p={},u=function(T,E){a=d*4+17,f=(function(R){const B=new Array(R);for(let H=0;H<R;H+=1){B[H]=new Array(R);for(let P=0;P<R;P+=1)B[H][P]=null}return B})(a),S(0,0),S(a-7,0),S(0,a-7),x(),A(),_(T,E),d>=7&&b(T),c==null&&(c=k(d,v,h)),g(c,E)},S=function(T,E){for(let R=-1;R<=7;R+=1)if(!(T+R<=-1||a<=T+R))for(let B=-1;B<=7;B+=1)E+B<=-1||a<=E+B||(0<=R&&R<=6&&(B==0||B==6)||0<=B&&B<=6&&(R==0||R==6)||2<=R&&R<=4&&2<=B&&B<=4?f[T+R][E+B]=!0:f[T+R][E+B]=!1)},C=function(){let T=0,E=0;for(let R=0;R<8;R+=1){u(!0,R);const B=Di.getLostPoint(p);(R==0||T>B)&&(T=B,E=R)}return E},A=function(){for(let T=8;T<a-8;T+=1)f[T][6]==null&&(f[T][6]=T%2==0);for(let T=8;T<a-8;T+=1)f[6][T]==null&&(f[6][T]=T%2==0)},x=function(){const T=Di.getPatternPosition(d);for(let E=0;E<T.length;E+=1)for(let R=0;R<T.length;R+=1){const B=T[E],H=T[R];if(f[B][H]==null)for(let P=-2;P<=2;P+=1)for(let F=-2;F<=2;F+=1)P==-2||P==2||F==-2||F==2||P==0&&F==0?f[B+P][H+F]=!0:f[B+P][H+F]=!1}},b=function(T){const E=Di.getBCHTypeNumber(d);for(let R=0;R<18;R+=1){const B=!T&&(E>>R&1)==1;f[Math.floor(R/3)][R%3+a-8-3]=B}for(let R=0;R<18;R+=1){const B=!T&&(E>>R&1)==1;f[R%3+a-8-3][Math.floor(R/3)]=B}},_=function(T,E){const R=v<<3|E,B=Di.getBCHTypeInfo(R);for(let H=0;H<15;H+=1){const P=!T&&(B>>H&1)==1;H<6?f[H][8]=P:H<8?f[H+1][8]=P:f[a-15+H][8]=P}for(let H=0;H<15;H+=1){const P=!T&&(B>>H&1)==1;H<8?f[8][a-H-1]=P:H<9?f[8][15-H-1+1]=P:f[8][15-H-1]=P}f[a-8][8]=!T},g=function(T,E){let R=-1,B=a-1,H=7,P=0;const F=Di.getMaskFunction(E);for(let $=a-1;$>0;$-=2)for($==6&&($-=1);;){for(let W=0;W<2;W+=1)if(f[B][$-W]==null){let G=!1;P<T.length&&(G=(T[P]>>>H&1)==1),F(B,$-W)&&(G=!G),f[B][$-W]=G,H-=1,H==-1&&(P+=1,H=7)}if(B+=R,B<0||a<=B){B-=R,R=-R;break}}},y=function(T,E){let R=0,B=0,H=0;const P=new Array(E.length),F=new Array(E.length);for(let X=0;X<E.length;X+=1){const te=E[X].dataCount,z=E[X].totalCount-te;B=Math.max(B,te),H=Math.max(H,z),P[X]=new Array(te);for(let I=0;I<P[X].length;I+=1)P[X][I]=255&T.getBuffer()[I+R];R+=te;const O=Di.getErrorCorrectPolynomial(z),V=el(P[X],O.getLength()-1).mod(O);F[X]=new Array(O.getLength()-1);for(let I=0;I<F[X].length;I+=1){const ne=I+V.getLength()-F[X].length;F[X][I]=ne>=0?V.getAt(ne):0}}let $=0;for(let X=0;X<E.length;X+=1)$+=E[X].totalCount;const W=new Array($);let G=0;for(let X=0;X<B;X+=1)for(let te=0;te<E.length;te+=1)X<P[te].length&&(W[G]=P[te][X],G+=1);for(let X=0;X<H;X+=1)for(let te=0;te<E.length;te+=1)X<F[te].length&&(W[G]=F[te][X],G+=1);return W},k=function(T,E,R){const B=rm.getRSBlocks(T,E),H=sm();for(let F=0;F<R.length;F+=1){const $=R[F];H.put($.getMode(),4),H.put($.getLength(),Di.getLengthInBits($.getMode(),T)),$.write(H)}let P=0;for(let F=0;F<B.length;F+=1)P+=B[F].dataCount;if(H.getLengthInBits()>P*8)throw"code length overflow. ("+H.getLengthInBits()+">"+P*8+")";for(H.getLengthInBits()+4<=P*8&&H.put(0,4);H.getLengthInBits()%8!=0;)H.putBit(!1);for(;!(H.getLengthInBits()>=P*8||(H.put(236,8),H.getLengthInBits()>=P*8));)H.put(17,8);return y(H,B)};p.addData=function(T,E){E=E||"Byte";let R=null;switch(E){case"Numeric":R=Q0(T);break;case"Alphanumeric":R=Z0(T);break;case"Byte":R=J0(T);break;case"Kanji":R=e1(T);break;default:throw"mode:"+E}h.push(R),c=null},p.isDark=function(T,E){if(T<0||a<=T||E<0||a<=E)throw T+","+E;return f[T][E]},p.getModuleCount=function(){return a},p.make=function(){if(d<1){let T=1;for(;T<40;T++){const E=rm.getRSBlocks(T,v),R=sm();for(let H=0;H<h.length;H++){const P=h[H];R.put(P.getMode(),4),R.put(P.getLength(),Di.getLengthInBits(P.getMode(),T)),P.write(R)}let B=0;for(let H=0;H<E.length;H++)B+=E[H].dataCount;if(R.getLengthInBits()<=B*8)break}d=T}u(!1,C())},p.createTableTag=function(T,E){T=T||2,E=typeof E>"u"?T*4:E;let R="";R+='<table style="',R+=" border-width: 0px; border-style: none;",R+=" border-collapse: collapse;",R+=" padding: 0px; margin: "+E+"px;",R+='">',R+="<tbody>";for(let B=0;B<p.getModuleCount();B+=1){R+="<tr>";for(let H=0;H<p.getModuleCount();H+=1)R+='<td style="',R+=" border-width: 0px; border-style: none;",R+=" border-collapse: collapse;",R+=" padding: 0px; margin: 0px;",R+=" width: "+T+"px;",R+=" height: "+T+"px;",R+=" background-color: ",R+=p.isDark(B,H)?"#000000":"#ffffff",R+=";",R+='"/>';R+="</tr>"}return R+="</tbody>",R+="</table>",R},p.createSvgTag=function(T,E,R,B){let H={};typeof arguments[0]=="object"&&(H=arguments[0],T=H.cellSize,E=H.margin,R=H.alt,B=H.title),T=T||2,E=typeof E>"u"?T*4:E,R=typeof R=="string"?{text:R}:R||{},R.text=R.text||null,R.id=R.text?R.id||"qrcode-description":null,B=typeof B=="string"?{text:B}:B||{},B.text=B.text||null,B.id=B.text?B.id||"qrcode-title":null;const P=p.getModuleCount()*T+E*2;let F,$,W,G,X="",te;for(te="l"+T+",0 0,"+T+" -"+T+",0 0,-"+T+"z ",X+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',X+=H.scalable?"":' width="'+P+'px" height="'+P+'px"',X+=' viewBox="0 0 '+P+" "+P+'" ',X+=' preserveAspectRatio="xMinYMin meet"',X+=B.text||R.text?' role="img" aria-labelledby="'+M([B.id,R.id].join(" ").trim())+'"':"",X+=">",X+=B.text?'<title id="'+M(B.id)+'">'+M(B.text)+"</title>":"",X+=R.text?'<description id="'+M(R.id)+'">'+M(R.text)+"</description>":"",X+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',X+='<path d="',W=0;W<p.getModuleCount();W+=1)for(G=W*T+E,F=0;F<p.getModuleCount();F+=1)p.isDark(W,F)&&($=F*T+E,X+="M"+$+","+G+te);return X+='" stroke="transparent" fill="black"/>',X+="</svg>",X},p.createDataURL=function(T,E){T=T||2,E=typeof E>"u"?T*4:E;const R=p.getModuleCount()*T+E*2,B=E,H=R-E;return r1(R,R,function(P,F){if(B<=P&&P<H&&B<=F&&F<H){const $=Math.floor((P-B)/T),W=Math.floor((F-B)/T);return p.isDark(W,$)?0:1}else return 1})},p.createImgTag=function(T,E,R){T=T||2,E=typeof E>"u"?T*4:E;const B=p.getModuleCount()*T+E*2;let H="";return H+="<img",H+=' src="',H+=p.createDataURL(T,E),H+='"',H+=' width="',H+=B,H+='"',H+=' height="',H+=B,H+='"',R&&(H+=' alt="',H+=M(R),H+='"'),H+="/>",H};const M=function(T){let E="";for(let R=0;R<T.length;R+=1){const B=T.charAt(R);switch(B){case"<":E+="<";break;case">":E+=">";break;case"&":E+="&";break;case'"':E+=""";break;default:E+=B;break}}return E},D=function(T){T=typeof T>"u"?2:T;const R=p.getModuleCount()*1+T*2,B=T,H=R-T;let P,F,$,W,G;const X={"██":"█","█ ":"▀"," █":"▄"," ":" "},te={"██":"▀","█ ":"▀"," █":" "," ":" "};let z="";for(P=0;P<R;P+=2){for($=Math.floor((P-B)/1),W=Math.floor((P+1-B)/1),F=0;F<R;F+=1)G="█",B<=F&&F<H&&B<=P&&P<H&&p.isDark($,Math.floor((F-B)/1))&&(G=" "),B<=F&&F<H&&B<=P+1&&P+1<H&&p.isDark(W,Math.floor((F-B)/1))?G+=" ":G+="█",z+=T<1&&P+1>=H?te[G]:X[G];z+=`
|
|
50
|
+
`}return R%2&&T>0?z.substring(0,z.length-R-1)+Array(R+1).join("▀"):z.substring(0,z.length-1)};return p.createASCII=function(T,E){if(T=T||1,T<2)return D(E);T-=1,E=typeof E>"u"?T*2:E;const R=p.getModuleCount()*T+E*2,B=E,H=R-E;let P,F,$,W;const G=Array(T+1).join("██"),X=Array(T+1).join(" ");let te="",z="";for(P=0;P<R;P+=1){for($=Math.floor((P-B)/T),z="",F=0;F<R;F+=1)W=1,B<=F&&F<H&&B<=P&&P<H&&p.isDark($,Math.floor((F-B)/T))&&(W=0),z+=W?G:X;for($=0;$<T;$+=1)te+=z+`
|
|
51
|
+
`}return te.substring(0,te.length-1)},p.renderTo2dContext=function(T,E){E=E||2;const R=p.getModuleCount();for(let B=0;B<R;B++)for(let H=0;H<R;H++)T.fillStyle=p.isDark(B,H)?"black":"white",T.fillRect(H*E,B*E,E,E)},p};Kr.stringToBytes=function(n){const r=[];for(let s=0;s<n.length;s+=1){const o=n.charCodeAt(s);r.push(o&255)}return r};Kr.createStringToBytes=function(n,r){const s=(function(){const d=n1(n),v=function(){const c=d.read();if(c==-1)throw"eof";return c};let f=0;const a={};for(;;){const c=d.read();if(c==-1)break;const h=v(),p=v(),u=v(),S=String.fromCharCode(c<<8|h),C=p<<8|u;a[S]=C,f+=1}if(f!=r)throw f+" != "+r;return a})(),o=63;return function(d){const v=[];for(let f=0;f<d.length;f+=1){const a=d.charCodeAt(f);if(a<128)v.push(a);else{const c=s[d.charAt(f)];typeof c=="number"?(c&255)==c?v.push(c):(v.push(c>>>8),v.push(c&255)):v.push(o)}}return v}};const Ft={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Xs={L:1,M:0,Q:3,H:2},Ti={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Di=(function(){const n=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],r=1335,s=7973,o=21522,d={},v=function(f){let a=0;for(;f!=0;)a+=1,f>>>=1;return a};return d.getBCHTypeInfo=function(f){let a=f<<10;for(;v(a)-v(r)>=0;)a^=r<<v(a)-v(r);return(f<<10|a)^o},d.getBCHTypeNumber=function(f){let a=f<<12;for(;v(a)-v(s)>=0;)a^=s<<v(a)-v(s);return f<<12|a},d.getPatternPosition=function(f){return n[f-1]},d.getMaskFunction=function(f){switch(f){case Ti.PATTERN000:return function(a,c){return(a+c)%2==0};case Ti.PATTERN001:return function(a,c){return a%2==0};case Ti.PATTERN010:return function(a,c){return c%3==0};case Ti.PATTERN011:return function(a,c){return(a+c)%3==0};case Ti.PATTERN100:return function(a,c){return(Math.floor(a/2)+Math.floor(c/3))%2==0};case Ti.PATTERN101:return function(a,c){return a*c%2+a*c%3==0};case Ti.PATTERN110:return function(a,c){return(a*c%2+a*c%3)%2==0};case Ti.PATTERN111:return function(a,c){return(a*c%3+(a+c)%2)%2==0};default:throw"bad maskPattern:"+f}},d.getErrorCorrectPolynomial=function(f){let a=el([1],0);for(let c=0;c<f;c+=1)a=a.multiply(el([1,Li.gexp(c)],0));return a},d.getLengthInBits=function(f,a){if(1<=a&&a<10)switch(f){case Ft.MODE_NUMBER:return 10;case Ft.MODE_ALPHA_NUM:return 9;case Ft.MODE_8BIT_BYTE:return 8;case Ft.MODE_KANJI:return 8;default:throw"mode:"+f}else if(a<27)switch(f){case Ft.MODE_NUMBER:return 12;case Ft.MODE_ALPHA_NUM:return 11;case Ft.MODE_8BIT_BYTE:return 16;case Ft.MODE_KANJI:return 10;default:throw"mode:"+f}else if(a<41)switch(f){case Ft.MODE_NUMBER:return 14;case Ft.MODE_ALPHA_NUM:return 13;case Ft.MODE_8BIT_BYTE:return 16;case Ft.MODE_KANJI:return 12;default:throw"mode:"+f}else throw"type:"+a},d.getLostPoint=function(f){const a=f.getModuleCount();let c=0;for(let u=0;u<a;u+=1)for(let S=0;S<a;S+=1){let C=0;const A=f.isDark(u,S);for(let x=-1;x<=1;x+=1)if(!(u+x<0||a<=u+x))for(let b=-1;b<=1;b+=1)S+b<0||a<=S+b||x==0&&b==0||A==f.isDark(u+x,S+b)&&(C+=1);C>5&&(c+=3+C-5)}for(let u=0;u<a-1;u+=1)for(let S=0;S<a-1;S+=1){let C=0;f.isDark(u,S)&&(C+=1),f.isDark(u+1,S)&&(C+=1),f.isDark(u,S+1)&&(C+=1),f.isDark(u+1,S+1)&&(C+=1),(C==0||C==4)&&(c+=3)}for(let u=0;u<a;u+=1)for(let S=0;S<a-6;S+=1)f.isDark(u,S)&&!f.isDark(u,S+1)&&f.isDark(u,S+2)&&f.isDark(u,S+3)&&f.isDark(u,S+4)&&!f.isDark(u,S+5)&&f.isDark(u,S+6)&&(c+=40);for(let u=0;u<a;u+=1)for(let S=0;S<a-6;S+=1)f.isDark(S,u)&&!f.isDark(S+1,u)&&f.isDark(S+2,u)&&f.isDark(S+3,u)&&f.isDark(S+4,u)&&!f.isDark(S+5,u)&&f.isDark(S+6,u)&&(c+=40);let h=0;for(let u=0;u<a;u+=1)for(let S=0;S<a;S+=1)f.isDark(S,u)&&(h+=1);const p=Math.abs(100*h/a/a-50)/5;return c+=p*10,c},d})(),Li=(function(){const n=new Array(256),r=new Array(256);for(let o=0;o<8;o+=1)n[o]=1<<o;for(let o=8;o<256;o+=1)n[o]=n[o-4]^n[o-5]^n[o-6]^n[o-8];for(let o=0;o<255;o+=1)r[n[o]]=o;const s={};return s.glog=function(o){if(o<1)throw"glog("+o+")";return r[o]},s.gexp=function(o){for(;o<0;)o+=255;for(;o>=256;)o-=255;return n[o]},s})(),el=function(n,r){if(typeof n.length>"u")throw n.length+"/"+r;const s=(function(){let d=0;for(;d<n.length&&n[d]==0;)d+=1;const v=new Array(n.length-d+r);for(let f=0;f<n.length-d;f+=1)v[f]=n[f+d];return v})(),o={};return o.getAt=function(d){return s[d]},o.getLength=function(){return s.length},o.multiply=function(d){const v=new Array(o.getLength()+d.getLength()-1);for(let f=0;f<o.getLength();f+=1)for(let a=0;a<d.getLength();a+=1)v[f+a]^=Li.gexp(Li.glog(o.getAt(f))+Li.glog(d.getAt(a)));return el(v,0)},o.mod=function(d){if(o.getLength()-d.getLength()<0)return o;const v=Li.glog(o.getAt(0))-Li.glog(d.getAt(0)),f=new Array(o.getLength());for(let a=0;a<o.getLength();a+=1)f[a]=o.getAt(a);for(let a=0;a<d.getLength();a+=1)f[a]^=Li.gexp(Li.glog(d.getAt(a))+v);return el(f,0).mod(d)},o},rm=(function(){const n=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],r=function(d,v){const f={};return f.totalCount=d,f.dataCount=v,f},s={},o=function(d,v){switch(v){case Xs.L:return n[(d-1)*4+0];case Xs.M:return n[(d-1)*4+1];case Xs.Q:return n[(d-1)*4+2];case Xs.H:return n[(d-1)*4+3];default:return}};return s.getRSBlocks=function(d,v){const f=o(d,v);if(typeof f>"u")throw"bad rs block @ typeNumber:"+d+"/errorCorrectionLevel:"+v;const a=f.length/3,c=[];for(let h=0;h<a;h+=1){const p=f[h*3+0],u=f[h*3+1],S=f[h*3+2];for(let C=0;C<p;C+=1)c.push(r(u,S))}return c},s})(),sm=function(){const n=[];let r=0;const s={};return s.getBuffer=function(){return n},s.getAt=function(o){const d=Math.floor(o/8);return(n[d]>>>7-o%8&1)==1},s.put=function(o,d){for(let v=0;v<d;v+=1)s.putBit((o>>>d-v-1&1)==1)},s.getLengthInBits=function(){return r},s.putBit=function(o){const d=Math.floor(r/8);n.length<=d&&n.push(0),o&&(n[d]|=128>>>r%8),r+=1},s},Q0=function(n){const r=Ft.MODE_NUMBER,s=n,o={};o.getMode=function(){return r},o.getLength=function(f){return s.length},o.write=function(f){const a=s;let c=0;for(;c+2<a.length;)f.put(d(a.substring(c,c+3)),10),c+=3;c<a.length&&(a.length-c==1?f.put(d(a.substring(c,c+1)),4):a.length-c==2&&f.put(d(a.substring(c,c+2)),7))};const d=function(f){let a=0;for(let c=0;c<f.length;c+=1)a=a*10+v(f.charAt(c));return a},v=function(f){if("0"<=f&&f<="9")return f.charCodeAt(0)-48;throw"illegal char :"+f};return o},Z0=function(n){const r=Ft.MODE_ALPHA_NUM,s=n,o={};o.getMode=function(){return r},o.getLength=function(v){return s.length},o.write=function(v){const f=s;let a=0;for(;a+1<f.length;)v.put(d(f.charAt(a))*45+d(f.charAt(a+1)),11),a+=2;a<f.length&&v.put(d(f.charAt(a)),6)};const d=function(v){if("0"<=v&&v<="9")return v.charCodeAt(0)-48;if("A"<=v&&v<="Z")return v.charCodeAt(0)-65+10;switch(v){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+v}};return o},J0=function(n){const r=Ft.MODE_8BIT_BYTE,s=Kr.stringToBytes(n),o={};return o.getMode=function(){return r},o.getLength=function(d){return s.length},o.write=function(d){for(let v=0;v<s.length;v+=1)d.put(s[v],8)},o},e1=function(n){const r=Ft.MODE_KANJI,s=Kr.stringToBytes;(function(v,f){const a=s(v);if(a.length!=2||(a[0]<<8|a[1])!=f)throw"sjis not supported."})("友",38726);const o=s(n),d={};return d.getMode=function(){return r},d.getLength=function(v){return~~(o.length/2)},d.write=function(v){const f=o;let a=0;for(;a+1<f.length;){let c=(255&f[a])<<8|255&f[a+1];if(33088<=c&&c<=40956)c-=33088;else if(57408<=c&&c<=60351)c-=49472;else throw"illegal char at "+(a+1)+"/"+c;c=(c>>>8&255)*192+(c&255),v.put(c,13),a+=2}if(a<f.length)throw"illegal char at "+(a+1)},d},ag=function(){const n=[],r={};return r.writeByte=function(s){n.push(s&255)},r.writeShort=function(s){r.writeByte(s),r.writeByte(s>>>8)},r.writeBytes=function(s,o,d){o=o||0,d=d||s.length;for(let v=0;v<d;v+=1)r.writeByte(s[v+o])},r.writeString=function(s){for(let o=0;o<s.length;o+=1)r.writeByte(s.charCodeAt(o))},r.toByteArray=function(){return n},r.toString=function(){let s="";s+="[";for(let o=0;o<n.length;o+=1)o>0&&(s+=","),s+=n[o];return s+="]",s},r},t1=function(){let n=0,r=0,s=0,o="";const d={},v=function(a){o+=String.fromCharCode(f(a&63))},f=function(a){if(a<0)throw"n:"+a;if(a<26)return 65+a;if(a<52)return 97+(a-26);if(a<62)return 48+(a-52);if(a==62)return 43;if(a==63)return 47;throw"n:"+a};return d.writeByte=function(a){for(n=n<<8|a&255,r+=8,s+=1;r>=6;)v(n>>>r-6),r-=6},d.flush=function(){if(r>0&&(v(n<<6-r),n=0,r=0),s%3!=0){const a=3-s%3;for(let c=0;c<a;c+=1)o+="="}},d.toString=function(){return o},d},n1=function(n){const r=n;let s=0,o=0,d=0;const v={};v.read=function(){for(;d<8;){if(s>=r.length){if(d==0)return-1;throw"unexpected end of file./"+d}const c=r.charAt(s);if(s+=1,c=="=")return d=0,-1;if(c.match(/^\s$/))continue;o=o<<6|f(c.charCodeAt(0)),d+=6}const a=o>>>d-8&255;return d-=8,a};const f=function(a){if(65<=a&&a<=90)return a-65;if(97<=a&&a<=122)return a-97+26;if(48<=a&&a<=57)return a-48+52;if(a==43)return 62;if(a==47)return 63;throw"c:"+a};return v},i1=function(n,r){const s=n,o=r,d=new Array(n*r),v={};v.setPixel=function(h,p,u){d[p*s+h]=u},v.write=function(h){h.writeString("GIF87a"),h.writeShort(s),h.writeShort(o),h.writeByte(128),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(255),h.writeByte(255),h.writeByte(255),h.writeString(","),h.writeShort(0),h.writeShort(0),h.writeShort(s),h.writeShort(o),h.writeByte(0);const p=2,u=a(p);h.writeByte(p);let S=0;for(;u.length-S>255;)h.writeByte(255),h.writeBytes(u,S,255),S+=255;h.writeByte(u.length-S),h.writeBytes(u,S,u.length-S),h.writeByte(0),h.writeString(";")};const f=function(h){const p=h;let u=0,S=0;const C={};return C.write=function(A,x){if(A>>>x)throw"length over";for(;u+x>=8;)p.writeByte(255&(A<<u|S)),x-=8-u,A>>>=8-u,S=0,u=0;S=A<<u|S,u=u+x},C.flush=function(){u>0&&p.writeByte(S)},C},a=function(h){const p=1<<h,u=(1<<h)+1;let S=h+1;const C=c();for(let g=0;g<p;g+=1)C.add(String.fromCharCode(g));C.add(String.fromCharCode(p)),C.add(String.fromCharCode(u));const A=ag(),x=f(A);x.write(p,S);let b=0,_=String.fromCharCode(d[b]);for(b+=1;b<d.length;){const g=String.fromCharCode(d[b]);b+=1,C.contains(_+g)?_=_+g:(x.write(C.indexOf(_),S),C.size()<4095&&(C.size()==1<<S&&(S+=1),C.add(_+g)),_=g)}return x.write(C.indexOf(_),S),x.write(u,S),x.flush(),A.toByteArray()},c=function(){const h={};let p=0;const u={};return u.add=function(S){if(u.contains(S))throw"dup key:"+S;h[S]=p,p+=1},u.size=function(){return p},u.indexOf=function(S){return h[S]},u.contains=function(S){return typeof h[S]<"u"},u};return v},r1=function(n,r,s){const o=i1(n,r);for(let a=0;a<r;a+=1)for(let c=0;c<n;c+=1)o.setPixel(c,a,s(c,a));const d=ag();o.write(d);const v=t1(),f=d.toByteArray();for(let a=0;a<f.length;a+=1)v.writeByte(f[a]);return v.flush(),"data:image/gif;base64,"+v};Kr.stringToBytes;const $r=[{name:"project-manager",label:"Project Manager",commandAgent:"project-manager",dispatchable:!1},{name:"architect",label:"Architect",commandAgent:"architect",dispatchable:!0},{name:"coder",label:"Coder",commandAgent:"coder",dispatchable:!0},{name:"reviewer",label:"Reviewer",commandAgent:"reviewer",dispatchable:!0}],og={name:"codex-reviewer",label:"Codex Reviewer",commandAgent:"codex-reviewer",dispatchable:!1},cg={name:"codex-translator",label:"Codex Translator",commandAgent:"codex-translator",dispatchable:!1},ug=[og,cg],Bu=[...$r,...ug],s1=$r.map(n=>n.name),l1=ug.map(n=>n.name);Bu.map(n=>n.name);Bu.filter(n=>n.dispatchable).map(n=>n.name);function Nu(n){return l1.includes(n)}function a1(){const n={};for(const r of s1)n[r]={permissionMode:"default",model:"default",effort:"default"};return{version:1,roles:n,autoOrchestration:!0,translationEnabled:!0}}function o1({sidebar:n,children:r}){const[s,o]=ce.useState(!1);return N.jsxs("div",{className:s?"app-shell is-sidebar-collapsed":"app-shell",children:[N.jsxs("aside",{className:"app-sidebar",children:[N.jsx("button",{className:"sidebar-toggle",type:"button","aria-label":s?"Expand sidebar":"Collapse sidebar",title:s?"Expand sidebar":"Collapse sidebar",onClick:()=>o(d=>!d)}),N.jsx("div",{className:"sidebar-content",children:n})]}),N.jsx("main",{className:"app-main",children:r})]})}function c1(n,r){return n.find(s=>s.taskSlug===r)??n[0]??null}const xe={getAppPreferences(){return Te("/api/settings/preferences")},updateAppPreferences(n){return Te("/api/settings/preferences",{method:"PUT",body:JSON.stringify(n)})},getRuntimeDiagnostics(){return Te("/api/diagnostics/runtime")},getCurrentProject(){return Te("/api/projects/current")},pullCurrentProject(){return Te("/api/projects/current/pull",{method:"POST"})},getRecentRepositoryPaths(){return Te("/api/projects/recent")},connectProject(n){return Te("/api/projects/connect",{method:"POST",body:JSON.stringify(n)})},listTasks(){return Te("/api/tasks")},createTask(n){return Te("/api/tasks",{method:"POST",body:JSON.stringify(n)})},cleanupTask(n,r={}){return Te(`/api/tasks/${encodeURIComponent(n)}/cleanup`,{method:"POST",body:JSON.stringify(r)})},getHarnessStatus(){return Te("/api/projects/harness")},applyHarness(){return Te("/api/projects/harness/apply",{method:"POST"})},getHarnessBootstrapStatus(){return Te("/api/projects/harness/bootstrap")},startHarnessBootstrap(n={}){return Te("/api/projects/harness/bootstrap/start",{method:"POST",body:JSON.stringify(n)})},getTaskStatus(n){return Te(`/api/tasks/${encodeURIComponent(n)}/status`)},listSessions(n){return Te(`/api/tasks/${encodeURIComponent(n)}/sessions`)},startRoleSession(n,r,s={}){return Te(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/start`,{method:"POST",body:JSON.stringify(s)})},stopRoleSession(n,r){return Te(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/stop`,{method:"POST"})},restartRoleSession(n,r,s={}){return Te(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/restart`,{method:"POST",body:JSON.stringify(s)})},resumeRoleSession(n,r,s={}){return Te(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/resume`,{method:"POST",body:JSON.stringify(s)})},dispatchRoleCommand(n,r){return Te(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/dispatch`,{method:"POST"})},listMessages(n){return Te(`/api/tasks/${encodeURIComponent(n)}/messages`)},markAllMessagesDone(n){return Te(`/api/tasks/${encodeURIComponent(n)}/messages/mark-all-done`,{method:"POST"})},deleteMessageHistory(n){return Te(`/api/tasks/${encodeURIComponent(n)}/messages/history`,{method:"DELETE"})},getOrchestrationState(n){return Te(`/api/tasks/${encodeURIComponent(n)}/orchestration`)},updateOrchestrationState(n,r){return Te(`/api/tasks/${encodeURIComponent(n)}/orchestration`,{method:"PUT",body:JSON.stringify(r)})},getSessionRoundState(n){return Te(`/api/tasks/${encodeURIComponent(n)}/round`)},getCodexReviewState(n){return Te(`/api/tasks/${encodeURIComponent(n)}/codex-review`)},updateCodexReviewSettings(n,r){return Te(`/api/tasks/${encodeURIComponent(n)}/codex-review/settings`,{method:"PUT",body:JSON.stringify(r)})},requestCodexReviewGate(n,r){return Te(`/api/tasks/${encodeURIComponent(n)}/codex-review/${r}/request`,{method:"POST"})},retryCodexReviewGate(n,r){return Te(`/api/tasks/${encodeURIComponent(n)}/codex-review/${r}/retry`,{method:"POST"})},skipCodexReviewGate(n,r,s){return Te(`/api/tasks/${encodeURIComponent(n)}/codex-review/${r}/skip`,{method:"POST",body:JSON.stringify(s)})},overrideCodexReviewGate(n,r,s){return Te(`/api/tasks/${encodeURIComponent(n)}/codex-review/${r}/override`,{method:"POST",body:JSON.stringify(s)})},getCodexReviewReport(n,r){return Te(`/api/tasks/${encodeURIComponent(n)}/codex-review/${r}/report`)},getTranslationSettings(){return Te("/api/translation/settings")},updateTranslationSettings(n){return Te("/api/translation/settings",{method:"PUT",body:JSON.stringify(n)})},getTranslationPrompts(){return Te("/api/translation/prompts")},testTranslationProvider(){return Te("/api/translation/test",{method:"POST"})},startTranslationSession(n,r){return Te(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/start`,{method:"POST"})},pollTranslationSession(n,r,s){const o=new URLSearchParams({after:String(r)});return s!==void 0&&o.set("limit",String(s)),Te(`/api/translation/sessions/${encodeURIComponent(n)}/events?${o.toString()}`)},translateUserInput(n,r,s){return Te(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/input`,{method:"POST",body:JSON.stringify(s)})},sendTranslatedInput(n,r,s){return Te(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/send`,{method:"POST",body:JSON.stringify(s)})},clearTranslationSession(n){return Te(`/api/translation/sessions/${encodeURIComponent(n)}/clear`,{method:"POST"})},stopTranslationSession(n){return Te(`/api/translation/sessions/${encodeURIComponent(n)}/stop`,{method:"POST"})},retryTranslation(n,r){return Te(`/api/translation/sessions/${encodeURIComponent(n)}/retry/${encodeURIComponent(r)}`,{method:"POST"})},ignoreTranslationFailures(n){return Te(`/api/translation/sessions/${encodeURIComponent(n)}/failures/ignore`,{method:"POST"})},retryTranslationFailures(n){return Te(`/api/translation/sessions/${encodeURIComponent(n)}/failures/retry`,{method:"POST"})},getCodexTranslationState(){return Te("/api/translation/codex/state")},browseCodexTranslationSourceFiles(n={}){const r=new URLSearchParams;n.path&&r.set("path",n.path),n.query&&r.set("query",n.query),n.limit!==void 0&&r.set("limit",String(n.limit));const s=r.toString()?`?${r.toString()}`:"";return Te(`/api/translation/codex/source-files${s}`)},createCodexFileTranslation(n){return Te("/api/translation/codex/files",{method:"POST",body:JSON.stringify(n)})},readCodexFileTranslation(n){return Te(`/api/translation/codex/files/${encodeURIComponent(n)}`)},createCodexBootstrap(n){return Te("/api/translation/codex/bootstrap",{method:"POST",body:JSON.stringify(n)})},promoteCodexTranslation(n,r){return Te(`/api/translation/codex/files/${encodeURIComponent(n)}/promote`,{method:"POST",body:JSON.stringify({targetPath:r})})},getGatewayStatus(){return Te("/api/gateway/status")},updateGatewaySettings(n){return Te("/api/gateway/settings",{method:"PUT",body:JSON.stringify(n)})},startGatewayQrLogin(){return Te("/api/gateway/qr/start",{method:"POST"})},checkGatewayQrLogin(n={}){return Te("/api/gateway/qr/check",{method:"POST",body:JSON.stringify(n)})},resetGatewayBinding(){return Te("/api/gateway/binding/reset",{method:"POST"})}};async function Te(n,r={}){var d,v,f;const s=new Headers(r.headers);r.body!==void 0&&r.body!==null&&!s.has("content-type")&&s.set("content-type","application/json");const o=await fetch(n,{...r,headers:s});if(!o.ok){const a=await o.json().catch(()=>null),c=(d=a==null?void 0:a.error)!=null&&d.hint?`${a.error.message} ${a.error.hint}`:((v=a==null?void 0:a.error)==null?void 0:v.message)??`Request failed: ${o.status}`,h=(f=a==null?void 0:a.error)==null?void 0:f.runtime,p=h?` [backend ${h.version??"unknown"} pid=${h.pid??"unknown"} cwd=${h.cwd??"unknown"}]`:"";throw new Error(`${c}${p}`)}return o.json()}const u1={role:"codex-reviewer",permissionMode:"default",model:"gpt-5.5",effort:"xhigh"};function h1(n,r){const s=$r.map(o=>({role:o.name,permissionMode:n.roles[o.name].permissionMode,model:n.roles[o.name].model,effort:n.roles[o.name].effort}));return r.codexReviewerEnabled&&s.push(u1),s}const f1=["architecture-plan","validation-adequacy","final-diff"];function d1({events:n,maxEvents:r=8,showHeader:s=!0}){const o=r===null?n:n.slice(-r);return N.jsxs("section",{className:"event-log",children:[s?N.jsx("h2",{children:"Events"}):null,n.length===0?N.jsx("p",{className:"muted",children:"No terminal events yet."}):N.jsx("ol",{children:o.map((d,v)=>N.jsx("li",{children:d},`${d}-${v}`))})]})}var eu={exports:{}},lm;function p1(){return lm||(lm=1,(function(n,r){(function(s,o){n.exports=o()})(self,(()=>(()=>{var s={};return(()=>{var o=s;Object.defineProperty(o,"__esModule",{value:!0}),o.FitAddon=void 0,o.FitAddon=class{activate(d){this._terminal=d}dispose(){}fit(){const d=this.proposeDimensions();if(!d||!this._terminal||isNaN(d.cols)||isNaN(d.rows))return;const v=this._terminal._core;this._terminal.rows===d.rows&&this._terminal.cols===d.cols||(v._renderService.clear(),this._terminal.resize(d.cols,d.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const d=this._terminal._core,v=d._renderService.dimensions;if(v.css.cell.width===0||v.css.cell.height===0)return;const f=this._terminal.options.scrollback===0?0:d.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(a.getPropertyValue("height")),h=Math.max(0,parseInt(a.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),u=c-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),S=h-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-f;return{cols:Math.max(2,Math.floor(S/v.css.cell.width)),rows:Math.max(1,Math.floor(u/v.css.cell.height))}}}})(),s})()))})(eu)),eu.exports}var m1=p1(),tu={exports:{}},am;function g1(){return am||(am=1,(function(n,r){(function(s,o){n.exports=o()})(self,(()=>(()=>{var s={6:(f,a)=>{function c(p){try{const u=new URL(p),S=u.password&&u.username?`${u.protocol}//${u.username}:${u.password}@${u.host}`:u.username?`${u.protocol}//${u.username}@${u.host}`:`${u.protocol}//${u.host}`;return p.toLocaleLowerCase().startsWith(S.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(p,u,S,C={}){this._terminal=p,this._regex=u,this._handler=S,this._options=C}provideLinks(p,u){const S=h.computeLink(p,this._regex,this._terminal,this._handler);u(this._addCallbacks(S))}_addCallbacks(p){return p.map((u=>(u.leave=this._options.leave,u.hover=(S,C)=>{if(this._options.hover){const{range:A}=u;this._options.hover(S,C,A)}},u)))}};class h{static computeLink(u,S,C,A){const x=new RegExp(S.source,(S.flags||"")+"g"),[b,_]=h._getWindowedLineStrings(u-1,C),g=b.join("");let y;const k=[];for(;y=x.exec(g);){const M=y[0];if(!c(M))continue;const[D,T]=h._mapStrIdx(C,_,0,y.index),[E,R]=h._mapStrIdx(C,D,T,M.length);if(D===-1||T===-1||E===-1||R===-1)continue;const B={start:{x:T+1,y:D+1},end:{x:R,y:E+1}};k.push({range:B,text:M,activate:A})}return k}static _getWindowedLineStrings(u,S){let C,A=u,x=u,b=0,_="";const g=[];if(C=S.buffer.active.getLine(u)){const y=C.translateToString(!0);if(C.isWrapped&&y[0]!==" "){for(b=0;(C=S.buffer.active.getLine(--A))&&b<2048&&(_=C.translateToString(!0),b+=_.length,g.push(_),C.isWrapped&&_.indexOf(" ")===-1););g.reverse()}for(g.push(y),b=0;(C=S.buffer.active.getLine(++x))&&C.isWrapped&&b<2048&&(_=C.translateToString(!0),b+=_.length,g.push(_),_.indexOf(" ")===-1););}return[g,A]}static _mapStrIdx(u,S,C,A){const x=u.buffer.active,b=x.getNullCell();let _=C;for(;A;){const g=x.getLine(S);if(!g)return[-1,-1];for(let y=_;y<g.length;++y){g.getCell(y,b);const k=b.getChars();if(b.getWidth()&&(A-=k.length||1,y===g.length-1&&k==="")){const M=x.getLine(S+1);M&&M.isWrapped&&(M.getCell(0,b),b.getWidth()===2&&(A+=1))}if(A<0)return[S,y]}S++,_=0}return[S,_]}}a.LinkComputer=h}},o={};function d(f){var a=o[f];if(a!==void 0)return a.exports;var c=o[f]={exports:{}};return s[f](c,c.exports,d),c.exports}var v={};return(()=>{var f=v;Object.defineProperty(f,"__esModule",{value:!0}),f.WebLinksAddon=void 0;const a=d(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function h(p,u){const S=window.open();if(S){try{S.opener=null}catch{}S.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}f.WebLinksAddon=class{constructor(p=h,u={}){this._handler=p,this._options=u}activate(p){this._terminal=p;const u=this._options,S=u.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,S,this._handler,u))}dispose(){var p;(p=this._linkProvider)==null||p.dispose()}}})(),v})()))})(tu)),tu.exports}var _1=g1(),nu={exports:{}},om;function v1(){return om||(om=1,(function(n,r){(function(s,o){n.exports=o()})(globalThis,(()=>(()=>{var s={4567:function(f,a,c){var h=this&&this.__decorate||function(g,y,k,M){var D,T=arguments.length,E=T<3?y:M===null?M=Object.getOwnPropertyDescriptor(y,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(g,y,k,M);else for(var R=g.length-1;R>=0;R--)(D=g[R])&&(E=(T<3?D(E):T>3?D(y,k,E):D(y,k))||E);return T>3&&E&&Object.defineProperty(y,k,E),E},p=this&&this.__param||function(g,y){return function(k,M){y(k,M,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const u=c(9042),S=c(9924),C=c(844),A=c(4725),x=c(2585),b=c(3656);let _=a.AccessibilityManager=class extends C.Disposable{constructor(g,y,k,M){super(),this._terminal=g,this._coreBrowserService=k,this._renderService=M,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let D=0;D<this._terminal.rows;D++)this._rowElements[D]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[D]);if(this._topBoundaryFocusListener=D=>this._handleBoundaryFocus(D,0),this._bottomBoundaryFocusListener=D=>this._handleBoundaryFocus(D,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new S.TimeBasedDebouncer(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((D=>this._handleResize(D.rows)))),this.register(this._terminal.onRender((D=>this._refreshRows(D.start,D.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((D=>this._handleChar(D)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
52
|
+
`)))),this.register(this._terminal.onA11yTab((D=>this._handleTab(D)))),this.register(this._terminal.onKey((D=>this._handleKey(D.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,b.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,C.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(g){for(let y=0;y<g;y++)this._handleChar(" ")}_handleChar(g){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==g&&(this._charsToAnnounce+=g):this._charsToAnnounce+=g,g===`
|
|
53
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(g){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(g)||this._charsToConsume.push(g)}_refreshRows(g,y){this._liveRegionDebouncer.refresh(g,y,this._terminal.rows)}_renderRows(g,y){const k=this._terminal.buffer,M=k.lines.length.toString();for(let D=g;D<=y;D++){const T=k.lines.get(k.ydisp+D),E=[],R=(T==null?void 0:T.translateToString(!0,void 0,void 0,E))||"",B=(k.ydisp+D+1).toString(),H=this._rowElements[D];H&&(R.length===0?(H.innerText=" ",this._rowColumns.set(H,[0,1])):(H.textContent=R,this._rowColumns.set(H,E)),H.setAttribute("aria-posinset",B),H.setAttribute("aria-setsize",M))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(g,y){const k=g.target,M=this._rowElements[y===0?1:this._rowElements.length-2];if(k.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||g.relatedTarget!==M)return;let D,T;if(y===0?(D=k,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(D=this._rowElements.shift(),T=k,this._rowContainer.removeChild(D)),D.removeEventListener("focus",this._topBoundaryFocusListener),T.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const E=this._createAccessibilityTreeNode();this._rowElements.unshift(E),this._rowContainer.insertAdjacentElement("afterbegin",E)}else{const E=this._createAccessibilityTreeNode();this._rowElements.push(E),this._rowContainer.appendChild(E)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),g.preventDefault(),g.stopImmediatePropagation()}_handleSelectionChange(){var R;if(this._rowElements.length===0)return;const g=document.getSelection();if(!g)return;if(g.isCollapsed)return void(this._rowContainer.contains(g.anchorNode)&&this._terminal.clearSelection());if(!g.anchorNode||!g.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:g.anchorNode,offset:g.anchorOffset},k={node:g.focusNode,offset:g.focusOffset};if((y.node.compareDocumentPosition(k.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===k.node&&y.offset>k.offset)&&([y,k]=[k,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const M=this._rowElements.slice(-1)[0];if(k.node.compareDocumentPosition(M)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(k={node:M,offset:((R=M.textContent)==null?void 0:R.length)??0}),!this._rowContainer.contains(k.node))return;const D=({node:B,offset:H})=>{const P=B instanceof Text?B.parentNode:B;let F=parseInt(P==null?void 0:P.getAttribute("aria-posinset"),10)-1;if(isNaN(F))return console.warn("row is invalid. Race condition?"),null;const $=this._rowColumns.get(P);if(!$)return console.warn("columns is null. Race condition?"),null;let W=H<$.length?$[H]:$.slice(-1)[0]+1;return W>=this._terminal.cols&&(++F,W=0),{row:F,column:W}},T=D(y),E=D(k);if(T&&E){if(T.row>E.row||T.row===E.row&&T.column>=E.column)throw new Error("invalid range");this._terminal.select(T.column,T.row,(E.row-T.row)*this._terminal.cols-T.column+E.column)}}_handleResize(g){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);for(;this._rowElements.length>g;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const g=this._coreBrowserService.mainDocument.createElement("div");return g.setAttribute("role","listitem"),g.tabIndex=-1,this._refreshRowDimensions(g),g}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let g=0;g<this._terminal.rows;g++)this._refreshRowDimensions(this._rowElements[g])}}_refreshRowDimensions(g){g.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=_=h([p(1,x.IInstantiationService),p(2,A.ICoreBrowserService),p(3,A.IRenderService)],_)},3614:(f,a)=>{function c(S){return S.replace(/\r?\n/g,"\r")}function h(S,C){return C?"\x1B[200~"+S+"\x1B[201~":S}function p(S,C,A,x){S=h(S=c(S),A.decPrivateModes.bracketedPasteMode&&x.rawOptions.ignoreBracketedPasteMode!==!0),A.triggerDataEvent(S,!0),C.value=""}function u(S,C,A){const x=A.getBoundingClientRect(),b=S.clientX-x.left-10,_=S.clientY-x.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${b}px`,C.style.top=`${_}px`,C.style.zIndex="1000",C.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=c,a.bracketTextForPaste=h,a.copyHandler=function(S,C){S.clipboardData&&S.clipboardData.setData("text/plain",C.selectionText),S.preventDefault()},a.handlePasteEvent=function(S,C,A,x){S.stopPropagation(),S.clipboardData&&p(S.clipboardData.getData("text/plain"),C,A,x)},a.paste=p,a.moveTextAreaUnderMouseCursor=u,a.rightClickHandler=function(S,C,A,x,b){u(S,C,A),b&&x.rightClickSelect(S),C.value=x.selectionText,C.select()}},7239:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const h=c(1505);a.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(p,u,S){this._css.set(p,u,S)}getCss(p,u){return this._css.get(p,u)}setColor(p,u,S){this._color.set(p,u,S)}getColor(p,u){return this._color.get(p,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(c,h,p,u){c.addEventListener(h,p,u);let S=!1;return{dispose:()=>{S||(S=!0,c.removeEventListener(h,p,u))}}}},3551:function(f,a,c){var h=this&&this.__decorate||function(_,g,y,k){var M,D=arguments.length,T=D<3?g:k===null?k=Object.getOwnPropertyDescriptor(g,y):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(_,g,y,k);else for(var E=_.length-1;E>=0;E--)(M=_[E])&&(T=(D<3?M(T):D>3?M(g,y,T):M(g,y))||T);return D>3&&T&&Object.defineProperty(g,y,T),T},p=this&&this.__param||function(_,g){return function(y,k){g(y,k,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const u=c(3656),S=c(8460),C=c(844),A=c(2585),x=c(4725);let b=a.Linkifier=class extends C.Disposable{get currentLink(){return this._currentLink}constructor(_,g,y,k,M){super(),this._element=_,this._mouseService=g,this._renderService=y,this._bufferService=k,this._linkProviderService=M,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new S.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new S.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,C.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,C.toDisposable)((()=>{var D;this._lastMouseEvent=void 0,(D=this._activeProviderReplies)==null||D.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(_){this._lastMouseEvent=_;const g=this._positionFromMouseEvent(_,this._element,this._mouseService);if(!g)return;this._isMouseOut=!1;const y=_.composedPath();for(let k=0;k<y.length;k++){const M=y[k];if(M.classList.contains("xterm"))break;if(M.classList.contains("xterm-hover"))return}this._lastBufferCell&&g.x===this._lastBufferCell.x&&g.y===this._lastBufferCell.y||(this._handleHover(g),this._lastBufferCell=g)}_handleHover(_){if(this._activeLine!==_.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(_,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,_)||(this._clearCurrentLink(),this._askForLink(_,!0))}_askForLink(_,g){var k,M;this._activeProviderReplies&&g||((k=this._activeProviderReplies)==null||k.forEach((D=>{D==null||D.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=_.y);let y=!1;for(const[D,T]of this._linkProviderService.linkProviders.entries())g?(M=this._activeProviderReplies)!=null&&M.get(D)&&(y=this._checkLinkProviderResult(D,_,y)):T.provideLinks(_.y,(E=>{var B,H;if(this._isMouseOut)return;const R=E==null?void 0:E.map((P=>({link:P})));(B=this._activeProviderReplies)==null||B.set(D,R),y=this._checkLinkProviderResult(D,_,y),((H=this._activeProviderReplies)==null?void 0:H.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(_.y,this._activeProviderReplies)}))}_removeIntersectingLinks(_,g){const y=new Set;for(let k=0;k<g.size;k++){const M=g.get(k);if(M)for(let D=0;D<M.length;D++){const T=M[D],E=T.link.range.start.y<_?0:T.link.range.start.x,R=T.link.range.end.y>_?this._bufferService.cols:T.link.range.end.x;for(let B=E;B<=R;B++){if(y.has(B)){M.splice(D--,1);break}y.add(B)}}}}_checkLinkProviderResult(_,g,y){var D;if(!this._activeProviderReplies)return y;const k=this._activeProviderReplies.get(_);let M=!1;for(let T=0;T<_;T++)this._activeProviderReplies.has(T)&&!this._activeProviderReplies.get(T)||(M=!0);if(!M&&k){const T=k.find((E=>this._linkAtPosition(E.link,g)));T&&(y=!0,this._handleNewLink(T))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let T=0;T<this._activeProviderReplies.size;T++){const E=(D=this._activeProviderReplies.get(T))==null?void 0:D.find((R=>this._linkAtPosition(R.link,g)));if(E){y=!0,this._handleNewLink(E);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(_){if(!this._currentLink)return;const g=this._positionFromMouseEvent(_,this._element,this._mouseService);g&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,g)&&this._currentLink.link.activate(_,this._currentLink.link.text)}_clearCurrentLink(_,g){this._currentLink&&this._lastMouseEvent&&(!_||!g||this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=g)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,C.disposeArray)(this._linkCacheDisposables))}_handleNewLink(_){if(!this._lastMouseEvent)return;const g=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);g&&this._linkAtPosition(_.link,g)&&(this._currentLink=_,this._currentLink.state={decorations:{underline:_.link.decorations===void 0||_.link.decorations.underline,pointerCursor:_.link.decorations===void 0||_.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,_.link,this._lastMouseEvent),_.link.decorations={},Object.defineProperties(_.link.decorations,{pointerCursor:{get:()=>{var y,k;return(k=(y=this._currentLink)==null?void 0:y.state)==null?void 0:k.decorations.pointerCursor},set:y=>{var k;(k=this._currentLink)!=null&&k.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>{var y,k;return(k=(y=this._currentLink)==null?void 0:y.state)==null?void 0:k.decorations.underline},set:y=>{var k,M,D;(k=this._currentLink)!=null&&k.state&&((D=(M=this._currentLink)==null?void 0:M.state)==null?void 0:D.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(_.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const k=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,M=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=k&&this._currentLink.link.range.end.y<=M&&(this._clearCurrentLink(k,M),this._lastMouseEvent)){const D=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);D&&this._askForLink(D,!1)}}))))}_linkHover(_,g,y){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!0),this._currentLink.state.decorations.pointerCursor&&_.classList.add("xterm-cursor-pointer")),g.hover&&g.hover(y,g.text)}_fireUnderlineEvent(_,g){const y=_.range,k=this._bufferService.buffer.ydisp,M=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-k-1,y.end.x,y.end.y-k-1,void 0);(g?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(M)}_linkLeave(_,g,y){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!1),this._currentLink.state.decorations.pointerCursor&&_.classList.remove("xterm-cursor-pointer")),g.leave&&g.leave(y,g.text)}_linkAtPosition(_,g){const y=_.range.start.y*this._bufferService.cols+_.range.start.x,k=_.range.end.y*this._bufferService.cols+_.range.end.x,M=g.y*this._bufferService.cols+g.x;return y<=M&&M<=k}_positionFromMouseEvent(_,g,y){const k=y.getCoords(_,g,this._bufferService.cols,this._bufferService.rows);if(k)return{x:k[0],y:k[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(_,g,y,k,M){return{x1:_,y1:g,x2:y,y2:k,cols:this._bufferService.cols,fg:M}}};a.Linkifier=b=h([p(1,x.IMouseService),p(2,x.IRenderService),p(3,A.IBufferService),p(4,x.ILinkProviderService)],b)},9042:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(f,a,c){var h=this&&this.__decorate||function(x,b,_,g){var y,k=arguments.length,M=k<3?b:g===null?g=Object.getOwnPropertyDescriptor(b,_):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,b,_,g);else for(var D=x.length-1;D>=0;D--)(y=x[D])&&(M=(k<3?y(M):k>3?y(b,_,M):y(b,_))||M);return k>3&&M&&Object.defineProperty(b,_,M),M},p=this&&this.__param||function(x,b){return function(_,g){b(_,g,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const u=c(511),S=c(2585);let C=a.OscLinkProvider=class{constructor(x,b,_){this._bufferService=x,this._optionsService=b,this._oscLinkService=_}provideLinks(x,b){var R;const _=this._bufferService.buffer.lines.get(x-1);if(!_)return void b(void 0);const g=[],y=this._optionsService.rawOptions.linkHandler,k=new u.CellData,M=_.getTrimmedLength();let D=-1,T=-1,E=!1;for(let B=0;B<M;B++)if(T!==-1||_.hasContent(B)){if(_.loadCell(B,k),k.hasExtendedAttrs()&&k.extended.urlId){if(T===-1){T=B,D=k.extended.urlId;continue}E=k.extended.urlId!==D}else T!==-1&&(E=!0);if(E||T!==-1&&B===M-1){const H=(R=this._oscLinkService.getLinkData(D))==null?void 0:R.uri;if(H){const P={start:{x:T+1,y:x},end:{x:B+(E||B!==M-1?0:1),y:x}};let F=!1;if(!(y!=null&&y.allowNonHttpProtocols))try{const $=new URL(H);["http:","https:"].includes($.protocol)||(F=!0)}catch{F=!0}F||g.push({text:H,range:P,activate:($,W)=>y?y.activate($,W,P):A(0,W),hover:($,W)=>{var G;return(G=y==null?void 0:y.hover)==null?void 0:G.call(y,$,W,P)},leave:($,W)=>{var G;return(G=y==null?void 0:y.leave)==null?void 0:G.call(y,$,W,P)}})}E=!1,k.hasExtendedAttrs()&&k.extended.urlId?(T=B,D=k.extended.urlId):(T=-1,D=-1)}}b(g)}};function A(x,b){if(confirm(`Do you want to navigate to ${b}?
|
|
54
54
|
|
|
55
|
-
WARNING: This link could potentially be dangerous`)){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=b}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=w=h([p(0,S.IBufferService),p(1,S.IOptionsService),p(2,S.IOscLinkService)],w)},6193:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(c,h){this._renderCallback=c,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,h,p){this._rowCount=p,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,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)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const h=c(3614),p=c(3656),u=c(3551),S=c(9042),w=c(3730),A=c(1680),x=c(3107),b=c(5744),_=c(2950),g=c(1296),y=c(428),k=c(4269),M=c(5114),D=c(8934),T=c(3230),E=c(9312),R=c(4725),N=c(6731),z=c(8055),F=c(8969),P=c(8460),$=c(844),K=c(6114),G=c(8437),X=c(2584),ee=c(7399),H=c(5941),O=c(9074),j=c(2585),V=c(5435),I=c(4567),ne=c(779);class _e extends F.CoreTerminal{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}constructor(Q={}){super(Q),this.browser=K,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new $.MutableDisposable),this._onCursorMove=this.register(new P.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new P.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new P.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new P.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new P.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new P.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new P.EventEmitter),this._onBlur=this.register(new P.EventEmitter),this._onA11yCharEmitter=this.register(new P.EventEmitter),this._onA11yTabEmitter=this.register(new P.EventEmitter),this._onWillOpen=this.register(new P.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(O.DecorationService),this._instantiationService.setService(j.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ne.LinkProviderService),this._instantiationService.setService(R.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(w.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((q,J)=>this.refresh(q,J)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((q=>this._reportWindowsOptions(q)))),this.register(this._inputHandler.onColor((q=>this._handleColorEvent(q)))),this.register((0,P.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,P.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((q=>this._afterResize(q.cols,q.rows)))),this.register((0,$.toDisposable)((()=>{var q,J;this._customKeyEventHandler=void 0,(J=(q=this.element)==null?void 0:q.parentNode)==null||J.removeChild(this.element)})))}_handleColorEvent(Q){if(this._themeService)for(const q of Q){let J,Y="";switch(q.index){case 256:J="foreground",Y="10";break;case 257:J="background",Y="11";break;case 258:J="cursor",Y="12";break;default:J="ansi",Y="4;"+q.index}switch(q.type){case 0:const he=z.color.toColorRGB(J==="ansi"?this._themeService.colors.ansi[q.index]:this._themeService.colors[J]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${Y};${(0,H.toRgbString)(he)}${X.C1_ESCAPED.ST}`);break;case 1:if(J==="ansi")this._themeService.modifyColors((de=>de.ansi[q.index]=z.channels.toColor(...q.color)));else{const de=J;this._themeService.modifyColors((be=>be[de]=z.channels.toColor(...q.color)))}break;case 2:this._themeService.restoreColor(q.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Q){Q?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(I.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Q){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var Q;return(Q=this.textarea)==null?void 0:Q.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const Q=this.buffer.ybase+this.buffer.y,q=this.buffer.lines.get(Q);if(!q)return;const J=Math.min(this.buffer.x,this.cols-1),Y=this._renderService.dimensions.css.cell.height,he=q.getWidth(J),de=this._renderService.dimensions.css.cell.width*he,be=this.buffer.y*this._renderService.dimensions.css.cell.height,Pe=J*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Pe+"px",this.textarea.style.top=be+"px",this.textarea.style.width=de+"px",this.textarea.style.height=Y+"px",this.textarea.style.lineHeight=Y+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",(q=>{this.hasSelection()&&(0,h.copyHandler)(q,this._selectionService)})));const Q=q=>(0,h.handlePasteEvent)(q,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",Q)),this.register((0,p.addDisposableDomListener)(this.element,"paste",Q)),K.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(q=>{q.button===2&&(0,h.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",(q=>{(0,h.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),K.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",(q=>{q.button===1&&(0,h.moveTextAreaUnderMouseCursor)(q,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(Q=>this._keyUp(Q)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(Q=>this._keyDown(Q)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(Q=>this._keyPress(Q)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(Q=>this._compositionHelper.compositionupdate(Q)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(Q=>this._inputEvent(Q)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Q){var J;if(!Q)throw new Error("Terminal requires a parent element.");if(Q.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((J=this.element)==null?void 0:J.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Q.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"),Q.appendChild(this.element);const q=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),q.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,p.addDisposableDomListener)(this.screenElement,"mousemove",(Y=>this.updateCursorStyle(Y)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),q.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",S.promptLabel),K.isChromeOS||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._coreBrowserService=this.register(this._instantiationService.createInstance(M.CoreBrowserService,this.textarea,Q.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(R.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",(Y=>this._handleTextAreaFocus(Y)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(R.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(N.ThemeService),this._instantiationService.setService(R.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(k.CharacterJoinerService),this._instantiationService.setService(R.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(R.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((Y=>this._onRender.fire(Y)))),this.onResize((Y=>this._renderService.resize(Y.cols,Y.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(_.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(D.MouseService),this._instantiationService.setService(R.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(u.Linkifier,this.screenElement)),this.element.appendChild(q);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(A.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((Y=>this.scrollLines(Y.amount,Y.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),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.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(E.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(R.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((Y=>this.scrollLines(Y.amount,Y.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((Y=>this._renderService.handleSelectionChanged(Y.start,Y.end,Y.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((Y=>{this.textarea.value=Y,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((Y=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(x.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(Y=>this._selectionService.handleMouseDown(Y)))),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(I.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(Y=>this._handleScreenReaderModeOptionChange(Y)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(Y=>{!this._overviewRulerRenderer&&Y&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(g.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Q=this,q=this.element;function J(de){const be=Q._mouseService.getMouseReportCoords(de,Q.screenElement);if(!be)return!1;let Pe,qe;switch(de.overrideType||de.type){case"mousemove":qe=32,de.buttons===void 0?(Pe=3,de.button!==void 0&&(Pe=de.button<3?de.button:3)):Pe=1&de.buttons?0:4&de.buttons?1:2&de.buttons?2:3;break;case"mouseup":qe=0,Pe=de.button<3?de.button:3;break;case"mousedown":qe=1,Pe=de.button<3?de.button:3;break;case"wheel":if(Q._customWheelEventHandler&&Q._customWheelEventHandler(de)===!1||Q.viewport.getLinesScrolled(de)===0)return!1;qe=de.deltaY<0?0:1,Pe=4;break;default:return!1}return!(qe===void 0||Pe===void 0||Pe>4)&&Q.coreMouseService.triggerMouseEvent({col:be.col,row:be.row,x:be.x,y:be.y,button:Pe,action:qe,ctrl:de.ctrlKey,alt:de.altKey,shift:de.shiftKey})}const Y={mouseup:null,wheel:null,mousedrag:null,mousemove:null},he={mouseup:de=>(J(de),de.buttons||(this._document.removeEventListener("mouseup",Y.mouseup),Y.mousedrag&&this._document.removeEventListener("mousemove",Y.mousedrag)),this.cancel(de)),wheel:de=>(J(de),this.cancel(de,!0)),mousedrag:de=>{de.buttons&&J(de)},mousemove:de=>{de.buttons||J(de)}};this.register(this.coreMouseService.onProtocolChange((de=>{de?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(de)),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()),8&de?Y.mousemove||(q.addEventListener("mousemove",he.mousemove),Y.mousemove=he.mousemove):(q.removeEventListener("mousemove",Y.mousemove),Y.mousemove=null),16&de?Y.wheel||(q.addEventListener("wheel",he.wheel,{passive:!1}),Y.wheel=he.wheel):(q.removeEventListener("wheel",Y.wheel),Y.wheel=null),2&de?Y.mouseup||(Y.mouseup=he.mouseup):(this._document.removeEventListener("mouseup",Y.mouseup),Y.mouseup=null),4&de?Y.mousedrag||(Y.mousedrag=he.mousedrag):(this._document.removeEventListener("mousemove",Y.mousedrag),Y.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(q,"mousedown",(de=>{if(de.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(de))return J(de),Y.mouseup&&this._document.addEventListener("mouseup",Y.mouseup),Y.mousedrag&&this._document.addEventListener("mousemove",Y.mousedrag),this.cancel(de)}))),this.register((0,p.addDisposableDomListener)(q,"wheel",(de=>{if(!Y.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(de)===!1)return!1;if(!this.buffer.hasScrollback){const be=this.viewport.getLinesScrolled(de);if(be===0)return;const Pe=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(de.deltaY<0?"A":"B");let qe="";for(let Ke=0;Ke<Math.abs(be);Ke++)qe+=Pe;return this.coreService.triggerDataEvent(qe,!0),this.cancel(de,!0)}return this.viewport.handleWheel(de)?this.cancel(de):void 0}}),{passive:!1})),this.register((0,p.addDisposableDomListener)(q,"touchstart",(de=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(de),this.cancel(de)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(q,"touchmove",(de=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(de)?void 0:this.cancel(de)}),{passive:!1}))}refresh(Q,q){var J;(J=this._renderService)==null||J.refreshRows(Q,q)}updateCursorStyle(Q){var q;(q=this._selectionService)!=null&&q.shouldColumnSelect(Q)?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(Q,q,J=0){var Y;J===1?(super.scrollLines(Q,q,J),this.refresh(0,this.rows-1)):(Y=this.viewport)==null||Y.scrollLines(Q)}paste(Q){(0,h.paste)(Q,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Q){this._customKeyEventHandler=Q}attachCustomWheelEventHandler(Q){this._customWheelEventHandler=Q}registerLinkProvider(Q){return this._linkProviderService.registerLinkProvider(Q)}registerCharacterJoiner(Q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const q=this._characterJoinerService.register(Q);return this.refresh(0,this.rows-1),q}deregisterCharacterJoiner(Q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Q)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Q){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Q)}registerDecoration(Q){return this._decorationService.registerDecoration(Q)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Q,q,J){this._selectionService.setSelection(Q,q,J)}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 Q;(Q=this._selectionService)==null||Q.clearSelection()}selectAll(){var Q;(Q=this._selectionService)==null||Q.selectAll()}selectLines(Q,q){var J;(J=this._selectionService)==null||J.selectLines(Q,q)}_keyDown(Q){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;const q=this.browser.isMac&&this.options.macOptionIsMeta&&Q.altKey;if(!q&&!this._compositionHelper.keydown(Q))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;q||Q.key!=="Dead"&&Q.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const J=(0,ee.evaluateKeyboardEvent)(Q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Q),J.type===3||J.type===2){const Y=this.rows-1;return this.scrollLines(J.type===2?-Y:Y),this.cancel(Q,!0)}return J.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Q)||(J.cancel&&this.cancel(Q,!0),!J.key||!!(Q.key&&!Q.ctrlKey&&!Q.altKey&&!Q.metaKey&&Q.key.length===1&&Q.key.charCodeAt(0)>=65&&Q.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(J.key!==X.C0.ETX&&J.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:J.key,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(J.key,!0),!this.optionsService.rawOptions.screenReaderMode||Q.altKey||Q.ctrlKey?this.cancel(Q,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Q,q){const J=Q.isMac&&!this.options.macOptionIsMeta&&q.altKey&&!q.ctrlKey&&!q.metaKey||Q.isWindows&&q.altKey&&q.ctrlKey&&!q.metaKey||Q.isWindows&&q.getModifierState("AltGraph");return q.type==="keypress"?J:J&&(!q.keyCode||q.keyCode>47)}_keyUp(Q){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1||((function(q){return q.keyCode===16||q.keyCode===17||q.keyCode===18})(Q)||this.focus(),this.updateCursorStyle(Q),this._keyPressHandled=!1)}_keyPress(Q){let q;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;if(this.cancel(Q),Q.charCode)q=Q.charCode;else if(Q.which===null||Q.which===void 0)q=Q.keyCode;else{if(Q.which===0||Q.charCode===0)return!1;q=Q.which}return!(!q||(Q.altKey||Q.ctrlKey||Q.metaKey)&&!this._isThirdLevelShift(this.browser,Q)||(q=String.fromCharCode(q),this._onKey.fire({key:q,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(q,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Q){if(Q.data&&Q.inputType==="insertText"&&(!Q.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const q=Q.data;return this.coreService.triggerDataEvent(q,!0),this.cancel(Q),!0}return!1}resize(Q,q){Q!==this.cols||q!==this.rows?super.resize(Q,q):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Q,q){var J,Y;(J=this._charSizeService)==null||J.measure(),(Y=this.viewport)==null||Y.syncScrollArea(!0)}clear(){var Q;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 q=1;q<this.rows;q++)this.buffer.lines.push(this.buffer.getBlankLine(G.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(Q=this.viewport)==null||Q.reset(),this.refresh(0,this.rows-1)}}reset(){var q,J;this.options.rows=this.rows,this.options.cols=this.cols;const Q=this._customKeyEventHandler;this._setup(),super.reset(),(q=this._selectionService)==null||q.reset(),this._decorationService.reset(),(J=this.viewport)==null||J.reset(),this._customKeyEventHandler=Q,this.refresh(0,this.rows-1)}clearTextureAtlas(){var Q;(Q=this._renderService)==null||Q.clearTextureAtlas()}_reportFocus(){var Q;(Q=this.element)!=null&&Q.classList.contains("focus")?this.coreService.triggerDataEvent(X.C0.ESC+"[I"):this.coreService.triggerDataEvent(X.C0.ESC+"[O")}_reportWindowsOptions(Q){if(this._renderService)switch(Q){case V.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const q=this._renderService.dimensions.css.canvas.width.toFixed(0),J=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[4;${J};${q}t`);break;case V.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const Y=this._renderService.dimensions.css.cell.width.toFixed(0),he=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[6;${he};${Y}t`)}}cancel(Q,q){if(this.options.cancelEvents||q)return Q.preventDefault(),Q.stopPropagation(),!1}}a.Terminal=_e},9924:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(c,h=1e3){this._renderCallback=c,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,h,p){this._rowCount=p,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const S=u-this._lastRefreshMs,w=this._debounceThresholdMS-S;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),w)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h)}}},1680:function(f,a,c){var h=this&&this.__decorate||function(_,g,y,k){var M,D=arguments.length,T=D<3?g:k===null?k=Object.getOwnPropertyDescriptor(g,y):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(_,g,y,k);else for(var E=_.length-1;E>=0;E--)(M=_[E])&&(T=(D<3?M(T):D>3?M(g,y,T):M(g,y))||T);return D>3&&T&&Object.defineProperty(g,y,T),T},p=this&&this.__param||function(_,g){return function(y,k){g(y,k,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const u=c(3656),S=c(4725),w=c(8460),A=c(844),x=c(2585);let b=a.Viewport=class extends A.Disposable{constructor(_,g,y,k,M,D,T,E){super(),this._viewportElement=_,this._scrollArea=g,this._bufferService=y,this._optionsService=k,this._charSizeService=M,this._renderService=D,this._coreBrowserService=T,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((R=>this._activeBuffer=R.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((R=>this._renderDimensions=R))),this._handleThemeChange(E.colors),this.register(E.onChangeColors((R=>this._handleThemeChange(R)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(_){this._viewportElement.style.backgroundColor=_.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(_){if(_)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const g=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==g&&(this._lastRecordedBufferHeight=g,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const _=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==_&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=_),this._refreshAnimationFrame=null}syncScrollArea(_=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(_);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(_)}_handleScroll(_){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const g=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:g,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const _=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(_*(this._smoothScrollState.target-this._smoothScrollState.origin)),_<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(_,g){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(g<0&&this._viewportElement.scrollTop!==0||g>0&&y<this._lastRecordedBufferHeight)||(_.cancelable&&_.preventDefault(),!1)}handleWheel(_){const g=this._getPixelsScrolled(_);return g!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+g:this._smoothScrollState.target+=g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=g,this._bubbleScroll(_,g))}scrollLines(_){if(_!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const g=_*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:_,suppressScrollEvent:!1})}_getPixelsScrolled(_){if(_.deltaY===0||_.shiftKey)return 0;let g=this._applyScrollModifier(_.deltaY,_);return _.deltaMode===WheelEvent.DOM_DELTA_LINE?g*=this._currentRowHeight:_.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._currentRowHeight*this._bufferService.rows),g}getBufferElements(_,g){var E;let y,k="";const M=[],D=g??this._bufferService.buffer.lines.length,T=this._bufferService.buffer.lines;for(let R=_;R<D;R++){const N=T.get(R);if(!N)continue;const z=(E=T.get(R+1))==null?void 0:E.isWrapped;if(k+=N.translateToString(!z),!z||R===T.length-1){const F=document.createElement("div");F.textContent=k,M.push(F),k.length>0&&(y=F),k=""}}return{bufferElements:M,cursorElement:y}}getLinesScrolled(_){if(_.deltaY===0||_.shiftKey)return 0;let g=this._applyScrollModifier(_.deltaY,_);return _.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(g/=this._currentRowHeight+0,this._wheelPartialScroll+=g,g=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):_.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._bufferService.rows),g}_applyScrollModifier(_,g){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&g.altKey||y==="ctrl"&&g.ctrlKey||y==="shift"&&g.shiftKey?_*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:_*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(_){this._lastTouchY=_.touches[0].pageY}handleTouchMove(_){const g=this._lastTouchY-_.touches[0].pageY;return this._lastTouchY=_.touches[0].pageY,g!==0&&(this._viewportElement.scrollTop+=g,this._bubbleScroll(_,g))}};a.Viewport=b=h([p(2,x.IBufferService),p(3,x.IOptionsService),p(4,S.ICharSizeService),p(5,S.IRenderService),p(6,S.ICoreBrowserService),p(7,S.IThemeService)],b)},3107:function(f,a,c){var h=this&&this.__decorate||function(x,b,_,g){var y,k=arguments.length,M=k<3?b:g===null?g=Object.getOwnPropertyDescriptor(b,_):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,b,_,g);else for(var D=x.length-1;D>=0;D--)(y=x[D])&&(M=(k<3?y(M):k>3?y(b,_,M):y(b,_))||M);return k>3&&M&&Object.defineProperty(b,_,M),M},p=this&&this.__param||function(x,b){return function(_,g){b(_,g,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const u=c(4725),S=c(844),w=c(2585);let A=a.BufferDecorationRenderer=class extends S.Disposable{constructor(x,b,_,g,y){super(),this._screenElement=x,this._bufferService=b,this._coreBrowserService=_,this._decorationService=g,this._renderService=y,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((k=>this._removeDecoration(k)))),this.register((0,S.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const x of this._decorationService.decorations)this._renderDecoration(x);this._dimensionsChanged=!1}_renderDecoration(x){this._refreshStyle(x),this._dimensionsChanged&&this._refreshXPosition(x)}_createElement(x){var g;const b=this._coreBrowserService.mainDocument.createElement("div");b.classList.add("xterm-decoration"),b.classList.toggle("xterm-decoration-top-layer",((g=x==null?void 0:x.options)==null?void 0:g.layer)==="top"),b.style.width=`${Math.round((x.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,b.style.height=(x.options.height||1)*this._renderService.dimensions.css.cell.height+"px",b.style.top=(x.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",b.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const _=x.options.x??0;return _&&_>this._bufferService.cols&&(b.style.display="none"),this._refreshXPosition(x,b),b}_refreshStyle(x){const b=x.marker.line-this._bufferService.buffers.active.ydisp;if(b<0||b>=this._bufferService.rows)x.element&&(x.element.style.display="none",x.onRenderEmitter.fire(x.element));else{let _=this._decorationElements.get(x);_||(_=this._createElement(x),x.element=_,this._decorationElements.set(x,_),this._container.appendChild(_),x.onDispose((()=>{this._decorationElements.delete(x),_.remove()}))),_.style.top=b*this._renderService.dimensions.css.cell.height+"px",_.style.display=this._altBufferIsActive?"none":"block",x.onRenderEmitter.fire(_)}}_refreshXPosition(x,b=x.element){if(!b)return;const _=x.options.x??0;(x.options.anchor||"left")==="right"?b.style.right=_?_*this._renderService.dimensions.css.cell.width+"px":"":b.style.left=_?_*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(x){var b;(b=this._decorationElements.get(x))==null||b.remove(),this._decorationElements.delete(x),x.dispose()}};a.BufferDecorationRenderer=A=h([p(1,w.IBufferService),p(2,u.ICoreBrowserService),p(3,w.IDecorationService),p(4,u.IRenderService)],A)},5871:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.ColorZoneStore=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(c){if(c.options.overviewRulerOptions){for(const h of this._zones)if(h.color===c.options.overviewRulerOptions.color&&h.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,c.marker.line))return;if(this._lineAdjacentToZone(h,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(h,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,h){return h>=c.startBufferLine&&h<=c.endBufferLine}_lineAdjacentToZone(c,h,p){return h>=c.startBufferLine-this._linePadding[p||"full"]&&h<=c.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(c,h){c.startBufferLine=Math.min(c.startBufferLine,h),c.endBufferLine=Math.max(c.endBufferLine,h)}}},5744:function(f,a,c){var h=this&&this.__decorate||function(y,k,M,D){var T,E=arguments.length,R=E<3?k:D===null?D=Object.getOwnPropertyDescriptor(k,M):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,k,M,D);else for(var N=y.length-1;N>=0;N--)(T=y[N])&&(R=(E<3?T(R):E>3?T(k,M,R):T(k,M))||R);return E>3&&R&&Object.defineProperty(k,M,R),R},p=this&&this.__param||function(y,k){return function(M,D){k(M,D,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const u=c(5871),S=c(4725),w=c(844),A=c(2585),x={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0};let g=a.OverviewRulerRenderer=class extends w.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,k,M,D,T,E,R){var z;super(),this._viewportElement=y,this._screenElement=k,this._bufferService=M,this._decorationService=D,this._renderService=T,this._optionsService=E,this._coreBrowserService=R,this._colorZoneStore=new u.ColorZoneStore,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(),(z=this._viewportElement.parentElement)==null||z.insertBefore(this._canvas,this._viewportElement);const N=this._canvas.getContext("2d");if(!N)throw new Error("Ctx cannot be null");this._ctx=N,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,w.toDisposable)((()=>{var F;(F=this._canvas)==null||F.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){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())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const y=Math.floor(this._canvas.width/3),k=Math.ceil(this._canvas.width/3);b.full=this._canvas.width,b.left=y,b.center=k,b.right=y,this._refreshDrawHeightConstants(),_.full=0,_.left=0,_.center=b.left,_.right=b.left+b.center}_refreshDrawHeightConstants(){x.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,k=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);x.left=k,x.center=k,x.right=k}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.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(const k of this._decorationService.decorations)this._colorZoneStore.addDecoration(k);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const k of y)k.position!=="full"&&this._renderColorZone(k);for(const k of y)k.position==="full"&&this._renderColorZone(k);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(_[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-x[y.position||"full"]/2),b[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+x[y.position||"full"]))}_queueRefresh(y,k){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=k||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};a.OverviewRulerRenderer=g=h([p(2,A.IBufferService),p(3,A.IDecorationService),p(4,S.IRenderService),p(5,A.IOptionsService),p(6,S.ICoreBrowserService)],g)},2950:function(f,a,c){var h=this&&this.__decorate||function(x,b,_,g){var y,k=arguments.length,M=k<3?b:g===null?g=Object.getOwnPropertyDescriptor(b,_):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,b,_,g);else for(var D=x.length-1;D>=0;D--)(y=x[D])&&(M=(k<3?y(M):k>3?y(b,_,M):y(b,_))||M);return k>3&&M&&Object.defineProperty(b,_,M),M},p=this&&this.__param||function(x,b){return function(_,g){b(_,g,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const u=c(4725),S=c(2585),w=c(2584);let A=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(x,b,_,g,y,k){this._textarea=x,this._compositionView=b,this._bufferService=_,this._optionsService=g,this._coreService=y,this._renderService=k,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(x){this._compositionView.textContent=x.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(x){if(this._isComposing||this._isSendingComposition){if(x.keyCode===229||x.keyCode===16||x.keyCode===17||x.keyCode===18)return!1;this._finalizeComposition(!1)}return x.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(x){if(this._compositionView.classList.remove("active"),this._isComposing=!1,x){const b={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let _;this._isSendingComposition=!1,b.start+=this._dataAlreadySent.length,_=this._isComposing?this._textarea.value.substring(b.start,b.end):this._textarea.value.substring(b.start),_.length>0&&this._coreService.triggerDataEvent(_,!0)}}),0)}else{this._isSendingComposition=!1;const b=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(b,!0)}}_handleAnyTextareaChanges(){const x=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const b=this._textarea.value,_=b.replace(x,"");this._dataAlreadySent=_,b.length>x.length?this._coreService.triggerDataEvent(_,!0):b.length<x.length?this._coreService.triggerDataEvent(`${w.C0.DEL}`,!0):b.length===x.length&&b!==x&&this._coreService.triggerDataEvent(b,!0)}}),0)}updateCompositionElements(x){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const b=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),_=this._renderService.dimensions.css.cell.height,g=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,y=b*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=y+"px",this._compositionView.style.top=g+"px",this._compositionView.style.height=_+"px",this._compositionView.style.lineHeight=_+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const k=this._compositionView.getBoundingClientRect();this._textarea.style.left=y+"px",this._textarea.style.top=g+"px",this._textarea.style.width=Math.max(k.width,1)+"px",this._textarea.style.height=Math.max(k.height,1)+"px",this._textarea.style.lineHeight=k.height+"px"}x||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};a.CompositionHelper=A=h([p(2,S.IBufferService),p(3,S.IOptionsService),p(4,S.ICoreService),p(5,u.IRenderService)],A)},9806:(f,a)=>{function c(h,p,u){const S=u.getBoundingClientRect(),w=h.getComputedStyle(u),A=parseInt(w.getPropertyValue("padding-left")),x=parseInt(w.getPropertyValue("padding-top"));return[p.clientX-S.left-A,p.clientY-S.top-x]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=c,a.getCoords=function(h,p,u,S,w,A,x,b,_){if(!A)return;const g=c(h,p,u);return g?(g[0]=Math.ceil((g[0]+(_?x/2:0))/x),g[1]=Math.ceil(g[1]/b),g[0]=Math.min(Math.max(g[0],1),S+(_?1:0)),g[1]=Math.min(Math.max(g[1],1),w),g):void 0}},9504:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const h=c(2584);function p(b,_,g,y){const k=b-u(b,g),M=_-u(_,g),D=Math.abs(k-M)-(function(T,E,R){let N=0;const z=T-u(T,R),F=E-u(E,R);for(let P=0;P<Math.abs(z-F);P++){const $=S(T,E)==="A"?-1:1,K=R.buffer.lines.get(z+$*P);K!=null&&K.isWrapped&&N++}return N})(b,_,g);return x(D,A(S(b,_),y))}function u(b,_){let g=0,y=_.buffer.lines.get(b),k=y==null?void 0:y.isWrapped;for(;k&&b>=0&&b<_.rows;)g++,y=_.buffer.lines.get(--b),k=y==null?void 0:y.isWrapped;return g}function S(b,_){return b>_?"A":"B"}function w(b,_,g,y,k,M){let D=b,T=_,E="";for(;D!==g||T!==y;)D+=k?1:-1,k&&D>M.cols-1?(E+=M.buffer.translateBufferLineToString(T,!1,b,D),D=0,b=0,T++):!k&&D<0&&(E+=M.buffer.translateBufferLineToString(T,!1,0,b+1),D=M.cols-1,b=D,T--);return E+M.buffer.translateBufferLineToString(T,!1,b,D)}function A(b,_){const g=_?"O":"[";return h.C0.ESC+g+b}function x(b,_){b=Math.floor(b);let g="";for(let y=0;y<b;y++)g+=_;return g}a.moveToCellSequence=function(b,_,g,y){const k=g.buffer.x,M=g.buffer.y;if(!g.buffer.hasScrollback)return(function(E,R,N,z,F,P){return p(R,z,F,P).length===0?"":x(w(E,R,E,R-u(R,F),!1,F).length,A("D",P))})(k,M,0,_,g,y)+p(M,_,g,y)+(function(E,R,N,z,F,P){let $;$=p(R,z,F,P).length>0?z-u(z,F):R;const K=z,G=(function(X,ee,H,O,j,V){let I;return I=p(H,O,j,V).length>0?O-u(O,j):ee,X<H&&I<=O||X>=H&&I<O?"C":"D"})(E,R,N,z,F,P);return x(w(E,$,N,K,G==="C",F).length,A(G,P))})(k,M,b,_,g,y);let D;if(M===_)return D=k>b?"D":"C",x(Math.abs(k-b),A(D,y));D=M>_?"D":"C";const T=Math.abs(M-_);return x((function(E,R){return R.cols-E})(M>_?b:k,g)+(T-1)*g.cols+1+((M>_?k:b)-1),A(D,y))}},1296:function(f,a,c){var h=this&&this.__decorate||function(P,$,K,G){var X,ee=arguments.length,H=ee<3?$:G===null?G=Object.getOwnPropertyDescriptor($,K):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(P,$,K,G);else for(var O=P.length-1;O>=0;O--)(X=P[O])&&(H=(ee<3?X(H):ee>3?X($,K,H):X($,K))||H);return ee>3&&H&&Object.defineProperty($,K,H),H},p=this&&this.__param||function(P,$){return function(K,G){$(K,G,P)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const u=c(3787),S=c(2550),w=c(2223),A=c(6171),x=c(6052),b=c(4725),_=c(8055),g=c(8460),y=c(844),k=c(2585),M="xterm-dom-renderer-owner-",D="xterm-rows",T="xterm-fg-",E="xterm-bg-",R="xterm-focus",N="xterm-selection";let z=1,F=a.DomRenderer=class extends y.Disposable{constructor(P,$,K,G,X,ee,H,O,j,V,I,ne,_e){super(),this._terminal=P,this._document=$,this._element=K,this._screenElement=G,this._viewportElement=X,this._helperContainer=ee,this._linkifier2=H,this._charSizeService=j,this._optionsService=V,this._bufferService=I,this._coreBrowserService=ne,this._themeService=_e,this._terminalClass=z++,this._rowElements=[],this._selectionRenderModel=(0,x.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new g.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(D),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(N),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,A.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ge=>this._injectCss(ge)))),this._injectCss(this._themeService.colors),this._rowFactory=O.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(M+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ge=>this._handleLinkHover(ge)))),this.register(this._linkifier2.onHideLinkUnderline((ge=>this._handleLinkLeave(ge)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(M+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new S.WidthCache(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(){const P=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*P,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*P),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/P),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/P),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(const K of this._rowElements)K.style.width=`${this.dimensions.css.canvas.width}px`,K.style.height=`${this.dimensions.css.cell.height}px`,K.style.lineHeight=`${this.dimensions.css.cell.height}px`,K.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const $=`${this._terminalSelector} .${D} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=$,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(P){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let $=`${this._terminalSelector} .${D} { color: ${P.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;$+=`${this._terminalSelector} .${D} .xterm-dim { color: ${_.color.multiplyOpacity(P.foreground,.5).css};}`,$+=`${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;}`;const K=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;$+=`@keyframes ${K} { 50% { border-bottom-style: hidden; }}`,$+=`@keyframes ${G} { 50% { box-shadow: none; }}`,$+=`@keyframes ${X} { 0% { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css}; } 50% { background-color: inherit; color: ${P.cursor.css}; }}`,$+=`${this._terminalSelector} .${D}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${D}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${D}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-block { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css};}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${P.cursor.css} !important; color: ${P.cursorAccent.css} !important;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${P.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${P.cursor.css} inset;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${P.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,$+=`${this._terminalSelector} .${N} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${N} div { position: absolute; background-color: ${P.selectionBackgroundOpaque.css};}${this._terminalSelector} .${N} div { position: absolute; background-color: ${P.selectionInactiveBackgroundOpaque.css};}`;for(const[ee,H]of P.ansi.entries())$+=`${this._terminalSelector} .${T}${ee} { color: ${H.css}; }${this._terminalSelector} .${T}${ee}.xterm-dim { color: ${_.color.multiplyOpacity(H,.5).css}; }${this._terminalSelector} .${E}${ee} { background-color: ${H.css}; }`;$+=`${this._terminalSelector} .${T}${w.INVERTED_DEFAULT_COLOR} { color: ${_.color.opaque(P.background).css}; }${this._terminalSelector} .${T}${w.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${_.color.multiplyOpacity(_.color.opaque(P.background),.5).css}; }${this._terminalSelector} .${E}${w.INVERTED_DEFAULT_COLOR} { background-color: ${P.foreground.css}; }`,this._themeStyleElement.textContent=$}_setDefaultSpacing(){const P=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${P}px`,this._rowFactory.defaultSpacing=P}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(P,$){for(let K=this._rowElements.length;K<=$;K++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>$;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(P,$){this._refreshRowElements(P,$),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(R),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(R),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(P,$,K){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(P,$,K),this.renderRows(0,this._bufferService.rows-1),!P||!$)return;this._selectionRenderModel.update(this._terminal,P,$,K);const G=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,ee=this._selectionRenderModel.viewportCappedStartRow,H=this._selectionRenderModel.viewportCappedEndRow;if(ee>=this._bufferService.rows||H<0)return;const O=this._document.createDocumentFragment();if(K){const j=P[0]>$[0];O.appendChild(this._createSelectionElement(ee,j?$[0]:P[0],j?P[0]:$[0],H-ee+1))}else{const j=G===ee?P[0]:0,V=ee===X?$[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(ee,j,V));const I=H-ee-1;if(O.appendChild(this._createSelectionElement(ee+1,0,this._bufferService.cols,I)),ee!==H){const ne=X===H?$[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(H,0,ne))}}this._selectionContainer.appendChild(O)}_createSelectionElement(P,$,K,G=1){const X=this._document.createElement("div"),ee=$*this.dimensions.css.cell.width;let H=this.dimensions.css.cell.width*(K-$);return ee+H>this.dimensions.css.canvas.width&&(H=this.dimensions.css.canvas.width-ee),X.style.height=G*this.dimensions.css.cell.height+"px",X.style.top=P*this.dimensions.css.cell.height+"px",X.style.left=`${ee}px`,X.style.width=`${H}px`,X}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(const P of this._rowElements)P.replaceChildren()}renderRows(P,$){const K=this._bufferService.buffer,G=K.ybase+K.y,X=Math.min(K.x,this._bufferService.cols-1),ee=this._optionsService.rawOptions.cursorBlink,H=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let j=P;j<=$;j++){const V=j+K.ydisp,I=this._rowElements[j],ne=K.lines.get(V);if(!I||!ne)break;I.replaceChildren(...this._rowFactory.createRow(ne,V,V===G,H,O,X,ee,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${M}${this._terminalClass}`}_handleLinkHover(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!0)}_handleLinkLeave(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!1)}_setCellUnderline(P,$,K,G,X,ee){K<0&&(P=0),G<0&&($=0);const H=this._bufferService.rows-1;K=Math.max(Math.min(K,H),0),G=Math.max(Math.min(G,H),0),X=Math.min(X,this._bufferService.cols);const O=this._bufferService.buffer,j=O.ybase+O.y,V=Math.min(O.x,X-1),I=this._optionsService.rawOptions.cursorBlink,ne=this._optionsService.rawOptions.cursorStyle,_e=this._optionsService.rawOptions.cursorInactiveStyle;for(let ge=K;ge<=G;++ge){const Q=ge+O.ydisp,q=this._rowElements[ge],J=O.lines.get(Q);if(!q||!J)break;q.replaceChildren(...this._rowFactory.createRow(J,Q,Q===j,ne,_e,V,I,this.dimensions.css.cell.width,this._widthCache,ee?ge===K?P:0:-1,ee?(ge===G?$:X)-1:-1))}}};a.DomRenderer=F=h([p(7,k.IInstantiationService),p(8,b.ICharSizeService),p(9,k.IOptionsService),p(10,k.IBufferService),p(11,b.ICoreBrowserService),p(12,b.IThemeService)],F)},3787:function(f,a,c){var h=this&&this.__decorate||function(D,T,E,R){var N,z=arguments.length,F=z<3?T:R===null?R=Object.getOwnPropertyDescriptor(T,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(D,T,E,R);else for(var P=D.length-1;P>=0;P--)(N=D[P])&&(F=(z<3?N(F):z>3?N(T,E,F):N(T,E))||F);return z>3&&F&&Object.defineProperty(T,E,F),F},p=this&&this.__param||function(D,T){return function(E,R){T(E,R,D)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const u=c(2223),S=c(643),w=c(511),A=c(2585),x=c(8055),b=c(4725),_=c(4269),g=c(6171),y=c(3734);let k=a.DomRendererRowFactory=class{constructor(D,T,E,R,N,z,F){this._document=D,this._characterJoinerService=T,this._optionsService=E,this._coreBrowserService=R,this._coreService=N,this._decorationService=z,this._themeService=F,this._workCell=new w.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(D,T,E){this._selectionStart=D,this._selectionEnd=T,this._columnSelectMode=E}createRow(D,T,E,R,N,z,F,P,$,K,G){const X=[],ee=this._characterJoinerService.getJoinedCharacters(T),H=this._themeService.colors;let O,j=D.getNoBgTrimmedLength();E&&j<z+1&&(j=z+1);let V=0,I="",ne=0,_e=0,ge=0,Q=!1,q=0,J=!1,Y=0;const he=[],de=K!==-1&&G!==-1;for(let be=0;be<j;be++){D.loadCell(be,this._workCell);let Pe=this._workCell.getWidth();if(Pe===0)continue;let qe=!1,Ke=be,Ae=this._workCell;if(ee.length>0&&be===ee[0][0]){qe=!0;const Fe=ee.shift();Ae=new _.JoinedCellData(this._workCell,D.translateToString(!0,Fe[0],Fe[1]),Fe[1]-Fe[0]),Ke=Fe[1]-1,Pe=Ae.getWidth()}const jt=this._isCellInSelection(be,T),ht=E&&be===z,Lt=de&&be>=K&&be<=G;let it=!1;this._decorationService.forEachDecorationAtCell(be,T,void 0,(Fe=>{it=!0}));let kt=Ae.getChars()||S.WHITESPACE_CELL_CHAR;if(kt===" "&&(Ae.isUnderline()||Ae.isOverline())&&(kt=" "),Y=Pe*P-$.get(kt,Ae.isBold(),Ae.isItalic()),O){if(V&&(jt&&J||!jt&&!J&&Ae.bg===ne)&&(jt&&J&&H.selectionForeground||Ae.fg===_e)&&Ae.extended.ext===ge&&Lt===Q&&Y===q&&!ht&&!qe&&!it){Ae.isInvisible()?I+=S.WHITESPACE_CELL_CHAR:I+=kt,V++;continue}V&&(O.textContent=I),O=this._document.createElement("span"),V=0,I=""}else O=this._document.createElement("span");if(ne=Ae.bg,_e=Ae.fg,ge=Ae.extended.ext,Q=Lt,q=Y,J=jt,qe&&z>=be&&z<=Ke&&(z=be),!this._coreService.isCursorHidden&&ht&&this._coreService.isCursorInitialized){if(he.push("xterm-cursor"),this._coreBrowserService.isFocused)F&&he.push("xterm-cursor-blink"),he.push(R==="bar"?"xterm-cursor-bar":R==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(N)switch(N){case"outline":he.push("xterm-cursor-outline");break;case"block":he.push("xterm-cursor-block");break;case"bar":he.push("xterm-cursor-bar");break;case"underline":he.push("xterm-cursor-underline")}}if(Ae.isBold()&&he.push("xterm-bold"),Ae.isItalic()&&he.push("xterm-italic"),Ae.isDim()&&he.push("xterm-dim"),I=Ae.isInvisible()?S.WHITESPACE_CELL_CHAR:Ae.getChars()||S.WHITESPACE_CELL_CHAR,Ae.isUnderline()&&(he.push(`xterm-underline-${Ae.extended.underlineStyle}`),I===" "&&(I=" "),!Ae.isUnderlineColorDefault()))if(Ae.isUnderlineColorRGB())O.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Ae.getUnderlineColor()).join(",")})`;else{let Fe=Ae.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ae.isBold()&&Fe<8&&(Fe+=8),O.style.textDecorationColor=H.ansi[Fe].css}Ae.isOverline()&&(he.push("xterm-overline"),I===" "&&(I=" ")),Ae.isStrikethrough()&&he.push("xterm-strikethrough"),Lt&&(O.style.textDecoration="underline");let ae=Ae.getFgColor(),at=Ae.getFgColorMode(),Ze=Ae.getBgColor(),ue=Ae.getBgColorMode();const Se=!!Ae.isInverse();if(Se){const Fe=ae;ae=Ze,Ze=Fe;const bt=at;at=ue,ue=bt}let Ce,De,Ne,_t=!1;switch(this._decorationService.forEachDecorationAtCell(be,T,void 0,(Fe=>{Fe.options.layer!=="top"&&_t||(Fe.backgroundColorRGB&&(ue=50331648,Ze=Fe.backgroundColorRGB.rgba>>8&16777215,Ce=Fe.backgroundColorRGB),Fe.foregroundColorRGB&&(at=50331648,ae=Fe.foregroundColorRGB.rgba>>8&16777215,De=Fe.foregroundColorRGB),_t=Fe.options.layer==="top")})),!_t&&jt&&(Ce=this._coreBrowserService.isFocused?H.selectionBackgroundOpaque:H.selectionInactiveBackgroundOpaque,Ze=Ce.rgba>>8&16777215,ue=50331648,_t=!0,H.selectionForeground&&(at=50331648,ae=H.selectionForeground.rgba>>8&16777215,De=H.selectionForeground)),_t&&he.push("xterm-decoration-top"),ue){case 16777216:case 33554432:Ne=H.ansi[Ze],he.push(`xterm-bg-${Ze}`);break;case 50331648:Ne=x.channels.toColor(Ze>>16,Ze>>8&255,255&Ze),this._addStyle(O,`background-color:#${M((Ze>>>0).toString(16),"0",6)}`);break;default:Se?(Ne=H.foreground,he.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):Ne=H.background}switch(Ce||Ae.isDim()&&(Ce=x.color.multiplyOpacity(Ne,.5)),at){case 16777216:case 33554432:Ae.isBold()&&ae<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ae+=8),this._applyMinimumContrast(O,Ne,H.ansi[ae],Ae,Ce,void 0)||he.push(`xterm-fg-${ae}`);break;case 50331648:const Fe=x.channels.toColor(ae>>16&255,ae>>8&255,255&ae);this._applyMinimumContrast(O,Ne,Fe,Ae,Ce,De)||this._addStyle(O,`color:#${M(ae.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(O,Ne,H.foreground,Ae,Ce,De)||Se&&he.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}he.length&&(O.className=he.join(" "),he.length=0),ht||qe||it?O.textContent=I:V++,Y!==this.defaultSpacing&&(O.style.letterSpacing=`${Y}px`),X.push(O),be=Ke}return O&&V&&(O.textContent=I),X}_applyMinimumContrast(D,T,E,R,N,z){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,g.treatGlyphAsBackgroundColor)(R.getCode()))return!1;const F=this._getContrastCache(R);let P;if(N||z||(P=F.getColor(T.rgba,E.rgba)),P===void 0){const $=this._optionsService.rawOptions.minimumContrastRatio/(R.isDim()?2:1);P=x.color.ensureContrastRatio(N||T,z||E,$),F.setColor((N||T).rgba,(z||E).rgba,P??null)}return!!P&&(this._addStyle(D,`color:${P.css}`),!0)}_getContrastCache(D){return D.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(D,T){D.setAttribute("style",`${D.getAttribute("style")||""}${T};`)}_isCellInSelection(D,T){const E=this._selectionStart,R=this._selectionEnd;return!(!E||!R)&&(this._columnSelectMode?E[0]<=R[0]?D>=E[0]&&T>=E[1]&&D<R[0]&&T<=R[1]:D<E[0]&&T>=E[1]&&D>=R[0]&&T<=R[1]:T>E[1]&&T<R[1]||E[1]===R[1]&&T===E[1]&&D>=E[0]&&D<R[0]||E[1]<R[1]&&T===R[1]&&D<R[0]||E[1]<R[1]&&T===E[1]&&D>=E[0])}};function M(D,T,E){for(;D.length<E;)D=T+D;return D}a.DomRendererRowFactory=k=h([p(1,b.ICharacterJoinerService),p(2,A.IOptionsService),p(3,b.ICoreBrowserService),p(4,A.ICoreService),p(5,A.IDecorationService),p(6,b.IThemeService)],k)},2550:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(c,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.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";const p=c.createElement("span");p.classList.add("xterm-char-measure-element");const u=c.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const S=c.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontStyle="italic";const w=c.createElement("span");w.classList.add("xterm-char-measure-element"),w.style.fontWeight="bold",w.style.fontStyle="italic",this._measureElements=[p,u,S,w],this._container.appendChild(p),this._container.appendChild(u),this._container.appendChild(S),this._container.appendChild(w),h.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(c,h,p,u){c===this._font&&h===this._fontSize&&p===this._weight&&u===this._weightBold||(this._font=c,this._fontSize=h,this._weight=p,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(c,h,p){let u=0;if(!h&&!p&&c.length===1&&(u=c.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const A=this._measure(c,0);return A>0&&(this._flat[u]=A),A}let S=c;h&&(S+="B"),p&&(S+="I");let w=this._holey.get(S);if(w===void 0){let A=0;h&&(A|=1),p&&(A|=2),w=this._measure(c,A),w>0&&this._holey.set(S,w)}return w}_measure(c,h){const p=this._measureElements[h];return p.textContent=c.repeat(32),p.offsetWidth/32}}},2223:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const h=c(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(f,a)=>{function c(p){return 57508<=p&&p<=57558}function h(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},a.isPowerlineGlyph=c,a.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},a.isEmoji=h,a.allowRescaling=function(p,u,S,w){return u===1&&S>Math.ceil(1.5*w)&&p!==void 0&&p>255&&!h(p)&&!c(p)&&!(function(A){return 57344<=A&&A<=63743})(p)},a.treatGlyphAsBackgroundColor=function(p){return c(p)||(function(u){return 9472<=u&&u<=9631})(p)},a.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},a.computeNextVariantOffset=function(p,u,S=0){return(p-(2*Math.round(u)-S))%(2*Math.round(u))}},6052:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class c{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(p,u,S,w=!1){if(this.selectionStart=u,this.selectionEnd=S,!u||!S||u[0]===S[0]&&u[1]===S[1])return void this.clear();const A=p.buffers.active.ydisp,x=u[1]-A,b=S[1]-A,_=Math.max(x,0),g=Math.min(b,p.rows-1);_>=p.rows||g<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=x,this.viewportEndRow=b,this.viewportCappedStartRow=_,this.viewportCappedEndRow=g,this.startCol=u[0],this.endCol=S[0])}isCellSelected(p,u,S){return!!this.hasSelection&&(S-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&S>=this.viewportCappedStartRow&&u<this.endCol&&S<=this.viewportCappedEndRow:u<this.startCol&&S>=this.viewportCappedStartRow&&u>=this.endCol&&S<=this.viewportCappedEndRow:S>this.viewportStartRow&&S<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&S===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&S===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&S===this.viewportStartRow&&u>=this.startCol)}}a.createSelectionRenderModel=function(){return new c}},456:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(c){this._bufferService=c,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.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()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,h=this.selectionEnd;return!(!c||!h)&&(c[1]>h[1]||c[1]===h[1]&&c[0]>h[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(f,a,c){var h=this&&this.__decorate||function(g,y,k,M){var D,T=arguments.length,E=T<3?y:M===null?M=Object.getOwnPropertyDescriptor(y,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(g,y,k,M);else for(var R=g.length-1;R>=0;R--)(D=g[R])&&(E=(T<3?D(E):T>3?D(y,k,E):D(y,k))||E);return T>3&&E&&Object.defineProperty(y,k,E),E},p=this&&this.__param||function(g,y){return function(k,M){y(k,M,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const u=c(2585),S=c(8460),w=c(844);let A=a.CharSizeService=class extends w.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(g,y,k){super(),this._optionsService=k,this.width=0,this.height=0,this._onCharSizeChange=this.register(new S.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new _(this._optionsService))}catch{this._measureStrategy=this.register(new b(g,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const g=this._measureStrategy.measure();g.width===this.width&&g.height===this.height||(this.width=g.width,this.height=g.height,this._onCharSizeChange.fire())}};a.CharSizeService=A=h([p(2,u.IOptionsService)],A);class x extends w.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,k){y!==void 0&&y>0&&k!==void 0&&k>0&&(this._result.width=y,this._result.height=k)}}class b extends x{constructor(y,k,M){super(),this._document=y,this._parentElement=k,this._optionsService=M,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}}class _ extends x{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const k=this._ctx.measureText("W");if(!("width"in k&&"fontBoundingBoxAscent"in k&&"fontBoundingBoxDescent"in k))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const y=this._ctx.measureText("W");return this._validateAndSet(y.width,y.fontBoundingBoxAscent+y.fontBoundingBoxDescent),this._result}}},4269:function(f,a,c){var h=this&&this.__decorate||function(_,g,y,k){var M,D=arguments.length,T=D<3?g:k===null?k=Object.getOwnPropertyDescriptor(g,y):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(_,g,y,k);else for(var E=_.length-1;E>=0;E--)(M=_[E])&&(T=(D<3?M(T):D>3?M(g,y,T):M(g,y))||T);return D>3&&T&&Object.defineProperty(g,y,T),T},p=this&&this.__param||function(_,g){return function(y,k){g(y,k,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const u=c(3734),S=c(643),w=c(511),A=c(2585);class x extends u.AttributeData{constructor(g,y,k){super(),this.content=0,this.combinedData="",this.fg=g.fg,this.bg=g.bg,this.combinedData=y,this._width=k}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(g){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=x;let b=a.CharacterJoinerService=class ug{constructor(g){this._bufferService=g,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new w.CellData}register(g){const y={id:this._nextCharacterJoinerId++,handler:g};return this._characterJoiners.push(y),y.id}deregister(g){for(let y=0;y<this._characterJoiners.length;y++)if(this._characterJoiners[y].id===g)return this._characterJoiners.splice(y,1),!0;return!1}getJoinedCharacters(g){if(this._characterJoiners.length===0)return[];const y=this._bufferService.buffer.lines.get(g);if(!y||y.length===0)return[];const k=[],M=y.translateToString(!0);let D=0,T=0,E=0,R=y.getFg(0),N=y.getBg(0);for(let z=0;z<y.getTrimmedLength();z++)if(y.loadCell(z,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==R||this._workCell.bg!==N){if(z-D>1){const F=this._getJoinedRanges(M,E,T,y,D);for(let P=0;P<F.length;P++)k.push(F[P])}D=z,E=T,R=this._workCell.fg,N=this._workCell.bg}T+=this._workCell.getChars().length||S.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-D>1){const z=this._getJoinedRanges(M,E,T,y,D);for(let F=0;F<z.length;F++)k.push(z[F])}return k}_getJoinedRanges(g,y,k,M,D){const T=g.substring(y,k);let E=[];try{E=this._characterJoiners[0].handler(T)}catch(R){console.error(R)}for(let R=1;R<this._characterJoiners.length;R++)try{const N=this._characterJoiners[R].handler(T);for(let z=0;z<N.length;z++)ug._mergeRanges(E,N[z])}catch(N){console.error(N)}return this._stringRangesToCellRanges(E,M,D),E}_stringRangesToCellRanges(g,y,k){let M=0,D=!1,T=0,E=g[M];if(E){for(let R=k;R<this._bufferService.cols;R++){const N=y.getWidth(R),z=y.getString(R).length||S.WHITESPACE_CELL_CHAR.length;if(N!==0){if(!D&&E[0]<=T&&(E[0]=R,D=!0),E[1]<=T){if(E[1]=R,E=g[++M],!E)break;E[0]<=T?(E[0]=R,D=!0):D=!1}T+=z}}E&&(E[1]=this._bufferService.cols)}}static _mergeRanges(g,y){let k=!1;for(let M=0;M<g.length;M++){const D=g[M];if(k){if(y[1]<=D[0])return g[M-1][1]=y[1],g;if(y[1]<=D[1])return g[M-1][1]=Math.max(y[1],D[1]),g.splice(M,1),g;g.splice(M,1),M--}else{if(y[1]<=D[0])return g.splice(M,0,y),g;if(y[1]<=D[1])return D[0]=Math.min(y[0],D[0]),g;y[0]<D[1]&&(D[0]=Math.min(y[0],D[0]),k=!0)}}return k?g[g.length-1][1]=y[1]:g.push(y),g}};a.CharacterJoinerService=b=h([p(0,A.IBufferService)],b)},5114:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const h=c(844),p=c(8460),u=c(3656);class S extends h.Disposable{constructor(x,b,_){super(),this._textarea=x,this._window=b,this.mainDocument=_,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new w(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((g=>this._screenDprMonitor.setWindow(g)))),this.register((0,p.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(x){this._window!==x&&(this._window=x,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}}a.CoreBrowserService=S;class w extends h.Disposable{constructor(x){super(),this._parentWindow=x,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(x){this._parentWindow=x,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var x;this._outerListener&&((x=this._resolutionMediaMatchList)==null||x.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)}}},779:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const h=c(844);class p extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(S){return this.linkProviders.push(S),{dispose:()=>{const w=this.linkProviders.indexOf(S);w!==-1&&this.linkProviders.splice(w,1)}}}}a.LinkProviderService=p},8934:function(f,a,c){var h=this&&this.__decorate||function(A,x,b,_){var g,y=arguments.length,k=y<3?x:_===null?_=Object.getOwnPropertyDescriptor(x,b):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(A,x,b,_);else for(var M=A.length-1;M>=0;M--)(g=A[M])&&(k=(y<3?g(k):y>3?g(x,b,k):g(x,b))||k);return y>3&&k&&Object.defineProperty(x,b,k),k},p=this&&this.__param||function(A,x){return function(b,_){x(b,_,A)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const u=c(4725),S=c(9806);let w=a.MouseService=class{constructor(A,x){this._renderService=A,this._charSizeService=x}getCoords(A,x,b,_,g){return(0,S.getCoords)(window,A,x,b,_,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,g)}getMouseReportCoords(A,x){const b=(0,S.getCoordsRelativeToElement)(window,A,x);if(this._charSizeService.hasValidSize)return b[0]=Math.min(Math.max(b[0],0),this._renderService.dimensions.css.canvas.width-1),b[1]=Math.min(Math.max(b[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(b[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(b[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(b[0]),y:Math.floor(b[1])}}};a.MouseService=w=h([p(0,u.IRenderService),p(1,u.ICharSizeService)],w)},3230:function(f,a,c){var h=this&&this.__decorate||function(g,y,k,M){var D,T=arguments.length,E=T<3?y:M===null?M=Object.getOwnPropertyDescriptor(y,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(g,y,k,M);else for(var R=g.length-1;R>=0;R--)(D=g[R])&&(E=(T<3?D(E):T>3?D(y,k,E):D(y,k))||E);return T>3&&E&&Object.defineProperty(y,k,E),E},p=this&&this.__param||function(g,y){return function(k,M){y(k,M,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const u=c(6193),S=c(4725),w=c(8460),A=c(844),x=c(7226),b=c(2585);let _=a.RenderService=class extends A.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(g,y,k,M,D,T,E,R){super(),this._rowCount=g,this._charSizeService=M,this._renderer=this.register(new A.MutableDisposable),this._pausedResizeTask=new x.DebouncedIdleTask,this._observerDisposable=this.register(new A.MutableDisposable),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 w.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new w.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new w.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new w.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer(((N,z)=>this._renderRows(N,z)),E),this.register(this._renderDebouncer),this.register(E.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(T.onResize((()=>this._fullRefresh()))),this.register(T.buffers.onBufferActivate((()=>{var N;return(N=this._renderer.value)==null?void 0:N.clear()}))),this.register(k.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(D.onDecorationRegistered((()=>this._fullRefresh()))),this.register(D.onDecorationRemoved((()=>this._fullRefresh()))),this.register(k.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(T.cols,T.rows),this._fullRefresh()}))),this.register(k.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(T.buffer.y,T.buffer.y,!0)))),this.register(R.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(E.window,y),this.register(E.onWindowChange((N=>this._registerIntersectionObserver(N,y))))}_registerIntersectionObserver(g,y){if("IntersectionObserver"in g){const k=new g.IntersectionObserver((M=>this._handleIntersectionChange(M[M.length-1])),{threshold:0});k.observe(y),this._observerDisposable.value=(0,A.toDisposable)((()=>k.disconnect()))}}_handleIntersectionChange(g){this._isPaused=g.isIntersecting===void 0?g.intersectionRatio===0:!g.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(g,y,k=!1){this._isPaused?this._needsFullRefresh=!0:(k||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(g,y,this._rowCount))}_renderRows(g,y){this._renderer.value&&(g=Math.min(g,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(g,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:g,end:y}),this._onRender.fire({start:g,end:y}),this._isNextRenderRedrawOnly=!0)}resize(g,y){this._rowCount=y,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(g){this._renderer.value=g,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(g){return this._renderDebouncer.addRefreshCallback(g)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var g,y;this._renderer.value&&((y=(g=this._renderer.value).clearTextureAtlas)==null||y.call(g),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(g,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var k;return(k=this._renderer.value)==null?void 0:k.handleResize(g,y)})):this._renderer.value.handleResize(g,y),this._fullRefresh())}handleCharSizeChanged(){var g;(g=this._renderer.value)==null||g.handleCharSizeChanged()}handleBlur(){var g;(g=this._renderer.value)==null||g.handleBlur()}handleFocus(){var g;(g=this._renderer.value)==null||g.handleFocus()}handleSelectionChanged(g,y,k){var M;this._selectionState.start=g,this._selectionState.end=y,this._selectionState.columnSelectMode=k,(M=this._renderer.value)==null||M.handleSelectionChanged(g,y,k)}handleCursorMove(){var g;(g=this._renderer.value)==null||g.handleCursorMove()}clear(){var g;(g=this._renderer.value)==null||g.clear()}};a.RenderService=_=h([p(2,b.IOptionsService),p(3,S.ICharSizeService),p(4,b.IDecorationService),p(5,b.IBufferService),p(6,S.ICoreBrowserService),p(7,S.IThemeService)],_)},9312:function(f,a,c){var h=this&&this.__decorate||function(E,R,N,z){var F,P=arguments.length,$=P<3?R:z===null?z=Object.getOwnPropertyDescriptor(R,N):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(E,R,N,z);else for(var K=E.length-1;K>=0;K--)(F=E[K])&&($=(P<3?F($):P>3?F(R,N,$):F(R,N))||$);return P>3&&$&&Object.defineProperty(R,N,$),$},p=this&&this.__param||function(E,R){return function(N,z){R(N,z,E)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const u=c(9806),S=c(9504),w=c(456),A=c(4725),x=c(8460),b=c(844),_=c(6114),g=c(4841),y=c(511),k=c(2585),M=" ",D=new RegExp(M,"g");let T=a.SelectionService=class extends b.Disposable{constructor(E,R,N,z,F,P,$,K,G){super(),this._element=E,this._screenElement=R,this._linkifier=N,this._bufferService=z,this._coreService=F,this._mouseService=P,this._optionsService=$,this._renderService=K,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new x.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new x.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new x.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new w.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,b.toDisposable)((()=>{this._removeMouseDownListeners()})))}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(){const E=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!(!E||!R||E[0]===R[0]&&E[1]===R[1])}get selectionText(){const E=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;if(!E||!R)return"";const N=this._bufferService.buffer,z=[];if(this._activeSelectionMode===3){if(E[0]===R[0])return"";const F=E[0]<R[0]?E[0]:R[0],P=E[0]<R[0]?R[0]:E[0];for(let $=E[1];$<=R[1];$++){const K=N.translateBufferLineToString($,!0,F,P);z.push(K)}}else{const F=E[1]===R[1]?R[0]:void 0;z.push(N.translateBufferLineToString(E[1],!0,E[0],F));for(let P=E[1]+1;P<=R[1]-1;P++){const $=N.lines.get(P),K=N.translateBufferLineToString(P,!0);$!=null&&$.isWrapped?z[z.length-1]+=K:z.push(K)}if(E[1]!==R[1]){const P=N.lines.get(R[1]),$=N.translateBufferLineToString(R[1],!0,0,R[0]);P&&P.isWrapped?z[z.length-1]+=$:z.push($)}}return z.map((F=>F.replace(D," "))).join(_.isWindows?`\r
|
|
55
|
+
WARNING: This link could potentially be dangerous`)){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=b}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=C=h([p(0,S.IBufferService),p(1,S.IOptionsService),p(2,S.IOscLinkService)],C)},6193:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(c,h){this._renderCallback=c,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,h,p){this._rowCount=p,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,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)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const h=c(3614),p=c(3656),u=c(3551),S=c(9042),C=c(3730),A=c(1680),x=c(3107),b=c(5744),_=c(2950),g=c(1296),y=c(428),k=c(4269),M=c(5114),D=c(8934),T=c(3230),E=c(9312),R=c(4725),B=c(6731),H=c(8055),P=c(8969),F=c(8460),$=c(844),W=c(6114),G=c(8437),X=c(2584),te=c(7399),z=c(5941),O=c(9074),j=c(2585),V=c(5435),I=c(4567),ne=c(779);class _e extends P.CoreTerminal{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}constructor(Q={}){super(Q),this.browser=W,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new $.MutableDisposable),this._onCursorMove=this.register(new F.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new F.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new F.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new F.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new F.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new F.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new F.EventEmitter),this._onBlur=this.register(new F.EventEmitter),this._onA11yCharEmitter=this.register(new F.EventEmitter),this._onA11yTabEmitter=this.register(new F.EventEmitter),this._onWillOpen=this.register(new F.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(O.DecorationService),this._instantiationService.setService(j.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ne.LinkProviderService),this._instantiationService.setService(R.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(C.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((q,J)=>this.refresh(q,J)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((q=>this._reportWindowsOptions(q)))),this.register(this._inputHandler.onColor((q=>this._handleColorEvent(q)))),this.register((0,F.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,F.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((q=>this._afterResize(q.cols,q.rows)))),this.register((0,$.toDisposable)((()=>{var q,J;this._customKeyEventHandler=void 0,(J=(q=this.element)==null?void 0:q.parentNode)==null||J.removeChild(this.element)})))}_handleColorEvent(Q){if(this._themeService)for(const q of Q){let J,Y="";switch(q.index){case 256:J="foreground",Y="10";break;case 257:J="background",Y="11";break;case 258:J="cursor",Y="12";break;default:J="ansi",Y="4;"+q.index}switch(q.type){case 0:const he=H.color.toColorRGB(J==="ansi"?this._themeService.colors.ansi[q.index]:this._themeService.colors[J]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${Y};${(0,z.toRgbString)(he)}${X.C1_ESCAPED.ST}`);break;case 1:if(J==="ansi")this._themeService.modifyColors((de=>de.ansi[q.index]=H.channels.toColor(...q.color)));else{const de=J;this._themeService.modifyColors((be=>be[de]=H.channels.toColor(...q.color)))}break;case 2:this._themeService.restoreColor(q.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Q){Q?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(I.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Q){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var Q;return(Q=this.textarea)==null?void 0:Q.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const Q=this.buffer.ybase+this.buffer.y,q=this.buffer.lines.get(Q);if(!q)return;const J=Math.min(this.buffer.x,this.cols-1),Y=this._renderService.dimensions.css.cell.height,he=q.getWidth(J),de=this._renderService.dimensions.css.cell.width*he,be=this.buffer.y*this._renderService.dimensions.css.cell.height,Pe=J*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Pe+"px",this.textarea.style.top=be+"px",this.textarea.style.width=de+"px",this.textarea.style.height=Y+"px",this.textarea.style.lineHeight=Y+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",(q=>{this.hasSelection()&&(0,h.copyHandler)(q,this._selectionService)})));const Q=q=>(0,h.handlePasteEvent)(q,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",Q)),this.register((0,p.addDisposableDomListener)(this.element,"paste",Q)),W.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(q=>{q.button===2&&(0,h.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",(q=>{(0,h.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),W.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",(q=>{q.button===1&&(0,h.moveTextAreaUnderMouseCursor)(q,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(Q=>this._keyUp(Q)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(Q=>this._keyDown(Q)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(Q=>this._keyPress(Q)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(Q=>this._compositionHelper.compositionupdate(Q)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(Q=>this._inputEvent(Q)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Q){var J;if(!Q)throw new Error("Terminal requires a parent element.");if(Q.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((J=this.element)==null?void 0:J.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Q.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"),Q.appendChild(this.element);const q=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),q.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,p.addDisposableDomListener)(this.screenElement,"mousemove",(Y=>this.updateCursorStyle(Y)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),q.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",S.promptLabel),W.isChromeOS||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._coreBrowserService=this.register(this._instantiationService.createInstance(M.CoreBrowserService,this.textarea,Q.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(R.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",(Y=>this._handleTextAreaFocus(Y)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(R.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(B.ThemeService),this._instantiationService.setService(R.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(k.CharacterJoinerService),this._instantiationService.setService(R.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(R.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((Y=>this._onRender.fire(Y)))),this.onResize((Y=>this._renderService.resize(Y.cols,Y.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(_.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(D.MouseService),this._instantiationService.setService(R.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(u.Linkifier,this.screenElement)),this.element.appendChild(q);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(A.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((Y=>this.scrollLines(Y.amount,Y.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),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.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(E.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(R.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((Y=>this.scrollLines(Y.amount,Y.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((Y=>this._renderService.handleSelectionChanged(Y.start,Y.end,Y.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((Y=>{this.textarea.value=Y,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((Y=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(x.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(Y=>this._selectionService.handleMouseDown(Y)))),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(I.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(Y=>this._handleScreenReaderModeOptionChange(Y)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(Y=>{!this._overviewRulerRenderer&&Y&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(g.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Q=this,q=this.element;function J(de){const be=Q._mouseService.getMouseReportCoords(de,Q.screenElement);if(!be)return!1;let Pe,Fe;switch(de.overrideType||de.type){case"mousemove":Fe=32,de.buttons===void 0?(Pe=3,de.button!==void 0&&(Pe=de.button<3?de.button:3)):Pe=1&de.buttons?0:4&de.buttons?1:2&de.buttons?2:3;break;case"mouseup":Fe=0,Pe=de.button<3?de.button:3;break;case"mousedown":Fe=1,Pe=de.button<3?de.button:3;break;case"wheel":if(Q._customWheelEventHandler&&Q._customWheelEventHandler(de)===!1||Q.viewport.getLinesScrolled(de)===0)return!1;Fe=de.deltaY<0?0:1,Pe=4;break;default:return!1}return!(Fe===void 0||Pe===void 0||Pe>4)&&Q.coreMouseService.triggerMouseEvent({col:be.col,row:be.row,x:be.x,y:be.y,button:Pe,action:Fe,ctrl:de.ctrlKey,alt:de.altKey,shift:de.shiftKey})}const Y={mouseup:null,wheel:null,mousedrag:null,mousemove:null},he={mouseup:de=>(J(de),de.buttons||(this._document.removeEventListener("mouseup",Y.mouseup),Y.mousedrag&&this._document.removeEventListener("mousemove",Y.mousedrag)),this.cancel(de)),wheel:de=>(J(de),this.cancel(de,!0)),mousedrag:de=>{de.buttons&&J(de)},mousemove:de=>{de.buttons||J(de)}};this.register(this.coreMouseService.onProtocolChange((de=>{de?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(de)),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()),8&de?Y.mousemove||(q.addEventListener("mousemove",he.mousemove),Y.mousemove=he.mousemove):(q.removeEventListener("mousemove",Y.mousemove),Y.mousemove=null),16&de?Y.wheel||(q.addEventListener("wheel",he.wheel,{passive:!1}),Y.wheel=he.wheel):(q.removeEventListener("wheel",Y.wheel),Y.wheel=null),2&de?Y.mouseup||(Y.mouseup=he.mouseup):(this._document.removeEventListener("mouseup",Y.mouseup),Y.mouseup=null),4&de?Y.mousedrag||(Y.mousedrag=he.mousedrag):(this._document.removeEventListener("mousemove",Y.mousedrag),Y.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(q,"mousedown",(de=>{if(de.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(de))return J(de),Y.mouseup&&this._document.addEventListener("mouseup",Y.mouseup),Y.mousedrag&&this._document.addEventListener("mousemove",Y.mousedrag),this.cancel(de)}))),this.register((0,p.addDisposableDomListener)(q,"wheel",(de=>{if(!Y.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(de)===!1)return!1;if(!this.buffer.hasScrollback){const be=this.viewport.getLinesScrolled(de);if(be===0)return;const Pe=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(de.deltaY<0?"A":"B");let Fe="";for(let We=0;We<Math.abs(be);We++)Fe+=Pe;return this.coreService.triggerDataEvent(Fe,!0),this.cancel(de,!0)}return this.viewport.handleWheel(de)?this.cancel(de):void 0}}),{passive:!1})),this.register((0,p.addDisposableDomListener)(q,"touchstart",(de=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(de),this.cancel(de)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(q,"touchmove",(de=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(de)?void 0:this.cancel(de)}),{passive:!1}))}refresh(Q,q){var J;(J=this._renderService)==null||J.refreshRows(Q,q)}updateCursorStyle(Q){var q;(q=this._selectionService)!=null&&q.shouldColumnSelect(Q)?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(Q,q,J=0){var Y;J===1?(super.scrollLines(Q,q,J),this.refresh(0,this.rows-1)):(Y=this.viewport)==null||Y.scrollLines(Q)}paste(Q){(0,h.paste)(Q,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Q){this._customKeyEventHandler=Q}attachCustomWheelEventHandler(Q){this._customWheelEventHandler=Q}registerLinkProvider(Q){return this._linkProviderService.registerLinkProvider(Q)}registerCharacterJoiner(Q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const q=this._characterJoinerService.register(Q);return this.refresh(0,this.rows-1),q}deregisterCharacterJoiner(Q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Q)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Q){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Q)}registerDecoration(Q){return this._decorationService.registerDecoration(Q)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Q,q,J){this._selectionService.setSelection(Q,q,J)}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 Q;(Q=this._selectionService)==null||Q.clearSelection()}selectAll(){var Q;(Q=this._selectionService)==null||Q.selectAll()}selectLines(Q,q){var J;(J=this._selectionService)==null||J.selectLines(Q,q)}_keyDown(Q){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;const q=this.browser.isMac&&this.options.macOptionIsMeta&&Q.altKey;if(!q&&!this._compositionHelper.keydown(Q))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;q||Q.key!=="Dead"&&Q.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const J=(0,te.evaluateKeyboardEvent)(Q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Q),J.type===3||J.type===2){const Y=this.rows-1;return this.scrollLines(J.type===2?-Y:Y),this.cancel(Q,!0)}return J.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Q)||(J.cancel&&this.cancel(Q,!0),!J.key||!!(Q.key&&!Q.ctrlKey&&!Q.altKey&&!Q.metaKey&&Q.key.length===1&&Q.key.charCodeAt(0)>=65&&Q.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(J.key!==X.C0.ETX&&J.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:J.key,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(J.key,!0),!this.optionsService.rawOptions.screenReaderMode||Q.altKey||Q.ctrlKey?this.cancel(Q,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Q,q){const J=Q.isMac&&!this.options.macOptionIsMeta&&q.altKey&&!q.ctrlKey&&!q.metaKey||Q.isWindows&&q.altKey&&q.ctrlKey&&!q.metaKey||Q.isWindows&&q.getModifierState("AltGraph");return q.type==="keypress"?J:J&&(!q.keyCode||q.keyCode>47)}_keyUp(Q){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1||((function(q){return q.keyCode===16||q.keyCode===17||q.keyCode===18})(Q)||this.focus(),this.updateCursorStyle(Q),this._keyPressHandled=!1)}_keyPress(Q){let q;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;if(this.cancel(Q),Q.charCode)q=Q.charCode;else if(Q.which===null||Q.which===void 0)q=Q.keyCode;else{if(Q.which===0||Q.charCode===0)return!1;q=Q.which}return!(!q||(Q.altKey||Q.ctrlKey||Q.metaKey)&&!this._isThirdLevelShift(this.browser,Q)||(q=String.fromCharCode(q),this._onKey.fire({key:q,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(q,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Q){if(Q.data&&Q.inputType==="insertText"&&(!Q.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const q=Q.data;return this.coreService.triggerDataEvent(q,!0),this.cancel(Q),!0}return!1}resize(Q,q){Q!==this.cols||q!==this.rows?super.resize(Q,q):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Q,q){var J,Y;(J=this._charSizeService)==null||J.measure(),(Y=this.viewport)==null||Y.syncScrollArea(!0)}clear(){var Q;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 q=1;q<this.rows;q++)this.buffer.lines.push(this.buffer.getBlankLine(G.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(Q=this.viewport)==null||Q.reset(),this.refresh(0,this.rows-1)}}reset(){var q,J;this.options.rows=this.rows,this.options.cols=this.cols;const Q=this._customKeyEventHandler;this._setup(),super.reset(),(q=this._selectionService)==null||q.reset(),this._decorationService.reset(),(J=this.viewport)==null||J.reset(),this._customKeyEventHandler=Q,this.refresh(0,this.rows-1)}clearTextureAtlas(){var Q;(Q=this._renderService)==null||Q.clearTextureAtlas()}_reportFocus(){var Q;(Q=this.element)!=null&&Q.classList.contains("focus")?this.coreService.triggerDataEvent(X.C0.ESC+"[I"):this.coreService.triggerDataEvent(X.C0.ESC+"[O")}_reportWindowsOptions(Q){if(this._renderService)switch(Q){case V.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const q=this._renderService.dimensions.css.canvas.width.toFixed(0),J=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[4;${J};${q}t`);break;case V.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const Y=this._renderService.dimensions.css.cell.width.toFixed(0),he=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[6;${he};${Y}t`)}}cancel(Q,q){if(this.options.cancelEvents||q)return Q.preventDefault(),Q.stopPropagation(),!1}}a.Terminal=_e},9924:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(c,h=1e3){this._renderCallback=c,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,h,p){this._rowCount=p,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const S=u-this._lastRefreshMs,C=this._debounceThresholdMS-S;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),C)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h)}}},1680:function(f,a,c){var h=this&&this.__decorate||function(_,g,y,k){var M,D=arguments.length,T=D<3?g:k===null?k=Object.getOwnPropertyDescriptor(g,y):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(_,g,y,k);else for(var E=_.length-1;E>=0;E--)(M=_[E])&&(T=(D<3?M(T):D>3?M(g,y,T):M(g,y))||T);return D>3&&T&&Object.defineProperty(g,y,T),T},p=this&&this.__param||function(_,g){return function(y,k){g(y,k,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const u=c(3656),S=c(4725),C=c(8460),A=c(844),x=c(2585);let b=a.Viewport=class extends A.Disposable{constructor(_,g,y,k,M,D,T,E){super(),this._viewportElement=_,this._scrollArea=g,this._bufferService=y,this._optionsService=k,this._charSizeService=M,this._renderService=D,this._coreBrowserService=T,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((R=>this._activeBuffer=R.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((R=>this._renderDimensions=R))),this._handleThemeChange(E.colors),this.register(E.onChangeColors((R=>this._handleThemeChange(R)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(_){this._viewportElement.style.backgroundColor=_.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(_){if(_)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const g=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==g&&(this._lastRecordedBufferHeight=g,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const _=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==_&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=_),this._refreshAnimationFrame=null}syncScrollArea(_=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(_);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(_)}_handleScroll(_){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const g=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:g,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const _=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(_*(this._smoothScrollState.target-this._smoothScrollState.origin)),_<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(_,g){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(g<0&&this._viewportElement.scrollTop!==0||g>0&&y<this._lastRecordedBufferHeight)||(_.cancelable&&_.preventDefault(),!1)}handleWheel(_){const g=this._getPixelsScrolled(_);return g!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+g:this._smoothScrollState.target+=g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=g,this._bubbleScroll(_,g))}scrollLines(_){if(_!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const g=_*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:_,suppressScrollEvent:!1})}_getPixelsScrolled(_){if(_.deltaY===0||_.shiftKey)return 0;let g=this._applyScrollModifier(_.deltaY,_);return _.deltaMode===WheelEvent.DOM_DELTA_LINE?g*=this._currentRowHeight:_.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._currentRowHeight*this._bufferService.rows),g}getBufferElements(_,g){var E;let y,k="";const M=[],D=g??this._bufferService.buffer.lines.length,T=this._bufferService.buffer.lines;for(let R=_;R<D;R++){const B=T.get(R);if(!B)continue;const H=(E=T.get(R+1))==null?void 0:E.isWrapped;if(k+=B.translateToString(!H),!H||R===T.length-1){const P=document.createElement("div");P.textContent=k,M.push(P),k.length>0&&(y=P),k=""}}return{bufferElements:M,cursorElement:y}}getLinesScrolled(_){if(_.deltaY===0||_.shiftKey)return 0;let g=this._applyScrollModifier(_.deltaY,_);return _.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(g/=this._currentRowHeight+0,this._wheelPartialScroll+=g,g=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):_.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._bufferService.rows),g}_applyScrollModifier(_,g){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&g.altKey||y==="ctrl"&&g.ctrlKey||y==="shift"&&g.shiftKey?_*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:_*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(_){this._lastTouchY=_.touches[0].pageY}handleTouchMove(_){const g=this._lastTouchY-_.touches[0].pageY;return this._lastTouchY=_.touches[0].pageY,g!==0&&(this._viewportElement.scrollTop+=g,this._bubbleScroll(_,g))}};a.Viewport=b=h([p(2,x.IBufferService),p(3,x.IOptionsService),p(4,S.ICharSizeService),p(5,S.IRenderService),p(6,S.ICoreBrowserService),p(7,S.IThemeService)],b)},3107:function(f,a,c){var h=this&&this.__decorate||function(x,b,_,g){var y,k=arguments.length,M=k<3?b:g===null?g=Object.getOwnPropertyDescriptor(b,_):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,b,_,g);else for(var D=x.length-1;D>=0;D--)(y=x[D])&&(M=(k<3?y(M):k>3?y(b,_,M):y(b,_))||M);return k>3&&M&&Object.defineProperty(b,_,M),M},p=this&&this.__param||function(x,b){return function(_,g){b(_,g,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const u=c(4725),S=c(844),C=c(2585);let A=a.BufferDecorationRenderer=class extends S.Disposable{constructor(x,b,_,g,y){super(),this._screenElement=x,this._bufferService=b,this._coreBrowserService=_,this._decorationService=g,this._renderService=y,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((k=>this._removeDecoration(k)))),this.register((0,S.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const x of this._decorationService.decorations)this._renderDecoration(x);this._dimensionsChanged=!1}_renderDecoration(x){this._refreshStyle(x),this._dimensionsChanged&&this._refreshXPosition(x)}_createElement(x){var g;const b=this._coreBrowserService.mainDocument.createElement("div");b.classList.add("xterm-decoration"),b.classList.toggle("xterm-decoration-top-layer",((g=x==null?void 0:x.options)==null?void 0:g.layer)==="top"),b.style.width=`${Math.round((x.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,b.style.height=(x.options.height||1)*this._renderService.dimensions.css.cell.height+"px",b.style.top=(x.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",b.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const _=x.options.x??0;return _&&_>this._bufferService.cols&&(b.style.display="none"),this._refreshXPosition(x,b),b}_refreshStyle(x){const b=x.marker.line-this._bufferService.buffers.active.ydisp;if(b<0||b>=this._bufferService.rows)x.element&&(x.element.style.display="none",x.onRenderEmitter.fire(x.element));else{let _=this._decorationElements.get(x);_||(_=this._createElement(x),x.element=_,this._decorationElements.set(x,_),this._container.appendChild(_),x.onDispose((()=>{this._decorationElements.delete(x),_.remove()}))),_.style.top=b*this._renderService.dimensions.css.cell.height+"px",_.style.display=this._altBufferIsActive?"none":"block",x.onRenderEmitter.fire(_)}}_refreshXPosition(x,b=x.element){if(!b)return;const _=x.options.x??0;(x.options.anchor||"left")==="right"?b.style.right=_?_*this._renderService.dimensions.css.cell.width+"px":"":b.style.left=_?_*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(x){var b;(b=this._decorationElements.get(x))==null||b.remove(),this._decorationElements.delete(x),x.dispose()}};a.BufferDecorationRenderer=A=h([p(1,C.IBufferService),p(2,u.ICoreBrowserService),p(3,C.IDecorationService),p(4,u.IRenderService)],A)},5871:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.ColorZoneStore=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(c){if(c.options.overviewRulerOptions){for(const h of this._zones)if(h.color===c.options.overviewRulerOptions.color&&h.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,c.marker.line))return;if(this._lineAdjacentToZone(h,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(h,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,h){return h>=c.startBufferLine&&h<=c.endBufferLine}_lineAdjacentToZone(c,h,p){return h>=c.startBufferLine-this._linePadding[p||"full"]&&h<=c.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(c,h){c.startBufferLine=Math.min(c.startBufferLine,h),c.endBufferLine=Math.max(c.endBufferLine,h)}}},5744:function(f,a,c){var h=this&&this.__decorate||function(y,k,M,D){var T,E=arguments.length,R=E<3?k:D===null?D=Object.getOwnPropertyDescriptor(k,M):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,k,M,D);else for(var B=y.length-1;B>=0;B--)(T=y[B])&&(R=(E<3?T(R):E>3?T(k,M,R):T(k,M))||R);return E>3&&R&&Object.defineProperty(k,M,R),R},p=this&&this.__param||function(y,k){return function(M,D){k(M,D,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const u=c(5871),S=c(4725),C=c(844),A=c(2585),x={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0};let g=a.OverviewRulerRenderer=class extends C.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,k,M,D,T,E,R){var H;super(),this._viewportElement=y,this._screenElement=k,this._bufferService=M,this._decorationService=D,this._renderService=T,this._optionsService=E,this._coreBrowserService=R,this._colorZoneStore=new u.ColorZoneStore,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);const B=this._canvas.getContext("2d");if(!B)throw new Error("Ctx cannot be null");this._ctx=B,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,C.toDisposable)((()=>{var P;(P=this._canvas)==null||P.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){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())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const y=Math.floor(this._canvas.width/3),k=Math.ceil(this._canvas.width/3);b.full=this._canvas.width,b.left=y,b.center=k,b.right=y,this._refreshDrawHeightConstants(),_.full=0,_.left=0,_.center=b.left,_.right=b.left+b.center}_refreshDrawHeightConstants(){x.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,k=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);x.left=k,x.center=k,x.right=k}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.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(const k of this._decorationService.decorations)this._colorZoneStore.addDecoration(k);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const k of y)k.position!=="full"&&this._renderColorZone(k);for(const k of y)k.position==="full"&&this._renderColorZone(k);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(_[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-x[y.position||"full"]/2),b[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+x[y.position||"full"]))}_queueRefresh(y,k){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=k||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};a.OverviewRulerRenderer=g=h([p(2,A.IBufferService),p(3,A.IDecorationService),p(4,S.IRenderService),p(5,A.IOptionsService),p(6,S.ICoreBrowserService)],g)},2950:function(f,a,c){var h=this&&this.__decorate||function(x,b,_,g){var y,k=arguments.length,M=k<3?b:g===null?g=Object.getOwnPropertyDescriptor(b,_):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,b,_,g);else for(var D=x.length-1;D>=0;D--)(y=x[D])&&(M=(k<3?y(M):k>3?y(b,_,M):y(b,_))||M);return k>3&&M&&Object.defineProperty(b,_,M),M},p=this&&this.__param||function(x,b){return function(_,g){b(_,g,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const u=c(4725),S=c(2585),C=c(2584);let A=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(x,b,_,g,y,k){this._textarea=x,this._compositionView=b,this._bufferService=_,this._optionsService=g,this._coreService=y,this._renderService=k,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(x){this._compositionView.textContent=x.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(x){if(this._isComposing||this._isSendingComposition){if(x.keyCode===229||x.keyCode===16||x.keyCode===17||x.keyCode===18)return!1;this._finalizeComposition(!1)}return x.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(x){if(this._compositionView.classList.remove("active"),this._isComposing=!1,x){const b={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let _;this._isSendingComposition=!1,b.start+=this._dataAlreadySent.length,_=this._isComposing?this._textarea.value.substring(b.start,b.end):this._textarea.value.substring(b.start),_.length>0&&this._coreService.triggerDataEvent(_,!0)}}),0)}else{this._isSendingComposition=!1;const b=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(b,!0)}}_handleAnyTextareaChanges(){const x=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const b=this._textarea.value,_=b.replace(x,"");this._dataAlreadySent=_,b.length>x.length?this._coreService.triggerDataEvent(_,!0):b.length<x.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):b.length===x.length&&b!==x&&this._coreService.triggerDataEvent(b,!0)}}),0)}updateCompositionElements(x){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const b=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),_=this._renderService.dimensions.css.cell.height,g=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,y=b*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=y+"px",this._compositionView.style.top=g+"px",this._compositionView.style.height=_+"px",this._compositionView.style.lineHeight=_+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const k=this._compositionView.getBoundingClientRect();this._textarea.style.left=y+"px",this._textarea.style.top=g+"px",this._textarea.style.width=Math.max(k.width,1)+"px",this._textarea.style.height=Math.max(k.height,1)+"px",this._textarea.style.lineHeight=k.height+"px"}x||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};a.CompositionHelper=A=h([p(2,S.IBufferService),p(3,S.IOptionsService),p(4,S.ICoreService),p(5,u.IRenderService)],A)},9806:(f,a)=>{function c(h,p,u){const S=u.getBoundingClientRect(),C=h.getComputedStyle(u),A=parseInt(C.getPropertyValue("padding-left")),x=parseInt(C.getPropertyValue("padding-top"));return[p.clientX-S.left-A,p.clientY-S.top-x]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=c,a.getCoords=function(h,p,u,S,C,A,x,b,_){if(!A)return;const g=c(h,p,u);return g?(g[0]=Math.ceil((g[0]+(_?x/2:0))/x),g[1]=Math.ceil(g[1]/b),g[0]=Math.min(Math.max(g[0],1),S+(_?1:0)),g[1]=Math.min(Math.max(g[1],1),C),g):void 0}},9504:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const h=c(2584);function p(b,_,g,y){const k=b-u(b,g),M=_-u(_,g),D=Math.abs(k-M)-(function(T,E,R){let B=0;const H=T-u(T,R),P=E-u(E,R);for(let F=0;F<Math.abs(H-P);F++){const $=S(T,E)==="A"?-1:1,W=R.buffer.lines.get(H+$*F);W!=null&&W.isWrapped&&B++}return B})(b,_,g);return x(D,A(S(b,_),y))}function u(b,_){let g=0,y=_.buffer.lines.get(b),k=y==null?void 0:y.isWrapped;for(;k&&b>=0&&b<_.rows;)g++,y=_.buffer.lines.get(--b),k=y==null?void 0:y.isWrapped;return g}function S(b,_){return b>_?"A":"B"}function C(b,_,g,y,k,M){let D=b,T=_,E="";for(;D!==g||T!==y;)D+=k?1:-1,k&&D>M.cols-1?(E+=M.buffer.translateBufferLineToString(T,!1,b,D),D=0,b=0,T++):!k&&D<0&&(E+=M.buffer.translateBufferLineToString(T,!1,0,b+1),D=M.cols-1,b=D,T--);return E+M.buffer.translateBufferLineToString(T,!1,b,D)}function A(b,_){const g=_?"O":"[";return h.C0.ESC+g+b}function x(b,_){b=Math.floor(b);let g="";for(let y=0;y<b;y++)g+=_;return g}a.moveToCellSequence=function(b,_,g,y){const k=g.buffer.x,M=g.buffer.y;if(!g.buffer.hasScrollback)return(function(E,R,B,H,P,F){return p(R,H,P,F).length===0?"":x(C(E,R,E,R-u(R,P),!1,P).length,A("D",F))})(k,M,0,_,g,y)+p(M,_,g,y)+(function(E,R,B,H,P,F){let $;$=p(R,H,P,F).length>0?H-u(H,P):R;const W=H,G=(function(X,te,z,O,j,V){let I;return I=p(z,O,j,V).length>0?O-u(O,j):te,X<z&&I<=O||X>=z&&I<O?"C":"D"})(E,R,B,H,P,F);return x(C(E,$,B,W,G==="C",P).length,A(G,F))})(k,M,b,_,g,y);let D;if(M===_)return D=k>b?"D":"C",x(Math.abs(k-b),A(D,y));D=M>_?"D":"C";const T=Math.abs(M-_);return x((function(E,R){return R.cols-E})(M>_?b:k,g)+(T-1)*g.cols+1+((M>_?k:b)-1),A(D,y))}},1296:function(f,a,c){var h=this&&this.__decorate||function(F,$,W,G){var X,te=arguments.length,z=te<3?$:G===null?G=Object.getOwnPropertyDescriptor($,W):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(F,$,W,G);else for(var O=F.length-1;O>=0;O--)(X=F[O])&&(z=(te<3?X(z):te>3?X($,W,z):X($,W))||z);return te>3&&z&&Object.defineProperty($,W,z),z},p=this&&this.__param||function(F,$){return function(W,G){$(W,G,F)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const u=c(3787),S=c(2550),C=c(2223),A=c(6171),x=c(6052),b=c(4725),_=c(8055),g=c(8460),y=c(844),k=c(2585),M="xterm-dom-renderer-owner-",D="xterm-rows",T="xterm-fg-",E="xterm-bg-",R="xterm-focus",B="xterm-selection";let H=1,P=a.DomRenderer=class extends y.Disposable{constructor(F,$,W,G,X,te,z,O,j,V,I,ne,_e){super(),this._terminal=F,this._document=$,this._element=W,this._screenElement=G,this._viewportElement=X,this._helperContainer=te,this._linkifier2=z,this._charSizeService=j,this._optionsService=V,this._bufferService=I,this._coreBrowserService=ne,this._themeService=_e,this._terminalClass=H++,this._rowElements=[],this._selectionRenderModel=(0,x.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new g.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(D),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(B),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,A.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((me=>this._injectCss(me)))),this._injectCss(this._themeService.colors),this._rowFactory=O.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(M+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((me=>this._handleLinkHover(me)))),this.register(this._linkifier2.onHideLinkUnderline((me=>this._handleLinkLeave(me)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(M+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new S.WidthCache(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(){const F=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*F,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*F),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/F),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/F),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(const W of this._rowElements)W.style.width=`${this.dimensions.css.canvas.width}px`,W.style.height=`${this.dimensions.css.cell.height}px`,W.style.lineHeight=`${this.dimensions.css.cell.height}px`,W.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const $=`${this._terminalSelector} .${D} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=$,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(F){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let $=`${this._terminalSelector} .${D} { color: ${F.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;$+=`${this._terminalSelector} .${D} .xterm-dim { color: ${_.color.multiplyOpacity(F.foreground,.5).css};}`,$+=`${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;}`;const W=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;$+=`@keyframes ${W} { 50% { border-bottom-style: hidden; }}`,$+=`@keyframes ${G} { 50% { box-shadow: none; }}`,$+=`@keyframes ${X} { 0% { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css}; } 50% { background-color: inherit; color: ${F.cursor.css}; }}`,$+=`${this._terminalSelector} .${D}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${D}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${D}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-block { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css};}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${F.cursor.css} !important; color: ${F.cursorAccent.css} !important;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${F.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${F.cursor.css} inset;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${F.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,$+=`${this._terminalSelector} .${B} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${B} div { position: absolute; background-color: ${F.selectionBackgroundOpaque.css};}${this._terminalSelector} .${B} div { position: absolute; background-color: ${F.selectionInactiveBackgroundOpaque.css};}`;for(const[te,z]of F.ansi.entries())$+=`${this._terminalSelector} .${T}${te} { color: ${z.css}; }${this._terminalSelector} .${T}${te}.xterm-dim { color: ${_.color.multiplyOpacity(z,.5).css}; }${this._terminalSelector} .${E}${te} { background-color: ${z.css}; }`;$+=`${this._terminalSelector} .${T}${C.INVERTED_DEFAULT_COLOR} { color: ${_.color.opaque(F.background).css}; }${this._terminalSelector} .${T}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${_.color.multiplyOpacity(_.color.opaque(F.background),.5).css}; }${this._terminalSelector} .${E}${C.INVERTED_DEFAULT_COLOR} { background-color: ${F.foreground.css}; }`,this._themeStyleElement.textContent=$}_setDefaultSpacing(){const F=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${F}px`,this._rowFactory.defaultSpacing=F}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(F,$){for(let W=this._rowElements.length;W<=$;W++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>$;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(F,$){this._refreshRowElements(F,$),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(R),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(R),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(F,$,W){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(F,$,W),this.renderRows(0,this._bufferService.rows-1),!F||!$)return;this._selectionRenderModel.update(this._terminal,F,$,W);const G=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,te=this._selectionRenderModel.viewportCappedStartRow,z=this._selectionRenderModel.viewportCappedEndRow;if(te>=this._bufferService.rows||z<0)return;const O=this._document.createDocumentFragment();if(W){const j=F[0]>$[0];O.appendChild(this._createSelectionElement(te,j?$[0]:F[0],j?F[0]:$[0],z-te+1))}else{const j=G===te?F[0]:0,V=te===X?$[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(te,j,V));const I=z-te-1;if(O.appendChild(this._createSelectionElement(te+1,0,this._bufferService.cols,I)),te!==z){const ne=X===z?$[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(z,0,ne))}}this._selectionContainer.appendChild(O)}_createSelectionElement(F,$,W,G=1){const X=this._document.createElement("div"),te=$*this.dimensions.css.cell.width;let z=this.dimensions.css.cell.width*(W-$);return te+z>this.dimensions.css.canvas.width&&(z=this.dimensions.css.canvas.width-te),X.style.height=G*this.dimensions.css.cell.height+"px",X.style.top=F*this.dimensions.css.cell.height+"px",X.style.left=`${te}px`,X.style.width=`${z}px`,X}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(const F of this._rowElements)F.replaceChildren()}renderRows(F,$){const W=this._bufferService.buffer,G=W.ybase+W.y,X=Math.min(W.x,this._bufferService.cols-1),te=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let j=F;j<=$;j++){const V=j+W.ydisp,I=this._rowElements[j],ne=W.lines.get(V);if(!I||!ne)break;I.replaceChildren(...this._rowFactory.createRow(ne,V,V===G,z,O,X,te,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${M}${this._terminalClass}`}_handleLinkHover(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!0)}_handleLinkLeave(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!1)}_setCellUnderline(F,$,W,G,X,te){W<0&&(F=0),G<0&&($=0);const z=this._bufferService.rows-1;W=Math.max(Math.min(W,z),0),G=Math.max(Math.min(G,z),0),X=Math.min(X,this._bufferService.cols);const O=this._bufferService.buffer,j=O.ybase+O.y,V=Math.min(O.x,X-1),I=this._optionsService.rawOptions.cursorBlink,ne=this._optionsService.rawOptions.cursorStyle,_e=this._optionsService.rawOptions.cursorInactiveStyle;for(let me=W;me<=G;++me){const Q=me+O.ydisp,q=this._rowElements[me],J=O.lines.get(Q);if(!q||!J)break;q.replaceChildren(...this._rowFactory.createRow(J,Q,Q===j,ne,_e,V,I,this.dimensions.css.cell.width,this._widthCache,te?me===W?F:0:-1,te?(me===G?$:X)-1:-1))}}};a.DomRenderer=P=h([p(7,k.IInstantiationService),p(8,b.ICharSizeService),p(9,k.IOptionsService),p(10,k.IBufferService),p(11,b.ICoreBrowserService),p(12,b.IThemeService)],P)},3787:function(f,a,c){var h=this&&this.__decorate||function(D,T,E,R){var B,H=arguments.length,P=H<3?T:R===null?R=Object.getOwnPropertyDescriptor(T,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(D,T,E,R);else for(var F=D.length-1;F>=0;F--)(B=D[F])&&(P=(H<3?B(P):H>3?B(T,E,P):B(T,E))||P);return H>3&&P&&Object.defineProperty(T,E,P),P},p=this&&this.__param||function(D,T){return function(E,R){T(E,R,D)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const u=c(2223),S=c(643),C=c(511),A=c(2585),x=c(8055),b=c(4725),_=c(4269),g=c(6171),y=c(3734);let k=a.DomRendererRowFactory=class{constructor(D,T,E,R,B,H,P){this._document=D,this._characterJoinerService=T,this._optionsService=E,this._coreBrowserService=R,this._coreService=B,this._decorationService=H,this._themeService=P,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(D,T,E){this._selectionStart=D,this._selectionEnd=T,this._columnSelectMode=E}createRow(D,T,E,R,B,H,P,F,$,W,G){const X=[],te=this._characterJoinerService.getJoinedCharacters(T),z=this._themeService.colors;let O,j=D.getNoBgTrimmedLength();E&&j<H+1&&(j=H+1);let V=0,I="",ne=0,_e=0,me=0,Q=!1,q=0,J=!1,Y=0;const he=[],de=W!==-1&&G!==-1;for(let be=0;be<j;be++){D.loadCell(be,this._workCell);let Pe=this._workCell.getWidth();if(Pe===0)continue;let Fe=!1,We=be,De=this._workCell;if(te.length>0&&be===te[0][0]){Fe=!0;const ve=te.shift();De=new _.JoinedCellData(this._workCell,D.translateToString(!0,ve[0],ve[1]),ve[1]-ve[0]),We=ve[1]-1,Pe=De.getWidth()}const Rt=this._isCellInSelection(be,T),ot=E&&be===H,Tt=de&&be>=W&&be<=G;let nt=!1;this._decorationService.forEachDecorationAtCell(be,T,void 0,(ve=>{nt=!0}));let Mt=De.getChars()||S.WHITESPACE_CELL_CHAR;if(Mt===" "&&(De.isUnderline()||De.isOverline())&&(Mt=" "),Y=Pe*F-$.get(Mt,De.isBold(),De.isItalic()),O){if(V&&(Rt&&J||!Rt&&!J&&De.bg===ne)&&(Rt&&J&&z.selectionForeground||De.fg===_e)&&De.extended.ext===me&&Tt===Q&&Y===q&&!ot&&!Fe&&!nt){De.isInvisible()?I+=S.WHITESPACE_CELL_CHAR:I+=Mt,V++;continue}V&&(O.textContent=I),O=this._document.createElement("span"),V=0,I=""}else O=this._document.createElement("span");if(ne=De.bg,_e=De.fg,me=De.extended.ext,Q=Tt,q=Y,J=Rt,Fe&&H>=be&&H<=We&&(H=be),!this._coreService.isCursorHidden&&ot&&this._coreService.isCursorInitialized){if(he.push("xterm-cursor"),this._coreBrowserService.isFocused)P&&he.push("xterm-cursor-blink"),he.push(R==="bar"?"xterm-cursor-bar":R==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(B)switch(B){case"outline":he.push("xterm-cursor-outline");break;case"block":he.push("xterm-cursor-block");break;case"bar":he.push("xterm-cursor-bar");break;case"underline":he.push("xterm-cursor-underline")}}if(De.isBold()&&he.push("xterm-bold"),De.isItalic()&&he.push("xterm-italic"),De.isDim()&&he.push("xterm-dim"),I=De.isInvisible()?S.WHITESPACE_CELL_CHAR:De.getChars()||S.WHITESPACE_CELL_CHAR,De.isUnderline()&&(he.push(`xterm-underline-${De.extended.underlineStyle}`),I===" "&&(I=" "),!De.isUnderlineColorDefault()))if(De.isUnderlineColorRGB())O.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(De.getUnderlineColor()).join(",")})`;else{let ve=De.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&De.isBold()&&ve<8&&(ve+=8),O.style.textDecorationColor=z.ansi[ve].css}De.isOverline()&&(he.push("xterm-overline"),I===" "&&(I=" ")),De.isStrikethrough()&&he.push("xterm-strikethrough"),Tt&&(O.style.textDecoration="underline");let ae=De.getFgColor(),tt=De.getFgColorMode(),Je=De.getBgColor(),ue=De.getBgColorMode();const Se=!!De.isInverse();if(Se){const ve=ae;ae=Je,Je=ve;const ke=tt;tt=ue,ue=ke}let we,Me,je,ht=!1;switch(this._decorationService.forEachDecorationAtCell(be,T,void 0,(ve=>{ve.options.layer!=="top"&&ht||(ve.backgroundColorRGB&&(ue=50331648,Je=ve.backgroundColorRGB.rgba>>8&16777215,we=ve.backgroundColorRGB),ve.foregroundColorRGB&&(tt=50331648,ae=ve.foregroundColorRGB.rgba>>8&16777215,Me=ve.foregroundColorRGB),ht=ve.options.layer==="top")})),!ht&&Rt&&(we=this._coreBrowserService.isFocused?z.selectionBackgroundOpaque:z.selectionInactiveBackgroundOpaque,Je=we.rgba>>8&16777215,ue=50331648,ht=!0,z.selectionForeground&&(tt=50331648,ae=z.selectionForeground.rgba>>8&16777215,Me=z.selectionForeground)),ht&&he.push("xterm-decoration-top"),ue){case 16777216:case 33554432:je=z.ansi[Je],he.push(`xterm-bg-${Je}`);break;case 50331648:je=x.channels.toColor(Je>>16,Je>>8&255,255&Je),this._addStyle(O,`background-color:#${M((Je>>>0).toString(16),"0",6)}`);break;default:Se?(je=z.foreground,he.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):je=z.background}switch(we||De.isDim()&&(we=x.color.multiplyOpacity(je,.5)),tt){case 16777216:case 33554432:De.isBold()&&ae<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ae+=8),this._applyMinimumContrast(O,je,z.ansi[ae],De,we,void 0)||he.push(`xterm-fg-${ae}`);break;case 50331648:const ve=x.channels.toColor(ae>>16&255,ae>>8&255,255&ae);this._applyMinimumContrast(O,je,ve,De,we,Me)||this._addStyle(O,`color:#${M(ae.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(O,je,z.foreground,De,we,Me)||Se&&he.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}he.length&&(O.className=he.join(" "),he.length=0),ot||Fe||nt?O.textContent=I:V++,Y!==this.defaultSpacing&&(O.style.letterSpacing=`${Y}px`),X.push(O),be=We}return O&&V&&(O.textContent=I),X}_applyMinimumContrast(D,T,E,R,B,H){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,g.treatGlyphAsBackgroundColor)(R.getCode()))return!1;const P=this._getContrastCache(R);let F;if(B||H||(F=P.getColor(T.rgba,E.rgba)),F===void 0){const $=this._optionsService.rawOptions.minimumContrastRatio/(R.isDim()?2:1);F=x.color.ensureContrastRatio(B||T,H||E,$),P.setColor((B||T).rgba,(H||E).rgba,F??null)}return!!F&&(this._addStyle(D,`color:${F.css}`),!0)}_getContrastCache(D){return D.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(D,T){D.setAttribute("style",`${D.getAttribute("style")||""}${T};`)}_isCellInSelection(D,T){const E=this._selectionStart,R=this._selectionEnd;return!(!E||!R)&&(this._columnSelectMode?E[0]<=R[0]?D>=E[0]&&T>=E[1]&&D<R[0]&&T<=R[1]:D<E[0]&&T>=E[1]&&D>=R[0]&&T<=R[1]:T>E[1]&&T<R[1]||E[1]===R[1]&&T===E[1]&&D>=E[0]&&D<R[0]||E[1]<R[1]&&T===R[1]&&D<R[0]||E[1]<R[1]&&T===E[1]&&D>=E[0])}};function M(D,T,E){for(;D.length<E;)D=T+D;return D}a.DomRendererRowFactory=k=h([p(1,b.ICharacterJoinerService),p(2,A.IOptionsService),p(3,b.ICoreBrowserService),p(4,A.ICoreService),p(5,A.IDecorationService),p(6,b.IThemeService)],k)},2550:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(c,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.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";const p=c.createElement("span");p.classList.add("xterm-char-measure-element");const u=c.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const S=c.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontStyle="italic";const C=c.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontWeight="bold",C.style.fontStyle="italic",this._measureElements=[p,u,S,C],this._container.appendChild(p),this._container.appendChild(u),this._container.appendChild(S),this._container.appendChild(C),h.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(c,h,p,u){c===this._font&&h===this._fontSize&&p===this._weight&&u===this._weightBold||(this._font=c,this._fontSize=h,this._weight=p,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(c,h,p){let u=0;if(!h&&!p&&c.length===1&&(u=c.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const A=this._measure(c,0);return A>0&&(this._flat[u]=A),A}let S=c;h&&(S+="B"),p&&(S+="I");let C=this._holey.get(S);if(C===void 0){let A=0;h&&(A|=1),p&&(A|=2),C=this._measure(c,A),C>0&&this._holey.set(S,C)}return C}_measure(c,h){const p=this._measureElements[h];return p.textContent=c.repeat(32),p.offsetWidth/32}}},2223:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const h=c(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(f,a)=>{function c(p){return 57508<=p&&p<=57558}function h(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},a.isPowerlineGlyph=c,a.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},a.isEmoji=h,a.allowRescaling=function(p,u,S,C){return u===1&&S>Math.ceil(1.5*C)&&p!==void 0&&p>255&&!h(p)&&!c(p)&&!(function(A){return 57344<=A&&A<=63743})(p)},a.treatGlyphAsBackgroundColor=function(p){return c(p)||(function(u){return 9472<=u&&u<=9631})(p)},a.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},a.computeNextVariantOffset=function(p,u,S=0){return(p-(2*Math.round(u)-S))%(2*Math.round(u))}},6052:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class c{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(p,u,S,C=!1){if(this.selectionStart=u,this.selectionEnd=S,!u||!S||u[0]===S[0]&&u[1]===S[1])return void this.clear();const A=p.buffers.active.ydisp,x=u[1]-A,b=S[1]-A,_=Math.max(x,0),g=Math.min(b,p.rows-1);_>=p.rows||g<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=C,this.viewportStartRow=x,this.viewportEndRow=b,this.viewportCappedStartRow=_,this.viewportCappedEndRow=g,this.startCol=u[0],this.endCol=S[0])}isCellSelected(p,u,S){return!!this.hasSelection&&(S-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&S>=this.viewportCappedStartRow&&u<this.endCol&&S<=this.viewportCappedEndRow:u<this.startCol&&S>=this.viewportCappedStartRow&&u>=this.endCol&&S<=this.viewportCappedEndRow:S>this.viewportStartRow&&S<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&S===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&S===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&S===this.viewportStartRow&&u>=this.startCol)}}a.createSelectionRenderModel=function(){return new c}},456:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(c){this._bufferService=c,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.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()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,h=this.selectionEnd;return!(!c||!h)&&(c[1]>h[1]||c[1]===h[1]&&c[0]>h[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(f,a,c){var h=this&&this.__decorate||function(g,y,k,M){var D,T=arguments.length,E=T<3?y:M===null?M=Object.getOwnPropertyDescriptor(y,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(g,y,k,M);else for(var R=g.length-1;R>=0;R--)(D=g[R])&&(E=(T<3?D(E):T>3?D(y,k,E):D(y,k))||E);return T>3&&E&&Object.defineProperty(y,k,E),E},p=this&&this.__param||function(g,y){return function(k,M){y(k,M,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const u=c(2585),S=c(8460),C=c(844);let A=a.CharSizeService=class extends C.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(g,y,k){super(),this._optionsService=k,this.width=0,this.height=0,this._onCharSizeChange=this.register(new S.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new _(this._optionsService))}catch{this._measureStrategy=this.register(new b(g,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const g=this._measureStrategy.measure();g.width===this.width&&g.height===this.height||(this.width=g.width,this.height=g.height,this._onCharSizeChange.fire())}};a.CharSizeService=A=h([p(2,u.IOptionsService)],A);class x extends C.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,k){y!==void 0&&y>0&&k!==void 0&&k>0&&(this._result.width=y,this._result.height=k)}}class b extends x{constructor(y,k,M){super(),this._document=y,this._parentElement=k,this._optionsService=M,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}}class _ extends x{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const k=this._ctx.measureText("W");if(!("width"in k&&"fontBoundingBoxAscent"in k&&"fontBoundingBoxDescent"in k))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const y=this._ctx.measureText("W");return this._validateAndSet(y.width,y.fontBoundingBoxAscent+y.fontBoundingBoxDescent),this._result}}},4269:function(f,a,c){var h=this&&this.__decorate||function(_,g,y,k){var M,D=arguments.length,T=D<3?g:k===null?k=Object.getOwnPropertyDescriptor(g,y):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(_,g,y,k);else for(var E=_.length-1;E>=0;E--)(M=_[E])&&(T=(D<3?M(T):D>3?M(g,y,T):M(g,y))||T);return D>3&&T&&Object.defineProperty(g,y,T),T},p=this&&this.__param||function(_,g){return function(y,k){g(y,k,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const u=c(3734),S=c(643),C=c(511),A=c(2585);class x extends u.AttributeData{constructor(g,y,k){super(),this.content=0,this.combinedData="",this.fg=g.fg,this.bg=g.bg,this.combinedData=y,this._width=k}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(g){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=x;let b=a.CharacterJoinerService=class hg{constructor(g){this._bufferService=g,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new C.CellData}register(g){const y={id:this._nextCharacterJoinerId++,handler:g};return this._characterJoiners.push(y),y.id}deregister(g){for(let y=0;y<this._characterJoiners.length;y++)if(this._characterJoiners[y].id===g)return this._characterJoiners.splice(y,1),!0;return!1}getJoinedCharacters(g){if(this._characterJoiners.length===0)return[];const y=this._bufferService.buffer.lines.get(g);if(!y||y.length===0)return[];const k=[],M=y.translateToString(!0);let D=0,T=0,E=0,R=y.getFg(0),B=y.getBg(0);for(let H=0;H<y.getTrimmedLength();H++)if(y.loadCell(H,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==R||this._workCell.bg!==B){if(H-D>1){const P=this._getJoinedRanges(M,E,T,y,D);for(let F=0;F<P.length;F++)k.push(P[F])}D=H,E=T,R=this._workCell.fg,B=this._workCell.bg}T+=this._workCell.getChars().length||S.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-D>1){const H=this._getJoinedRanges(M,E,T,y,D);for(let P=0;P<H.length;P++)k.push(H[P])}return k}_getJoinedRanges(g,y,k,M,D){const T=g.substring(y,k);let E=[];try{E=this._characterJoiners[0].handler(T)}catch(R){console.error(R)}for(let R=1;R<this._characterJoiners.length;R++)try{const B=this._characterJoiners[R].handler(T);for(let H=0;H<B.length;H++)hg._mergeRanges(E,B[H])}catch(B){console.error(B)}return this._stringRangesToCellRanges(E,M,D),E}_stringRangesToCellRanges(g,y,k){let M=0,D=!1,T=0,E=g[M];if(E){for(let R=k;R<this._bufferService.cols;R++){const B=y.getWidth(R),H=y.getString(R).length||S.WHITESPACE_CELL_CHAR.length;if(B!==0){if(!D&&E[0]<=T&&(E[0]=R,D=!0),E[1]<=T){if(E[1]=R,E=g[++M],!E)break;E[0]<=T?(E[0]=R,D=!0):D=!1}T+=H}}E&&(E[1]=this._bufferService.cols)}}static _mergeRanges(g,y){let k=!1;for(let M=0;M<g.length;M++){const D=g[M];if(k){if(y[1]<=D[0])return g[M-1][1]=y[1],g;if(y[1]<=D[1])return g[M-1][1]=Math.max(y[1],D[1]),g.splice(M,1),g;g.splice(M,1),M--}else{if(y[1]<=D[0])return g.splice(M,0,y),g;if(y[1]<=D[1])return D[0]=Math.min(y[0],D[0]),g;y[0]<D[1]&&(D[0]=Math.min(y[0],D[0]),k=!0)}}return k?g[g.length-1][1]=y[1]:g.push(y),g}};a.CharacterJoinerService=b=h([p(0,A.IBufferService)],b)},5114:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const h=c(844),p=c(8460),u=c(3656);class S extends h.Disposable{constructor(x,b,_){super(),this._textarea=x,this._window=b,this.mainDocument=_,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new C(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((g=>this._screenDprMonitor.setWindow(g)))),this.register((0,p.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(x){this._window!==x&&(this._window=x,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}}a.CoreBrowserService=S;class C extends h.Disposable{constructor(x){super(),this._parentWindow=x,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(x){this._parentWindow=x,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var x;this._outerListener&&((x=this._resolutionMediaMatchList)==null||x.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)}}},779:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const h=c(844);class p extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(S){return this.linkProviders.push(S),{dispose:()=>{const C=this.linkProviders.indexOf(S);C!==-1&&this.linkProviders.splice(C,1)}}}}a.LinkProviderService=p},8934:function(f,a,c){var h=this&&this.__decorate||function(A,x,b,_){var g,y=arguments.length,k=y<3?x:_===null?_=Object.getOwnPropertyDescriptor(x,b):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(A,x,b,_);else for(var M=A.length-1;M>=0;M--)(g=A[M])&&(k=(y<3?g(k):y>3?g(x,b,k):g(x,b))||k);return y>3&&k&&Object.defineProperty(x,b,k),k},p=this&&this.__param||function(A,x){return function(b,_){x(b,_,A)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const u=c(4725),S=c(9806);let C=a.MouseService=class{constructor(A,x){this._renderService=A,this._charSizeService=x}getCoords(A,x,b,_,g){return(0,S.getCoords)(window,A,x,b,_,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,g)}getMouseReportCoords(A,x){const b=(0,S.getCoordsRelativeToElement)(window,A,x);if(this._charSizeService.hasValidSize)return b[0]=Math.min(Math.max(b[0],0),this._renderService.dimensions.css.canvas.width-1),b[1]=Math.min(Math.max(b[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(b[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(b[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(b[0]),y:Math.floor(b[1])}}};a.MouseService=C=h([p(0,u.IRenderService),p(1,u.ICharSizeService)],C)},3230:function(f,a,c){var h=this&&this.__decorate||function(g,y,k,M){var D,T=arguments.length,E=T<3?y:M===null?M=Object.getOwnPropertyDescriptor(y,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(g,y,k,M);else for(var R=g.length-1;R>=0;R--)(D=g[R])&&(E=(T<3?D(E):T>3?D(y,k,E):D(y,k))||E);return T>3&&E&&Object.defineProperty(y,k,E),E},p=this&&this.__param||function(g,y){return function(k,M){y(k,M,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const u=c(6193),S=c(4725),C=c(8460),A=c(844),x=c(7226),b=c(2585);let _=a.RenderService=class extends A.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(g,y,k,M,D,T,E,R){super(),this._rowCount=g,this._charSizeService=M,this._renderer=this.register(new A.MutableDisposable),this._pausedResizeTask=new x.DebouncedIdleTask,this._observerDisposable=this.register(new A.MutableDisposable),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 C.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new C.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new C.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new C.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer(((B,H)=>this._renderRows(B,H)),E),this.register(this._renderDebouncer),this.register(E.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(T.onResize((()=>this._fullRefresh()))),this.register(T.buffers.onBufferActivate((()=>{var B;return(B=this._renderer.value)==null?void 0:B.clear()}))),this.register(k.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(D.onDecorationRegistered((()=>this._fullRefresh()))),this.register(D.onDecorationRemoved((()=>this._fullRefresh()))),this.register(k.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(T.cols,T.rows),this._fullRefresh()}))),this.register(k.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(T.buffer.y,T.buffer.y,!0)))),this.register(R.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(E.window,y),this.register(E.onWindowChange((B=>this._registerIntersectionObserver(B,y))))}_registerIntersectionObserver(g,y){if("IntersectionObserver"in g){const k=new g.IntersectionObserver((M=>this._handleIntersectionChange(M[M.length-1])),{threshold:0});k.observe(y),this._observerDisposable.value=(0,A.toDisposable)((()=>k.disconnect()))}}_handleIntersectionChange(g){this._isPaused=g.isIntersecting===void 0?g.intersectionRatio===0:!g.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(g,y,k=!1){this._isPaused?this._needsFullRefresh=!0:(k||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(g,y,this._rowCount))}_renderRows(g,y){this._renderer.value&&(g=Math.min(g,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(g,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:g,end:y}),this._onRender.fire({start:g,end:y}),this._isNextRenderRedrawOnly=!0)}resize(g,y){this._rowCount=y,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(g){this._renderer.value=g,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(g){return this._renderDebouncer.addRefreshCallback(g)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var g,y;this._renderer.value&&((y=(g=this._renderer.value).clearTextureAtlas)==null||y.call(g),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(g,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var k;return(k=this._renderer.value)==null?void 0:k.handleResize(g,y)})):this._renderer.value.handleResize(g,y),this._fullRefresh())}handleCharSizeChanged(){var g;(g=this._renderer.value)==null||g.handleCharSizeChanged()}handleBlur(){var g;(g=this._renderer.value)==null||g.handleBlur()}handleFocus(){var g;(g=this._renderer.value)==null||g.handleFocus()}handleSelectionChanged(g,y,k){var M;this._selectionState.start=g,this._selectionState.end=y,this._selectionState.columnSelectMode=k,(M=this._renderer.value)==null||M.handleSelectionChanged(g,y,k)}handleCursorMove(){var g;(g=this._renderer.value)==null||g.handleCursorMove()}clear(){var g;(g=this._renderer.value)==null||g.clear()}};a.RenderService=_=h([p(2,b.IOptionsService),p(3,S.ICharSizeService),p(4,b.IDecorationService),p(5,b.IBufferService),p(6,S.ICoreBrowserService),p(7,S.IThemeService)],_)},9312:function(f,a,c){var h=this&&this.__decorate||function(E,R,B,H){var P,F=arguments.length,$=F<3?R:H===null?H=Object.getOwnPropertyDescriptor(R,B):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(E,R,B,H);else for(var W=E.length-1;W>=0;W--)(P=E[W])&&($=(F<3?P($):F>3?P(R,B,$):P(R,B))||$);return F>3&&$&&Object.defineProperty(R,B,$),$},p=this&&this.__param||function(E,R){return function(B,H){R(B,H,E)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const u=c(9806),S=c(9504),C=c(456),A=c(4725),x=c(8460),b=c(844),_=c(6114),g=c(4841),y=c(511),k=c(2585),M=" ",D=new RegExp(M,"g");let T=a.SelectionService=class extends b.Disposable{constructor(E,R,B,H,P,F,$,W,G){super(),this._element=E,this._screenElement=R,this._linkifier=B,this._bufferService=H,this._coreService=P,this._mouseService=F,this._optionsService=$,this._renderService=W,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new x.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new x.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new x.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new C.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,b.toDisposable)((()=>{this._removeMouseDownListeners()})))}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(){const E=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!(!E||!R||E[0]===R[0]&&E[1]===R[1])}get selectionText(){const E=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;if(!E||!R)return"";const B=this._bufferService.buffer,H=[];if(this._activeSelectionMode===3){if(E[0]===R[0])return"";const P=E[0]<R[0]?E[0]:R[0],F=E[0]<R[0]?R[0]:E[0];for(let $=E[1];$<=R[1];$++){const W=B.translateBufferLineToString($,!0,P,F);H.push(W)}}else{const P=E[1]===R[1]?R[0]:void 0;H.push(B.translateBufferLineToString(E[1],!0,E[0],P));for(let F=E[1]+1;F<=R[1]-1;F++){const $=B.lines.get(F),W=B.translateBufferLineToString(F,!0);$!=null&&$.isWrapped?H[H.length-1]+=W:H.push(W)}if(E[1]!==R[1]){const F=B.lines.get(R[1]),$=B.translateBufferLineToString(R[1],!0,0,R[0]);F&&F.isWrapped?H[H.length-1]+=$:H.push($)}}return H.map((P=>P.replace(D," "))).join(_.isWindows?`\r
|
|
56
56
|
`:`
|
|
57
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(E){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),_.isLinux&&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){const R=this._getMouseBufferCoords(E),N=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!!(N&&z&&R)&&this._areCoordsInSelection(R,N,z)}isCellInSelection(E,R){const N=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!(!N||!z)&&this._areCoordsInSelection([E,R],N,z)}_areCoordsInSelection(E,R,N){return E[1]>R[1]&&E[1]<N[1]||R[1]===N[1]&&E[1]===R[1]&&E[0]>=R[0]&&E[0]<N[0]||R[1]<N[1]&&E[1]===N[1]&&E[0]<N[0]||R[1]<N[1]&&E[1]===R[1]&&E[0]>=R[0]}_selectWordAtCursor(E,R){var F,P;const N=(P=(F=this._linkifier.currentLink)==null?void 0:F.link)==null?void 0:P.range;if(N)return this._model.selectionStart=[N.start.x-1,N.start.y-1],this._model.selectionStartLength=(0,g.getRangeLength)(N,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const z=this._getMouseBufferCoords(E);return!!z&&(this._selectWordAt(z,R),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(E,R){this._model.clearSelection(),E=Math.max(E,0),R=Math.min(R,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,E],this._model.selectionEnd=[this._bufferService.cols,R],this.refresh(),this._onSelectionChange.fire()}_handleTrim(E){this._model.handleTrim(E)&&this.refresh()}_getMouseBufferCoords(E){const R=this._mouseService.getCoords(E,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(R)return R[0]--,R[1]--,R[1]+=this._bufferService.buffer.ydisp,R}_getMouseEventScrollAmount(E){let R=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,E,this._screenElement)[1];const N=this._renderService.dimensions.css.canvas.height;return R>=0&&R<=N?0:(R>N&&(R-=N),R=Math.min(Math.max(R,-50),50),R/=50,R/Math.abs(R)+Math.round(14*R))}shouldForceSelection(E){return _.isMac?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()),50)}_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;const R=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);R&&R.length!==this._model.selectionStart[0]&&R.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(E){this._selectWordAtCursor(E,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(E){const R=this._getMouseBufferCoords(E);R&&(this._activeSelectionMode=2,this._selectLineAt(R[1]))}shouldColumnSelect(E){return E.altKey&&!(_.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(E){if(E.stopImmediatePropagation(),!this._model.selectionStart)return;const R=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(E),!this._model.selectionEnd)return void this.refresh(!0);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));const N=this._bufferService.buffer;if(this._model.selectionEnd[1]<N.lines.length){const z=N.lines.get(this._model.selectionEnd[1]);z&&z.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}R&&R[0]===this._model.selectionEnd[0]&&R[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});const 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){const R=E.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&R<500&&E.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const N=this._mouseService.getCoords(E,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(N&&N[0]!==void 0&&N[1]!==void 0){const z=(0,S.moveToCellSequence)(N[0]-1,N[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(z,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const E=this._model.finalSelectionStart,R=this._model.finalSelectionEnd,N=!(!E||!R||E[0]===R[0]&&E[1]===R[1]);N?E&&R&&(this._oldSelectionStart&&this._oldSelectionEnd&&E[0]===this._oldSelectionStart[0]&&E[1]===this._oldSelectionStart[1]&&R[0]===this._oldSelectionEnd[0]&&R[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(E,R,N)):this._oldHasSelection&&this._fireOnSelectionChange(E,R,N)}_fireOnSelectionChange(E,R,N){this._oldSelectionStart=E,this._oldSelectionEnd=R,this._oldHasSelection=N,this._onSelectionChange.fire()}_handleBufferActivate(E){this.clearSelection(),this._trimListener.dispose(),this._trimListener=E.activeBuffer.lines.onTrim((R=>this._handleTrim(R)))}_convertViewportColToCharacterIndex(E,R){let N=R;for(let z=0;R>=z;z++){const F=E.loadCell(z,this._workCell).getChars().length;this._workCell.getWidth()===0?N--:F>1&&R!==z&&(N+=F-1)}return N}setSelection(E,R,N){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[E,R],this._model.selectionStartLength=N,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(E){this._isClickInSelection(E)||(this._selectWordAtCursor(E,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(E,R,N=!0,z=!0){if(E[0]>=this._bufferService.cols)return;const F=this._bufferService.buffer,P=F.lines.get(E[1]);if(!P)return;const $=F.translateBufferLineToString(E[1],!1);let K=this._convertViewportColToCharacterIndex(P,E[0]),G=K;const X=E[0]-K;let ee=0,H=0,O=0,j=0;if($.charAt(K)===" "){for(;K>0&&$.charAt(K-1)===" ";)K--;for(;G<$.length&&$.charAt(G+1)===" ";)G++}else{let ne=E[0],_e=E[0];P.getWidth(ne)===0&&(ee++,ne--),P.getWidth(_e)===2&&(H++,_e++);const ge=P.getString(_e).length;for(ge>1&&(j+=ge-1,G+=ge-1);ne>0&&K>0&&!this._isCharWordSeparator(P.loadCell(ne-1,this._workCell));){P.loadCell(ne-1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===0?(ee++,ne--):Q>1&&(O+=Q-1,K-=Q-1),K--,ne--}for(;_e<P.length&&G+1<$.length&&!this._isCharWordSeparator(P.loadCell(_e+1,this._workCell));){P.loadCell(_e+1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===2?(H++,_e++):Q>1&&(j+=Q-1,G+=Q-1),G++,_e++}}G++;let V=K+X-ee+O,I=Math.min(this._bufferService.cols,G-K+ee+H-O-j);if(R||$.slice(K,G).trim()!==""){if(N&&V===0&&P.getCodePoint(0)!==32){const ne=F.lines.get(E[1]-1);if(ne&&P.isWrapped&&ne.getCodePoint(this._bufferService.cols-1)!==32){const _e=this._getWordAt([this._bufferService.cols-1,E[1]-1],!1,!0,!1);if(_e){const ge=this._bufferService.cols-_e.start;V-=ge,I+=ge}}}if(z&&V+I===this._bufferService.cols&&P.getCodePoint(this._bufferService.cols-1)!==32){const ne=F.lines.get(E[1]+1);if(ne!=null&&ne.isWrapped&&ne.getCodePoint(0)!==32){const _e=this._getWordAt([0,E[1]+1],!1,!1,!0);_e&&(I+=_e.length)}}return{start:V,length:I}}}_selectWordAt(E,R){const N=this._getWordAt(E,R);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){const R=this._getWordAt(E,!0);if(R){let N=E[1];for(;R.start<0;)R.start+=this._bufferService.cols,N--;if(!this._model.areSelectionValuesReversed())for(;R.start+R.length>this._bufferService.cols;)R.length-=this._bufferService.cols,N++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?R.start:R.start+R.length,N]}}_isCharWordSeparator(E){return E.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(E.getChars())>=0}_selectLineAt(E){const R=this._bufferService.buffer.getWrappedRangeForLine(E),N={start:{x:0,y:R.first},end:{x:this._bufferService.cols-1,y:R.last}};this._model.selectionStart=[0,R.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,g.getRangeLength)(N,this._bufferService.cols)}};a.SelectionService=T=h([p(3,k.IBufferService),p(4,k.ICoreService),p(5,A.IMouseService),p(6,k.IOptionsService),p(7,A.IRenderService),p(8,A.ICoreBrowserService)],T)},4725:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ILinkProviderService=a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const h=c(8343);a.ICharSizeService=(0,h.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),a.IMouseService=(0,h.createDecorator)("MouseService"),a.IRenderService=(0,h.createDecorator)("RenderService"),a.ISelectionService=(0,h.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,h.createDecorator)("ThemeService"),a.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(f,a,c){var h=this&&this.__decorate||function(T,E,R,N){var z,F=arguments.length,P=F<3?E:N===null?N=Object.getOwnPropertyDescriptor(E,R):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(T,E,R,N);else for(var $=T.length-1;$>=0;$--)(z=T[$])&&(P=(F<3?z(P):F>3?z(E,R,P):z(E,R))||P);return F>3&&P&&Object.defineProperty(E,R,P),P},p=this&&this.__param||function(T,E){return function(R,N){E(R,N,T)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const u=c(7239),S=c(8055),w=c(8460),A=c(844),x=c(2585),b=S.css.toColor("#ffffff"),_=S.css.toColor("#000000"),g=S.css.toColor("#ffffff"),y=S.css.toColor("#000000"),k={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[S.css.toColor("#2e3436"),S.css.toColor("#cc0000"),S.css.toColor("#4e9a06"),S.css.toColor("#c4a000"),S.css.toColor("#3465a4"),S.css.toColor("#75507b"),S.css.toColor("#06989a"),S.css.toColor("#d3d7cf"),S.css.toColor("#555753"),S.css.toColor("#ef2929"),S.css.toColor("#8ae234"),S.css.toColor("#fce94f"),S.css.toColor("#729fcf"),S.css.toColor("#ad7fa8"),S.css.toColor("#34e2e2"),S.css.toColor("#eeeeec")],E=[0,95,135,175,215,255];for(let R=0;R<216;R++){const N=E[R/36%6|0],z=E[R/6%6|0],F=E[R%6];T.push({css:S.channels.toCss(N,z,F),rgba:S.channels.toRgba(N,z,F)})}for(let R=0;R<24;R++){const N=8+10*R;T.push({css:S.channels.toCss(N,N,N),rgba:S.channels.toRgba(N,N,N)})}return T})());let M=a.ThemeService=class extends A.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new w.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:b,background:_,cursor:g,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:k,selectionBackgroundOpaque:S.color.blend(_,k),selectionInactiveBackgroundTransparent:k,selectionInactiveBackgroundOpaque:S.color.blend(_,k),ansi:a.DEFAULT_ANSI_COLORS.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))))}_setTheme(T={}){const E=this._colors;if(E.foreground=D(T.foreground,b),E.background=D(T.background,_),E.cursor=D(T.cursor,g),E.cursorAccent=D(T.cursorAccent,y),E.selectionBackgroundTransparent=D(T.selectionBackground,k),E.selectionBackgroundOpaque=S.color.blend(E.background,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundTransparent=D(T.selectionInactiveBackground,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundOpaque=S.color.blend(E.background,E.selectionInactiveBackgroundTransparent),E.selectionForeground=T.selectionForeground?D(T.selectionForeground,S.NULL_COLOR):void 0,E.selectionForeground===S.NULL_COLOR&&(E.selectionForeground=void 0),S.color.isOpaque(E.selectionBackgroundTransparent)&&(E.selectionBackgroundTransparent=S.color.opacity(E.selectionBackgroundTransparent,.3)),S.color.isOpaque(E.selectionInactiveBackgroundTransparent)&&(E.selectionInactiveBackgroundTransparent=S.color.opacity(E.selectionInactiveBackgroundTransparent,.3)),E.ansi=a.DEFAULT_ANSI_COLORS.slice(),E.ansi[0]=D(T.black,a.DEFAULT_ANSI_COLORS[0]),E.ansi[1]=D(T.red,a.DEFAULT_ANSI_COLORS[1]),E.ansi[2]=D(T.green,a.DEFAULT_ANSI_COLORS[2]),E.ansi[3]=D(T.yellow,a.DEFAULT_ANSI_COLORS[3]),E.ansi[4]=D(T.blue,a.DEFAULT_ANSI_COLORS[4]),E.ansi[5]=D(T.magenta,a.DEFAULT_ANSI_COLORS[5]),E.ansi[6]=D(T.cyan,a.DEFAULT_ANSI_COLORS[6]),E.ansi[7]=D(T.white,a.DEFAULT_ANSI_COLORS[7]),E.ansi[8]=D(T.brightBlack,a.DEFAULT_ANSI_COLORS[8]),E.ansi[9]=D(T.brightRed,a.DEFAULT_ANSI_COLORS[9]),E.ansi[10]=D(T.brightGreen,a.DEFAULT_ANSI_COLORS[10]),E.ansi[11]=D(T.brightYellow,a.DEFAULT_ANSI_COLORS[11]),E.ansi[12]=D(T.brightBlue,a.DEFAULT_ANSI_COLORS[12]),E.ansi[13]=D(T.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),E.ansi[14]=D(T.brightCyan,a.DEFAULT_ANSI_COLORS[14]),E.ansi[15]=D(T.brightWhite,a.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const R=Math.min(E.ansi.length-16,T.extendedAnsi.length);for(let N=0;N<R;N++)E.ansi[N+16]=D(T.extendedAnsi[N],a.DEFAULT_ANSI_COLORS[N+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(T){this._restoreColor(T),this._onChangeColors.fire(this.colors)}_restoreColor(T){if(T!==void 0)switch(T){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[T]=this._restoreColors.ansi[T]}else for(let E=0;E<this._restoreColors.ansi.length;++E)this._colors.ansi[E]=this._restoreColors.ansi[E]}modifyColors(T){T(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()}}};function D(T,E){if(T!==void 0)try{return S.css.toColor(T)}catch{}return E}a.ThemeService=M=h([p(0,x.IOptionsService)],M)},6349:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const h=c(8460),p=c(844);class u extends p.Disposable{constructor(w){super(),this._maxLength=w,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(w){if(this._maxLength===w)return;const A=new Array(w);for(let x=0;x<Math.min(w,this.length);x++)A[x]=this._array[this._getCyclicIndex(x)];this._array=A,this._maxLength=w,this._startIndex=0}get length(){return this._length}set length(w){if(w>this._length)for(let A=this._length;A<w;A++)this._array[A]=void 0;this._length=w}get(w){return this._array[this._getCyclicIndex(w)]}set(w,A){this._array[this._getCyclicIndex(w)]=A}push(w){this._array[this._getCyclicIndex(this._length)]=w,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(w,A,...x){if(A){for(let b=w;b<this._length-A;b++)this._array[this._getCyclicIndex(b)]=this._array[this._getCyclicIndex(b+A)];this._length-=A,this.onDeleteEmitter.fire({index:w,amount:A})}for(let b=this._length-1;b>=w;b--)this._array[this._getCyclicIndex(b+x.length)]=this._array[this._getCyclicIndex(b)];for(let b=0;b<x.length;b++)this._array[this._getCyclicIndex(w+b)]=x[b];if(x.length&&this.onInsertEmitter.fire({index:w,amount:x.length}),this._length+x.length>this._maxLength){const b=this._length+x.length-this._maxLength;this._startIndex+=b,this._length=this._maxLength,this.onTrimEmitter.fire(b)}else this._length+=x.length}trimStart(w){w>this._length&&(w=this._length),this._startIndex+=w,this._length-=w,this.onTrimEmitter.fire(w)}shiftElements(w,A,x){if(!(A<=0)){if(w<0||w>=this._length)throw new Error("start argument out of range");if(w+x<0)throw new Error("Cannot shift elements in list beyond index 0");if(x>0){for(let _=A-1;_>=0;_--)this.set(w+_+x,this.get(w+_));const b=w+A+x-this._length;if(b>0)for(this._length+=b;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let b=0;b<A;b++)this.set(w+b+x,this.get(w+b))}}_getCyclicIndex(w){return(this._startIndex+w)%this._maxLength}}a.CircularList=u},1439:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function c(h,p=5){if(typeof h!="object")return h;const u=Array.isArray(h)?[]:{};for(const S in h)u[S]=p<=1?h[S]:h[S]&&c(h[S],p-1);return u}},8055:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let c=0,h=0,p=0,u=0;var S,w,A,x,b;function _(y){const k=y.toString(16);return k.length<2?"0"+k:k}function g(y,k){return y<k?(k+.05)/(y+.05):(y+.05)/(k+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(y){y.toCss=function(k,M,D,T){return T!==void 0?`#${_(k)}${_(M)}${_(D)}${_(T)}`:`#${_(k)}${_(M)}${_(D)}`},y.toRgba=function(k,M,D,T=255){return(k<<24|M<<16|D<<8|T)>>>0},y.toColor=function(k,M,D,T){return{css:y.toCss(k,M,D,T),rgba:y.toRgba(k,M,D,T)}}})(S||(a.channels=S={})),(function(y){function k(M,D){return u=Math.round(255*D),[c,h,p]=b.toChannels(M.rgba),{css:S.toCss(c,h,p,u),rgba:S.toRgba(c,h,p,u)}}y.blend=function(M,D){if(u=(255&D.rgba)/255,u===1)return{css:D.css,rgba:D.rgba};const T=D.rgba>>24&255,E=D.rgba>>16&255,R=D.rgba>>8&255,N=M.rgba>>24&255,z=M.rgba>>16&255,F=M.rgba>>8&255;return c=N+Math.round((T-N)*u),h=z+Math.round((E-z)*u),p=F+Math.round((R-F)*u),{css:S.toCss(c,h,p),rgba:S.toRgba(c,h,p)}},y.isOpaque=function(M){return(255&M.rgba)==255},y.ensureContrastRatio=function(M,D,T){const E=b.ensureContrastRatio(M.rgba,D.rgba,T);if(E)return S.toColor(E>>24&255,E>>16&255,E>>8&255)},y.opaque=function(M){const D=(255|M.rgba)>>>0;return[c,h,p]=b.toChannels(D),{css:S.toCss(c,h,p),rgba:D}},y.opacity=k,y.multiplyOpacity=function(M,D){return u=255&M.rgba,k(M,u*D/255)},y.toColorRGB=function(M){return[M.rgba>>24&255,M.rgba>>16&255,M.rgba>>8&255]}})(w||(a.color=w={})),(function(y){let k,M;try{const D=document.createElement("canvas");D.width=1,D.height=1;const T=D.getContext("2d",{willReadFrequently:!0});T&&(k=T,k.globalCompositeOperation="copy",M=k.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(D){if(D.match(/#[\da-f]{3,8}/i))switch(D.length){case 4:return c=parseInt(D.slice(1,2).repeat(2),16),h=parseInt(D.slice(2,3).repeat(2),16),p=parseInt(D.slice(3,4).repeat(2),16),S.toColor(c,h,p);case 5:return c=parseInt(D.slice(1,2).repeat(2),16),h=parseInt(D.slice(2,3).repeat(2),16),p=parseInt(D.slice(3,4).repeat(2),16),u=parseInt(D.slice(4,5).repeat(2),16),S.toColor(c,h,p,u);case 7:return{css:D,rgba:(parseInt(D.slice(1),16)<<8|255)>>>0};case 9:return{css:D,rgba:parseInt(D.slice(1),16)>>>0}}const T=D.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return c=parseInt(T[1]),h=parseInt(T[2]),p=parseInt(T[3]),u=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),S.toColor(c,h,p,u);if(!k||!M)throw new Error("css.toColor: Unsupported css format");if(k.fillStyle=M,k.fillStyle=D,typeof k.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(k.fillRect(0,0,1,1),[c,h,p,u]=k.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:S.toRgba(c,h,p,u),css:D}}})(A||(a.css=A={})),(function(y){function k(M,D,T){const E=M/255,R=D/255,N=T/255;return .2126*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))}y.relativeLuminance=function(M){return k(M>>16&255,M>>8&255,255&M)},y.relativeLuminance2=k})(x||(a.rgb=x={})),(function(y){function k(D,T,E){const R=D>>24&255,N=D>>16&255,z=D>>8&255;let F=T>>24&255,P=T>>16&255,$=T>>8&255,K=g(x.relativeLuminance2(F,P,$),x.relativeLuminance2(R,N,z));for(;K<E&&(F>0||P>0||$>0);)F-=Math.max(0,Math.ceil(.1*F)),P-=Math.max(0,Math.ceil(.1*P)),$-=Math.max(0,Math.ceil(.1*$)),K=g(x.relativeLuminance2(F,P,$),x.relativeLuminance2(R,N,z));return(F<<24|P<<16|$<<8|255)>>>0}function M(D,T,E){const R=D>>24&255,N=D>>16&255,z=D>>8&255;let F=T>>24&255,P=T>>16&255,$=T>>8&255,K=g(x.relativeLuminance2(F,P,$),x.relativeLuminance2(R,N,z));for(;K<E&&(F<255||P<255||$<255);)F=Math.min(255,F+Math.ceil(.1*(255-F))),P=Math.min(255,P+Math.ceil(.1*(255-P))),$=Math.min(255,$+Math.ceil(.1*(255-$))),K=g(x.relativeLuminance2(F,P,$),x.relativeLuminance2(R,N,z));return(F<<24|P<<16|$<<8|255)>>>0}y.blend=function(D,T){if(u=(255&T)/255,u===1)return T;const E=T>>24&255,R=T>>16&255,N=T>>8&255,z=D>>24&255,F=D>>16&255,P=D>>8&255;return c=z+Math.round((E-z)*u),h=F+Math.round((R-F)*u),p=P+Math.round((N-P)*u),S.toRgba(c,h,p)},y.ensureContrastRatio=function(D,T,E){const R=x.relativeLuminance(D>>8),N=x.relativeLuminance(T>>8);if(g(R,N)<E){if(N<R){const P=k(D,T,E),$=g(R,x.relativeLuminance(P>>8));if($<E){const K=M(D,T,E);return $>g(R,x.relativeLuminance(K>>8))?P:K}return P}const z=M(D,T,E),F=g(R,x.relativeLuminance(z>>8));if(F<E){const P=k(D,T,E);return F>g(R,x.relativeLuminance(P>>8))?z:P}return z}},y.reduceLuminance=k,y.increaseLuminance=M,y.toChannels=function(D){return[D>>24&255,D>>16&255,D>>8&255,255&D]}})(b||(a.rgba=b={})),a.toPaddedHex=_,a.contrastRatio=g},8969:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const h=c(844),p=c(2585),u=c(4348),S=c(7866),w=c(744),A=c(7302),x=c(6975),b=c(8460),_=c(1753),g=c(1480),y=c(7994),k=c(9282),M=c(5435),D=c(5981),T=c(2660);let E=!1;class R extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new b.EventEmitter),this._onScroll.event((z=>{var F;(F=this._onScrollApi)==null||F.fire(z.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(z){for(const F in z)this.optionsService.options[F]=z[F]}constructor(z){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new b.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new b.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new b.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new b.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new b.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new A.OptionsService(z)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(w.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(S.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(x.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(_.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(g.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new M.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,b.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,b.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,b.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,b.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((F=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((F=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new D.WriteBuffer(((F,P)=>this._inputHandler.parse(F,P)))),this.register((0,b.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(z,F){this._writeBuffer.write(z,F)}writeSync(z,F){this._logService.logLevel<=p.LogLevelEnum.WARN&&!E&&(this._logService.warn("writeSync is unreliable and will be removed soon."),E=!0),this._writeBuffer.writeSync(z,F)}input(z,F=!0){this.coreService.triggerDataEvent(z,F)}resize(z,F){isNaN(z)||isNaN(F)||(z=Math.max(z,w.MINIMUM_COLS),F=Math.max(F,w.MINIMUM_ROWS),this._bufferService.resize(z,F))}scroll(z,F=!1){this._bufferService.scroll(z,F)}scrollLines(z,F,P){this._bufferService.scrollLines(z,F,P)}scrollPages(z){this.scrollLines(z*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(z){const F=z-this._bufferService.buffer.ydisp;F!==0&&this.scrollLines(F)}registerEscHandler(z,F){return this._inputHandler.registerEscHandler(z,F)}registerDcsHandler(z,F){return this._inputHandler.registerDcsHandler(z,F)}registerCsiHandler(z,F){return this._inputHandler.registerCsiHandler(z,F)}registerOscHandler(z,F){return this._inputHandler.registerOscHandler(z,F)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let z=!1;const F=this.optionsService.rawOptions.windowsPty;F&&F.buildNumber!==void 0&&F.buildNumber!==void 0?z=F.backend==="conpty"&&F.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(z=!0),z?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const z=[];z.push(this.onLineFeed(k.updateWindowsModeWrappedState.bind(null,this._bufferService))),z.push(this.registerCsiHandler({final:"H"},(()=>((0,k.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const F of z)F.dispose()}))}}}a.CoreTerminal=R},8460:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===c)return void this._listeners.splice(h,1)}}})),this._event}fire(c,h){const p=[];for(let u=0;u<this._listeners.length;u++)p.push(this._listeners[u]);for(let u=0;u<p.length;u++)p[u].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(c,h){return c((p=>h.fire(p)))},a.runAndSubscribe=function(c,h){return h(void 0),c((p=>h(p)))}},5435:function(f,a,c){var h=this&&this.__decorate||function(ee,H,O,j){var V,I=arguments.length,ne=I<3?H:j===null?j=Object.getOwnPropertyDescriptor(H,O):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ne=Reflect.decorate(ee,H,O,j);else for(var _e=ee.length-1;_e>=0;_e--)(V=ee[_e])&&(ne=(I<3?V(ne):I>3?V(H,O,ne):V(H,O))||ne);return I>3&&ne&&Object.defineProperty(H,O,ne),ne},p=this&&this.__param||function(ee,H){return function(O,j){H(O,j,ee)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const u=c(2584),S=c(7116),w=c(2015),A=c(844),x=c(482),b=c(8437),_=c(8460),g=c(643),y=c(511),k=c(3734),M=c(2585),D=c(1480),T=c(6242),E=c(6351),R=c(5941),N={"(":0,")":1,"*":2,"+":3,"-":1,".":2},z=131072;function F(ee,H){if(ee>24)return H.setWinLines||!1;switch(ee){case 1:return!!H.restoreWin;case 2:return!!H.minimizeWin;case 3:return!!H.setWinPosition;case 4:return!!H.setWinSizePixels;case 5:return!!H.raiseWin;case 6:return!!H.lowerWin;case 7:return!!H.refreshWin;case 8:return!!H.setWinSizeChars;case 9:return!!H.maximizeWin;case 10:return!!H.fullscreenWin;case 11:return!!H.getWinState;case 13:return!!H.getWinPosition;case 14:return!!H.getWinSizePixels;case 15:return!!H.getScreenSizePixels;case 16:return!!H.getCellSizePixels;case 18:return!!H.getWinSizeChars;case 19:return!!H.getScreenSizeChars;case 20:return!!H.getIconTitle;case 21:return!!H.getWinTitle;case 22:return!!H.pushTitle;case 23:return!!H.popTitle;case 24:return!!H.setWinLines}return!1}var P;(function(ee){ee[ee.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ee[ee.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(a.WindowsOptionsReportType=P={}));let $=0;class K extends A.Disposable{getAttrData(){return this._curAttrData}constructor(H,O,j,V,I,ne,_e,ge,Q=new w.EscapeSequenceParser){super(),this._bufferService=H,this._charsetService=O,this._coreService=j,this._logService=V,this._optionsService=I,this._oscLinkService=ne,this._coreMouseService=_e,this._unicodeService=ge,this._parser=Q,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new x.StringToUtf32,this._utf8Decoder=new x.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new _.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new _.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new _.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new _.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new _.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new _.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new _.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new _.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new _.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new _.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new _.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new _.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new _.EventEmitter),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 G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((q=>this._activeBuffer=q.activeBuffer))),this._parser.setCsiHandlerFallback(((q,J)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(q),params:J.toArray()})})),this._parser.setEscHandlerFallback((q=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(q)})})),this._parser.setExecuteHandlerFallback((q=>{this._logService.debug("Unknown EXECUTE code: ",{code:q})})),this._parser.setOscHandlerFallback(((q,J,Y)=>{this._logService.debug("Unknown OSC code: ",{identifier:q,action:J,data:Y})})),this._parser.setDcsHandlerFallback(((q,J,Y)=>{J==="HOOK"&&(Y=Y.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(q),action:J,payload:Y})})),this._parser.setPrintHandler(((q,J,Y)=>this.print(q,J,Y))),this._parser.registerCsiHandler({final:"@"},(q=>this.insertChars(q))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(q=>this.scrollLeft(q))),this._parser.registerCsiHandler({final:"A"},(q=>this.cursorUp(q))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(q=>this.scrollRight(q))),this._parser.registerCsiHandler({final:"B"},(q=>this.cursorDown(q))),this._parser.registerCsiHandler({final:"C"},(q=>this.cursorForward(q))),this._parser.registerCsiHandler({final:"D"},(q=>this.cursorBackward(q))),this._parser.registerCsiHandler({final:"E"},(q=>this.cursorNextLine(q))),this._parser.registerCsiHandler({final:"F"},(q=>this.cursorPrecedingLine(q))),this._parser.registerCsiHandler({final:"G"},(q=>this.cursorCharAbsolute(q))),this._parser.registerCsiHandler({final:"H"},(q=>this.cursorPosition(q))),this._parser.registerCsiHandler({final:"I"},(q=>this.cursorForwardTab(q))),this._parser.registerCsiHandler({final:"J"},(q=>this.eraseInDisplay(q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(q=>this.eraseInDisplay(q,!0))),this._parser.registerCsiHandler({final:"K"},(q=>this.eraseInLine(q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(q=>this.eraseInLine(q,!0))),this._parser.registerCsiHandler({final:"L"},(q=>this.insertLines(q))),this._parser.registerCsiHandler({final:"M"},(q=>this.deleteLines(q))),this._parser.registerCsiHandler({final:"P"},(q=>this.deleteChars(q))),this._parser.registerCsiHandler({final:"S"},(q=>this.scrollUp(q))),this._parser.registerCsiHandler({final:"T"},(q=>this.scrollDown(q))),this._parser.registerCsiHandler({final:"X"},(q=>this.eraseChars(q))),this._parser.registerCsiHandler({final:"Z"},(q=>this.cursorBackwardTab(q))),this._parser.registerCsiHandler({final:"`"},(q=>this.charPosAbsolute(q))),this._parser.registerCsiHandler({final:"a"},(q=>this.hPositionRelative(q))),this._parser.registerCsiHandler({final:"b"},(q=>this.repeatPrecedingCharacter(q))),this._parser.registerCsiHandler({final:"c"},(q=>this.sendDeviceAttributesPrimary(q))),this._parser.registerCsiHandler({prefix:">",final:"c"},(q=>this.sendDeviceAttributesSecondary(q))),this._parser.registerCsiHandler({final:"d"},(q=>this.linePosAbsolute(q))),this._parser.registerCsiHandler({final:"e"},(q=>this.vPositionRelative(q))),this._parser.registerCsiHandler({final:"f"},(q=>this.hVPosition(q))),this._parser.registerCsiHandler({final:"g"},(q=>this.tabClear(q))),this._parser.registerCsiHandler({final:"h"},(q=>this.setMode(q))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(q=>this.setModePrivate(q))),this._parser.registerCsiHandler({final:"l"},(q=>this.resetMode(q))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(q=>this.resetModePrivate(q))),this._parser.registerCsiHandler({final:"m"},(q=>this.charAttributes(q))),this._parser.registerCsiHandler({final:"n"},(q=>this.deviceStatus(q))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(q=>this.deviceStatusPrivate(q))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(q=>this.softReset(q))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(q=>this.setCursorStyle(q))),this._parser.registerCsiHandler({final:"r"},(q=>this.setScrollRegion(q))),this._parser.registerCsiHandler({final:"s"},(q=>this.saveCursor(q))),this._parser.registerCsiHandler({final:"t"},(q=>this.windowOptions(q))),this._parser.registerCsiHandler({final:"u"},(q=>this.restoreCursor(q))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(q=>this.insertColumns(q))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(q=>this.deleteColumns(q))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(q=>this.selectProtected(q))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(q=>this.requestMode(q,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(q=>this.requestMode(q,!1))),this._parser.setExecuteHandler(u.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(u.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(u.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(u.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(u.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(u.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(u.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(u.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(u.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((q=>(this.setTitle(q),this.setIconName(q),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((q=>this.setIconName(q)))),this._parser.registerOscHandler(2,new T.OscHandler((q=>this.setTitle(q)))),this._parser.registerOscHandler(4,new T.OscHandler((q=>this.setOrReportIndexedColor(q)))),this._parser.registerOscHandler(8,new T.OscHandler((q=>this.setHyperlink(q)))),this._parser.registerOscHandler(10,new T.OscHandler((q=>this.setOrReportFgColor(q)))),this._parser.registerOscHandler(11,new T.OscHandler((q=>this.setOrReportBgColor(q)))),this._parser.registerOscHandler(12,new T.OscHandler((q=>this.setOrReportCursorColor(q)))),this._parser.registerOscHandler(104,new T.OscHandler((q=>this.restoreIndexedColor(q)))),this._parser.registerOscHandler(110,new T.OscHandler((q=>this.restoreFgColor(q)))),this._parser.registerOscHandler(111,new T.OscHandler((q=>this.restoreBgColor(q)))),this._parser.registerOscHandler(112,new T.OscHandler((q=>this.restoreCursorColor(q)))),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(const q in S.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:q},(()=>this.selectCharset("("+q))),this._parser.registerEscHandler({intermediates:")",final:q},(()=>this.selectCharset(")"+q))),this._parser.registerEscHandler({intermediates:"*",final:q},(()=>this.selectCharset("*"+q))),this._parser.registerEscHandler({intermediates:"+",final:q},(()=>this.selectCharset("+"+q))),this._parser.registerEscHandler({intermediates:"-",final:q},(()=>this.selectCharset("-"+q))),this._parser.registerEscHandler({intermediates:".",final:q},(()=>this.selectCharset("."+q))),this._parser.registerEscHandler({intermediates:"/",final:q},(()=>this.selectCharset("/"+q)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((q=>(this._logService.error("Parsing error: ",q),q))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new E.DcsHandler(((q,J)=>this.requestStatusString(q,J))))}_preserveStack(H,O,j,V){this._parseStack.paused=!0,this._parseStack.cursorStartX=H,this._parseStack.cursorStartY=O,this._parseStack.decodedLength=j,this._parseStack.position=V}_logSlowResolvingAsync(H){this._logService.logLevel<=M.LogLevelEnum.WARN&&Promise.race([H,new Promise(((O,j)=>setTimeout((()=>j("#SLOW_TIMEOUT")),5e3)))]).catch((O=>{if(O!=="#SLOW_TIMEOUT")throw O;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(H,O){let j,V=this._activeBuffer.x,I=this._activeBuffer.y,ne=0;const _e=this._parseStack.paused;if(_e){if(j=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,O))return this._logSlowResolvingAsync(j),j;V=this._parseStack.cursorStartX,I=this._parseStack.cursorStartY,this._parseStack.paused=!1,H.length>z&&(ne=this._parseStack.position+z)}if(this._logService.logLevel<=M.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof H=="string"?` "${H}"`:` "${Array.prototype.map.call(H,(q=>String.fromCharCode(q))).join("")}"`),typeof H=="string"?H.split("").map((q=>q.charCodeAt(0))):H),this._parseBuffer.length<H.length&&this._parseBuffer.length<z&&(this._parseBuffer=new Uint32Array(Math.min(H.length,z))),_e||this._dirtyRowTracker.clearRange(),H.length>z)for(let q=ne;q<H.length;q+=z){const J=q+z<H.length?q+z:H.length,Y=typeof H=="string"?this._stringDecoder.decode(H.substring(q,J),this._parseBuffer):this._utf8Decoder.decode(H.subarray(q,J),this._parseBuffer);if(j=this._parser.parse(this._parseBuffer,Y))return this._preserveStack(V,I,Y,q),this._logSlowResolvingAsync(j),j}else if(!_e){const q=typeof H=="string"?this._stringDecoder.decode(H,this._parseBuffer):this._utf8Decoder.decode(H,this._parseBuffer);if(j=this._parser.parse(this._parseBuffer,q))return this._preserveStack(V,I,q,0),this._logSlowResolvingAsync(j),j}this._activeBuffer.x===V&&this._activeBuffer.y===I||this._onCursorMove.fire();const ge=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Q=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Q<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Q,this._bufferService.rows-1),Math.min(ge,this._bufferService.rows-1))}print(H,O,j){let V,I;const ne=this._charsetService.charset,_e=this._optionsService.rawOptions.screenReaderMode,ge=this._bufferService.cols,Q=this._coreService.decPrivateModes.wraparound,q=this._coreService.modes.insertMode,J=this._curAttrData;let Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&j-O>0&&Y.getWidth(this._activeBuffer.x-1)===2&&Y.setCellFromCodepoint(this._activeBuffer.x-1,0,1,J);let he=this._parser.precedingJoinState;for(let de=O;de<j;++de){if(V=H[de],V<127&&ne){const Ke=ne[String.fromCharCode(V)];Ke&&(V=Ke.charCodeAt(0))}const be=this._unicodeService.charProperties(V,he);I=D.UnicodeService.extractWidth(be);const Pe=D.UnicodeService.extractShouldJoin(be),qe=Pe?D.UnicodeService.extractWidth(he):0;if(he=be,_e&&this._onA11yChar.fire((0,x.stringFromCodePoint)(V)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+I-qe>ge){if(Q){const Ke=Y;let Ae=this._activeBuffer.x-qe;for(this._activeBuffer.x=qe,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),Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),qe>0&&Y instanceof b.BufferLine&&Y.copyCellsFrom(Ke,Ae,0,qe,!1);Ae<ge;)Ke.setCellFromCodepoint(Ae++,0,1,J)}else if(this._activeBuffer.x=ge-1,I===2)continue}if(Pe&&this._activeBuffer.x){const Ke=Y.getWidth(this._activeBuffer.x-1)?1:2;Y.addCodepointToCell(this._activeBuffer.x-Ke,V,I);for(let Ae=I-qe;--Ae>=0;)Y.setCellFromCodepoint(this._activeBuffer.x++,0,0,J)}else if(q&&(Y.insertCells(this._activeBuffer.x,I-qe,this._activeBuffer.getNullCell(J)),Y.getWidth(ge-1)===2&&Y.setCellFromCodepoint(ge-1,g.NULL_CELL_CODE,g.NULL_CELL_WIDTH,J)),Y.setCellFromCodepoint(this._activeBuffer.x++,V,I,J),I>0)for(;--I;)Y.setCellFromCodepoint(this._activeBuffer.x++,0,0,J)}this._parser.precedingJoinState=he,this._activeBuffer.x<ge&&j-O>0&&Y.getWidth(this._activeBuffer.x)===0&&!Y.hasContent(this._activeBuffer.x)&&Y.setCellFromCodepoint(this._activeBuffer.x,0,1,J),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(H,O){return H.final!=="t"||H.prefix||H.intermediates?this._parser.registerCsiHandler(H,O):this._parser.registerCsiHandler(H,(j=>!F(j.params[0],this._optionsService.rawOptions.windowOptions)||O(j)))}registerDcsHandler(H,O){return this._parser.registerDcsHandler(H,new E.DcsHandler(O))}registerEscHandler(H,O){return this._parser.registerEscHandler(H,O)}registerOscHandler(H,O){return this._parser.registerOscHandler(H,new T.OscHandler(O))}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 H;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&&((H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&H.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);O.hasWidth(this._activeBuffer.x)&&!O.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const H=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-H),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(H=this._bufferService.cols-1){this._activeBuffer.x=Math.min(H,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(H,O){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=H,this._activeBuffer.y=this._activeBuffer.scrollTop+O):(this._activeBuffer.x=H,this._activeBuffer.y=O),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(H,O){this._restrictCursor(),this._setCursor(this._activeBuffer.x+H,this._activeBuffer.y+O)}cursorUp(H){const O=this._activeBuffer.y-this._activeBuffer.scrollTop;return O>=0?this._moveCursor(0,-Math.min(O,H.params[0]||1)):this._moveCursor(0,-(H.params[0]||1)),!0}cursorDown(H){const O=this._activeBuffer.scrollBottom-this._activeBuffer.y;return O>=0?this._moveCursor(0,Math.min(O,H.params[0]||1)):this._moveCursor(0,H.params[0]||1),!0}cursorForward(H){return this._moveCursor(H.params[0]||1,0),!0}cursorBackward(H){return this._moveCursor(-(H.params[0]||1),0),!0}cursorNextLine(H){return this.cursorDown(H),this._activeBuffer.x=0,!0}cursorPrecedingLine(H){return this.cursorUp(H),this._activeBuffer.x=0,!0}cursorCharAbsolute(H){return this._setCursor((H.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(H){return this._setCursor(H.length>=2?(H.params[1]||1)-1:0,(H.params[0]||1)-1),!0}charPosAbsolute(H){return this._setCursor((H.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(H){return this._moveCursor(H.params[0]||1,0),!0}linePosAbsolute(H){return this._setCursor(this._activeBuffer.x,(H.params[0]||1)-1),!0}vPositionRelative(H){return this._moveCursor(0,H.params[0]||1),!0}hVPosition(H){return this.cursorPosition(H),!0}tabClear(H){const O=H.params[0];return O===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:O===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(H){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=H.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(H){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=H.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(H){const O=H.params[0];return O===1&&(this._curAttrData.bg|=536870912),O!==2&&O!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(H,O,j,V=!1,I=!1){const ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);ne.replaceCells(O,j,this._activeBuffer.getNullCell(this._eraseAttrData()),I),V&&(ne.isWrapped=!1)}_resetBufferLine(H,O=!1){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);j&&(j.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),O),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+H),j.isWrapped=!1)}eraseInDisplay(H,O=!1){let j;switch(this._restrictCursor(this._bufferService.cols),H.params[0]){case 0:for(j=this._activeBuffer.y,this._dirtyRowTracker.markDirty(j),this._eraseInBufferLine(j++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);j<this._bufferService.rows;j++)this._resetBufferLine(j,O);this._dirtyRowTracker.markDirty(j);break;case 1:for(j=this._activeBuffer.y,this._dirtyRowTracker.markDirty(j),this._eraseInBufferLine(j,0,this._activeBuffer.x+1,!0,O),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(j+1).isWrapped=!1);j--;)this._resetBufferLine(j,O);this._dirtyRowTracker.markDirty(0);break;case 2:for(j=this._bufferService.rows,this._dirtyRowTracker.markDirty(j-1);j--;)this._resetBufferLine(j,O);this._dirtyRowTracker.markDirty(0);break;case 3:const V=this._activeBuffer.lines.length-this._bufferService.rows;V>0&&(this._activeBuffer.lines.trimStart(V),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-V,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-V,0),this._onScroll.fire(0))}return!0}eraseInLine(H,O=!1){switch(this._restrictCursor(this._bufferService.cols),H.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,O);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,O)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(H){this._restrictCursor();let O=H.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=this._activeBuffer.ybase+this._activeBuffer.y,V=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-V+1;for(;O--;)this._activeBuffer.lines.splice(I-1,1),this._activeBuffer.lines.splice(j,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(H){this._restrictCursor();let O=H.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=this._activeBuffer.ybase+this._activeBuffer.y;let V;for(V=this._bufferService.rows-1-this._activeBuffer.scrollBottom,V=this._bufferService.rows-1+this._activeBuffer.ybase-V;O--;)this._activeBuffer.lines.splice(j,1),this._activeBuffer.lines.splice(V,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(H){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.insertCells(this._activeBuffer.x,H.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(H){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.deleteCells(this._activeBuffer.x,H.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(H){let O=H.params[0]||1;for(;O--;)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(H){let O=H.params[0]||1;for(;O--;)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(b.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(H){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=H.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);V.deleteCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),V.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(H){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=H.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);V.insertCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),V.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(H){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=H.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);V.insertCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),V.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(H){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=H.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);V.deleteCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),V.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(H){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(H.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(H){const O=this._parser.precedingJoinState;if(!O)return!0;const j=H.params[0]||1,V=D.UnicodeService.extractWidth(O),I=this._activeBuffer.x-V,ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(I),_e=new Uint32Array(ne.length*j);let ge=0;for(let q=0;q<ne.length;){const J=ne.codePointAt(q)||0;_e[ge++]=J,q+=J>65535?2:1}let Q=ge;for(let q=1;q<j;++q)_e.copyWithin(Q,0,ge),Q+=ge;return this.print(_e,0,Q),!0}sendDeviceAttributesPrimary(H){return H.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(H){return H.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(H.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(H){return(this._optionsService.rawOptions.termName+"").indexOf(H)===0}setMode(H){for(let O=0;O<H.length;O++)switch(H.params[O]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(H){for(let O=0;O<H.length;O++)switch(H.params[O]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,S.DEFAULT_CHARSET),this._charsetService.setgCharset(1,S.DEFAULT_CHARSET),this._charsetService.setgCharset(2,S.DEFAULT_CHARSET),this._charsetService.setgCharset(3,S.DEFAULT_CHARSET);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(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(H){for(let O=0;O<H.length;O++)switch(H.params[O]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(H){for(let O=0;O<H.length;O++)switch(H.params[O]){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:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),H.params[O]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(H,O){const j=this._coreService.decPrivateModes,{activeProtocol:V,activeEncoding:I}=this._coreMouseService,ne=this._coreService,{buffers:_e,cols:ge}=this._bufferService,{active:Q,alt:q}=_e,J=this._optionsService.rawOptions,Y=Pe=>Pe?1:2,he=H.params[0];return de=he,be=O?he===2?4:he===4?Y(ne.modes.insertMode):he===12?3:he===20?Y(J.convertEol):0:he===1?Y(j.applicationCursorKeys):he===3?J.windowOptions.setWinLines?ge===80?2:ge===132?1:0:0:he===6?Y(j.origin):he===7?Y(j.wraparound):he===8?3:he===9?Y(V==="X10"):he===12?Y(J.cursorBlink):he===25?Y(!ne.isCursorHidden):he===45?Y(j.reverseWraparound):he===66?Y(j.applicationKeypad):he===67?4:he===1e3?Y(V==="VT200"):he===1002?Y(V==="DRAG"):he===1003?Y(V==="ANY"):he===1004?Y(j.sendFocus):he===1005?4:he===1006?Y(I==="SGR"):he===1015?4:he===1016?Y(I==="SGR_PIXELS"):he===1048?1:he===47||he===1047||he===1049?Y(Q===q):he===2004?Y(j.bracketedPasteMode):0,ne.triggerDataEvent(`${u.C0.ESC}[${O?"":"?"}${de};${be}$y`),!0;var de,be}_updateAttrColor(H,O,j,V,I){return O===2?(H|=50331648,H&=-16777216,H|=k.AttributeData.fromColorRGB([j,V,I])):O===5&&(H&=-50331904,H|=33554432|255&j),H}_extractColor(H,O,j){const V=[0,0,-1,0,0,0];let I=0,ne=0;do{if(V[ne+I]=H.params[O+ne],H.hasSubParams(O+ne)){const _e=H.getSubParams(O+ne);let ge=0;do V[1]===5&&(I=1),V[ne+ge+1+I]=_e[ge];while(++ge<_e.length&&ge+ne+1+I<V.length);break}if(V[1]===5&&ne+I>=2||V[1]===2&&ne+I>=5)break;V[1]&&(I=1)}while(++ne+O<H.length&&ne+I<V.length);for(let _e=2;_e<V.length;++_e)V[_e]===-1&&(V[_e]=0);switch(V[0]){case 38:j.fg=this._updateAttrColor(j.fg,V[1],V[3],V[4],V[5]);break;case 48:j.bg=this._updateAttrColor(j.bg,V[1],V[3],V[4],V[5]);break;case 58:j.extended=j.extended.clone(),j.extended.underlineColor=this._updateAttrColor(j.extended.underlineColor,V[1],V[3],V[4],V[5])}return ne}_processUnderline(H,O){O.extended=O.extended.clone(),(!~H||H>5)&&(H=1),O.extended.underlineStyle=H,O.fg|=268435456,H===0&&(O.fg&=-268435457),O.updateExtended()}_processSGR0(H){H.fg=b.DEFAULT_ATTR_DATA.fg,H.bg=b.DEFAULT_ATTR_DATA.bg,H.extended=H.extended.clone(),H.extended.underlineStyle=0,H.extended.underlineColor&=-67108864,H.updateExtended()}charAttributes(H){if(H.length===1&&H.params[0]===0)return this._processSGR0(this._curAttrData),!0;const O=H.length;let j;const V=this._curAttrData;for(let I=0;I<O;I++)j=H.params[I],j>=30&&j<=37?(V.fg&=-50331904,V.fg|=16777216|j-30):j>=40&&j<=47?(V.bg&=-50331904,V.bg|=16777216|j-40):j>=90&&j<=97?(V.fg&=-50331904,V.fg|=16777224|j-90):j>=100&&j<=107?(V.bg&=-50331904,V.bg|=16777224|j-100):j===0?this._processSGR0(V):j===1?V.fg|=134217728:j===3?V.bg|=67108864:j===4?(V.fg|=268435456,this._processUnderline(H.hasSubParams(I)?H.getSubParams(I)[0]:1,V)):j===5?V.fg|=536870912:j===7?V.fg|=67108864:j===8?V.fg|=1073741824:j===9?V.fg|=2147483648:j===2?V.bg|=134217728:j===21?this._processUnderline(2,V):j===22?(V.fg&=-134217729,V.bg&=-134217729):j===23?V.bg&=-67108865:j===24?(V.fg&=-268435457,this._processUnderline(0,V)):j===25?V.fg&=-536870913:j===27?V.fg&=-67108865:j===28?V.fg&=-1073741825:j===29?V.fg&=2147483647:j===39?(V.fg&=-67108864,V.fg|=16777215&b.DEFAULT_ATTR_DATA.fg):j===49?(V.bg&=-67108864,V.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):j===38||j===48||j===58?I+=this._extractColor(H,I,V):j===53?V.bg|=1073741824:j===55?V.bg&=-1073741825:j===59?(V.extended=V.extended.clone(),V.extended.underlineColor=-1,V.updateExtended()):j===100?(V.fg&=-67108864,V.fg|=16777215&b.DEFAULT_ATTR_DATA.fg,V.bg&=-67108864,V.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",j);return!0}deviceStatus(H){switch(H.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const O=this._activeBuffer.y+1,j=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${O};${j}R`)}return!0}deviceStatusPrivate(H){if(H.params[0]===6){const O=this._activeBuffer.y+1,j=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${O};${j}R`)}return!0}softReset(H){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=b.DEFAULT_ATTR_DATA.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(H){const O=H.params[0]||1;switch(O){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const j=O%2==1;return this._optionsService.options.cursorBlink=j,!0}setScrollRegion(H){const O=H.params[0]||1;let j;return(H.length<2||(j=H.params[1])>this._bufferService.rows||j===0)&&(j=this._bufferService.rows),j>O&&(this._activeBuffer.scrollTop=O-1,this._activeBuffer.scrollBottom=j-1,this._setCursor(0,0)),!0}windowOptions(H){if(!F(H.params[0],this._optionsService.rawOptions.windowOptions))return!0;const O=H.length>1?H.params[1]:0;switch(H.params[0]){case 14:O!==2&&this._onRequestWindowsOptionsReport.fire(P.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(P.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:O!==0&&O!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),O!==0&&O!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:O!==0&&O!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),O!==0&&O!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(H){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(H){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(H){return this._windowTitle=H,this._onTitleChange.fire(H),!0}setIconName(H){return this._iconName=H,!0}setOrReportIndexedColor(H){const O=[],j=H.split(";");for(;j.length>1;){const V=j.shift(),I=j.shift();if(/^\d+$/.exec(V)){const ne=parseInt(V);if(X(ne))if(I==="?")O.push({type:0,index:ne});else{const _e=(0,R.parseColor)(I);_e&&O.push({type:1,index:ne,color:_e})}}}return O.length&&this._onColor.fire(O),!0}setHyperlink(H){const O=H.split(";");return!(O.length<2)&&(O[1]?this._createHyperlink(O[0],O[1]):!O[0]&&this._finishHyperlink())}_createHyperlink(H,O){this._getCurrentLinkId()&&this._finishHyperlink();const j=H.split(":");let V;const I=j.findIndex((ne=>ne.startsWith("id=")));return I!==-1&&(V=j[I].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:V,uri:O}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(H,O){const j=H.split(";");for(let V=0;V<j.length&&!(O>=this._specialColors.length);++V,++O)if(j[V]==="?")this._onColor.fire([{type:0,index:this._specialColors[O]}]);else{const I=(0,R.parseColor)(j[V]);I&&this._onColor.fire([{type:1,index:this._specialColors[O],color:I}])}return!0}setOrReportFgColor(H){return this._setOrReportSpecialColor(H,0)}setOrReportBgColor(H){return this._setOrReportSpecialColor(H,1)}setOrReportCursorColor(H){return this._setOrReportSpecialColor(H,2)}restoreIndexedColor(H){if(!H)return this._onColor.fire([{type:2}]),!0;const O=[],j=H.split(";");for(let V=0;V<j.length;++V)if(/^\d+$/.exec(j[V])){const I=parseInt(j[V]);X(I)&&O.push({type:2,index:I})}return O.length&&this._onColor.fire(O),!0}restoreFgColor(H){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(H){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(H){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,S.DEFAULT_CHARSET),!0}selectCharset(H){return H.length!==2?(this.selectDefaultCharset(),!0):(H[0]==="/"||this._charsetService.setgCharset(N[H[0]],S.CHARSETS[H[1]]||S.DEFAULT_CHARSET),!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){const H=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,H,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=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(H){return this._charsetService.setgLevel(H),!0}screenAlignmentPattern(){const H=new y.CellData;H.content=4194373,H.fg=this._curAttrData.fg,H.bg=this._curAttrData.bg,this._setCursor(0,0);for(let O=0;O<this._bufferService.rows;++O){const j=this._activeBuffer.ybase+this._activeBuffer.y+O,V=this._activeBuffer.lines.get(j);V&&(V.fill(H),V.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(H,O){const j=this._bufferService.buffer,V=this._optionsService.rawOptions;return(I=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${I}${u.C0.ESC}\\`),!0))(H==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:H==='"p'?'P1$r61;1"p':H==="r"?`P1$r${j.scrollTop+1};${j.scrollBottom+1}r`:H==="m"?"P1$r0m":H===" q"?`P1$r${{block:2,underline:4,bar:6}[V.cursorStyle]-(V.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(H,O){this._dirtyRowTracker.markRangeDirty(H,O)}}a.InputHandler=K;let G=class{constructor(ee){this._bufferService=ee,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ee){ee<this.start?this.start=ee:ee>this.end&&(this.end=ee)}markRangeDirty(ee,H){ee>H&&($=ee,ee=H,H=$),ee<this.start&&(this.start=ee),H>this.end&&(this.end=H)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(ee){return 0<=ee&&ee<256}G=h([p(0,M.IBufferService)],G)},844:(f,a)=>{function c(h){for(const p of h)p.dispose();h.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const p=this._disposables.indexOf(h);p!==-1&&this._disposables.splice(p,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var p;this._isDisposed||h===this._value||((p=this._value)==null||p.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},a.toDisposable=function(h){return{dispose:h}},a.disposeArray=c,a.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(p,u,S){this._data[p]||(this._data[p]={}),this._data[p][u]=S}get(p,u){return this._data[p]?this._data[p][u]:void 0}clear(){this._data={}}}a.TwoKeyMap=c,a.FourKeyMap=class{constructor(){this._data=new c}set(h,p,u,S,w){this._data.get(h,p)||this._data.set(h,p,new c),this._data.get(h,p).set(u,S,w)}get(h,p,u,S){var w;return(w=this._data.get(h,p))==null?void 0:w.get(u,S)}clear(){this._data.clear()}}},6114:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const c=a.isNode?"node":navigator.userAgent,h=a.isNode?"node":navigator.platform;a.isFirefox=c.includes("Firefox"),a.isLegacyEdge=c.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(c),a.getSafariVersion=function(){if(!a.isSafari)return 0;const p=c.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),a.isIpad=h==="iPad",a.isIphone=h==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),a.isLinux=h.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(c)},6106:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let c=0;a.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(c=this._search(this._getKey(h)),this._array.splice(c,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const p=this._getKey(h);if(p===void 0||(c=this._search(p),c===-1)||this._getKey(this._array[c])!==p)return!1;do if(this._array[c]===h)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===p);return!1}*getKeyIterator(h){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===h)}forEachByKey(h,p){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do p(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===h)}values(){return[...this._array].values()}_search(h){let p=0,u=this._array.length-1;for(;u>=p;){let S=p+u>>1;const w=this._getKey(this._array[S]);if(w>h)u=S-1;else{if(!(w<h)){for(;S>0&&this._getKey(this._array[S-1])===h;)S--;return S}p=S+1}}return p}}},7226:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const h=c(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),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(w){this._idleCallback=void 0;let A=0,x=0,b=w.timeRemaining(),_=0;for(;this._i<this._tasks.length;){if(A=Date.now(),this._tasks[this._i]()||this._i++,A=Math.max(1,Date.now()-A),x=Math.max(A,x),_=w.timeRemaining(),1.5*x>_)return b-A<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(b-A))}ms`),void this._start();b=_}this.clear()}}class u extends p{_requestCallback(w){return setTimeout((()=>w(this._createDeadline(16))))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const A=Date.now()+w;return{timeRemaining:()=>Math.max(0,A-Date.now())}}}a.PriorityTaskQueue=u,a.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(S){return requestIdleCallback(S)}_cancelCallback(S){cancelIdleCallback(S)}}:u,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(S){this._queue.clear(),this._queue.enqueue(S)}flush(){this._queue.flush()}}},9282:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const h=c(643);a.updateWindowsModeWrappedState=function(p){const u=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),S=u==null?void 0:u.get(p.cols-1),w=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);w&&S&&(w.isWrapped=S[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&S[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new c;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}a.AttributeData=c;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,S=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=S}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=h},9092:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const h=c(6349),p=c(7226),u=c(3734),S=c(8437),w=c(4634),A=c(511),x=c(643),b=c(4863),_=c(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(g,y,k){this._hasScrollback=g,this._optionsService=y,this._bufferService=k,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=S.DEFAULT_ATTR_DATA.clone(),this.savedCharset=_.DEFAULT_CHARSET,this.markers=[],this._nullCell=A.CellData.fromCharData([0,x.NULL_CELL_CHAR,x.NULL_CELL_WIDTH,x.NULL_CELL_CODE]),this._whitespaceCell=A.CellData.fromCharData([0,x.WHITESPACE_CELL_CHAR,x.WHITESPACE_CELL_WIDTH,x.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(g){return g?(this._nullCell.fg=g.fg,this._nullCell.bg=g.bg,this._nullCell.extended=g.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(g){return g?(this._whitespaceCell.fg=g.fg,this._whitespaceCell.bg=g.bg,this._whitespaceCell.extended=g.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(g,y){return new S.BufferLine(this._bufferService.cols,this.getNullCell(g),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const g=this.ybase+this.y-this.ydisp;return g>=0&&g<this._rows}_getCorrectBufferLength(g){if(!this._hasScrollback)return g;const y=g+this._optionsService.rawOptions.scrollback;return y>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:y}fillViewportRows(g){if(this.lines.length===0){g===void 0&&(g=S.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(g))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(g,y){const k=this.getNullCell(S.DEFAULT_ATTR_DATA);let M=0;const D=this._getCorrectBufferLength(y);if(D>this.lines.maxLength&&(this.lines.maxLength=D),this.lines.length>0){if(this._cols<g)for(let E=0;E<this.lines.length;E++)M+=+this.lines.get(E).resize(g,k);let T=0;if(this._rows<y)for(let E=this._rows;E<y;E++)this.lines.length<y+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new S.BufferLine(g,k)):this.ybase>0&&this.lines.length<=this.ybase+this.y+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new S.BufferLine(g,k)));else for(let E=this._rows;E>y;E--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(D<this.lines.maxLength){const E=this.lines.length-D;E>0&&(this.lines.trimStart(E),this.ybase=Math.max(this.ybase-E,0),this.ydisp=Math.max(this.ydisp-E,0),this.savedY=Math.max(this.savedY-E,0)),this.lines.maxLength=D}this.x=Math.min(this.x,g-1),this.y=Math.min(this.y,y-1),T&&(this.y+=T),this.savedX=Math.min(this.savedX,g-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(g,y),this._cols>g))for(let T=0;T<this.lines.length;T++)M+=+this.lines.get(T).resize(g,k);this._cols=g,this._rows=y,this._memoryCleanupQueue.clear(),M>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let g=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,g=!1);let y=0;for(;this._memoryCleanupPosition<this.lines.length;)if(y+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),y>100)return!0;return g}get _isReflowEnabled(){const g=this._optionsService.rawOptions.windowsPty;return g&&g.buildNumber?this._hasScrollback&&g.backend==="conpty"&&g.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(g,y){this._cols!==g&&(g>this._cols?this._reflowLarger(g,y):this._reflowSmaller(g,y))}_reflowLarger(g,y){const k=(0,w.reflowLargerGetLinesToRemove)(this.lines,this._cols,g,this.ybase+this.y,this.getNullCell(S.DEFAULT_ATTR_DATA));if(k.length>0){const M=(0,w.reflowLargerCreateNewLayout)(this.lines,k);(0,w.reflowLargerApplyNewLayout)(this.lines,M.layout),this._reflowLargerAdjustViewport(g,y,M.countRemoved)}}_reflowLargerAdjustViewport(g,y,k){const M=this.getNullCell(S.DEFAULT_ATTR_DATA);let D=k;for(;D-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<y&&this.lines.push(new S.BufferLine(g,M))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-k,0)}_reflowSmaller(g,y){const k=this.getNullCell(S.DEFAULT_ATTR_DATA),M=[];let D=0;for(let T=this.lines.length-1;T>=0;T--){let E=this.lines.get(T);if(!E||!E.isWrapped&&E.getTrimmedLength()<=g)continue;const R=[E];for(;E.isWrapped&&T>0;)E=this.lines.get(--T),R.unshift(E);const N=this.ybase+this.y;if(N>=T&&N<T+R.length)continue;const z=R[R.length-1].getTrimmedLength(),F=(0,w.reflowSmallerGetNewLineLengths)(R,this._cols,g),P=F.length-R.length;let $;$=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+P):Math.max(0,this.lines.length-this.lines.maxLength+P);const K=[];for(let j=0;j<P;j++){const V=this.getBlankLine(S.DEFAULT_ATTR_DATA,!0);K.push(V)}K.length>0&&(M.push({start:T+R.length+D,newLines:K}),D+=K.length),R.push(...K);let G=F.length-1,X=F[G];X===0&&(G--,X=F[G]);let ee=R.length-P-1,H=z;for(;ee>=0;){const j=Math.min(H,X);if(R[G]===void 0)break;if(R[G].copyCellsFrom(R[ee],H-j,X-j,j,!0),X-=j,X===0&&(G--,X=F[G]),H-=j,H===0){ee--;const V=Math.max(ee,0);H=(0,w.getWrappedLineTrimmedLength)(R,V,this._cols)}}for(let j=0;j<R.length;j++)F[j]<g&&R[j].setCell(F[j],k);let O=P-$;for(;O-- >0;)this.ybase===0?this.y<y-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+D)-y&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+P,this.ybase+y-1)}if(M.length>0){const T=[],E=[];for(let G=0;G<this.lines.length;G++)E.push(this.lines.get(G));const R=this.lines.length;let N=R-1,z=0,F=M[z];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+D);let P=0;for(let G=Math.min(this.lines.maxLength-1,R+D-1);G>=0;G--)if(F&&F.start>N+P){for(let X=F.newLines.length-1;X>=0;X--)this.lines.set(G--,F.newLines[X]);G++,T.push({index:N+1,amount:F.newLines.length}),P+=F.newLines.length,F=M[++z]}else this.lines.set(G,E[N--]);let $=0;for(let G=T.length-1;G>=0;G--)T[G].index+=$,this.lines.onInsertEmitter.fire(T[G]),$+=T[G].amount;const K=Math.max(0,R+D-this.lines.maxLength);K>0&&this.lines.onTrimEmitter.fire(K)}}translateBufferLineToString(g,y,k=0,M){const D=this.lines.get(g);return D?D.translateToString(y,k,M):""}getWrappedRangeForLine(g){let y=g,k=g;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;k+1<this.lines.length&&this.lines.get(k+1).isWrapped;)k++;return{first:y,last:k}}setupTabStops(g){for(g!=null?this.tabs[g]||(g=this.prevStop(g)):(this.tabs={},g=0);g<this._cols;g+=this._optionsService.rawOptions.tabStopWidth)this.tabs[g]=!0}prevStop(g){for(g==null&&(g=this.x);!this.tabs[--g]&&g>0;);return g>=this._cols?this._cols-1:g<0?0:g}nextStop(g){for(g==null&&(g=this.x);!this.tabs[++g]&&g<this._cols;);return g>=this._cols?this._cols-1:g<0?0:g}clearMarkers(g){this._isClearing=!0;for(let y=0;y<this.markers.length;y++)this.markers[y].line===g&&(this.markers[y].dispose(),this.markers.splice(y--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let g=0;g<this.markers.length;g++)this.markers[g].dispose(),this.markers.splice(g--,1);this._isClearing=!1}addMarker(g){const y=new b.Marker(g);return this.markers.push(y),y.register(this.lines.onTrim((k=>{y.line-=k,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((k=>{y.line>=k.index&&(y.line+=k.amount)}))),y.register(this.lines.onDelete((k=>{y.line>=k.index&&y.line<k.index+k.amount&&y.dispose(),y.line>k.index&&(y.line-=k.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(g){this._isClearing||this.markers.splice(this.markers.indexOf(g),1)}}},8437:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const h=c(3734),p=c(511),u=c(643),S=c(482);a.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let w=0;class A{constructor(b,_,g=!1){this.isWrapped=g,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*b);const y=_||p.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let k=0;k<b;++k)this.setCell(k,y);this.length=b}get(b){const _=this._data[3*b+0],g=2097151&_;return[this._data[3*b+1],2097152&_?this._combined[b]:g?(0,S.stringFromCodePoint)(g):"",_>>22,2097152&_?this._combined[b].charCodeAt(this._combined[b].length-1):g]}set(b,_){this._data[3*b+1]=_[u.CHAR_DATA_ATTR_INDEX],_[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[b]=_[1],this._data[3*b+0]=2097152|b|_[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*b+0]=_[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|_[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(b){return this._data[3*b+0]>>22}hasWidth(b){return 12582912&this._data[3*b+0]}getFg(b){return this._data[3*b+1]}getBg(b){return this._data[3*b+2]}hasContent(b){return 4194303&this._data[3*b+0]}getCodePoint(b){const _=this._data[3*b+0];return 2097152&_?this._combined[b].charCodeAt(this._combined[b].length-1):2097151&_}isCombined(b){return 2097152&this._data[3*b+0]}getString(b){const _=this._data[3*b+0];return 2097152&_?this._combined[b]:2097151&_?(0,S.stringFromCodePoint)(2097151&_):""}isProtected(b){return 536870912&this._data[3*b+2]}loadCell(b,_){return w=3*b,_.content=this._data[w+0],_.fg=this._data[w+1],_.bg=this._data[w+2],2097152&_.content&&(_.combinedData=this._combined[b]),268435456&_.bg&&(_.extended=this._extendedAttrs[b]),_}setCell(b,_){2097152&_.content&&(this._combined[b]=_.combinedData),268435456&_.bg&&(this._extendedAttrs[b]=_.extended),this._data[3*b+0]=_.content,this._data[3*b+1]=_.fg,this._data[3*b+2]=_.bg}setCellFromCodepoint(b,_,g,y){268435456&y.bg&&(this._extendedAttrs[b]=y.extended),this._data[3*b+0]=_|g<<22,this._data[3*b+1]=y.fg,this._data[3*b+2]=y.bg}addCodepointToCell(b,_,g){let y=this._data[3*b+0];2097152&y?this._combined[b]+=(0,S.stringFromCodePoint)(_):2097151&y?(this._combined[b]=(0,S.stringFromCodePoint)(2097151&y)+(0,S.stringFromCodePoint)(_),y&=-2097152,y|=2097152):y=_|4194304,g&&(y&=-12582913,y|=g<<22),this._data[3*b+0]=y}insertCells(b,_,g){if((b%=this.length)&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,g),_<this.length-b){const y=new p.CellData;for(let k=this.length-b-_-1;k>=0;--k)this.setCell(b+_+k,this.loadCell(b+k,y));for(let k=0;k<_;++k)this.setCell(b+k,g)}else for(let y=b;y<this.length;++y)this.setCell(y,g);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,g)}deleteCells(b,_,g){if(b%=this.length,_<this.length-b){const y=new p.CellData;for(let k=0;k<this.length-b-_;++k)this.setCell(b+k,this.loadCell(b+_+k,y));for(let k=this.length-_;k<this.length;++k)this.setCell(k,g)}else for(let y=b;y<this.length;++y)this.setCell(y,g);b&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,g),this.getWidth(b)!==0||this.hasContent(b)||this.setCellFromCodepoint(b,0,1,g)}replaceCells(b,_,g,y=!1){if(y)for(b&&this.getWidth(b-1)===2&&!this.isProtected(b-1)&&this.setCellFromCodepoint(b-1,0,1,g),_<this.length&&this.getWidth(_-1)===2&&!this.isProtected(_)&&this.setCellFromCodepoint(_,0,1,g);b<_&&b<this.length;)this.isProtected(b)||this.setCell(b,g),b++;else for(b&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,g),_<this.length&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_,0,1,g);b<_&&b<this.length;)this.setCell(b++,g)}resize(b,_){if(b===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const g=3*b;if(b>this.length){if(this._data.buffer.byteLength>=4*g)this._data=new Uint32Array(this._data.buffer,0,g);else{const y=new Uint32Array(g);y.set(this._data),this._data=y}for(let y=this.length;y<b;++y)this.setCell(y,_)}else{this._data=this._data.subarray(0,g);const y=Object.keys(this._combined);for(let M=0;M<y.length;M++){const D=parseInt(y[M],10);D>=b&&delete this._combined[D]}const k=Object.keys(this._extendedAttrs);for(let M=0;M<k.length;M++){const D=parseInt(k[M],10);D>=b&&delete this._extendedAttrs[D]}}return this.length=b,4*g*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const b=new Uint32Array(this._data.length);return b.set(this._data),this._data=b,1}return 0}fill(b,_=!1){if(_)for(let g=0;g<this.length;++g)this.isProtected(g)||this.setCell(g,b);else{this._combined={},this._extendedAttrs={};for(let g=0;g<this.length;++g)this.setCell(g,b)}}copyFrom(b){this.length!==b.length?this._data=new Uint32Array(b._data):this._data.set(b._data),this.length=b.length,this._combined={};for(const _ in b._combined)this._combined[_]=b._combined[_];this._extendedAttrs={};for(const _ in b._extendedAttrs)this._extendedAttrs[_]=b._extendedAttrs[_];this.isWrapped=b.isWrapped}clone(){const b=new A(0);b._data=new Uint32Array(this._data),b.length=this.length;for(const _ in this._combined)b._combined[_]=this._combined[_];for(const _ in this._extendedAttrs)b._extendedAttrs[_]=this._extendedAttrs[_];return b.isWrapped=this.isWrapped,b}getTrimmedLength(){for(let b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0])return b+(this._data[3*b+0]>>22);return 0}getNoBgTrimmedLength(){for(let b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0]||50331648&this._data[3*b+2])return b+(this._data[3*b+0]>>22);return 0}copyCellsFrom(b,_,g,y,k){const M=b._data;if(k)for(let T=y-1;T>=0;T--){for(let E=0;E<3;E++)this._data[3*(g+T)+E]=M[3*(_+T)+E];268435456&M[3*(_+T)+2]&&(this._extendedAttrs[g+T]=b._extendedAttrs[_+T])}else for(let T=0;T<y;T++){for(let E=0;E<3;E++)this._data[3*(g+T)+E]=M[3*(_+T)+E];268435456&M[3*(_+T)+2]&&(this._extendedAttrs[g+T]=b._extendedAttrs[_+T])}const D=Object.keys(b._combined);for(let T=0;T<D.length;T++){const E=parseInt(D[T],10);E>=_&&(this._combined[E-_+g]=b._combined[E])}}translateToString(b,_,g,y){_=_??0,g=g??this.length,b&&(g=Math.min(g,this.getTrimmedLength())),y&&(y.length=0);let k="";for(;_<g;){const M=this._data[3*_+0],D=2097151&M,T=2097152&M?this._combined[_]:D?(0,S.stringFromCodePoint)(D):u.WHITESPACE_CELL_CHAR;if(k+=T,y)for(let E=0;E<T.length;++E)y.push(_);_+=M>>22||1}return y&&y.push(_),k}}a.BufferLine=A},4841:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(c,h){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return h*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(f,a)=>{function c(h,p,u){if(p===h.length-1)return h[p].getTrimmedLength();const S=!h[p].hasContent(u-1)&&h[p].getWidth(u-1)===1,w=h[p+1].getWidth(0)===2;return S&&w?u-1:u}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(h,p,u,S,w){const A=[];for(let x=0;x<h.length-1;x++){let b=x,_=h.get(++b);if(!_.isWrapped)continue;const g=[h.get(x)];for(;b<h.length&&_.isWrapped;)g.push(_),_=h.get(++b);if(S>=x&&S<b){x+=g.length-1;continue}let y=0,k=c(g,y,p),M=1,D=0;for(;M<g.length;){const E=c(g,M,p),R=E-D,N=u-k,z=Math.min(R,N);g[y].copyCellsFrom(g[M],D,k,z,!1),k+=z,k===u&&(y++,k=0),D+=z,D===E&&(M++,D=0),k===0&&y!==0&&g[y-1].getWidth(u-1)===2&&(g[y].copyCellsFrom(g[y-1],u-1,k++,1,!1),g[y-1].setCell(u-1,w))}g[y].replaceCells(k,u,w);let T=0;for(let E=g.length-1;E>0&&(E>y||g[E].getTrimmedLength()===0);E--)T++;T>0&&(A.push(x+g.length-T),A.push(T)),x+=g.length-1}return A},a.reflowLargerCreateNewLayout=function(h,p){const u=[];let S=0,w=p[S],A=0;for(let x=0;x<h.length;x++)if(w===x){const b=p[++S];h.onDeleteEmitter.fire({index:x-A,amount:b}),x+=b-1,A+=b,w=p[++S]}else u.push(x);return{layout:u,countRemoved:A}},a.reflowLargerApplyNewLayout=function(h,p){const u=[];for(let S=0;S<p.length;S++)u.push(h.get(p[S]));for(let S=0;S<u.length;S++)h.set(S,u[S]);h.length=p.length},a.reflowSmallerGetNewLineLengths=function(h,p,u){const S=[],w=h.map(((_,g)=>c(h,g,p))).reduce(((_,g)=>_+g));let A=0,x=0,b=0;for(;b<w;){if(w-b<u){S.push(w-b);break}A+=u;const _=c(h,x,p);A>_&&(A-=_,x++);const g=h[x].getWidth(A-1)===2;g&&A--;const y=g?u-1:u;S.push(y),b+=y}return S},a.getWrappedLineTrimmedLength=c},5295:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const h=c(8460),p=c(844),u=c(9092);class S extends p.Disposable{constructor(A,x){super(),this._optionsService=A,this._bufferService=x,this._onBufferActivate=this.register(new h.EventEmitter),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 u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!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(A){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(A),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(A,x){this._normal.resize(A,x),this._alt.resize(A,x),this.setupTabStops(A)}setupTabStops(A){this._normal.setupTabStops(A),this._alt.setupTabStops(A)}}a.BufferSet=S},511:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const h=c(482),p=c(643),u=c(3734);class S extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(A){const x=new S;return x.setFromCharData(A),x}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(A){this.fg=A[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let x=!1;if(A[p.CHAR_DATA_CHAR_INDEX].length>2)x=!0;else if(A[p.CHAR_DATA_CHAR_INDEX].length===2){const b=A[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=b&&b<=56319){const _=A[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=_&&_<=57343?this.content=1024*(b-55296)+_-56320+65536|A[p.CHAR_DATA_WIDTH_INDEX]<<22:x=!0}else x=!0}else this.content=A[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|A[p.CHAR_DATA_WIDTH_INDEX]<<22;x&&(this.combinedData=A[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|A[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=S},643:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const h=c(8460),p=c(844);class u{get id(){return this._id}constructor(w){this.line=w,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(w){return this._disposables.push(w),w}}a.Marker=u,u._nextId=1},7116:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.CHARSETS[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:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(f,a)=>{var c,h,p;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,(function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
|
|
58
|
-
`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""})(c||(a.C0=c={})),(function(u){u.PAD="",u.HOP="",u.BPH="",u.NBH="",u.IND="",u.NEL="
",u.SSA="",u.ESA="",u.HTS="",u.HTJ="",u.VTS="",u.PLD="",u.PLU="",u.RI="",u.SS2="",u.SS3="",u.DCS="",u.PU1="",u.PU2="",u.STS="",u.CCH="",u.MW="",u.SPA="",u.EPA="",u.SOS="",u.SGCI="",u.SCI="",u.CSI="",u.ST="",u.OSC="",u.PM="",u.APC=""})(h||(a.C1=h={})),(function(u){u.ST=`${c.ESC}\\`})(p||(a.C1_ESCAPED=p={}))},7399:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const h=c(2584),p={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:["'",'"']};a.evaluateKeyboardEvent=function(u,S,w,A){const x={type:0,cancel:!1,key:void 0},b=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?x.key=S?h.C0.ESC+"OA":h.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?x.key=S?h.C0.ESC+"OD":h.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?x.key=S?h.C0.ESC+"OC":h.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(x.key=S?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:x.key=u.ctrlKey?"\b":h.C0.DEL,u.altKey&&(x.key=h.C0.ESC+x.key);break;case 9:if(u.shiftKey){x.key=h.C0.ESC+"[Z";break}x.key=h.C0.HT,x.cancel=!0;break;case 13:x.key=u.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,x.cancel=!0;break;case 27:x.key=h.C0.ESC,u.altKey&&(x.key=h.C0.ESC+h.C0.ESC),x.cancel=!0;break;case 37:if(u.metaKey)break;b?(x.key=h.C0.ESC+"[1;"+(b+1)+"D",x.key===h.C0.ESC+"[1;3D"&&(x.key=h.C0.ESC+(w?"b":"[1;5D"))):x.key=S?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(u.metaKey)break;b?(x.key=h.C0.ESC+"[1;"+(b+1)+"C",x.key===h.C0.ESC+"[1;3C"&&(x.key=h.C0.ESC+(w?"f":"[1;5C"))):x.key=S?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(u.metaKey)break;b?(x.key=h.C0.ESC+"[1;"+(b+1)+"A",w||x.key!==h.C0.ESC+"[1;3A"||(x.key=h.C0.ESC+"[1;5A")):x.key=S?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(u.metaKey)break;b?(x.key=h.C0.ESC+"[1;"+(b+1)+"B",w||x.key!==h.C0.ESC+"[1;3B"||(x.key=h.C0.ESC+"[1;5B")):x.key=S?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(x.key=h.C0.ESC+"[2~");break;case 46:x.key=b?h.C0.ESC+"[3;"+(b+1)+"~":h.C0.ESC+"[3~";break;case 36:x.key=b?h.C0.ESC+"[1;"+(b+1)+"H":S?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:x.key=b?h.C0.ESC+"[1;"+(b+1)+"F":S?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:u.shiftKey?x.type=2:u.ctrlKey?x.key=h.C0.ESC+"[5;"+(b+1)+"~":x.key=h.C0.ESC+"[5~";break;case 34:u.shiftKey?x.type=3:u.ctrlKey?x.key=h.C0.ESC+"[6;"+(b+1)+"~":x.key=h.C0.ESC+"[6~";break;case 112:x.key=b?h.C0.ESC+"[1;"+(b+1)+"P":h.C0.ESC+"OP";break;case 113:x.key=b?h.C0.ESC+"[1;"+(b+1)+"Q":h.C0.ESC+"OQ";break;case 114:x.key=b?h.C0.ESC+"[1;"+(b+1)+"R":h.C0.ESC+"OR";break;case 115:x.key=b?h.C0.ESC+"[1;"+(b+1)+"S":h.C0.ESC+"OS";break;case 116:x.key=b?h.C0.ESC+"[15;"+(b+1)+"~":h.C0.ESC+"[15~";break;case 117:x.key=b?h.C0.ESC+"[17;"+(b+1)+"~":h.C0.ESC+"[17~";break;case 118:x.key=b?h.C0.ESC+"[18;"+(b+1)+"~":h.C0.ESC+"[18~";break;case 119:x.key=b?h.C0.ESC+"[19;"+(b+1)+"~":h.C0.ESC+"[19~";break;case 120:x.key=b?h.C0.ESC+"[20;"+(b+1)+"~":h.C0.ESC+"[20~";break;case 121:x.key=b?h.C0.ESC+"[21;"+(b+1)+"~":h.C0.ESC+"[21~";break;case 122:x.key=b?h.C0.ESC+"[23;"+(b+1)+"~":h.C0.ESC+"[23~";break;case 123:x.key=b?h.C0.ESC+"[24;"+(b+1)+"~":h.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(w&&!A||!u.altKey||u.metaKey)!w||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?x.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(x.key=h.C0.US),u.key==="@"&&(x.key=h.C0.NUL)):u.keyCode===65&&(x.type=1);else{const _=p[u.keyCode],g=_==null?void 0:_[u.shiftKey?1:0];if(g)x.key=h.C0.ESC+g;else if(u.keyCode>=65&&u.keyCode<=90){const y=u.ctrlKey?u.keyCode-64:u.keyCode+32;let k=String.fromCharCode(y);u.shiftKey&&(k=k.toUpperCase()),x.key=h.C0.ESC+k}else if(u.keyCode===32)x.key=h.C0.ESC+(u.ctrlKey?h.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let y=u.code.slice(3,4);u.shiftKey||(y=y.toLowerCase()),x.key=h.C0.ESC+y,x.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?x.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?x.key=h.C0.NUL:u.keyCode>=51&&u.keyCode<=55?x.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?x.key=h.C0.DEL:u.keyCode===219?x.key=h.C0.ESC:u.keyCode===220?x.key=h.C0.FS:u.keyCode===221&&(x.key=h.C0.GS)}return x}},482:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},a.utf32ToString=function(c,h=0,p=c.length){let u="";for(let S=h;S<p;++S){let w=c[S];w>65535?(w-=65536,u+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):u+=String.fromCharCode(w)}return u},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,h){const p=c.length;if(!p)return 0;let u=0,S=0;if(this._interim){const w=c.charCodeAt(S++);56320<=w&&w<=57343?h[u++]=1024*(this._interim-55296)+w-56320+65536:(h[u++]=this._interim,h[u++]=w),this._interim=0}for(let w=S;w<p;++w){const A=c.charCodeAt(w);if(55296<=A&&A<=56319){if(++w>=p)return this._interim=A,u;const x=c.charCodeAt(w);56320<=x&&x<=57343?h[u++]=1024*(A-55296)+x-56320+65536:(h[u++]=A,h[u++]=x)}else A!==65279&&(h[u++]=A)}return u}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,h){const p=c.length;if(!p)return 0;let u,S,w,A,x=0,b=0,_=0;if(this.interim[0]){let k=!1,M=this.interim[0];M&=(224&M)==192?31:(240&M)==224?15:7;let D,T=0;for(;(D=63&this.interim[++T])&&T<4;)M<<=6,M|=D;const E=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=E-T;for(;_<R;){if(_>=p)return 0;if(D=c[_++],(192&D)!=128){_--,k=!0;break}this.interim[T++]=D,M<<=6,M|=63&D}k||(E===2?M<128?_--:h[x++]=M:E===3?M<2048||M>=55296&&M<=57343||M===65279||(h[x++]=M):M<65536||M>1114111||(h[x++]=M)),this.interim.fill(0)}const g=p-4;let y=_;for(;y<p;){for(;!(!(y<g)||128&(u=c[y])||128&(S=c[y+1])||128&(w=c[y+2])||128&(A=c[y+3]));)h[x++]=u,h[x++]=S,h[x++]=w,h[x++]=A,y+=4;if(u=c[y++],u<128)h[x++]=u;else if((224&u)==192){if(y>=p)return this.interim[0]=u,x;if(S=c[y++],(192&S)!=128){y--;continue}if(b=(31&u)<<6|63&S,b<128){y--;continue}h[x++]=b}else if((240&u)==224){if(y>=p)return this.interim[0]=u,x;if(S=c[y++],(192&S)!=128){y--;continue}if(y>=p)return this.interim[0]=u,this.interim[1]=S,x;if(w=c[y++],(192&w)!=128){y--;continue}if(b=(15&u)<<12|(63&S)<<6|63&w,b<2048||b>=55296&&b<=57343||b===65279)continue;h[x++]=b}else if((248&u)==240){if(y>=p)return this.interim[0]=u,x;if(S=c[y++],(192&S)!=128){y--;continue}if(y>=p)return this.interim[0]=u,this.interim[1]=S,x;if(w=c[y++],(192&w)!=128){y--;continue}if(y>=p)return this.interim[0]=u,this.interim[1]=S,this.interim[2]=w,x;if(A=c[y++],(192&A)!=128){y--;continue}if(b=(7&u)<<18|(63&S)<<12|(63&w)<<6|63&A,b<65536||b>1114111)continue;h[x++]=b}}return x}}},225:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const h=c(1480),p=[[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]],u=[[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]];let S;a.UnicodeV6=class{constructor(){if(this.version="6",!S){S=new Uint8Array(65536),S.fill(1),S[0]=0,S.fill(0,1,32),S.fill(0,127,160),S.fill(2,4352,4448),S[9001]=2,S[9002]=2,S.fill(2,11904,42192),S[12351]=1,S.fill(2,44032,55204),S.fill(2,63744,64256),S.fill(2,65040,65050),S.fill(2,65072,65136),S.fill(2,65280,65377),S.fill(2,65504,65511);for(let w=0;w<p.length;++w)S.fill(0,p[w][0],p[w][1]+1)}}wcwidth(w){return w<32?0:w<127?1:w<65536?S[w]:(function(A,x){let b,_=0,g=x.length-1;if(A<x[0][0]||A>x[g][1])return!1;for(;g>=_;)if(b=_+g>>1,A>x[b][1])_=b+1;else{if(!(A<x[b][0]))return!0;g=b-1}return!1})(w,u)?0:w>=131072&&w<=196605||w>=196608&&w<=262141?2:1}charProperties(w,A){let x=this.wcwidth(w),b=x===0&&A!==0;if(b){const _=h.UnicodeService.extractWidth(A);_===0?b=!1:_>x&&(x=_)}return h.UnicodeService.createPropertyValue(0,x,b)}}},5981:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const h=c(8460),p=c(844);class u extends p.Disposable{constructor(w){super(),this._action=w,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(w,A){if(A!==void 0&&this._syncCalls>A)return void(this._syncCalls=0);if(this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let x;for(this._isSyncWriting=!0;x=this._writeBuffer.shift();){this._action(x);const b=this._callbacks.shift();b&&b()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(w,A){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(A),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(A)}_innerWrite(w=0,A=!0){const x=w||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const b=this._writeBuffer[this._bufferOffset],_=this._action(b,A);if(_){const y=k=>Date.now()-x>=12?setTimeout((()=>this._innerWrite(0,k))):this._innerWrite(x,k);return void _.catch((k=>(queueMicrotask((()=>{throw k})),Promise.resolve(!1)))).then(y)}const g=this._callbacks[this._bufferOffset];if(g&&g(),this._bufferOffset++,this._pendingData-=b.length,Date.now()-x>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(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()}}a.WriteBuffer=u},5941:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const c=/^([\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})$/,h=/^[\da-f]+$/;function p(u,S){const w=u.toString(16),A=w.length<2?"0"+w:w;switch(S){case 4:return w[0];case 8:return A;case 12:return(A+A).slice(0,3);default:return A+A}}a.parseColor=function(u){if(!u)return;let S=u.toLowerCase();if(S.indexOf("rgb:")===0){S=S.slice(4);const w=c.exec(S);if(w){const A=w[1]?15:w[4]?255:w[7]?4095:65535;return[Math.round(parseInt(w[1]||w[4]||w[7]||w[10],16)/A*255),Math.round(parseInt(w[2]||w[5]||w[8]||w[11],16)/A*255),Math.round(parseInt(w[3]||w[6]||w[9]||w[12],16)/A*255)]}}else if(S.indexOf("#")===0&&(S=S.slice(1),h.exec(S)&&[3,6,9,12].includes(S.length))){const w=S.length/3,A=[0,0,0];for(let x=0;x<3;++x){const b=parseInt(S.slice(w*x,w*x+w),16);A[x]=w===1?b<<4:w===2?b:w===3?b>>4:b>>8}return A}},a.toRgbString=function(u,S=16){const[w,A,x]=u;return`rgb:${p(w,S)}/${p(A,S)}/${p(x,S)}`}},5770:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const h=c(482),p=c(8742),u=c(5770),S=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=S,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=S}registerHandler(A,x){this._handlers[A]===void 0&&(this._handlers[A]=[]);const b=this._handlers[A];return b.push(x),{dispose:()=>{const _=b.indexOf(x);_!==-1&&b.splice(_,1)}}}clearHandler(A){this._handlers[A]&&delete this._handlers[A]}setHandlerFallback(A){this._handlerFb=A}reset(){if(this._active.length)for(let A=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;A>=0;--A)this._active[A].unhook(!1);this._stack.paused=!1,this._active=S,this._ident=0}hook(A,x){if(this.reset(),this._ident=A,this._active=this._handlers[A]||S,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].hook(x);else this._handlerFb(this._ident,"HOOK",x)}put(A,x,b){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(A,x,b);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(A,x,b))}unhook(A,x=!0){if(this._active.length){let b=!1,_=this._active.length-1,g=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,b=x,g=this._stack.fallThrough,this._stack.paused=!1),!g&&b===!1){for(;_>=0&&(b=this._active[_].unhook(A),b!==!0);_--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,b;_--}for(;_>=0;_--)if(b=this._active[_].unhook(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,b}else this._handlerFb(this._ident,"UNHOOK",A);this._active=S,this._ident=0}};const w=new p.Params;w.addParam(0),a.DcsHandler=class{constructor(A){this._handler=A,this._data="",this._params=w,this._hitLimit=!1}hook(A){this._params=A.length>1||A.params[0]?A.clone():w,this._data="",this._hitLimit=!1}put(A,x,b){this._hitLimit||(this._data+=(0,h.utf32ToString)(A,x,b),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(A){let x=!1;if(this._hitLimit)x=!1;else if(A&&(x=this._handler(this._data,this._params),x instanceof Promise))return x.then((b=>(this._params=w,this._data="",this._hitLimit=!1,b)));return this._params=w,this._data="",this._hitLimit=!1,x}}},2015:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const h=c(844),p=c(8742),u=c(6242),S=c(6351);class w{constructor(_){this.table=new Uint8Array(_)}setDefault(_,g){this.table.fill(_<<4|g)}add(_,g,y,k){this.table[g<<8|_]=y<<4|k}addMany(_,g,y,k){for(let M=0;M<_.length;M++)this.table[g<<8|_[M]]=y<<4|k}}a.TransitionTable=w;const A=160;a.VT500_TRANSITION_TABLE=(function(){const b=new w(4095),_=Array.apply(null,Array(256)).map(((T,E)=>E)),g=(T,E)=>_.slice(T,E),y=g(32,127),k=g(0,24);k.push(25),k.push.apply(k,g(28,32));const M=g(0,14);let D;for(D in b.setDefault(1,0),b.addMany(y,0,2,0),M)b.addMany([24,26,153,154],D,3,0),b.addMany(g(128,144),D,3,0),b.addMany(g(144,152),D,3,0),b.add(156,D,0,0),b.add(27,D,11,1),b.add(157,D,4,8),b.addMany([152,158,159],D,0,7),b.add(155,D,11,3),b.add(144,D,11,9);return b.addMany(k,0,3,0),b.addMany(k,1,3,1),b.add(127,1,0,1),b.addMany(k,8,0,8),b.addMany(k,3,3,3),b.add(127,3,0,3),b.addMany(k,4,3,4),b.add(127,4,0,4),b.addMany(k,6,3,6),b.addMany(k,5,3,5),b.add(127,5,0,5),b.addMany(k,2,3,2),b.add(127,2,0,2),b.add(93,1,4,8),b.addMany(y,8,5,8),b.add(127,8,5,8),b.addMany([156,27,24,26,7],8,6,0),b.addMany(g(28,32),8,0,8),b.addMany([88,94,95],1,0,7),b.addMany(y,7,0,7),b.addMany(k,7,0,7),b.add(156,7,0,0),b.add(127,7,0,7),b.add(91,1,11,3),b.addMany(g(64,127),3,7,0),b.addMany(g(48,60),3,8,4),b.addMany([60,61,62,63],3,9,4),b.addMany(g(48,60),4,8,4),b.addMany(g(64,127),4,7,0),b.addMany([60,61,62,63],4,0,6),b.addMany(g(32,64),6,0,6),b.add(127,6,0,6),b.addMany(g(64,127),6,0,0),b.addMany(g(32,48),3,9,5),b.addMany(g(32,48),5,9,5),b.addMany(g(48,64),5,0,6),b.addMany(g(64,127),5,7,0),b.addMany(g(32,48),4,9,5),b.addMany(g(32,48),1,9,2),b.addMany(g(32,48),2,9,2),b.addMany(g(48,127),2,10,0),b.addMany(g(48,80),1,10,0),b.addMany(g(81,88),1,10,0),b.addMany([89,90,92],1,10,0),b.addMany(g(96,127),1,10,0),b.add(80,1,11,9),b.addMany(k,9,0,9),b.add(127,9,0,9),b.addMany(g(28,32),9,0,9),b.addMany(g(32,48),9,9,12),b.addMany(g(48,60),9,8,10),b.addMany([60,61,62,63],9,9,10),b.addMany(k,11,0,11),b.addMany(g(32,128),11,0,11),b.addMany(g(28,32),11,0,11),b.addMany(k,10,0,10),b.add(127,10,0,10),b.addMany(g(28,32),10,0,10),b.addMany(g(48,60),10,8,10),b.addMany([60,61,62,63],10,0,11),b.addMany(g(32,48),10,9,12),b.addMany(k,12,0,12),b.add(127,12,0,12),b.addMany(g(28,32),12,0,12),b.addMany(g(32,48),12,9,12),b.addMany(g(48,64),12,0,11),b.addMany(g(64,127),12,12,13),b.addMany(g(64,127),10,12,13),b.addMany(g(64,127),9,12,13),b.addMany(k,13,13,13),b.addMany(y,13,13,13),b.add(127,13,0,13),b.addMany([27,156,24,26],13,14,0),b.add(A,0,2,0),b.add(A,8,5,8),b.add(A,6,0,6),b.add(A,11,0,11),b.add(A,13,13,13),b})();class x extends h.Disposable{constructor(_=a.VT500_TRANSITION_TABLE){super(),this._transitions=_,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(g,y,k)=>{},this._executeHandlerFb=g=>{},this._csiHandlerFb=(g,y)=>{},this._escHandlerFb=g=>{},this._errorHandlerFb=g=>g,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new S.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(_,g=[64,126]){let y=0;if(_.prefix){if(_.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=_.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(_.intermediates){if(_.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let M=0;M<_.intermediates.length;++M){const D=_.intermediates.charCodeAt(M);if(32>D||D>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=D}}if(_.final.length!==1)throw new Error("final must be a single byte");const k=_.final.charCodeAt(0);if(g[0]>k||k>g[1])throw new Error(`final must be in range ${g[0]} .. ${g[1]}`);return y<<=8,y|=k,y}identToString(_){const g=[];for(;_;)g.push(String.fromCharCode(255&_)),_>>=8;return g.reverse().join("")}setPrintHandler(_){this._printHandler=_}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(_,g){const y=this._identifier(_,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const k=this._escHandlers[y];return k.push(g),{dispose:()=>{const M=k.indexOf(g);M!==-1&&k.splice(M,1)}}}clearEscHandler(_){this._escHandlers[this._identifier(_,[48,126])]&&delete this._escHandlers[this._identifier(_,[48,126])]}setEscHandlerFallback(_){this._escHandlerFb=_}setExecuteHandler(_,g){this._executeHandlers[_.charCodeAt(0)]=g}clearExecuteHandler(_){this._executeHandlers[_.charCodeAt(0)]&&delete this._executeHandlers[_.charCodeAt(0)]}setExecuteHandlerFallback(_){this._executeHandlerFb=_}registerCsiHandler(_,g){const y=this._identifier(_);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const k=this._csiHandlers[y];return k.push(g),{dispose:()=>{const M=k.indexOf(g);M!==-1&&k.splice(M,1)}}}clearCsiHandler(_){this._csiHandlers[this._identifier(_)]&&delete this._csiHandlers[this._identifier(_)]}setCsiHandlerFallback(_){this._csiHandlerFb=_}registerDcsHandler(_,g){return this._dcsParser.registerHandler(this._identifier(_),g)}clearDcsHandler(_){this._dcsParser.clearHandler(this._identifier(_))}setDcsHandlerFallback(_){this._dcsParser.setHandlerFallback(_)}registerOscHandler(_,g){return this._oscParser.registerHandler(_,g)}clearOscHandler(_){this._oscParser.clearHandler(_)}setOscHandlerFallback(_){this._oscParser.setHandlerFallback(_)}setErrorHandler(_){this._errorHandler=_}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(_,g,y,k,M){this._parseStack.state=_,this._parseStack.handlers=g,this._parseStack.handlerPos=y,this._parseStack.transition=k,this._parseStack.chunkPos=M}parse(_,g,y){let k,M=0,D=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const E=this._parseStack.handlers;let R=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&R>-1){for(;R>=0&&(k=E[R](this._params),k!==!0);R--)if(k instanceof Promise)return this._parseStack.handlerPos=R,k}this._parseStack.handlers=[];break;case 4:if(y===!1&&R>-1){for(;R>=0&&(k=E[R](),k!==!0);R--)if(k instanceof Promise)return this._parseStack.handlerPos=R,k}this._parseStack.handlers=[];break;case 6:if(M=_[this._parseStack.chunkPos],k=this._dcsParser.unhook(M!==24&&M!==26,y),k)return k;M===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(M=_[this._parseStack.chunkPos],k=this._oscParser.end(M!==24&&M!==26,y),k)return k;M===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,T=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let E=T;E<g;++E){switch(M=_[E],D=this._transitions.table[this.currentState<<8|(M<160?M:A)],D>>4){case 2:for(let P=E+1;;++P){if(P>=g||(M=_[P])<32||M>126&&M<A){this._printHandler(_,E,P),E=P-1;break}if(++P>=g||(M=_[P])<32||M>126&&M<A){this._printHandler(_,E,P),E=P-1;break}if(++P>=g||(M=_[P])<32||M>126&&M<A){this._printHandler(_,E,P),E=P-1;break}if(++P>=g||(M=_[P])<32||M>126&&M<A){this._printHandler(_,E,P),E=P-1;break}}break;case 3:this._executeHandlers[M]?this._executeHandlers[M]():this._executeHandlerFb(M),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:E,code:M,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const R=this._csiHandlers[this._collect<<8|M];let N=R?R.length-1:-1;for(;N>=0&&(k=R[N](this._params),k!==!0);N--)if(k instanceof Promise)return this._preserveStack(3,R,N,D,E),k;N<0&&this._csiHandlerFb(this._collect<<8|M,this._params),this.precedingJoinState=0;break;case 8:do switch(M){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(M-48)}while(++E<g&&(M=_[E])>47&&M<60);E--;break;case 9:this._collect<<=8,this._collect|=M;break;case 10:const z=this._escHandlers[this._collect<<8|M];let F=z?z.length-1:-1;for(;F>=0&&(k=z[F](),k!==!0);F--)if(k instanceof Promise)return this._preserveStack(4,z,F,D,E),k;F<0&&this._escHandlerFb(this._collect<<8|M),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|M,this._params);break;case 13:for(let P=E+1;;++P)if(P>=g||(M=_[P])===24||M===26||M===27||M>127&&M<A){this._dcsParser.put(_,E,P),E=P-1;break}break;case 14:if(k=this._dcsParser.unhook(M!==24&&M!==26),k)return this._preserveStack(6,[],0,D,E),k;M===27&&(D|=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 P=E+1;;P++)if(P>=g||(M=_[P])<32||M>127&&M<A){this._oscParser.put(_,E,P),E=P-1;break}break;case 6:if(k=this._oscParser.end(M!==24&&M!==26),k)return this._preserveStack(5,[],0,D,E),k;M===27&&(D|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&D}}}a.EscapeSequenceParser=x},6242:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const h=c(5770),p=c(482),u=[];a.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(S,w){this._handlers[S]===void 0&&(this._handlers[S]=[]);const A=this._handlers[S];return A.push(w),{dispose:()=>{const x=A.indexOf(w);x!==-1&&A.splice(x,1)}}}clearHandler(S){this._handlers[S]&&delete this._handlers[S]}setHandlerFallback(S){this._handlerFb=S}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let S=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;S>=0;--S)this._active[S].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].start();else this._handlerFb(this._id,"START")}_put(S,w,A){if(this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].put(S,w,A);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(S,w,A))}start(){this.reset(),this._state=1}put(S,w,A){if(this._state!==3){if(this._state===1)for(;w<A;){const x=S[w++];if(x===59){this._state=2,this._start();break}if(x<48||57<x)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+x-48}this._state===2&&A-w>0&&this._put(S,w,A)}}end(S,w=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let A=!1,x=this._active.length-1,b=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,A=w,b=this._stack.fallThrough,this._stack.paused=!1),!b&&A===!1){for(;x>=0&&(A=this._active[x].end(S),A!==!0);x--)if(A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!1,A;x--}for(;x>=0;x--)if(A=this._active[x].end(!1),A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!0,A}else this._handlerFb(this._id,"END",S);this._active=u,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(S){this._handler=S,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(S,w,A){this._hitLimit||(this._data+=(0,p.utf32ToString)(S,w,A),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(S){let w=!1;if(this._hitLimit)w=!1;else if(S&&(w=this._handler(this._data),w instanceof Promise))return w.then((A=>(this._data="",this._hitLimit=!1,A)));return this._data="",this._hitLimit=!1,w}}},8742:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const c=2147483647;class h{static fromArray(u){const S=new h;if(!u.length)return S;for(let w=Array.isArray(u[0])?1:0;w<u.length;++w){const A=u[w];if(Array.isArray(A))for(let x=0;x<A.length;++x)S.addSubParam(A[x]);else S.addParam(A)}return S}constructor(u=32,S=32){if(this.maxLength=u,this.maxSubParamsLength=S,S>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(S),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new h(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let S=0;S<this.length;++S){u.push(this.params[S]);const w=this._subParamsIdx[S]>>8,A=255&this._subParamsIdx[S];A-w>0&&u.push(Array.prototype.slice.call(this._subParams,w,A))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>c?c:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>c?c:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const S=this._subParamsIdx[u]>>8,w=255&this._subParamsIdx[u];return w-S>0?this._subParams.subarray(S,w):null}getSubParamsAll(){const u={};for(let S=0;S<this.length;++S){const w=this._subParamsIdx[S]>>8,A=255&this._subParamsIdx[S];A-w>0&&(u[S]=this._subParams.slice(w,A))}return u}addDigit(u){let S;if(this._rejectDigits||!(S=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const w=this._digitIsSub?this._subParams:this.params,A=w[S-1];w[S-1]=~A?Math.min(10*A+u,c):u}}a.Params=h},5741:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,h){const p={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(p),h.dispose=()=>this._wrappedAddonDispose(p),h.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let h=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===c){h=p;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(h,1)}}},8771:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const h=c(3785),p=c(511);a.BufferApiView=class{constructor(u,S){this._buffer=u,this.type=S}init(u){return this._buffer=u,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(u){const S=this._buffer.lines.get(u);if(S)return new h.BufferLineApiView(S)}getNullCell(){return new p.CellData}}},3785:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const h=c(511);a.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,u){if(!(p<0||p>=this._line.length))return u?(this._line.loadCell(p,u),u):this._line.loadCell(p,new h.CellData)}translateToString(p,u,S){return this._line.translateToString(p,u,S)}}},8285:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const h=c(8771),p=c(8460),u=c(844);class S extends u.Disposable{constructor(A){super(),this._core=A,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.BufferApiView(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)}}a.BufferNamespaceApi=S},7975:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,h){return this._core.registerCsiHandler(c,(p=>h(p.toArray())))}addCsiHandler(c,h){return this.registerCsiHandler(c,h)}registerDcsHandler(c,h){return this._core.registerDcsHandler(c,((p,u)=>h(p,u.toArray())))}addDcsHandler(c,h){return this.registerDcsHandler(c,h)}registerEscHandler(c,h){return this._core.registerEscHandler(c,h)}addEscHandler(c,h){return this.registerEscHandler(c,h)}registerOscHandler(c,h){return this._core.registerOscHandler(c,h)}addOscHandler(c,h){return this.registerOscHandler(c,h)}}},7090:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(f,a,c){var h=this&&this.__decorate||function(b,_,g,y){var k,M=arguments.length,D=M<3?_:y===null?y=Object.getOwnPropertyDescriptor(_,g):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(b,_,g,y);else for(var T=b.length-1;T>=0;T--)(k=b[T])&&(D=(M<3?k(D):M>3?k(_,g,D):k(_,g))||D);return M>3&&D&&Object.defineProperty(_,g,D),D},p=this&&this.__param||function(b,_){return function(g,y){_(g,y,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const u=c(8460),S=c(844),w=c(5295),A=c(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let x=a.BufferService=class extends S.Disposable{get buffer(){return this.buffers.active}constructor(b){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(b.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(b.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new w.BufferSet(b,this))}resize(b,_){this.cols=b,this.rows=_,this.buffers.resize(b,_),this._onResize.fire({cols:b,rows:_})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(b,_=!1){const g=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===b.fg&&y.getBg(0)===b.bg||(y=g.getBlankLine(b,_),this._cachedBlankLine=y),y.isWrapped=_;const k=g.ybase+g.scrollTop,M=g.ybase+g.scrollBottom;if(g.scrollTop===0){const D=g.lines.isFull;M===g.lines.length-1?D?g.lines.recycle().copyFrom(y):g.lines.push(y.clone()):g.lines.splice(M+1,0,y.clone()),D?this.isUserScrolling&&(g.ydisp=Math.max(g.ydisp-1,0)):(g.ybase++,this.isUserScrolling||g.ydisp++)}else{const D=M-k+1;g.lines.shiftElements(k+1,D-1,-1),g.lines.set(M,y.clone())}this.isUserScrolling||(g.ydisp=g.ybase),this._onScroll.fire(g.ydisp)}scrollLines(b,_,g){const y=this.buffer;if(b<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else b+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const k=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+b,y.ybase),0),k!==y.ydisp&&(_||this._onScroll.fire(y.ydisp))}};a.BufferService=x=h([p(0,A.IOptionsService)],x)},7994:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,h){this._charsets[c]=h,this.glevel===c&&(this.charset=h)}}},1753:function(f,a,c){var h=this&&this.__decorate||function(y,k,M,D){var T,E=arguments.length,R=E<3?k:D===null?D=Object.getOwnPropertyDescriptor(k,M):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,k,M,D);else for(var N=y.length-1;N>=0;N--)(T=y[N])&&(R=(E<3?T(R):E>3?T(k,M,R):T(k,M))||R);return E>3&&R&&Object.defineProperty(k,M,R),R},p=this&&this.__param||function(y,k){return function(M,D){k(M,D,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const u=c(2585),S=c(8460),w=c(844),A={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function x(y,k){let M=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(M|=64,M|=y.action):(M|=3&y.button,4&y.button&&(M|=64),8&y.button&&(M|=128),y.action===32?M|=32:y.action!==0||k||(M|=3)),M}const b=String.fromCharCode,_={DEFAULT:y=>{const k=[x(y,!1)+32,y.col+32,y.row+32];return k[0]>255||k[1]>255||k[2]>255?"":`\x1B[M${b(k[0])}${b(k[1])}${b(k[2])}`},SGR:y=>{const k=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${x(y,!0)};${y.col};${y.row}${k}`},SGR_PIXELS:y=>{const k=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${x(y,!0)};${y.x};${y.y}${k}`}};let g=a.CoreMouseService=class extends w.Disposable{constructor(y,k){super(),this._bufferService=y,this._coreService=k,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new S.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const M of Object.keys(A))this.addProtocol(M,A[M]);for(const M of Object.keys(_))this.addEncoding(M,_[M]);this.reset()}addProtocol(y,k){this._protocols[y]=k}addEncoding(y,k){this._encodings[y]=k}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const k=this._encodings[this._activeEncoding](y);return k&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(k):this._coreService.triggerDataEvent(k,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,k,M){if(M){if(y.x!==k.x||y.y!==k.y)return!1}else if(y.col!==k.col||y.row!==k.row)return!1;return y.button===k.button&&y.action===k.action&&y.ctrl===k.ctrl&&y.alt===k.alt&&y.shift===k.shift}};a.CoreMouseService=g=h([p(0,u.IBufferService),p(1,u.ICoreService)],g)},6975:function(f,a,c){var h=this&&this.__decorate||function(g,y,k,M){var D,T=arguments.length,E=T<3?y:M===null?M=Object.getOwnPropertyDescriptor(y,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(g,y,k,M);else for(var R=g.length-1;R>=0;R--)(D=g[R])&&(E=(T<3?D(E):T>3?D(y,k,E):D(y,k))||E);return T>3&&E&&Object.defineProperty(y,k,E),E},p=this&&this.__param||function(g,y){return function(k,M){y(k,M,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const u=c(1439),S=c(8460),w=c(844),A=c(2585),x=Object.freeze({insertMode:!1}),b=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let _=a.CoreService=class extends w.Disposable{constructor(g,y,k){super(),this._bufferService=g,this._logService=y,this._optionsService=k,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new S.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new S.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new S.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new S.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(x),this.decPrivateModes=(0,u.clone)(b)}reset(){this.modes=(0,u.clone)(x),this.decPrivateModes=(0,u.clone)(b)}triggerDataEvent(g,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const k=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&k.ybase!==k.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${g}"`,(()=>g.split("").map((M=>M.charCodeAt(0))))),this._onData.fire(g)}triggerBinaryEvent(g){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${g}"`,(()=>g.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(g))}};a.CoreService=_=h([p(0,A.IBufferService),p(1,A.ILogService),p(2,A.IOptionsService)],_)},9074:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const h=c(8055),p=c(8460),u=c(844),S=c(6106);let w=0,A=0;class x extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new S.SortedList((g=>g==null?void 0:g.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)((()=>this.reset())))}registerDecoration(g){if(g.marker.isDisposed)return;const y=new b(g);if(y){const k=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),k.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const g of this._decorations.values())g.dispose();this._decorations.clear()}*getDecorationsAtCell(g,y,k){let M=0,D=0;for(const T of this._decorations.getKeyIterator(y))M=T.options.x??0,D=M+(T.options.width??1),g>=M&&g<D&&(!k||(T.options.layer??"bottom")===k)&&(yield T)}forEachDecorationAtCell(g,y,k,M){this._decorations.forEachByKey(y,(D=>{w=D.options.x??0,A=w+(D.options.width??1),g>=w&&g<A&&(!k||(D.options.layer??"bottom")===k)&&M(D)}))}}a.DecorationService=x;class b extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(g){super(),this.options=g,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=g.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const h=c(2585),p=c(8343);class u{constructor(...w){this._entries=new Map;for(const[A,x]of w)this.set(A,x)}set(w,A){const x=this._entries.get(w);return this._entries.set(w,A),x}forEach(w){for(const[A,x]of this._entries.entries())w(A,x)}has(w){return this._entries.has(w)}get(w){return this._entries.get(w)}}a.ServiceCollection=u,a.InstantiationService=class{constructor(){this._services=new u,this._services.set(h.IInstantiationService,this)}setService(S,w){this._services.set(S,w)}getService(S){return this._services.get(S)}createInstance(S,...w){const A=(0,p.getServiceDependencies)(S).sort(((_,g)=>_.index-g.index)),x=[];for(const _ of A){const g=this._services.get(_.id);if(!g)throw new Error(`[createInstance] ${S.name} depends on UNKNOWN service ${_.id}.`);x.push(g)}const b=A.length>0?A[0].index:w.length;if(w.length!==b)throw new Error(`[createInstance] First service dependency of ${S.name} at position ${b+1} conflicts with ${w.length} static arguments`);return new S(...w,...x)}}},7866:function(f,a,c){var h=this&&this.__decorate||function(b,_,g,y){var k,M=arguments.length,D=M<3?_:y===null?y=Object.getOwnPropertyDescriptor(_,g):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(b,_,g,y);else for(var T=b.length-1;T>=0;T--)(k=b[T])&&(D=(M<3?k(D):M>3?k(_,g,D):k(_,g))||D);return M>3&&D&&Object.defineProperty(_,g,D),D},p=this&&this.__param||function(b,_){return function(g,y){_(g,y,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const u=c(844),S=c(2585),w={trace:S.LogLevelEnum.TRACE,debug:S.LogLevelEnum.DEBUG,info:S.LogLevelEnum.INFO,warn:S.LogLevelEnum.WARN,error:S.LogLevelEnum.ERROR,off:S.LogLevelEnum.OFF};let A,x=a.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(b){super(),this._optionsService=b,this._logLevel=S.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),A=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(b){for(let _=0;_<b.length;_++)typeof b[_]=="function"&&(b[_]=b[_]())}_log(b,_,g){this._evalLazyOptionalParams(g),b.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+_,...g)}trace(b,..._){var g;this._logLevel<=S.LogLevelEnum.TRACE&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.trace.bind(this._optionsService.options.logger))??console.log,b,_)}debug(b,..._){var g;this._logLevel<=S.LogLevelEnum.DEBUG&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.debug.bind(this._optionsService.options.logger))??console.log,b,_)}info(b,..._){var g;this._logLevel<=S.LogLevelEnum.INFO&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.info.bind(this._optionsService.options.logger))??console.info,b,_)}warn(b,..._){var g;this._logLevel<=S.LogLevelEnum.WARN&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.warn.bind(this._optionsService.options.logger))??console.warn,b,_)}error(b,..._){var g;this._logLevel<=S.LogLevelEnum.ERROR&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.error.bind(this._optionsService.options.logger))??console.error,b,_)}};a.LogService=x=h([p(0,S.IOptionsService)],x),a.setTraceLogger=function(b){A=b},a.traceCall=function(b,_,g){if(typeof g.value!="function")throw new Error("not supported");const y=g.value;g.value=function(...k){if(A.logLevel!==S.LogLevelEnum.TRACE)return y.apply(this,k);A.trace(`GlyphRenderer#${y.name}(${k.map((D=>JSON.stringify(D))).join(", ")})`);const M=y.apply(this,k);return A.trace(`GlyphRenderer#${y.name} return`,M),M}}},7302:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const h=c(8460),p=c(844),u=c(6114);a.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const S=["normal","bold","100","200","300","400","500","600","700","800","900"];class w extends p.Disposable{constructor(x){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const b={...a.DEFAULT_OPTIONS};for(const _ in x)if(_ in b)try{const g=x[_];b[_]=this._sanitizeAndValidateOption(_,g)}catch(g){console.error(g)}this.rawOptions=b,this.options={...b},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(x,b){return this.onOptionChange((_=>{_===x&&b(this.rawOptions[x])}))}onMultipleOptionChange(x,b){return this.onOptionChange((_=>{x.indexOf(_)!==-1&&b()}))}_setupOptions(){const x=_=>{if(!(_ in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${_}"`);return this.rawOptions[_]},b=(_,g)=>{if(!(_ in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${_}"`);g=this._sanitizeAndValidateOption(_,g),this.rawOptions[_]!==g&&(this.rawOptions[_]=g,this._onOptionChange.fire(_))};for(const _ in this.rawOptions){const g={get:x.bind(this,_),set:b.bind(this,_)};Object.defineProperty(this.options,_,g)}}_sanitizeAndValidateOption(x,b){switch(x){case"cursorStyle":if(b||(b=a.DEFAULT_OPTIONS[x]),!(function(_){return _==="block"||_==="underline"||_==="bar"})(b))throw new Error(`"${b}" is not a valid value for ${x}`);break;case"wordSeparator":b||(b=a.DEFAULT_OPTIONS[x]);break;case"fontWeight":case"fontWeightBold":if(typeof b=="number"&&1<=b&&b<=1e3)break;b=S.includes(b)?b:a.DEFAULT_OPTIONS[x];break;case"cursorWidth":b=Math.floor(b);case"lineHeight":case"tabStopWidth":if(b<1)throw new Error(`${x} cannot be less than 1, value: ${b}`);break;case"minimumContrastRatio":b=Math.max(1,Math.min(21,Math.round(10*b)/10));break;case"scrollback":if((b=Math.min(b,4294967295))<0)throw new Error(`${x} cannot be less than 0, value: ${b}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(b<=0)throw new Error(`${x} cannot be less than or equal to 0, value: ${b}`);break;case"rows":case"cols":if(!b&&b!==0)throw new Error(`${x} must be numeric, value: ${b}`);break;case"windowsPty":b=b??{}}return b}}a.OptionsService=w},2660:function(f,a,c){var h=this&&this.__decorate||function(w,A,x,b){var _,g=arguments.length,y=g<3?A:b===null?b=Object.getOwnPropertyDescriptor(A,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(w,A,x,b);else for(var k=w.length-1;k>=0;k--)(_=w[k])&&(y=(g<3?_(y):g>3?_(A,x,y):_(A,x))||y);return g>3&&y&&Object.defineProperty(A,x,y),y},p=this&&this.__param||function(w,A){return function(x,b){A(x,b,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const u=c(2585);let S=a.OscLinkService=class{constructor(w){this._bufferService=w,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(w){const A=this._bufferService.buffer;if(w.id===void 0){const k=A.addMarker(A.ybase+A.y),M={data:w,id:this._nextId++,lines:[k]};return k.onDispose((()=>this._removeMarkerFromLink(M,k))),this._dataByLinkId.set(M.id,M),M.id}const x=w,b=this._getEntryIdKey(x),_=this._entriesWithId.get(b);if(_)return this.addLineToLink(_.id,A.ybase+A.y),_.id;const g=A.addMarker(A.ybase+A.y),y={id:this._nextId++,key:this._getEntryIdKey(x),data:x,lines:[g]};return g.onDispose((()=>this._removeMarkerFromLink(y,g))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(w,A){const x=this._dataByLinkId.get(w);if(x&&x.lines.every((b=>b.line!==A))){const b=this._bufferService.buffer.addMarker(A);x.lines.push(b),b.onDispose((()=>this._removeMarkerFromLink(x,b)))}}getLinkData(w){var A;return(A=this._dataByLinkId.get(w))==null?void 0:A.data}_getEntryIdKey(w){return`${w.id};;${w.uri}`}_removeMarkerFromLink(w,A){const x=w.lines.indexOf(A);x!==-1&&(w.lines.splice(x,1),w.lines.length===0&&(w.data.id!==void 0&&this._entriesWithId.delete(w.key),this._dataByLinkId.delete(w.id)))}};a.OscLinkService=S=h([p(0,u.IBufferService)],S)},8343:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const c="di$target",h="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(p){return p[h]||[]},a.createDecorator=function(p){if(a.serviceRegistry.has(p))return a.serviceRegistry.get(p);const u=function(S,w,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(x,b,_){b[c]===b?b[h].push({id:x,index:_}):(b[h]=[{id:x,index:_}],b[c]=b)})(u,S,A)};return u.toString=()=>p,a.serviceRegistry.set(p,u),u}},2585:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const h=c(8343);var p;a.IBufferService=(0,h.createDecorator)("BufferService"),a.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),a.ICoreService=(0,h.createDecorator)("CoreService"),a.ICharsetService=(0,h.createDecorator)("CharsetService"),a.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"})(p||(a.LogLevelEnum=p={})),a.ILogService=(0,h.createDecorator)("LogService"),a.IOptionsService=(0,h.createDecorator)("OptionsService"),a.IOscLinkService=(0,h.createDecorator)("OscLinkService"),a.IUnicodeService=(0,h.createDecorator)("UnicodeService"),a.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const h=c(8460),p=c(225);class u{static extractShouldJoin(w){return(1&w)!=0}static extractWidth(w){return w>>1&3}static extractCharKind(w){return w>>3}static createPropertyValue(w,A,x=!1){return(16777215&w)<<3|(3&A)<<1|(x?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const w=new p.UnicodeV6;this.register(w),this._active=w.version,this._activeProvider=w}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(w){if(!this._providers[w])throw new Error(`unknown Unicode version "${w}"`);this._active=w,this._activeProvider=this._providers[w],this._onChange.fire(w)}register(w){this._providers[w.version]=w}wcwidth(w){return this._activeProvider.wcwidth(w)}getStringCellWidth(w){let A=0,x=0;const b=w.length;for(let _=0;_<b;++_){let g=w.charCodeAt(_);if(55296<=g&&g<=56319){if(++_>=b)return A+this.wcwidth(g);const M=w.charCodeAt(_);56320<=M&&M<=57343?g=1024*(g-55296)+M-56320+65536:A+=this.wcwidth(M)}const y=this.charProperties(g,x);let k=u.extractWidth(y);u.extractShouldJoin(y)&&(k-=u.extractWidth(x)),A+=k,x=y}return A}charProperties(w,A){return this._activeProvider.charProperties(w,A)}}a.UnicodeService=u}},o={};function d(f){var a=o[f];if(a!==void 0)return a.exports;var c=o[f]={exports:{}};return s[f].call(c.exports,c,c.exports,d),c.exports}var v={};return(()=>{var f=v;Object.defineProperty(f,"__esModule",{value:!0}),f.Terminal=void 0;const a=d(9042),c=d(3236),h=d(844),p=d(5741),u=d(8285),S=d(7975),w=d(7090),A=["cols","rows"];class x extends h.Disposable{constructor(_){super(),this._core=this.register(new c.Terminal(_)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const g=k=>this._core.options[k],y=(k,M)=>{this._checkReadonlyOptions(k),this._core.options[k]=M};for(const k in this._core.options){const M={get:g.bind(this,k),set:y.bind(this,k)};Object.defineProperty(this._publicOptions,k,M)}}_checkReadonlyOptions(_){if(A.includes(_))throw new Error(`Option "${_}" 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 S.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new w.UnicodeApi(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 u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const _=this._core.coreService.decPrivateModes;let g="none";switch(this._core.coreMouseService.activeProtocol){case"X10":g="x10";break;case"VT200":g="vt200";break;case"DRAG":g="drag";break;case"ANY":g="any"}return{applicationCursorKeysMode:_.applicationCursorKeys,applicationKeypadMode:_.applicationKeypad,bracketedPasteMode:_.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:g,originMode:_.origin,reverseWraparoundMode:_.reverseWraparound,sendFocusMode:_.sendFocus,wraparoundMode:_.wraparound}}get options(){return this._publicOptions}set options(_){for(const g in _)this._publicOptions[g]=_[g]}blur(){this._core.blur()}focus(){this._core.focus()}input(_,g=!0){this._core.input(_,g)}resize(_,g){this._verifyIntegers(_,g),this._core.resize(_,g)}open(_){this._core.open(_)}attachCustomKeyEventHandler(_){this._core.attachCustomKeyEventHandler(_)}attachCustomWheelEventHandler(_){this._core.attachCustomWheelEventHandler(_)}registerLinkProvider(_){return this._core.registerLinkProvider(_)}registerCharacterJoiner(_){return this._checkProposedApi(),this._core.registerCharacterJoiner(_)}deregisterCharacterJoiner(_){this._checkProposedApi(),this._core.deregisterCharacterJoiner(_)}registerMarker(_=0){return this._verifyIntegers(_),this._core.registerMarker(_)}registerDecoration(_){return this._checkProposedApi(),this._verifyPositiveIntegers(_.x??0,_.width??0,_.height??0),this._core.registerDecoration(_)}hasSelection(){return this._core.hasSelection()}select(_,g,y){this._verifyIntegers(_,g,y),this._core.select(_,g,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(_,g){this._verifyIntegers(_,g),this._core.selectLines(_,g)}dispose(){super.dispose()}scrollLines(_){this._verifyIntegers(_),this._core.scrollLines(_)}scrollPages(_){this._verifyIntegers(_),this._core.scrollPages(_)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(_){this._verifyIntegers(_),this._core.scrollToLine(_)}clear(){this._core.clear()}write(_,g){this._core.write(_,g)}writeln(_,g){this._core.write(_),this._core.write(`\r
|
|
59
|
-
`,g)}paste(_){this._core.paste(_)}refresh(_,g){this._verifyIntegers(_,g),this._core.refresh(_,g)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(_){this._addonManager.loadAddon(this,_)}static get strings(){return a}_verifyIntegers(..._){for(const g of _)if(g===1/0||isNaN(g)||g%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(..._){for(const g of _)if(g&&(g===1/0||isNaN(g)||g%1!=0||g<0))throw new Error("This API only accepts positive integers")}}f.Terminal=x})(),v})()))})(nu)),nu.exports}var v1
|
|
60
|
-
[VCM] ${y}`),(k=c.current)==null||k.call(c,y)}});d.current=S;const w=p.onData(y=>{S.sendInput(y)});let A=0,x=0,b=0;const _=()=>{A&&window.cancelAnimationFrame(A),A=window.requestAnimationFrame(()=>{A=0,h({focus:a.current})})},g=new ResizeObserver(()=>{_()});return g.observe(o.current),x=window.requestAnimationFrame(_),b=window.setTimeout(_,120),()=>{A&&window.cancelAnimationFrame(A),x&&window.cancelAnimationFrame(x),b&&window.clearTimeout(b),g.disconnect(),w.dispose(),S.close(),p.dispose(),d.current=null,f.current=null,v.current=null}},[n]),ce.useEffect(()=>{if(!r)return;const p=[],u=[];return p.push(window.requestAnimationFrame(()=>{h({focus:!0}),p.push(window.requestAnimationFrame(()=>h({focus:!0})))})),u.push(window.setTimeout(()=>h({focus:!0}),160)),u.push(window.setTimeout(()=>h({focus:!0}),360)),()=>{for(const S of p)window.cancelAnimationFrame(S);for(const S of u)window.clearTimeout(S)}},[r]),ce.useEffect(()=>{const p=()=>{a.current&&h()};return window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]),B.jsx("div",{className:"terminal-frame",ref:o,onMouseDown:()=>{var p;return(p=f.current)==null?void 0:p.focus()}})}const S1=160,b1=80,C1=20,w1=5,x1={background:"#0d1117",foreground:"#d6deeb",cursor:"#ffd866",cursorAccent:"#0d1117",selectionBackground:"#264f78",selectionForeground:"#ffffff",black:"#1f2430",red:"#ff5c57",green:"#5af78e",yellow:"#f3f99d",blue:"#57c7ff",magenta:"#ff6ac1",cyan:"#9aedfe",white:"#f1f1f0",brightBlack:"#686868",brightRed:"#ff5c57",brightGreen:"#5af78e",brightYellow:"#f3f99d",brightBlue:"#57c7ff",brightMagenta:"#ff6ac1",brightCyan:"#9aedfe",brightWhite:"#ffffff"};function Yr({status:n}){return B.jsx("span",{className:`status-badge status-${n}`,children:n.replaceAll("_"," ")})}function E1({status:n,bootstrapStatus:r,applyResult:s,busy:o=!1,onRefresh:d,onApply:v,onStartBootstrap:f}){const[a,c]=ce.useState(!1),h=r==null?void 0:r.session;return ce.useEffect(()=>{h||c(!1)},[h]),n?B.jsxs("section",{className:"harness-panel",children:[B.jsxs("div",{className:"harness-stage",children:[B.jsxs("div",{className:"harness-panel-header",children:[B.jsxs("div",{children:[B.jsx("strong",{children:"Fixed install"}),B.jsx("p",{className:"muted",children:n.initialized?n.needsApply?`${n.plannedChanges.length} pending updates`:"Up to date":"Not initialized"})]}),B.jsx("div",{className:"harness-actions",children:n.initialized?B.jsxs(B.Fragment,{children:[B.jsx("button",{type:"button",disabled:o,onClick:()=>void d(),children:"Refresh"}),n.needsApply?B.jsx("button",{type:"button",disabled:o,onClick:()=>void v(),children:"Update"}):null]}):B.jsx("button",{type:"button",disabled:o,onClick:()=>void v(),children:"Initialize"})})]}),n.initialized&&n.needsApply?B.jsxs(B.Fragment,{children:[B.jsx("h3",{className:"harness-file-list-title",children:"Files to update"}),B.jsx("ol",{className:"harness-file-list",children:n.plannedChanges.map(p=>B.jsxs("li",{children:[B.jsx("span",{children:p.path}),B.jsx(Yr,{status:p.action})]},`${p.path}:${p.action}`))})]}):null]}),B.jsxs("div",{className:"harness-stage",children:[B.jsxs("div",{className:"harness-panel-header",children:[B.jsxs("div",{children:[B.jsx("strong",{children:"Bootstrap"}),B.jsx("p",{className:"muted",children:r?k1(r.status):"not loaded"})]}),B.jsx("div",{className:"harness-actions",children:B.jsx("button",{type:"button",disabled:o||!(r!=null&&r.canStart),onClick:()=>{c(!0),f()},children:"Run Bootstrap"})})]}),r?B.jsxs(B.Fragment,{children:[B.jsx("ol",{className:"harness-file-list",children:r.checks.map(p=>B.jsxs("li",{title:p.detail??p.path??"",children:[B.jsx("span",{children:p.path?`${p.label}: ${p.path}`:p.label}),B.jsx(Yr,{status:p.status})]},p.key))}),h?B.jsxs("div",{className:"harness-bootstrap-session",children:[B.jsxs("div",{children:[B.jsx("span",{children:h.command}),B.jsx(Yr,{status:h.status})]}),B.jsx("button",{type:"button",onClick:()=>c(!0),children:"Open Terminal"})]}):null]}):B.jsx("p",{className:"muted",children:"Refresh harness status to load bootstrap checks."})]}),s?B.jsxs("div",{className:"harness-result",children:[B.jsx("p",{children:s.message}),s.changedFiles.length>0?B.jsx("ul",{children:s.changedFiles.map(p=>B.jsxs("li",{children:[B.jsx("strong",{children:p.action})," ",p.path]},`${p.path}:${p.action}`))}):null]}):null,n.warnings.length>0?B.jsx("ul",{className:"warnings",children:n.warnings.map(p=>B.jsx("li",{children:p},p))}):null,r!=null&&r.warnings.length?B.jsx("ul",{className:"warnings",children:r.warnings.map(p=>B.jsx("li",{children:p},p))}):null,a&&h?B.jsx("div",{className:"harness-bootstrap-modal",role:"dialog","aria-modal":"true","aria-label":"Harness bootstrap terminal",children:B.jsxs("div",{className:"harness-bootstrap-modal-surface",children:[B.jsxs("header",{className:"harness-bootstrap-modal-header",children:[B.jsxs("div",{children:[B.jsx("strong",{children:"Harness Bootstrap Terminal"}),B.jsx("p",{className:"muted",children:h.command})]}),B.jsxs("div",{className:"harness-bootstrap-modal-actions",children:[B.jsx(Yr,{status:h.status}),B.jsx("button",{type:"button",onClick:()=>c(!1),children:"Close"})]})]}),B.jsx("div",{className:"harness-bootstrap-terminal",children:B.jsx(hg,{sessionId:h.id,active:a})})]})}):null]}):null}function k1(n){return n.replaceAll("_"," ")}function ju(n){return{total:n.length,accepted:n.filter(r=>r.acceptedAt).length,delivered:n.filter(r=>r.deliveredAt).length}}function A1(n,r=6){const s=[...n].sort(R1).map((d,v)=>({message:d,sequence:v+1}));return[...r===null?s:s.slice(-r)].sort((d,v)=>v.sequence-d.sequence)}function T1({messages:n,orchestration:r,busy:s,maxMessages:o=6,showControls:d=!0,showHeader:v=!0,onModeChange:f,onMarkAllDone:a}){const[c,h]=ce.useState(null),p=ju(n),u=(r==null?void 0:r.mode)??"auto",S=A1(n,o);async function w(A){await M1(A.body),h(A.id),window.setTimeout(()=>h(x=>x===A.id?null:x),1200)}return B.jsxs("section",{className:"message-panel",children:[v?B.jsxs("div",{className:"message-panel-header",children:[B.jsxs("div",{children:[B.jsx("h2",{children:"Messages"}),B.jsxs("p",{className:"muted",children:[p.total," total / ",p.accepted," accepted"]})]}),d&&f?B.jsx("div",{className:"message-controls",children:B.jsxs("label",{className:"message-mode-toggle",children:[B.jsx("input",{type:"checkbox",checked:u==="auto",disabled:s,onChange:A=>f(A.target.checked?"auto":"manual")}),B.jsx("span",{children:"Auto orchestration"})]})}):null,d&&a?B.jsx("button",{type:"button",disabled:s,onClick:a,children:"Mark All Done"}):null]}):null,n.length===0?B.jsx("p",{className:"muted",children:"No role messages yet."}):B.jsx("ol",{className:"message-list",children:S.map(({message:A,sequence:x})=>B.jsxs("li",{className:"message-item",children:[B.jsxs("div",{className:"message-item-main",children:[B.jsxs("div",{className:"message-meta",children:[B.jsxs("span",{className:"message-sequence",children:["#",x]}),B.jsx("time",{dateTime:Aa(A),children:D1(Aa(A))}),B.jsxs("strong",{children:[A.fromRole," ","->"," ",A.toRole]}),B.jsx("span",{children:A.type})]}),B.jsx("p",{children:A.body}),A.failureReason?B.jsx("span",{className:"message-reason",children:A.failureReason}):null,A.bodyPath?B.jsx("span",{className:"message-path",children:A.bodyPath}):null]}),B.jsx("div",{className:"message-actions",children:B.jsx("button",{type:"button",disabled:s,onClick:()=>void w(A),children:c===A.id?"Copied":"Copy"})})]},A.id))})]})}function D1(n){const r=new Date(n);return Number.isNaN(r.getTime())?n:r.toLocaleString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Aa(n){return n.acceptedAt??n.deliveredAt??n.dispatchingAt??n.createdAt}function R1(n,r){const s=Aa(n).localeCompare(Aa(r));if(s!==0)return s;const o=n.createdAt.localeCompare(r.createdAt);return o!==0?o:n.id.localeCompare(r.id)}async function M1(n){var s;if((s=navigator.clipboard)!=null&&s.writeText){await navigator.clipboard.writeText(n);return}const r=document.createElement("textarea");r.value=n,r.setAttribute("readonly","true"),r.style.position="fixed",r.style.left="-9999px",document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove()}function L1({defaultPath:n="",recentPaths:r=[],busy:s=!1,onConnect:o}){const[d,v]=ce.useState(n);ce.useEffect(()=>{n&&v(n)},[n]);async function f(a){a.preventDefault(),await o(d)}return B.jsx("form",{className:"repo-connect",onSubmit:f,children:B.jsxs("div",{className:r.length>0?"inline-form has-recent-paths":"inline-form",children:[B.jsx("input",{"aria-label":"Repository path",id:"repo-path",value:d,onChange:a=>v(a.target.value),placeholder:"/path/to/repo"}),r.length>0?B.jsxs("select",{"aria-label":"Recent repositories",className:"repo-recent-select",value:"",onChange:a=>{a.target.value&&v(a.target.value)},children:[B.jsx("option",{value:"",children:"Recent"}),r.map(a=>B.jsx("option",{value:a,children:a},a))]}):null,B.jsx("button",{type:"submit",disabled:s||!d.trim(),children:"Connect"})]})})}function O1({tasks:n,activeTaskSlug:r,onSelect:s}){return B.jsx("nav",{className:"task-nav","aria-label":"Tasks",children:n.map(o=>B.jsxs("button",{className:o.taskSlug===r?"task-nav-item is-active":"task-nav-item",type:"button",onClick:()=>s(o.taskSlug),children:[B.jsx("span",{children:o.title||o.taskSlug}),B.jsx(Yr,{status:o.status})]},o.taskSlug))})}function B1({project:n,recentRepositoryPaths:r,tasks:s,activeTaskSlug:o,messages:d,orchestration:v,events:f,roundState:a,codexReview:c,harnessStatus:h,harnessBootstrapStatus:p,harnessApplyResult:u,gatewayStatus:S,gatewayQrLogin:w,gatewayQrCheck:A,busy:x,onConnect:b,onRefreshConnectedRepository:_,onPullConnectedRepository:g,onRefreshHarness:y,onApplyHarness:k,onStartHarnessBootstrap:M,onRefreshGateway:D,onGatewayEnabledChange:T,onGatewayTranslationChange:E,onStartGatewayQrLogin:R,onResetGatewayBinding:N,onCodexGateEnabledChange:z,onCreateTask:F,onSelectTask:P,themeMode:$,onThemeModeChange:K,flowPauseAlerts:G,onFlowPauseAlertsChange:X,permissionRequestMode:ee,onPermissionRequestModeChange:H,launchTemplate:O,canSaveLaunchTemplate:j,canOneClickStart:V,onSaveLaunchTemplate:I,onOneClickStart:ne,onTryFlowPauseAlert:_e,onMarkAllMessagesDone:ge,onDeleteMessageHistory:Q}){const[q,J]=ce.useState(""),[Y,he]=ce.useState(!0),[de,be]=ce.useState(!1),[Pe,qe]=ce.useState(!1),[Ke,Ae]=ce.useState(()=>o?null:"repository-path"),jt=ju(d),ht=q.trim(),Lt=s.find(ae=>ae.taskSlug===o)??null;ce.useEffect(()=>{Ae(ae=>o&&ae==="repository-path"?null:!o&&ae===null?"repository-path":ae)},[o]);function it(ae,at){Ae(at?ae:null)}async function kt(ae){ae.preventDefault(),await F({taskSlug:ht,createWorktree:Y}),J(""),he(!0)}return B.jsxs("div",{className:"project-dashboard",children:[B.jsx("header",{className:"brand-header",children:B.jsx("strong",{children:"VibeCodingMaster"})}),B.jsx(Bi,{title:"Repository Path",open:Ke==="repository-path",onOpenChange:ae=>it("repository-path",ae),children:B.jsx(L1,{defaultPath:(n==null?void 0:n.repoRoot)??"",recentPaths:r,busy:x,onConnect:b})}),n?B.jsx(Bi,{title:"Connected Repository",open:Ke==="connected-repository",onOpenChange:ae=>{it("connected-repository",ae),ae&&_()},children:B.jsx(I1,{activeTask:Lt,busy:x,project:n,onPull:g})}):null,B.jsx(Bi,{title:"Settings",open:Ke==="settings",onOpenChange:ae=>it("settings",ae),children:B.jsxs("div",{className:"sidebar-settings",children:[B.jsxs("button",{"aria-label":`Theme mode: ${hm($)}`,className:"settings-toggle theme-mode-toggle",disabled:x,title:"Cycle theme: system, light, dark",type:"button",onClick:()=>K(q1($)),children:[B.jsx("span",{children:"Theme"}),B.jsx("span",{children:hm($)})]}),B.jsxs("button",{"aria-pressed":!(S!=null&&S.enabled)&&G,className:!(S!=null&&S.enabled)&&G?"settings-toggle is-active":"settings-toggle",disabled:x||(S==null?void 0:S.enabled),title:S!=null&&S.enabled?"Disabled while Gateway is on":void 0,type:"button",onClick:()=>X(!G),children:[B.jsx("span",{children:"Flow pause alert"}),B.jsx("span",{children:S!=null&&S.enabled?"off":G?"on":"off"})]}),B.jsxs("button",{className:"settings-toggle",disabled:x||(S==null?void 0:S.enabled),title:S!=null&&S.enabled?"Disabled while Gateway is on":void 0,type:"button",onClick:_e,children:[B.jsx("span",{children:"Try alert"}),B.jsx("span",{children:"test"})]}),B.jsxs("label",{className:"settings-select-row",children:[B.jsx("span",{children:"Permission requests"}),B.jsxs("select",{value:ee,disabled:x,onChange:ae=>H(ae.target.value),children:[B.jsx("option",{value:"off",children:"off"}),B.jsx("option",{value:"allowAll",children:"allow all"})]})]}),B.jsxs("button",{className:"settings-toggle",disabled:x||!j,title:"Save the current four role launch settings",type:"button",onClick:I,children:[B.jsx("span",{children:"Save launch template"}),B.jsx("span",{children:j?"ready":"needs 4 sessions"})]}),V?B.jsxs("button",{className:"settings-toggle is-active",disabled:x,title:N1(O),type:"button",onClick:ne,children:[B.jsx("span",{children:"One-click start"}),B.jsx("span",{children:fg(O)})]}):null,o?B.jsxs(B.Fragment,{children:[B.jsxs("button",{type:"button",onClick:()=>be(!0),children:[B.jsx("span",{children:"Messages"}),B.jsxs("span",{className:"muted",children:[jt.total," total"]})]}),B.jsxs("button",{type:"button",onClick:()=>qe(!0),children:[B.jsx("span",{children:"Events"}),B.jsxs("span",{className:"muted",children:[f.length," total"]})]})]}):null]})}),n&&o?B.jsx(Bi,{title:"Codex Review Gates",open:Ke==="codex-review-gates",onOpenChange:ae=>it("codex-review-gates",ae),children:B.jsx(j1,{busy:x,state:c,onGateEnabledChange:z})}):null,B.jsx(Bi,{title:"Gateway",open:Ke==="gateway",onOpenChange:ae=>{it("gateway",ae),ae&&D()},children:B.jsx(H1,{busy:x,qrCheck:A,qrLogin:w,status:S,onEnabledChange:T,onResetBinding:N,onStartQrLogin:R,onTranslationChange:E})}),n?B.jsx(Bi,{title:"VCM Harness",open:Ke==="vcm-harness",onOpenChange:ae=>it("vcm-harness",ae),children:B.jsx(E1,{status:h,bootstrapStatus:p,applyResult:u,busy:x,onRefresh:y,onApply:k,onStartBootstrap:M})}):null,n?B.jsx(Bi,{title:"New Task",open:Ke==="new-task",onOpenChange:ae=>it("new-task",ae),children:B.jsx("div",{className:"task-create",children:B.jsxs("form",{onSubmit:kt,children:[B.jsx("input",{value:q,onChange:ae=>J(ae.target.value),placeholder:"task name"}),B.jsxs("label",{className:"task-create-option",children:[B.jsx("input",{type:"checkbox",checked:Y,onChange:ae=>he(ae.target.checked)}),B.jsx("span",{children:"Create worktree and branch"})]}),Y?B.jsxs("div",{className:"task-create-preview",children:[B.jsxs("small",{children:["branch: ",ht?`feature/${ht}`:"feature/<task>"]}),B.jsxs("small",{children:["worktree: ",ht?`.claude/worktrees/${ht}`:".claude/worktrees/<task>"]})]}):B.jsx("div",{className:"task-create-preview",children:B.jsx("small",{children:"uses current repository path and current branch"})}),B.jsx("button",{type:"submit",disabled:x||!ht,children:"Create"})]})})}):null,s.length>0?B.jsx(Bi,{title:"Tasks",open:Ke==="tasks",onOpenChange:ae=>it("tasks",ae),children:B.jsx(O1,{tasks:s,activeTaskSlug:o,onSelect:P})}):null,n&&Lt?B.jsx(F1,{task:Lt,roundState:a}):null,de?B.jsx(G1,{busy:x,messages:d,orchestration:v,onClose:()=>be(!1),onMarkAllDone:()=>{o&&ge(o)},onDeleteMessageHistory:()=>{o&&Q(o)}}):null,Pe?B.jsx(V1,{events:f,onClose:()=>qe(!1)}):null]})}function fg(n){return[n.autoOrchestration?"auto":"manual",n.translationEnabled?"tx":"no tx"].join(" + ")}function N1(n){const r=Object.entries(n.roles).map(([s,o])=>`${s}: ${o.permissionMode} / ${o.model} / ${o.effort}`).join("; ");return`Launch template: ${fg(n)}; ${r}`}function j1({busy:n,onGateEnabledChange:r,state:s}){return B.jsx("div",{className:"sidebar-settings",children:h1.map(o=>{const d=s==null?void 0:s.gates[o],v=!!(d!=null&&d.required);return B.jsxs("button",{"aria-pressed":v,className:v?"settings-toggle is-active":"settings-toggle",disabled:n||!s,title:d!=null&&d.status?`status: ${d.status}`:void 0,type:"button",onClick:()=>r(o,!v),children:[B.jsx("span",{children:z1(o)}),B.jsx("span",{children:v?"on":"off"})]},o)})})}function z1(n){switch(n){case"architecture-plan":return"Architecture plan";case"validation-adequacy":return"Validation adequacy";case"final-diff":return"Final diff"}return n}function H1({busy:n,onEnabledChange:r,onResetBinding:s,onStartQrLogin:o,onTranslationChange:d,qrCheck:v,qrLogin:f,status:a}){const c=!!(a!=null&&a.binding.tokenConfigured),h=!!(a!=null&&a.binding.tokenConfigured);return B.jsxs("div",{className:"gateway-panel",children:[B.jsxs("div",{className:"gateway-actions",children:[B.jsxs("button",{"aria-pressed":!!(a!=null&&a.enabled),className:a!=null&&a.enabled?"settings-toggle is-active":"settings-toggle",disabled:n||!a||!a.enabled&&!c,title:c?"Enable or disable PM messages and task-changing Gateway commands":"Scan and confirm iLink login first",type:"button",onClick:()=>a?r(!a.enabled):void 0,children:[B.jsx("span",{children:"Gateway"}),B.jsx("span",{children:a!=null&&a.enabled?"on":"off"})]}),B.jsxs("button",{"aria-pressed":!!(a!=null&&a.translationEnabled),className:a!=null&&a.translationEnabled?"settings-toggle is-active":"settings-toggle",disabled:n||!a,type:"button",onClick:()=>a?d(!a.translationEnabled):void 0,children:[B.jsx("span",{children:"Translation"}),B.jsx("span",{children:a!=null&&a.translationEnabled?"on":"off"})]}),h?B.jsx("button",{className:"danger-button",type:"button",disabled:n,onClick:s,children:"Reset Binding"}):B.jsx("button",{type:"button",disabled:n,onClick:o,children:"Start QR Login"})]}),f?B.jsx("p",{className:"muted",children:"QR login started. Use the login dialog to confirm binding."}):null,v?B.jsxs("p",{className:"muted",children:["QR status: ",v.status,v.message?` · ${v.message}`:""]}):null]})}function I1({activeTask:n,busy:r,onPull:s,project:o}){const d=!!(n&&!n.worktreePath&&n.cleanupStatus!=="cleaned"),v=d?`Inline task "${n==null?void 0:n.taskSlug}" uses the base repository.`:o.pullDisabledReason,f=!!(o.canPull&&!d);return B.jsxs("div",{className:"project-summary",children:[B.jsxs("dl",{children:[B.jsxs("div",{children:[B.jsx("dt",{children:"Base path"}),B.jsx("dd",{children:o.repoRoot})]}),B.jsxs("div",{children:[B.jsx("dt",{children:"Branch"}),B.jsx("dd",{children:U1(o)})]}),B.jsxs("div",{children:[B.jsx("dt",{children:"Remote"}),B.jsx("dd",{children:o.upstreamBranch??"no upstream"})]}),B.jsxs("div",{children:[B.jsx("dt",{children:"Status"}),B.jsx("dd",{children:P1(o)})]}),B.jsxs("div",{children:[B.jsx("dt",{children:"Commit"}),B.jsx("dd",{children:o.shortHeadCommit??o.headCommit??"unknown"})]}),B.jsxs("div",{children:[B.jsx("dt",{children:"Working tree"}),B.jsx("dd",{children:o.isDirty?"uncommitted changes":"clean"})]})]}),B.jsxs("div",{className:"connected-repo-actions",children:[B.jsx("button",{type:"button",disabled:r||!f,title:v??"Pull latest changes with git pull --ff-only",onClick:()=>void s(),children:"Pull"}),B.jsx("span",{className:"muted",children:o.checkedAt?`checked ${Su(o.checkedAt)}`:"status not refreshed"})]}),v?B.jsx("p",{className:"muted",children:v}):null,o.warnings.length>0?B.jsx("ul",{className:"warnings",children:o.warnings.map(a=>B.jsx("li",{children:a},a))}):null]})}function U1(n){return n.branch||"unknown"}function P1(n){if(!n.upstreamBranch)return"no upstream";const r=n.ahead??0,s=n.behind??0;return r===0&&s===0?"up to date":r>0&&s>0?`ahead ${r}, behind ${s}`:r>0?`ahead ${r}`:`behind ${s}`}function F1({roundState:n,task:r}){var p;const[s,o]=ce.useState(()=>Date.now()),d=!!(n!=null&&n.startedAt&&n.status==="running"),v=um(r.createdAt,s),f=cm(n,(n==null?void 0:n.totalCcActiveMs)??0,s),a=d&&n?cm(n,n.currentRoundCcActiveMs,s):0,c=d&&(n!=null&&n.startedAt)?um(n.startedAt,s):0,h=((p=r.title)==null?void 0:p.trim())||r.taskSlug;return ce.useEffect(()=>{const u=window.setInterval(()=>o(Date.now()),1e3);return()=>window.clearInterval(u)},[]),B.jsxs("section",{className:"task-status-dock","aria-label":"VCM Session status",children:[B.jsxs("div",{className:"task-status-dock-title",children:[B.jsx("strong",{title:h,children:h}),B.jsx("span",{className:`status-badge status-${r.status}`,children:r.status})]}),B.jsxs("dl",{className:"task-status-stats",children:[B.jsxs("div",{children:[B.jsx("dt",{children:"Session start"}),B.jsx("dd",{children:Su(r.createdAt)})]}),B.jsxs("div",{children:[B.jsx("dt",{children:"Session total"}),B.jsx("dd",{children:Sa(v)})]}),B.jsxs("div",{children:[B.jsx("dt",{children:"Rounds"}),B.jsx("dd",{children:(n==null?void 0:n.totalRoundCount)??0})]}),B.jsxs("div",{children:[B.jsx("dt",{children:"Role runtime"}),B.jsx("dd",{children:Sa(f)})]})]}),d&&n?B.jsxs("div",{className:"current-round-status",children:[B.jsxs("div",{className:"current-round-title",children:[B.jsx("span",{children:"Current Round"}),B.jsx("span",{className:`status-badge status-${n.status}`,children:n.status})]}),B.jsxs("dl",{className:"task-status-stats",children:[B.jsxs("div",{children:[B.jsx("dt",{children:"Started"}),B.jsx("dd",{children:Su(n.startedAt)})]}),B.jsxs("div",{children:[B.jsx("dt",{children:"Total"}),B.jsx("dd",{children:Sa(c)})]}),B.jsxs("div",{children:[B.jsx("dt",{children:"Role runtime"}),B.jsx("dd",{children:Sa(a)})]}),B.jsxs("div",{children:[B.jsx("dt",{children:"Turn count"}),B.jsx("dd",{children:n.turnCount})]})]})]}):null]})}function cm(n,r,s){if(!(n!=null&&n.activeTurnStartedAt)||n.status!=="running")return r;const o=Date.parse(n.updatedAt);return Number.isFinite(o)?r+Math.max(0,s-o):r}function um(n,r){const s=Date.parse(n);return Number.isFinite(s)?Math.max(0,r-s):0}function Su(n){if(!n)return"-";const r=new Date(n);return Number.isNaN(r.getTime())?"-":new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(r)}function Sa(n){const r=Math.max(0,Math.floor(n/1e3)),s=Math.floor(r/3600),o=Math.floor(r%3600/60),d=r%60;return s>0?o>0?`${s}h ${o}m`:`${s}h`:o>0?d>0?`${o}m ${d}s`:`${o}m`:`${d}s`}function q1(n){return n==="system"?"light":n==="light"?"dark":"system"}function hm(n){return n==="system"?"System":n==="light"?"Light":"Dark"}function V1({events:n,onClose:r}){return B.jsx("div",{className:"modal-backdrop",children:B.jsxs("section",{className:"event-modal",role:"dialog","aria-modal":"true","aria-label":"Events",children:[B.jsxs("header",{children:[B.jsxs("div",{children:[B.jsx("h2",{children:"Events"}),B.jsxs("p",{className:"muted",children:[n.length," total"]})]}),B.jsx("button",{type:"button",onClick:r,children:"Close"})]}),B.jsx(f1,{events:n,maxEvents:null,showHeader:!1})]})})}function G1({busy:n,messages:r,orchestration:s,onClose:o,onMarkAllDone:d,onDeleteMessageHistory:v}){const f=ju(r);function a(){window.confirm(["Clear all pending route-file messages?","","Use this only after you manually copied or handled stuck route-file messages.","VCM will clear non-empty handoff message files so Stop-hook orchestration can continue."].join(`
|
|
57
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(E){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),_.isLinux&&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){const R=this._getMouseBufferCoords(E),B=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!!(B&&H&&R)&&this._areCoordsInSelection(R,B,H)}isCellInSelection(E,R){const B=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!(!B||!H)&&this._areCoordsInSelection([E,R],B,H)}_areCoordsInSelection(E,R,B){return E[1]>R[1]&&E[1]<B[1]||R[1]===B[1]&&E[1]===R[1]&&E[0]>=R[0]&&E[0]<B[0]||R[1]<B[1]&&E[1]===B[1]&&E[0]<B[0]||R[1]<B[1]&&E[1]===R[1]&&E[0]>=R[0]}_selectWordAtCursor(E,R){var P,F;const B=(F=(P=this._linkifier.currentLink)==null?void 0:P.link)==null?void 0:F.range;if(B)return this._model.selectionStart=[B.start.x-1,B.start.y-1],this._model.selectionStartLength=(0,g.getRangeLength)(B,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const H=this._getMouseBufferCoords(E);return!!H&&(this._selectWordAt(H,R),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(E,R){this._model.clearSelection(),E=Math.max(E,0),R=Math.min(R,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,E],this._model.selectionEnd=[this._bufferService.cols,R],this.refresh(),this._onSelectionChange.fire()}_handleTrim(E){this._model.handleTrim(E)&&this.refresh()}_getMouseBufferCoords(E){const R=this._mouseService.getCoords(E,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(R)return R[0]--,R[1]--,R[1]+=this._bufferService.buffer.ydisp,R}_getMouseEventScrollAmount(E){let R=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,E,this._screenElement)[1];const B=this._renderService.dimensions.css.canvas.height;return R>=0&&R<=B?0:(R>B&&(R-=B),R=Math.min(Math.max(R,-50),50),R/=50,R/Math.abs(R)+Math.round(14*R))}shouldForceSelection(E){return _.isMac?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()),50)}_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;const R=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);R&&R.length!==this._model.selectionStart[0]&&R.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(E){this._selectWordAtCursor(E,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(E){const R=this._getMouseBufferCoords(E);R&&(this._activeSelectionMode=2,this._selectLineAt(R[1]))}shouldColumnSelect(E){return E.altKey&&!(_.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(E){if(E.stopImmediatePropagation(),!this._model.selectionStart)return;const R=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(E),!this._model.selectionEnd)return void this.refresh(!0);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));const B=this._bufferService.buffer;if(this._model.selectionEnd[1]<B.lines.length){const H=B.lines.get(this._model.selectionEnd[1]);H&&H.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}R&&R[0]===this._model.selectionEnd[0]&&R[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});const 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){const R=E.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&R<500&&E.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const B=this._mouseService.getCoords(E,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(B&&B[0]!==void 0&&B[1]!==void 0){const H=(0,S.moveToCellSequence)(B[0]-1,B[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(H,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const E=this._model.finalSelectionStart,R=this._model.finalSelectionEnd,B=!(!E||!R||E[0]===R[0]&&E[1]===R[1]);B?E&&R&&(this._oldSelectionStart&&this._oldSelectionEnd&&E[0]===this._oldSelectionStart[0]&&E[1]===this._oldSelectionStart[1]&&R[0]===this._oldSelectionEnd[0]&&R[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(E,R,B)):this._oldHasSelection&&this._fireOnSelectionChange(E,R,B)}_fireOnSelectionChange(E,R,B){this._oldSelectionStart=E,this._oldSelectionEnd=R,this._oldHasSelection=B,this._onSelectionChange.fire()}_handleBufferActivate(E){this.clearSelection(),this._trimListener.dispose(),this._trimListener=E.activeBuffer.lines.onTrim((R=>this._handleTrim(R)))}_convertViewportColToCharacterIndex(E,R){let B=R;for(let H=0;R>=H;H++){const P=E.loadCell(H,this._workCell).getChars().length;this._workCell.getWidth()===0?B--:P>1&&R!==H&&(B+=P-1)}return B}setSelection(E,R,B){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[E,R],this._model.selectionStartLength=B,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(E){this._isClickInSelection(E)||(this._selectWordAtCursor(E,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(E,R,B=!0,H=!0){if(E[0]>=this._bufferService.cols)return;const P=this._bufferService.buffer,F=P.lines.get(E[1]);if(!F)return;const $=P.translateBufferLineToString(E[1],!1);let W=this._convertViewportColToCharacterIndex(F,E[0]),G=W;const X=E[0]-W;let te=0,z=0,O=0,j=0;if($.charAt(W)===" "){for(;W>0&&$.charAt(W-1)===" ";)W--;for(;G<$.length&&$.charAt(G+1)===" ";)G++}else{let ne=E[0],_e=E[0];F.getWidth(ne)===0&&(te++,ne--),F.getWidth(_e)===2&&(z++,_e++);const me=F.getString(_e).length;for(me>1&&(j+=me-1,G+=me-1);ne>0&&W>0&&!this._isCharWordSeparator(F.loadCell(ne-1,this._workCell));){F.loadCell(ne-1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===0?(te++,ne--):Q>1&&(O+=Q-1,W-=Q-1),W--,ne--}for(;_e<F.length&&G+1<$.length&&!this._isCharWordSeparator(F.loadCell(_e+1,this._workCell));){F.loadCell(_e+1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===2?(z++,_e++):Q>1&&(j+=Q-1,G+=Q-1),G++,_e++}}G++;let V=W+X-te+O,I=Math.min(this._bufferService.cols,G-W+te+z-O-j);if(R||$.slice(W,G).trim()!==""){if(B&&V===0&&F.getCodePoint(0)!==32){const ne=P.lines.get(E[1]-1);if(ne&&F.isWrapped&&ne.getCodePoint(this._bufferService.cols-1)!==32){const _e=this._getWordAt([this._bufferService.cols-1,E[1]-1],!1,!0,!1);if(_e){const me=this._bufferService.cols-_e.start;V-=me,I+=me}}}if(H&&V+I===this._bufferService.cols&&F.getCodePoint(this._bufferService.cols-1)!==32){const ne=P.lines.get(E[1]+1);if(ne!=null&&ne.isWrapped&&ne.getCodePoint(0)!==32){const _e=this._getWordAt([0,E[1]+1],!1,!1,!0);_e&&(I+=_e.length)}}return{start:V,length:I}}}_selectWordAt(E,R){const B=this._getWordAt(E,R);if(B){for(;B.start<0;)B.start+=this._bufferService.cols,E[1]--;this._model.selectionStart=[B.start,E[1]],this._model.selectionStartLength=B.length}}_selectToWordAt(E){const R=this._getWordAt(E,!0);if(R){let B=E[1];for(;R.start<0;)R.start+=this._bufferService.cols,B--;if(!this._model.areSelectionValuesReversed())for(;R.start+R.length>this._bufferService.cols;)R.length-=this._bufferService.cols,B++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?R.start:R.start+R.length,B]}}_isCharWordSeparator(E){return E.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(E.getChars())>=0}_selectLineAt(E){const R=this._bufferService.buffer.getWrappedRangeForLine(E),B={start:{x:0,y:R.first},end:{x:this._bufferService.cols-1,y:R.last}};this._model.selectionStart=[0,R.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,g.getRangeLength)(B,this._bufferService.cols)}};a.SelectionService=T=h([p(3,k.IBufferService),p(4,k.ICoreService),p(5,A.IMouseService),p(6,k.IOptionsService),p(7,A.IRenderService),p(8,A.ICoreBrowserService)],T)},4725:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ILinkProviderService=a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const h=c(8343);a.ICharSizeService=(0,h.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),a.IMouseService=(0,h.createDecorator)("MouseService"),a.IRenderService=(0,h.createDecorator)("RenderService"),a.ISelectionService=(0,h.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,h.createDecorator)("ThemeService"),a.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(f,a,c){var h=this&&this.__decorate||function(T,E,R,B){var H,P=arguments.length,F=P<3?E:B===null?B=Object.getOwnPropertyDescriptor(E,R):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(T,E,R,B);else for(var $=T.length-1;$>=0;$--)(H=T[$])&&(F=(P<3?H(F):P>3?H(E,R,F):H(E,R))||F);return P>3&&F&&Object.defineProperty(E,R,F),F},p=this&&this.__param||function(T,E){return function(R,B){E(R,B,T)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const u=c(7239),S=c(8055),C=c(8460),A=c(844),x=c(2585),b=S.css.toColor("#ffffff"),_=S.css.toColor("#000000"),g=S.css.toColor("#ffffff"),y=S.css.toColor("#000000"),k={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[S.css.toColor("#2e3436"),S.css.toColor("#cc0000"),S.css.toColor("#4e9a06"),S.css.toColor("#c4a000"),S.css.toColor("#3465a4"),S.css.toColor("#75507b"),S.css.toColor("#06989a"),S.css.toColor("#d3d7cf"),S.css.toColor("#555753"),S.css.toColor("#ef2929"),S.css.toColor("#8ae234"),S.css.toColor("#fce94f"),S.css.toColor("#729fcf"),S.css.toColor("#ad7fa8"),S.css.toColor("#34e2e2"),S.css.toColor("#eeeeec")],E=[0,95,135,175,215,255];for(let R=0;R<216;R++){const B=E[R/36%6|0],H=E[R/6%6|0],P=E[R%6];T.push({css:S.channels.toCss(B,H,P),rgba:S.channels.toRgba(B,H,P)})}for(let R=0;R<24;R++){const B=8+10*R;T.push({css:S.channels.toCss(B,B,B),rgba:S.channels.toRgba(B,B,B)})}return T})());let M=a.ThemeService=class extends A.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new C.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:b,background:_,cursor:g,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:k,selectionBackgroundOpaque:S.color.blend(_,k),selectionInactiveBackgroundTransparent:k,selectionInactiveBackgroundOpaque:S.color.blend(_,k),ansi:a.DEFAULT_ANSI_COLORS.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))))}_setTheme(T={}){const E=this._colors;if(E.foreground=D(T.foreground,b),E.background=D(T.background,_),E.cursor=D(T.cursor,g),E.cursorAccent=D(T.cursorAccent,y),E.selectionBackgroundTransparent=D(T.selectionBackground,k),E.selectionBackgroundOpaque=S.color.blend(E.background,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundTransparent=D(T.selectionInactiveBackground,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundOpaque=S.color.blend(E.background,E.selectionInactiveBackgroundTransparent),E.selectionForeground=T.selectionForeground?D(T.selectionForeground,S.NULL_COLOR):void 0,E.selectionForeground===S.NULL_COLOR&&(E.selectionForeground=void 0),S.color.isOpaque(E.selectionBackgroundTransparent)&&(E.selectionBackgroundTransparent=S.color.opacity(E.selectionBackgroundTransparent,.3)),S.color.isOpaque(E.selectionInactiveBackgroundTransparent)&&(E.selectionInactiveBackgroundTransparent=S.color.opacity(E.selectionInactiveBackgroundTransparent,.3)),E.ansi=a.DEFAULT_ANSI_COLORS.slice(),E.ansi[0]=D(T.black,a.DEFAULT_ANSI_COLORS[0]),E.ansi[1]=D(T.red,a.DEFAULT_ANSI_COLORS[1]),E.ansi[2]=D(T.green,a.DEFAULT_ANSI_COLORS[2]),E.ansi[3]=D(T.yellow,a.DEFAULT_ANSI_COLORS[3]),E.ansi[4]=D(T.blue,a.DEFAULT_ANSI_COLORS[4]),E.ansi[5]=D(T.magenta,a.DEFAULT_ANSI_COLORS[5]),E.ansi[6]=D(T.cyan,a.DEFAULT_ANSI_COLORS[6]),E.ansi[7]=D(T.white,a.DEFAULT_ANSI_COLORS[7]),E.ansi[8]=D(T.brightBlack,a.DEFAULT_ANSI_COLORS[8]),E.ansi[9]=D(T.brightRed,a.DEFAULT_ANSI_COLORS[9]),E.ansi[10]=D(T.brightGreen,a.DEFAULT_ANSI_COLORS[10]),E.ansi[11]=D(T.brightYellow,a.DEFAULT_ANSI_COLORS[11]),E.ansi[12]=D(T.brightBlue,a.DEFAULT_ANSI_COLORS[12]),E.ansi[13]=D(T.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),E.ansi[14]=D(T.brightCyan,a.DEFAULT_ANSI_COLORS[14]),E.ansi[15]=D(T.brightWhite,a.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const R=Math.min(E.ansi.length-16,T.extendedAnsi.length);for(let B=0;B<R;B++)E.ansi[B+16]=D(T.extendedAnsi[B],a.DEFAULT_ANSI_COLORS[B+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(T){this._restoreColor(T),this._onChangeColors.fire(this.colors)}_restoreColor(T){if(T!==void 0)switch(T){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[T]=this._restoreColors.ansi[T]}else for(let E=0;E<this._restoreColors.ansi.length;++E)this._colors.ansi[E]=this._restoreColors.ansi[E]}modifyColors(T){T(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()}}};function D(T,E){if(T!==void 0)try{return S.css.toColor(T)}catch{}return E}a.ThemeService=M=h([p(0,x.IOptionsService)],M)},6349:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const h=c(8460),p=c(844);class u extends p.Disposable{constructor(C){super(),this._maxLength=C,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(C){if(this._maxLength===C)return;const A=new Array(C);for(let x=0;x<Math.min(C,this.length);x++)A[x]=this._array[this._getCyclicIndex(x)];this._array=A,this._maxLength=C,this._startIndex=0}get length(){return this._length}set length(C){if(C>this._length)for(let A=this._length;A<C;A++)this._array[A]=void 0;this._length=C}get(C){return this._array[this._getCyclicIndex(C)]}set(C,A){this._array[this._getCyclicIndex(C)]=A}push(C){this._array[this._getCyclicIndex(this._length)]=C,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(C,A,...x){if(A){for(let b=C;b<this._length-A;b++)this._array[this._getCyclicIndex(b)]=this._array[this._getCyclicIndex(b+A)];this._length-=A,this.onDeleteEmitter.fire({index:C,amount:A})}for(let b=this._length-1;b>=C;b--)this._array[this._getCyclicIndex(b+x.length)]=this._array[this._getCyclicIndex(b)];for(let b=0;b<x.length;b++)this._array[this._getCyclicIndex(C+b)]=x[b];if(x.length&&this.onInsertEmitter.fire({index:C,amount:x.length}),this._length+x.length>this._maxLength){const b=this._length+x.length-this._maxLength;this._startIndex+=b,this._length=this._maxLength,this.onTrimEmitter.fire(b)}else this._length+=x.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,A,x){if(!(A<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+x<0)throw new Error("Cannot shift elements in list beyond index 0");if(x>0){for(let _=A-1;_>=0;_--)this.set(C+_+x,this.get(C+_));const b=C+A+x-this._length;if(b>0)for(this._length+=b;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let b=0;b<A;b++)this.set(C+b+x,this.get(C+b))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}a.CircularList=u},1439:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function c(h,p=5){if(typeof h!="object")return h;const u=Array.isArray(h)?[]:{};for(const S in h)u[S]=p<=1?h[S]:h[S]&&c(h[S],p-1);return u}},8055:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let c=0,h=0,p=0,u=0;var S,C,A,x,b;function _(y){const k=y.toString(16);return k.length<2?"0"+k:k}function g(y,k){return y<k?(k+.05)/(y+.05):(y+.05)/(k+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(y){y.toCss=function(k,M,D,T){return T!==void 0?`#${_(k)}${_(M)}${_(D)}${_(T)}`:`#${_(k)}${_(M)}${_(D)}`},y.toRgba=function(k,M,D,T=255){return(k<<24|M<<16|D<<8|T)>>>0},y.toColor=function(k,M,D,T){return{css:y.toCss(k,M,D,T),rgba:y.toRgba(k,M,D,T)}}})(S||(a.channels=S={})),(function(y){function k(M,D){return u=Math.round(255*D),[c,h,p]=b.toChannels(M.rgba),{css:S.toCss(c,h,p,u),rgba:S.toRgba(c,h,p,u)}}y.blend=function(M,D){if(u=(255&D.rgba)/255,u===1)return{css:D.css,rgba:D.rgba};const T=D.rgba>>24&255,E=D.rgba>>16&255,R=D.rgba>>8&255,B=M.rgba>>24&255,H=M.rgba>>16&255,P=M.rgba>>8&255;return c=B+Math.round((T-B)*u),h=H+Math.round((E-H)*u),p=P+Math.round((R-P)*u),{css:S.toCss(c,h,p),rgba:S.toRgba(c,h,p)}},y.isOpaque=function(M){return(255&M.rgba)==255},y.ensureContrastRatio=function(M,D,T){const E=b.ensureContrastRatio(M.rgba,D.rgba,T);if(E)return S.toColor(E>>24&255,E>>16&255,E>>8&255)},y.opaque=function(M){const D=(255|M.rgba)>>>0;return[c,h,p]=b.toChannels(D),{css:S.toCss(c,h,p),rgba:D}},y.opacity=k,y.multiplyOpacity=function(M,D){return u=255&M.rgba,k(M,u*D/255)},y.toColorRGB=function(M){return[M.rgba>>24&255,M.rgba>>16&255,M.rgba>>8&255]}})(C||(a.color=C={})),(function(y){let k,M;try{const D=document.createElement("canvas");D.width=1,D.height=1;const T=D.getContext("2d",{willReadFrequently:!0});T&&(k=T,k.globalCompositeOperation="copy",M=k.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(D){if(D.match(/#[\da-f]{3,8}/i))switch(D.length){case 4:return c=parseInt(D.slice(1,2).repeat(2),16),h=parseInt(D.slice(2,3).repeat(2),16),p=parseInt(D.slice(3,4).repeat(2),16),S.toColor(c,h,p);case 5:return c=parseInt(D.slice(1,2).repeat(2),16),h=parseInt(D.slice(2,3).repeat(2),16),p=parseInt(D.slice(3,4).repeat(2),16),u=parseInt(D.slice(4,5).repeat(2),16),S.toColor(c,h,p,u);case 7:return{css:D,rgba:(parseInt(D.slice(1),16)<<8|255)>>>0};case 9:return{css:D,rgba:parseInt(D.slice(1),16)>>>0}}const T=D.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return c=parseInt(T[1]),h=parseInt(T[2]),p=parseInt(T[3]),u=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),S.toColor(c,h,p,u);if(!k||!M)throw new Error("css.toColor: Unsupported css format");if(k.fillStyle=M,k.fillStyle=D,typeof k.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(k.fillRect(0,0,1,1),[c,h,p,u]=k.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:S.toRgba(c,h,p,u),css:D}}})(A||(a.css=A={})),(function(y){function k(M,D,T){const E=M/255,R=D/255,B=T/255;return .2126*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))}y.relativeLuminance=function(M){return k(M>>16&255,M>>8&255,255&M)},y.relativeLuminance2=k})(x||(a.rgb=x={})),(function(y){function k(D,T,E){const R=D>>24&255,B=D>>16&255,H=D>>8&255;let P=T>>24&255,F=T>>16&255,$=T>>8&255,W=g(x.relativeLuminance2(P,F,$),x.relativeLuminance2(R,B,H));for(;W<E&&(P>0||F>0||$>0);)P-=Math.max(0,Math.ceil(.1*P)),F-=Math.max(0,Math.ceil(.1*F)),$-=Math.max(0,Math.ceil(.1*$)),W=g(x.relativeLuminance2(P,F,$),x.relativeLuminance2(R,B,H));return(P<<24|F<<16|$<<8|255)>>>0}function M(D,T,E){const R=D>>24&255,B=D>>16&255,H=D>>8&255;let P=T>>24&255,F=T>>16&255,$=T>>8&255,W=g(x.relativeLuminance2(P,F,$),x.relativeLuminance2(R,B,H));for(;W<E&&(P<255||F<255||$<255);)P=Math.min(255,P+Math.ceil(.1*(255-P))),F=Math.min(255,F+Math.ceil(.1*(255-F))),$=Math.min(255,$+Math.ceil(.1*(255-$))),W=g(x.relativeLuminance2(P,F,$),x.relativeLuminance2(R,B,H));return(P<<24|F<<16|$<<8|255)>>>0}y.blend=function(D,T){if(u=(255&T)/255,u===1)return T;const E=T>>24&255,R=T>>16&255,B=T>>8&255,H=D>>24&255,P=D>>16&255,F=D>>8&255;return c=H+Math.round((E-H)*u),h=P+Math.round((R-P)*u),p=F+Math.round((B-F)*u),S.toRgba(c,h,p)},y.ensureContrastRatio=function(D,T,E){const R=x.relativeLuminance(D>>8),B=x.relativeLuminance(T>>8);if(g(R,B)<E){if(B<R){const F=k(D,T,E),$=g(R,x.relativeLuminance(F>>8));if($<E){const W=M(D,T,E);return $>g(R,x.relativeLuminance(W>>8))?F:W}return F}const H=M(D,T,E),P=g(R,x.relativeLuminance(H>>8));if(P<E){const F=k(D,T,E);return P>g(R,x.relativeLuminance(F>>8))?H:F}return H}},y.reduceLuminance=k,y.increaseLuminance=M,y.toChannels=function(D){return[D>>24&255,D>>16&255,D>>8&255,255&D]}})(b||(a.rgba=b={})),a.toPaddedHex=_,a.contrastRatio=g},8969:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const h=c(844),p=c(2585),u=c(4348),S=c(7866),C=c(744),A=c(7302),x=c(6975),b=c(8460),_=c(1753),g=c(1480),y=c(7994),k=c(9282),M=c(5435),D=c(5981),T=c(2660);let E=!1;class R extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new b.EventEmitter),this._onScroll.event((H=>{var P;(P=this._onScrollApi)==null||P.fire(H.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(H){for(const P in H)this.optionsService.options[P]=H[P]}constructor(H){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new b.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new b.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new b.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new b.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new b.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new A.OptionsService(H)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(C.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(S.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(x.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(_.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(g.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new M.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,b.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,b.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,b.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,b.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new D.WriteBuffer(((P,F)=>this._inputHandler.parse(P,F)))),this.register((0,b.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(H,P){this._writeBuffer.write(H,P)}writeSync(H,P){this._logService.logLevel<=p.LogLevelEnum.WARN&&!E&&(this._logService.warn("writeSync is unreliable and will be removed soon."),E=!0),this._writeBuffer.writeSync(H,P)}input(H,P=!0){this.coreService.triggerDataEvent(H,P)}resize(H,P){isNaN(H)||isNaN(P)||(H=Math.max(H,C.MINIMUM_COLS),P=Math.max(P,C.MINIMUM_ROWS),this._bufferService.resize(H,P))}scroll(H,P=!1){this._bufferService.scroll(H,P)}scrollLines(H,P,F){this._bufferService.scrollLines(H,P,F)}scrollPages(H){this.scrollLines(H*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(H){const P=H-this._bufferService.buffer.ydisp;P!==0&&this.scrollLines(P)}registerEscHandler(H,P){return this._inputHandler.registerEscHandler(H,P)}registerDcsHandler(H,P){return this._inputHandler.registerDcsHandler(H,P)}registerCsiHandler(H,P){return this._inputHandler.registerCsiHandler(H,P)}registerOscHandler(H,P){return this._inputHandler.registerOscHandler(H,P)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let H=!1;const P=this.optionsService.rawOptions.windowsPty;P&&P.buildNumber!==void 0&&P.buildNumber!==void 0?H=P.backend==="conpty"&&P.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(H=!0),H?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const H=[];H.push(this.onLineFeed(k.updateWindowsModeWrappedState.bind(null,this._bufferService))),H.push(this.registerCsiHandler({final:"H"},(()=>((0,k.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const P of H)P.dispose()}))}}}a.CoreTerminal=R},8460:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===c)return void this._listeners.splice(h,1)}}})),this._event}fire(c,h){const p=[];for(let u=0;u<this._listeners.length;u++)p.push(this._listeners[u]);for(let u=0;u<p.length;u++)p[u].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(c,h){return c((p=>h.fire(p)))},a.runAndSubscribe=function(c,h){return h(void 0),c((p=>h(p)))}},5435:function(f,a,c){var h=this&&this.__decorate||function(te,z,O,j){var V,I=arguments.length,ne=I<3?z:j===null?j=Object.getOwnPropertyDescriptor(z,O):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ne=Reflect.decorate(te,z,O,j);else for(var _e=te.length-1;_e>=0;_e--)(V=te[_e])&&(ne=(I<3?V(ne):I>3?V(z,O,ne):V(z,O))||ne);return I>3&&ne&&Object.defineProperty(z,O,ne),ne},p=this&&this.__param||function(te,z){return function(O,j){z(O,j,te)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const u=c(2584),S=c(7116),C=c(2015),A=c(844),x=c(482),b=c(8437),_=c(8460),g=c(643),y=c(511),k=c(3734),M=c(2585),D=c(1480),T=c(6242),E=c(6351),R=c(5941),B={"(":0,")":1,"*":2,"+":3,"-":1,".":2},H=131072;function P(te,z){if(te>24)return z.setWinLines||!1;switch(te){case 1:return!!z.restoreWin;case 2:return!!z.minimizeWin;case 3:return!!z.setWinPosition;case 4:return!!z.setWinSizePixels;case 5:return!!z.raiseWin;case 6:return!!z.lowerWin;case 7:return!!z.refreshWin;case 8:return!!z.setWinSizeChars;case 9:return!!z.maximizeWin;case 10:return!!z.fullscreenWin;case 11:return!!z.getWinState;case 13:return!!z.getWinPosition;case 14:return!!z.getWinSizePixels;case 15:return!!z.getScreenSizePixels;case 16:return!!z.getCellSizePixels;case 18:return!!z.getWinSizeChars;case 19:return!!z.getScreenSizeChars;case 20:return!!z.getIconTitle;case 21:return!!z.getWinTitle;case 22:return!!z.pushTitle;case 23:return!!z.popTitle;case 24:return!!z.setWinLines}return!1}var F;(function(te){te[te.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",te[te.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(F||(a.WindowsOptionsReportType=F={}));let $=0;class W extends A.Disposable{getAttrData(){return this._curAttrData}constructor(z,O,j,V,I,ne,_e,me,Q=new C.EscapeSequenceParser){super(),this._bufferService=z,this._charsetService=O,this._coreService=j,this._logService=V,this._optionsService=I,this._oscLinkService=ne,this._coreMouseService=_e,this._unicodeService=me,this._parser=Q,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new x.StringToUtf32,this._utf8Decoder=new x.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new _.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new _.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new _.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new _.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new _.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new _.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new _.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new _.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new _.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new _.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new _.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new _.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new _.EventEmitter),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 G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((q=>this._activeBuffer=q.activeBuffer))),this._parser.setCsiHandlerFallback(((q,J)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(q),params:J.toArray()})})),this._parser.setEscHandlerFallback((q=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(q)})})),this._parser.setExecuteHandlerFallback((q=>{this._logService.debug("Unknown EXECUTE code: ",{code:q})})),this._parser.setOscHandlerFallback(((q,J,Y)=>{this._logService.debug("Unknown OSC code: ",{identifier:q,action:J,data:Y})})),this._parser.setDcsHandlerFallback(((q,J,Y)=>{J==="HOOK"&&(Y=Y.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(q),action:J,payload:Y})})),this._parser.setPrintHandler(((q,J,Y)=>this.print(q,J,Y))),this._parser.registerCsiHandler({final:"@"},(q=>this.insertChars(q))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(q=>this.scrollLeft(q))),this._parser.registerCsiHandler({final:"A"},(q=>this.cursorUp(q))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(q=>this.scrollRight(q))),this._parser.registerCsiHandler({final:"B"},(q=>this.cursorDown(q))),this._parser.registerCsiHandler({final:"C"},(q=>this.cursorForward(q))),this._parser.registerCsiHandler({final:"D"},(q=>this.cursorBackward(q))),this._parser.registerCsiHandler({final:"E"},(q=>this.cursorNextLine(q))),this._parser.registerCsiHandler({final:"F"},(q=>this.cursorPrecedingLine(q))),this._parser.registerCsiHandler({final:"G"},(q=>this.cursorCharAbsolute(q))),this._parser.registerCsiHandler({final:"H"},(q=>this.cursorPosition(q))),this._parser.registerCsiHandler({final:"I"},(q=>this.cursorForwardTab(q))),this._parser.registerCsiHandler({final:"J"},(q=>this.eraseInDisplay(q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(q=>this.eraseInDisplay(q,!0))),this._parser.registerCsiHandler({final:"K"},(q=>this.eraseInLine(q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(q=>this.eraseInLine(q,!0))),this._parser.registerCsiHandler({final:"L"},(q=>this.insertLines(q))),this._parser.registerCsiHandler({final:"M"},(q=>this.deleteLines(q))),this._parser.registerCsiHandler({final:"P"},(q=>this.deleteChars(q))),this._parser.registerCsiHandler({final:"S"},(q=>this.scrollUp(q))),this._parser.registerCsiHandler({final:"T"},(q=>this.scrollDown(q))),this._parser.registerCsiHandler({final:"X"},(q=>this.eraseChars(q))),this._parser.registerCsiHandler({final:"Z"},(q=>this.cursorBackwardTab(q))),this._parser.registerCsiHandler({final:"`"},(q=>this.charPosAbsolute(q))),this._parser.registerCsiHandler({final:"a"},(q=>this.hPositionRelative(q))),this._parser.registerCsiHandler({final:"b"},(q=>this.repeatPrecedingCharacter(q))),this._parser.registerCsiHandler({final:"c"},(q=>this.sendDeviceAttributesPrimary(q))),this._parser.registerCsiHandler({prefix:">",final:"c"},(q=>this.sendDeviceAttributesSecondary(q))),this._parser.registerCsiHandler({final:"d"},(q=>this.linePosAbsolute(q))),this._parser.registerCsiHandler({final:"e"},(q=>this.vPositionRelative(q))),this._parser.registerCsiHandler({final:"f"},(q=>this.hVPosition(q))),this._parser.registerCsiHandler({final:"g"},(q=>this.tabClear(q))),this._parser.registerCsiHandler({final:"h"},(q=>this.setMode(q))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(q=>this.setModePrivate(q))),this._parser.registerCsiHandler({final:"l"},(q=>this.resetMode(q))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(q=>this.resetModePrivate(q))),this._parser.registerCsiHandler({final:"m"},(q=>this.charAttributes(q))),this._parser.registerCsiHandler({final:"n"},(q=>this.deviceStatus(q))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(q=>this.deviceStatusPrivate(q))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(q=>this.softReset(q))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(q=>this.setCursorStyle(q))),this._parser.registerCsiHandler({final:"r"},(q=>this.setScrollRegion(q))),this._parser.registerCsiHandler({final:"s"},(q=>this.saveCursor(q))),this._parser.registerCsiHandler({final:"t"},(q=>this.windowOptions(q))),this._parser.registerCsiHandler({final:"u"},(q=>this.restoreCursor(q))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(q=>this.insertColumns(q))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(q=>this.deleteColumns(q))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(q=>this.selectProtected(q))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(q=>this.requestMode(q,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(q=>this.requestMode(q,!1))),this._parser.setExecuteHandler(u.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(u.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(u.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(u.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(u.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(u.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(u.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(u.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(u.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((q=>(this.setTitle(q),this.setIconName(q),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((q=>this.setIconName(q)))),this._parser.registerOscHandler(2,new T.OscHandler((q=>this.setTitle(q)))),this._parser.registerOscHandler(4,new T.OscHandler((q=>this.setOrReportIndexedColor(q)))),this._parser.registerOscHandler(8,new T.OscHandler((q=>this.setHyperlink(q)))),this._parser.registerOscHandler(10,new T.OscHandler((q=>this.setOrReportFgColor(q)))),this._parser.registerOscHandler(11,new T.OscHandler((q=>this.setOrReportBgColor(q)))),this._parser.registerOscHandler(12,new T.OscHandler((q=>this.setOrReportCursorColor(q)))),this._parser.registerOscHandler(104,new T.OscHandler((q=>this.restoreIndexedColor(q)))),this._parser.registerOscHandler(110,new T.OscHandler((q=>this.restoreFgColor(q)))),this._parser.registerOscHandler(111,new T.OscHandler((q=>this.restoreBgColor(q)))),this._parser.registerOscHandler(112,new T.OscHandler((q=>this.restoreCursorColor(q)))),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(const q in S.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:q},(()=>this.selectCharset("("+q))),this._parser.registerEscHandler({intermediates:")",final:q},(()=>this.selectCharset(")"+q))),this._parser.registerEscHandler({intermediates:"*",final:q},(()=>this.selectCharset("*"+q))),this._parser.registerEscHandler({intermediates:"+",final:q},(()=>this.selectCharset("+"+q))),this._parser.registerEscHandler({intermediates:"-",final:q},(()=>this.selectCharset("-"+q))),this._parser.registerEscHandler({intermediates:".",final:q},(()=>this.selectCharset("."+q))),this._parser.registerEscHandler({intermediates:"/",final:q},(()=>this.selectCharset("/"+q)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((q=>(this._logService.error("Parsing error: ",q),q))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new E.DcsHandler(((q,J)=>this.requestStatusString(q,J))))}_preserveStack(z,O,j,V){this._parseStack.paused=!0,this._parseStack.cursorStartX=z,this._parseStack.cursorStartY=O,this._parseStack.decodedLength=j,this._parseStack.position=V}_logSlowResolvingAsync(z){this._logService.logLevel<=M.LogLevelEnum.WARN&&Promise.race([z,new Promise(((O,j)=>setTimeout((()=>j("#SLOW_TIMEOUT")),5e3)))]).catch((O=>{if(O!=="#SLOW_TIMEOUT")throw O;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(z,O){let j,V=this._activeBuffer.x,I=this._activeBuffer.y,ne=0;const _e=this._parseStack.paused;if(_e){if(j=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,O))return this._logSlowResolvingAsync(j),j;V=this._parseStack.cursorStartX,I=this._parseStack.cursorStartY,this._parseStack.paused=!1,z.length>H&&(ne=this._parseStack.position+H)}if(this._logService.logLevel<=M.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof z=="string"?` "${z}"`:` "${Array.prototype.map.call(z,(q=>String.fromCharCode(q))).join("")}"`),typeof z=="string"?z.split("").map((q=>q.charCodeAt(0))):z),this._parseBuffer.length<z.length&&this._parseBuffer.length<H&&(this._parseBuffer=new Uint32Array(Math.min(z.length,H))),_e||this._dirtyRowTracker.clearRange(),z.length>H)for(let q=ne;q<z.length;q+=H){const J=q+H<z.length?q+H:z.length,Y=typeof z=="string"?this._stringDecoder.decode(z.substring(q,J),this._parseBuffer):this._utf8Decoder.decode(z.subarray(q,J),this._parseBuffer);if(j=this._parser.parse(this._parseBuffer,Y))return this._preserveStack(V,I,Y,q),this._logSlowResolvingAsync(j),j}else if(!_e){const q=typeof z=="string"?this._stringDecoder.decode(z,this._parseBuffer):this._utf8Decoder.decode(z,this._parseBuffer);if(j=this._parser.parse(this._parseBuffer,q))return this._preserveStack(V,I,q,0),this._logSlowResolvingAsync(j),j}this._activeBuffer.x===V&&this._activeBuffer.y===I||this._onCursorMove.fire();const me=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Q=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Q<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Q,this._bufferService.rows-1),Math.min(me,this._bufferService.rows-1))}print(z,O,j){let V,I;const ne=this._charsetService.charset,_e=this._optionsService.rawOptions.screenReaderMode,me=this._bufferService.cols,Q=this._coreService.decPrivateModes.wraparound,q=this._coreService.modes.insertMode,J=this._curAttrData;let Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&j-O>0&&Y.getWidth(this._activeBuffer.x-1)===2&&Y.setCellFromCodepoint(this._activeBuffer.x-1,0,1,J);let he=this._parser.precedingJoinState;for(let de=O;de<j;++de){if(V=z[de],V<127&&ne){const We=ne[String.fromCharCode(V)];We&&(V=We.charCodeAt(0))}const be=this._unicodeService.charProperties(V,he);I=D.UnicodeService.extractWidth(be);const Pe=D.UnicodeService.extractShouldJoin(be),Fe=Pe?D.UnicodeService.extractWidth(he):0;if(he=be,_e&&this._onA11yChar.fire((0,x.stringFromCodePoint)(V)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+I-Fe>me){if(Q){const We=Y;let De=this._activeBuffer.x-Fe;for(this._activeBuffer.x=Fe,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),Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Fe>0&&Y instanceof b.BufferLine&&Y.copyCellsFrom(We,De,0,Fe,!1);De<me;)We.setCellFromCodepoint(De++,0,1,J)}else if(this._activeBuffer.x=me-1,I===2)continue}if(Pe&&this._activeBuffer.x){const We=Y.getWidth(this._activeBuffer.x-1)?1:2;Y.addCodepointToCell(this._activeBuffer.x-We,V,I);for(let De=I-Fe;--De>=0;)Y.setCellFromCodepoint(this._activeBuffer.x++,0,0,J)}else if(q&&(Y.insertCells(this._activeBuffer.x,I-Fe,this._activeBuffer.getNullCell(J)),Y.getWidth(me-1)===2&&Y.setCellFromCodepoint(me-1,g.NULL_CELL_CODE,g.NULL_CELL_WIDTH,J)),Y.setCellFromCodepoint(this._activeBuffer.x++,V,I,J),I>0)for(;--I;)Y.setCellFromCodepoint(this._activeBuffer.x++,0,0,J)}this._parser.precedingJoinState=he,this._activeBuffer.x<me&&j-O>0&&Y.getWidth(this._activeBuffer.x)===0&&!Y.hasContent(this._activeBuffer.x)&&Y.setCellFromCodepoint(this._activeBuffer.x,0,1,J),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(z,O){return z.final!=="t"||z.prefix||z.intermediates?this._parser.registerCsiHandler(z,O):this._parser.registerCsiHandler(z,(j=>!P(j.params[0],this._optionsService.rawOptions.windowOptions)||O(j)))}registerDcsHandler(z,O){return this._parser.registerDcsHandler(z,new E.DcsHandler(O))}registerEscHandler(z,O){return this._parser.registerEscHandler(z,O)}registerOscHandler(z,O){return this._parser.registerOscHandler(z,new T.OscHandler(O))}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 z;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&&((z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&z.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);O.hasWidth(this._activeBuffer.x)&&!O.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const z=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-z),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(z=this._bufferService.cols-1){this._activeBuffer.x=Math.min(z,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(z,O){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=z,this._activeBuffer.y=this._activeBuffer.scrollTop+O):(this._activeBuffer.x=z,this._activeBuffer.y=O),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(z,O){this._restrictCursor(),this._setCursor(this._activeBuffer.x+z,this._activeBuffer.y+O)}cursorUp(z){const O=this._activeBuffer.y-this._activeBuffer.scrollTop;return O>=0?this._moveCursor(0,-Math.min(O,z.params[0]||1)):this._moveCursor(0,-(z.params[0]||1)),!0}cursorDown(z){const O=this._activeBuffer.scrollBottom-this._activeBuffer.y;return O>=0?this._moveCursor(0,Math.min(O,z.params[0]||1)):this._moveCursor(0,z.params[0]||1),!0}cursorForward(z){return this._moveCursor(z.params[0]||1,0),!0}cursorBackward(z){return this._moveCursor(-(z.params[0]||1),0),!0}cursorNextLine(z){return this.cursorDown(z),this._activeBuffer.x=0,!0}cursorPrecedingLine(z){return this.cursorUp(z),this._activeBuffer.x=0,!0}cursorCharAbsolute(z){return this._setCursor((z.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(z){return this._setCursor(z.length>=2?(z.params[1]||1)-1:0,(z.params[0]||1)-1),!0}charPosAbsolute(z){return this._setCursor((z.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(z){return this._moveCursor(z.params[0]||1,0),!0}linePosAbsolute(z){return this._setCursor(this._activeBuffer.x,(z.params[0]||1)-1),!0}vPositionRelative(z){return this._moveCursor(0,z.params[0]||1),!0}hVPosition(z){return this.cursorPosition(z),!0}tabClear(z){const O=z.params[0];return O===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:O===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=z.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=z.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(z){const O=z.params[0];return O===1&&(this._curAttrData.bg|=536870912),O!==2&&O!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(z,O,j,V=!1,I=!1){const ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);ne.replaceCells(O,j,this._activeBuffer.getNullCell(this._eraseAttrData()),I),V&&(ne.isWrapped=!1)}_resetBufferLine(z,O=!1){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);j&&(j.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),O),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+z),j.isWrapped=!1)}eraseInDisplay(z,O=!1){let j;switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:for(j=this._activeBuffer.y,this._dirtyRowTracker.markDirty(j),this._eraseInBufferLine(j++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);j<this._bufferService.rows;j++)this._resetBufferLine(j,O);this._dirtyRowTracker.markDirty(j);break;case 1:for(j=this._activeBuffer.y,this._dirtyRowTracker.markDirty(j),this._eraseInBufferLine(j,0,this._activeBuffer.x+1,!0,O),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(j+1).isWrapped=!1);j--;)this._resetBufferLine(j,O);this._dirtyRowTracker.markDirty(0);break;case 2:for(j=this._bufferService.rows,this._dirtyRowTracker.markDirty(j-1);j--;)this._resetBufferLine(j,O);this._dirtyRowTracker.markDirty(0);break;case 3:const V=this._activeBuffer.lines.length-this._bufferService.rows;V>0&&(this._activeBuffer.lines.trimStart(V),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-V,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-V,0),this._onScroll.fire(0))}return!0}eraseInLine(z,O=!1){switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,O);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,O)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(z){this._restrictCursor();let O=z.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=this._activeBuffer.ybase+this._activeBuffer.y,V=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-V+1;for(;O--;)this._activeBuffer.lines.splice(I-1,1),this._activeBuffer.lines.splice(j,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(z){this._restrictCursor();let O=z.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=this._activeBuffer.ybase+this._activeBuffer.y;let V;for(V=this._bufferService.rows-1-this._activeBuffer.scrollBottom,V=this._bufferService.rows-1+this._activeBuffer.ybase-V;O--;)this._activeBuffer.lines.splice(j,1),this._activeBuffer.lines.splice(V,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(z){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.insertCells(this._activeBuffer.x,z.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(z){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.deleteCells(this._activeBuffer.x,z.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(z){let O=z.params[0]||1;for(;O--;)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(z){let O=z.params[0]||1;for(;O--;)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(b.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=z.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);V.deleteCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),V.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=z.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);V.insertCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),V.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=z.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);V.insertCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),V.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=z.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);V.deleteCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),V.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(z){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(z.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(z){const O=this._parser.precedingJoinState;if(!O)return!0;const j=z.params[0]||1,V=D.UnicodeService.extractWidth(O),I=this._activeBuffer.x-V,ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(I),_e=new Uint32Array(ne.length*j);let me=0;for(let q=0;q<ne.length;){const J=ne.codePointAt(q)||0;_e[me++]=J,q+=J>65535?2:1}let Q=me;for(let q=1;q<j;++q)_e.copyWithin(Q,0,me),Q+=me;return this.print(_e,0,Q),!0}sendDeviceAttributesPrimary(z){return z.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(z){return z.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(z.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(z){return(this._optionsService.rawOptions.termName+"").indexOf(z)===0}setMode(z){for(let O=0;O<z.length;O++)switch(z.params[O]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(z){for(let O=0;O<z.length;O++)switch(z.params[O]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,S.DEFAULT_CHARSET),this._charsetService.setgCharset(1,S.DEFAULT_CHARSET),this._charsetService.setgCharset(2,S.DEFAULT_CHARSET),this._charsetService.setgCharset(3,S.DEFAULT_CHARSET);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(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(z){for(let O=0;O<z.length;O++)switch(z.params[O]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(z){for(let O=0;O<z.length;O++)switch(z.params[O]){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:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),z.params[O]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(z,O){const j=this._coreService.decPrivateModes,{activeProtocol:V,activeEncoding:I}=this._coreMouseService,ne=this._coreService,{buffers:_e,cols:me}=this._bufferService,{active:Q,alt:q}=_e,J=this._optionsService.rawOptions,Y=Pe=>Pe?1:2,he=z.params[0];return de=he,be=O?he===2?4:he===4?Y(ne.modes.insertMode):he===12?3:he===20?Y(J.convertEol):0:he===1?Y(j.applicationCursorKeys):he===3?J.windowOptions.setWinLines?me===80?2:me===132?1:0:0:he===6?Y(j.origin):he===7?Y(j.wraparound):he===8?3:he===9?Y(V==="X10"):he===12?Y(J.cursorBlink):he===25?Y(!ne.isCursorHidden):he===45?Y(j.reverseWraparound):he===66?Y(j.applicationKeypad):he===67?4:he===1e3?Y(V==="VT200"):he===1002?Y(V==="DRAG"):he===1003?Y(V==="ANY"):he===1004?Y(j.sendFocus):he===1005?4:he===1006?Y(I==="SGR"):he===1015?4:he===1016?Y(I==="SGR_PIXELS"):he===1048?1:he===47||he===1047||he===1049?Y(Q===q):he===2004?Y(j.bracketedPasteMode):0,ne.triggerDataEvent(`${u.C0.ESC}[${O?"":"?"}${de};${be}$y`),!0;var de,be}_updateAttrColor(z,O,j,V,I){return O===2?(z|=50331648,z&=-16777216,z|=k.AttributeData.fromColorRGB([j,V,I])):O===5&&(z&=-50331904,z|=33554432|255&j),z}_extractColor(z,O,j){const V=[0,0,-1,0,0,0];let I=0,ne=0;do{if(V[ne+I]=z.params[O+ne],z.hasSubParams(O+ne)){const _e=z.getSubParams(O+ne);let me=0;do V[1]===5&&(I=1),V[ne+me+1+I]=_e[me];while(++me<_e.length&&me+ne+1+I<V.length);break}if(V[1]===5&&ne+I>=2||V[1]===2&&ne+I>=5)break;V[1]&&(I=1)}while(++ne+O<z.length&&ne+I<V.length);for(let _e=2;_e<V.length;++_e)V[_e]===-1&&(V[_e]=0);switch(V[0]){case 38:j.fg=this._updateAttrColor(j.fg,V[1],V[3],V[4],V[5]);break;case 48:j.bg=this._updateAttrColor(j.bg,V[1],V[3],V[4],V[5]);break;case 58:j.extended=j.extended.clone(),j.extended.underlineColor=this._updateAttrColor(j.extended.underlineColor,V[1],V[3],V[4],V[5])}return ne}_processUnderline(z,O){O.extended=O.extended.clone(),(!~z||z>5)&&(z=1),O.extended.underlineStyle=z,O.fg|=268435456,z===0&&(O.fg&=-268435457),O.updateExtended()}_processSGR0(z){z.fg=b.DEFAULT_ATTR_DATA.fg,z.bg=b.DEFAULT_ATTR_DATA.bg,z.extended=z.extended.clone(),z.extended.underlineStyle=0,z.extended.underlineColor&=-67108864,z.updateExtended()}charAttributes(z){if(z.length===1&&z.params[0]===0)return this._processSGR0(this._curAttrData),!0;const O=z.length;let j;const V=this._curAttrData;for(let I=0;I<O;I++)j=z.params[I],j>=30&&j<=37?(V.fg&=-50331904,V.fg|=16777216|j-30):j>=40&&j<=47?(V.bg&=-50331904,V.bg|=16777216|j-40):j>=90&&j<=97?(V.fg&=-50331904,V.fg|=16777224|j-90):j>=100&&j<=107?(V.bg&=-50331904,V.bg|=16777224|j-100):j===0?this._processSGR0(V):j===1?V.fg|=134217728:j===3?V.bg|=67108864:j===4?(V.fg|=268435456,this._processUnderline(z.hasSubParams(I)?z.getSubParams(I)[0]:1,V)):j===5?V.fg|=536870912:j===7?V.fg|=67108864:j===8?V.fg|=1073741824:j===9?V.fg|=2147483648:j===2?V.bg|=134217728:j===21?this._processUnderline(2,V):j===22?(V.fg&=-134217729,V.bg&=-134217729):j===23?V.bg&=-67108865:j===24?(V.fg&=-268435457,this._processUnderline(0,V)):j===25?V.fg&=-536870913:j===27?V.fg&=-67108865:j===28?V.fg&=-1073741825:j===29?V.fg&=2147483647:j===39?(V.fg&=-67108864,V.fg|=16777215&b.DEFAULT_ATTR_DATA.fg):j===49?(V.bg&=-67108864,V.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):j===38||j===48||j===58?I+=this._extractColor(z,I,V):j===53?V.bg|=1073741824:j===55?V.bg&=-1073741825:j===59?(V.extended=V.extended.clone(),V.extended.underlineColor=-1,V.updateExtended()):j===100?(V.fg&=-67108864,V.fg|=16777215&b.DEFAULT_ATTR_DATA.fg,V.bg&=-67108864,V.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",j);return!0}deviceStatus(z){switch(z.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const O=this._activeBuffer.y+1,j=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${O};${j}R`)}return!0}deviceStatusPrivate(z){if(z.params[0]===6){const O=this._activeBuffer.y+1,j=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${O};${j}R`)}return!0}softReset(z){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=b.DEFAULT_ATTR_DATA.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(z){const O=z.params[0]||1;switch(O){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const j=O%2==1;return this._optionsService.options.cursorBlink=j,!0}setScrollRegion(z){const O=z.params[0]||1;let j;return(z.length<2||(j=z.params[1])>this._bufferService.rows||j===0)&&(j=this._bufferService.rows),j>O&&(this._activeBuffer.scrollTop=O-1,this._activeBuffer.scrollBottom=j-1,this._setCursor(0,0)),!0}windowOptions(z){if(!P(z.params[0],this._optionsService.rawOptions.windowOptions))return!0;const O=z.length>1?z.params[1]:0;switch(z.params[0]){case 14:O!==2&&this._onRequestWindowsOptionsReport.fire(F.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(F.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:O!==0&&O!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),O!==0&&O!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:O!==0&&O!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),O!==0&&O!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(z){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(z){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(z){return this._windowTitle=z,this._onTitleChange.fire(z),!0}setIconName(z){return this._iconName=z,!0}setOrReportIndexedColor(z){const O=[],j=z.split(";");for(;j.length>1;){const V=j.shift(),I=j.shift();if(/^\d+$/.exec(V)){const ne=parseInt(V);if(X(ne))if(I==="?")O.push({type:0,index:ne});else{const _e=(0,R.parseColor)(I);_e&&O.push({type:1,index:ne,color:_e})}}}return O.length&&this._onColor.fire(O),!0}setHyperlink(z){const O=z.split(";");return!(O.length<2)&&(O[1]?this._createHyperlink(O[0],O[1]):!O[0]&&this._finishHyperlink())}_createHyperlink(z,O){this._getCurrentLinkId()&&this._finishHyperlink();const j=z.split(":");let V;const I=j.findIndex((ne=>ne.startsWith("id=")));return I!==-1&&(V=j[I].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:V,uri:O}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(z,O){const j=z.split(";");for(let V=0;V<j.length&&!(O>=this._specialColors.length);++V,++O)if(j[V]==="?")this._onColor.fire([{type:0,index:this._specialColors[O]}]);else{const I=(0,R.parseColor)(j[V]);I&&this._onColor.fire([{type:1,index:this._specialColors[O],color:I}])}return!0}setOrReportFgColor(z){return this._setOrReportSpecialColor(z,0)}setOrReportBgColor(z){return this._setOrReportSpecialColor(z,1)}setOrReportCursorColor(z){return this._setOrReportSpecialColor(z,2)}restoreIndexedColor(z){if(!z)return this._onColor.fire([{type:2}]),!0;const O=[],j=z.split(";");for(let V=0;V<j.length;++V)if(/^\d+$/.exec(j[V])){const I=parseInt(j[V]);X(I)&&O.push({type:2,index:I})}return O.length&&this._onColor.fire(O),!0}restoreFgColor(z){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(z){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(z){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,S.DEFAULT_CHARSET),!0}selectCharset(z){return z.length!==2?(this.selectDefaultCharset(),!0):(z[0]==="/"||this._charsetService.setgCharset(B[z[0]],S.CHARSETS[z[1]]||S.DEFAULT_CHARSET),!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){const z=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,z,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=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(z){return this._charsetService.setgLevel(z),!0}screenAlignmentPattern(){const z=new y.CellData;z.content=4194373,z.fg=this._curAttrData.fg,z.bg=this._curAttrData.bg,this._setCursor(0,0);for(let O=0;O<this._bufferService.rows;++O){const j=this._activeBuffer.ybase+this._activeBuffer.y+O,V=this._activeBuffer.lines.get(j);V&&(V.fill(z),V.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(z,O){const j=this._bufferService.buffer,V=this._optionsService.rawOptions;return(I=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${I}${u.C0.ESC}\\`),!0))(z==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:z==='"p'?'P1$r61;1"p':z==="r"?`P1$r${j.scrollTop+1};${j.scrollBottom+1}r`:z==="m"?"P1$r0m":z===" q"?`P1$r${{block:2,underline:4,bar:6}[V.cursorStyle]-(V.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(z,O){this._dirtyRowTracker.markRangeDirty(z,O)}}a.InputHandler=W;let G=class{constructor(te){this._bufferService=te,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(te){te<this.start?this.start=te:te>this.end&&(this.end=te)}markRangeDirty(te,z){te>z&&($=te,te=z,z=$),te<this.start&&(this.start=te),z>this.end&&(this.end=z)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(te){return 0<=te&&te<256}G=h([p(0,M.IBufferService)],G)},844:(f,a)=>{function c(h){for(const p of h)p.dispose();h.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const p=this._disposables.indexOf(h);p!==-1&&this._disposables.splice(p,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var p;this._isDisposed||h===this._value||((p=this._value)==null||p.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},a.toDisposable=function(h){return{dispose:h}},a.disposeArray=c,a.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(p,u,S){this._data[p]||(this._data[p]={}),this._data[p][u]=S}get(p,u){return this._data[p]?this._data[p][u]:void 0}clear(){this._data={}}}a.TwoKeyMap=c,a.FourKeyMap=class{constructor(){this._data=new c}set(h,p,u,S,C){this._data.get(h,p)||this._data.set(h,p,new c),this._data.get(h,p).set(u,S,C)}get(h,p,u,S){var C;return(C=this._data.get(h,p))==null?void 0:C.get(u,S)}clear(){this._data.clear()}}},6114:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const c=a.isNode?"node":navigator.userAgent,h=a.isNode?"node":navigator.platform;a.isFirefox=c.includes("Firefox"),a.isLegacyEdge=c.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(c),a.getSafariVersion=function(){if(!a.isSafari)return 0;const p=c.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),a.isIpad=h==="iPad",a.isIphone=h==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),a.isLinux=h.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(c)},6106:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let c=0;a.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(c=this._search(this._getKey(h)),this._array.splice(c,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const p=this._getKey(h);if(p===void 0||(c=this._search(p),c===-1)||this._getKey(this._array[c])!==p)return!1;do if(this._array[c]===h)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===p);return!1}*getKeyIterator(h){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===h)}forEachByKey(h,p){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do p(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===h)}values(){return[...this._array].values()}_search(h){let p=0,u=this._array.length-1;for(;u>=p;){let S=p+u>>1;const C=this._getKey(this._array[S]);if(C>h)u=S-1;else{if(!(C<h)){for(;S>0&&this._getKey(this._array[S-1])===h;)S--;return S}p=S+1}}return p}}},7226:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const h=c(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(C){this._tasks.push(C),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(C){this._idleCallback=void 0;let A=0,x=0,b=C.timeRemaining(),_=0;for(;this._i<this._tasks.length;){if(A=Date.now(),this._tasks[this._i]()||this._i++,A=Math.max(1,Date.now()-A),x=Math.max(A,x),_=C.timeRemaining(),1.5*x>_)return b-A<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(b-A))}ms`),void this._start();b=_}this.clear()}}class u extends p{_requestCallback(C){return setTimeout((()=>C(this._createDeadline(16))))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const A=Date.now()+C;return{timeRemaining:()=>Math.max(0,A-Date.now())}}}a.PriorityTaskQueue=u,a.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(S){return requestIdleCallback(S)}_cancelCallback(S){cancelIdleCallback(S)}}:u,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(S){this._queue.clear(),this._queue.enqueue(S)}flush(){this._queue.flush()}}},9282:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const h=c(643);a.updateWindowsModeWrappedState=function(p){const u=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),S=u==null?void 0:u.get(p.cols-1),C=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);C&&S&&(C.isWrapped=S[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&S[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new c;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}a.AttributeData=c;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,S=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=S}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=h},9092:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const h=c(6349),p=c(7226),u=c(3734),S=c(8437),C=c(4634),A=c(511),x=c(643),b=c(4863),_=c(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(g,y,k){this._hasScrollback=g,this._optionsService=y,this._bufferService=k,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=S.DEFAULT_ATTR_DATA.clone(),this.savedCharset=_.DEFAULT_CHARSET,this.markers=[],this._nullCell=A.CellData.fromCharData([0,x.NULL_CELL_CHAR,x.NULL_CELL_WIDTH,x.NULL_CELL_CODE]),this._whitespaceCell=A.CellData.fromCharData([0,x.WHITESPACE_CELL_CHAR,x.WHITESPACE_CELL_WIDTH,x.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(g){return g?(this._nullCell.fg=g.fg,this._nullCell.bg=g.bg,this._nullCell.extended=g.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(g){return g?(this._whitespaceCell.fg=g.fg,this._whitespaceCell.bg=g.bg,this._whitespaceCell.extended=g.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(g,y){return new S.BufferLine(this._bufferService.cols,this.getNullCell(g),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const g=this.ybase+this.y-this.ydisp;return g>=0&&g<this._rows}_getCorrectBufferLength(g){if(!this._hasScrollback)return g;const y=g+this._optionsService.rawOptions.scrollback;return y>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:y}fillViewportRows(g){if(this.lines.length===0){g===void 0&&(g=S.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(g))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(g,y){const k=this.getNullCell(S.DEFAULT_ATTR_DATA);let M=0;const D=this._getCorrectBufferLength(y);if(D>this.lines.maxLength&&(this.lines.maxLength=D),this.lines.length>0){if(this._cols<g)for(let E=0;E<this.lines.length;E++)M+=+this.lines.get(E).resize(g,k);let T=0;if(this._rows<y)for(let E=this._rows;E<y;E++)this.lines.length<y+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new S.BufferLine(g,k)):this.ybase>0&&this.lines.length<=this.ybase+this.y+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new S.BufferLine(g,k)));else for(let E=this._rows;E>y;E--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(D<this.lines.maxLength){const E=this.lines.length-D;E>0&&(this.lines.trimStart(E),this.ybase=Math.max(this.ybase-E,0),this.ydisp=Math.max(this.ydisp-E,0),this.savedY=Math.max(this.savedY-E,0)),this.lines.maxLength=D}this.x=Math.min(this.x,g-1),this.y=Math.min(this.y,y-1),T&&(this.y+=T),this.savedX=Math.min(this.savedX,g-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(g,y),this._cols>g))for(let T=0;T<this.lines.length;T++)M+=+this.lines.get(T).resize(g,k);this._cols=g,this._rows=y,this._memoryCleanupQueue.clear(),M>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let g=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,g=!1);let y=0;for(;this._memoryCleanupPosition<this.lines.length;)if(y+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),y>100)return!0;return g}get _isReflowEnabled(){const g=this._optionsService.rawOptions.windowsPty;return g&&g.buildNumber?this._hasScrollback&&g.backend==="conpty"&&g.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(g,y){this._cols!==g&&(g>this._cols?this._reflowLarger(g,y):this._reflowSmaller(g,y))}_reflowLarger(g,y){const k=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,g,this.ybase+this.y,this.getNullCell(S.DEFAULT_ATTR_DATA));if(k.length>0){const M=(0,C.reflowLargerCreateNewLayout)(this.lines,k);(0,C.reflowLargerApplyNewLayout)(this.lines,M.layout),this._reflowLargerAdjustViewport(g,y,M.countRemoved)}}_reflowLargerAdjustViewport(g,y,k){const M=this.getNullCell(S.DEFAULT_ATTR_DATA);let D=k;for(;D-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<y&&this.lines.push(new S.BufferLine(g,M))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-k,0)}_reflowSmaller(g,y){const k=this.getNullCell(S.DEFAULT_ATTR_DATA),M=[];let D=0;for(let T=this.lines.length-1;T>=0;T--){let E=this.lines.get(T);if(!E||!E.isWrapped&&E.getTrimmedLength()<=g)continue;const R=[E];for(;E.isWrapped&&T>0;)E=this.lines.get(--T),R.unshift(E);const B=this.ybase+this.y;if(B>=T&&B<T+R.length)continue;const H=R[R.length-1].getTrimmedLength(),P=(0,C.reflowSmallerGetNewLineLengths)(R,this._cols,g),F=P.length-R.length;let $;$=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+F):Math.max(0,this.lines.length-this.lines.maxLength+F);const W=[];for(let j=0;j<F;j++){const V=this.getBlankLine(S.DEFAULT_ATTR_DATA,!0);W.push(V)}W.length>0&&(M.push({start:T+R.length+D,newLines:W}),D+=W.length),R.push(...W);let G=P.length-1,X=P[G];X===0&&(G--,X=P[G]);let te=R.length-F-1,z=H;for(;te>=0;){const j=Math.min(z,X);if(R[G]===void 0)break;if(R[G].copyCellsFrom(R[te],z-j,X-j,j,!0),X-=j,X===0&&(G--,X=P[G]),z-=j,z===0){te--;const V=Math.max(te,0);z=(0,C.getWrappedLineTrimmedLength)(R,V,this._cols)}}for(let j=0;j<R.length;j++)P[j]<g&&R[j].setCell(P[j],k);let O=F-$;for(;O-- >0;)this.ybase===0?this.y<y-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+D)-y&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+F,this.ybase+y-1)}if(M.length>0){const T=[],E=[];for(let G=0;G<this.lines.length;G++)E.push(this.lines.get(G));const R=this.lines.length;let B=R-1,H=0,P=M[H];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+D);let F=0;for(let G=Math.min(this.lines.maxLength-1,R+D-1);G>=0;G--)if(P&&P.start>B+F){for(let X=P.newLines.length-1;X>=0;X--)this.lines.set(G--,P.newLines[X]);G++,T.push({index:B+1,amount:P.newLines.length}),F+=P.newLines.length,P=M[++H]}else this.lines.set(G,E[B--]);let $=0;for(let G=T.length-1;G>=0;G--)T[G].index+=$,this.lines.onInsertEmitter.fire(T[G]),$+=T[G].amount;const W=Math.max(0,R+D-this.lines.maxLength);W>0&&this.lines.onTrimEmitter.fire(W)}}translateBufferLineToString(g,y,k=0,M){const D=this.lines.get(g);return D?D.translateToString(y,k,M):""}getWrappedRangeForLine(g){let y=g,k=g;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;k+1<this.lines.length&&this.lines.get(k+1).isWrapped;)k++;return{first:y,last:k}}setupTabStops(g){for(g!=null?this.tabs[g]||(g=this.prevStop(g)):(this.tabs={},g=0);g<this._cols;g+=this._optionsService.rawOptions.tabStopWidth)this.tabs[g]=!0}prevStop(g){for(g==null&&(g=this.x);!this.tabs[--g]&&g>0;);return g>=this._cols?this._cols-1:g<0?0:g}nextStop(g){for(g==null&&(g=this.x);!this.tabs[++g]&&g<this._cols;);return g>=this._cols?this._cols-1:g<0?0:g}clearMarkers(g){this._isClearing=!0;for(let y=0;y<this.markers.length;y++)this.markers[y].line===g&&(this.markers[y].dispose(),this.markers.splice(y--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let g=0;g<this.markers.length;g++)this.markers[g].dispose(),this.markers.splice(g--,1);this._isClearing=!1}addMarker(g){const y=new b.Marker(g);return this.markers.push(y),y.register(this.lines.onTrim((k=>{y.line-=k,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((k=>{y.line>=k.index&&(y.line+=k.amount)}))),y.register(this.lines.onDelete((k=>{y.line>=k.index&&y.line<k.index+k.amount&&y.dispose(),y.line>k.index&&(y.line-=k.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(g){this._isClearing||this.markers.splice(this.markers.indexOf(g),1)}}},8437:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const h=c(3734),p=c(511),u=c(643),S=c(482);a.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let C=0;class A{constructor(b,_,g=!1){this.isWrapped=g,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*b);const y=_||p.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let k=0;k<b;++k)this.setCell(k,y);this.length=b}get(b){const _=this._data[3*b+0],g=2097151&_;return[this._data[3*b+1],2097152&_?this._combined[b]:g?(0,S.stringFromCodePoint)(g):"",_>>22,2097152&_?this._combined[b].charCodeAt(this._combined[b].length-1):g]}set(b,_){this._data[3*b+1]=_[u.CHAR_DATA_ATTR_INDEX],_[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[b]=_[1],this._data[3*b+0]=2097152|b|_[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*b+0]=_[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|_[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(b){return this._data[3*b+0]>>22}hasWidth(b){return 12582912&this._data[3*b+0]}getFg(b){return this._data[3*b+1]}getBg(b){return this._data[3*b+2]}hasContent(b){return 4194303&this._data[3*b+0]}getCodePoint(b){const _=this._data[3*b+0];return 2097152&_?this._combined[b].charCodeAt(this._combined[b].length-1):2097151&_}isCombined(b){return 2097152&this._data[3*b+0]}getString(b){const _=this._data[3*b+0];return 2097152&_?this._combined[b]:2097151&_?(0,S.stringFromCodePoint)(2097151&_):""}isProtected(b){return 536870912&this._data[3*b+2]}loadCell(b,_){return C=3*b,_.content=this._data[C+0],_.fg=this._data[C+1],_.bg=this._data[C+2],2097152&_.content&&(_.combinedData=this._combined[b]),268435456&_.bg&&(_.extended=this._extendedAttrs[b]),_}setCell(b,_){2097152&_.content&&(this._combined[b]=_.combinedData),268435456&_.bg&&(this._extendedAttrs[b]=_.extended),this._data[3*b+0]=_.content,this._data[3*b+1]=_.fg,this._data[3*b+2]=_.bg}setCellFromCodepoint(b,_,g,y){268435456&y.bg&&(this._extendedAttrs[b]=y.extended),this._data[3*b+0]=_|g<<22,this._data[3*b+1]=y.fg,this._data[3*b+2]=y.bg}addCodepointToCell(b,_,g){let y=this._data[3*b+0];2097152&y?this._combined[b]+=(0,S.stringFromCodePoint)(_):2097151&y?(this._combined[b]=(0,S.stringFromCodePoint)(2097151&y)+(0,S.stringFromCodePoint)(_),y&=-2097152,y|=2097152):y=_|4194304,g&&(y&=-12582913,y|=g<<22),this._data[3*b+0]=y}insertCells(b,_,g){if((b%=this.length)&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,g),_<this.length-b){const y=new p.CellData;for(let k=this.length-b-_-1;k>=0;--k)this.setCell(b+_+k,this.loadCell(b+k,y));for(let k=0;k<_;++k)this.setCell(b+k,g)}else for(let y=b;y<this.length;++y)this.setCell(y,g);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,g)}deleteCells(b,_,g){if(b%=this.length,_<this.length-b){const y=new p.CellData;for(let k=0;k<this.length-b-_;++k)this.setCell(b+k,this.loadCell(b+_+k,y));for(let k=this.length-_;k<this.length;++k)this.setCell(k,g)}else for(let y=b;y<this.length;++y)this.setCell(y,g);b&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,g),this.getWidth(b)!==0||this.hasContent(b)||this.setCellFromCodepoint(b,0,1,g)}replaceCells(b,_,g,y=!1){if(y)for(b&&this.getWidth(b-1)===2&&!this.isProtected(b-1)&&this.setCellFromCodepoint(b-1,0,1,g),_<this.length&&this.getWidth(_-1)===2&&!this.isProtected(_)&&this.setCellFromCodepoint(_,0,1,g);b<_&&b<this.length;)this.isProtected(b)||this.setCell(b,g),b++;else for(b&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,g),_<this.length&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_,0,1,g);b<_&&b<this.length;)this.setCell(b++,g)}resize(b,_){if(b===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const g=3*b;if(b>this.length){if(this._data.buffer.byteLength>=4*g)this._data=new Uint32Array(this._data.buffer,0,g);else{const y=new Uint32Array(g);y.set(this._data),this._data=y}for(let y=this.length;y<b;++y)this.setCell(y,_)}else{this._data=this._data.subarray(0,g);const y=Object.keys(this._combined);for(let M=0;M<y.length;M++){const D=parseInt(y[M],10);D>=b&&delete this._combined[D]}const k=Object.keys(this._extendedAttrs);for(let M=0;M<k.length;M++){const D=parseInt(k[M],10);D>=b&&delete this._extendedAttrs[D]}}return this.length=b,4*g*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const b=new Uint32Array(this._data.length);return b.set(this._data),this._data=b,1}return 0}fill(b,_=!1){if(_)for(let g=0;g<this.length;++g)this.isProtected(g)||this.setCell(g,b);else{this._combined={},this._extendedAttrs={};for(let g=0;g<this.length;++g)this.setCell(g,b)}}copyFrom(b){this.length!==b.length?this._data=new Uint32Array(b._data):this._data.set(b._data),this.length=b.length,this._combined={};for(const _ in b._combined)this._combined[_]=b._combined[_];this._extendedAttrs={};for(const _ in b._extendedAttrs)this._extendedAttrs[_]=b._extendedAttrs[_];this.isWrapped=b.isWrapped}clone(){const b=new A(0);b._data=new Uint32Array(this._data),b.length=this.length;for(const _ in this._combined)b._combined[_]=this._combined[_];for(const _ in this._extendedAttrs)b._extendedAttrs[_]=this._extendedAttrs[_];return b.isWrapped=this.isWrapped,b}getTrimmedLength(){for(let b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0])return b+(this._data[3*b+0]>>22);return 0}getNoBgTrimmedLength(){for(let b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0]||50331648&this._data[3*b+2])return b+(this._data[3*b+0]>>22);return 0}copyCellsFrom(b,_,g,y,k){const M=b._data;if(k)for(let T=y-1;T>=0;T--){for(let E=0;E<3;E++)this._data[3*(g+T)+E]=M[3*(_+T)+E];268435456&M[3*(_+T)+2]&&(this._extendedAttrs[g+T]=b._extendedAttrs[_+T])}else for(let T=0;T<y;T++){for(let E=0;E<3;E++)this._data[3*(g+T)+E]=M[3*(_+T)+E];268435456&M[3*(_+T)+2]&&(this._extendedAttrs[g+T]=b._extendedAttrs[_+T])}const D=Object.keys(b._combined);for(let T=0;T<D.length;T++){const E=parseInt(D[T],10);E>=_&&(this._combined[E-_+g]=b._combined[E])}}translateToString(b,_,g,y){_=_??0,g=g??this.length,b&&(g=Math.min(g,this.getTrimmedLength())),y&&(y.length=0);let k="";for(;_<g;){const M=this._data[3*_+0],D=2097151&M,T=2097152&M?this._combined[_]:D?(0,S.stringFromCodePoint)(D):u.WHITESPACE_CELL_CHAR;if(k+=T,y)for(let E=0;E<T.length;++E)y.push(_);_+=M>>22||1}return y&&y.push(_),k}}a.BufferLine=A},4841:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(c,h){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return h*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(f,a)=>{function c(h,p,u){if(p===h.length-1)return h[p].getTrimmedLength();const S=!h[p].hasContent(u-1)&&h[p].getWidth(u-1)===1,C=h[p+1].getWidth(0)===2;return S&&C?u-1:u}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(h,p,u,S,C){const A=[];for(let x=0;x<h.length-1;x++){let b=x,_=h.get(++b);if(!_.isWrapped)continue;const g=[h.get(x)];for(;b<h.length&&_.isWrapped;)g.push(_),_=h.get(++b);if(S>=x&&S<b){x+=g.length-1;continue}let y=0,k=c(g,y,p),M=1,D=0;for(;M<g.length;){const E=c(g,M,p),R=E-D,B=u-k,H=Math.min(R,B);g[y].copyCellsFrom(g[M],D,k,H,!1),k+=H,k===u&&(y++,k=0),D+=H,D===E&&(M++,D=0),k===0&&y!==0&&g[y-1].getWidth(u-1)===2&&(g[y].copyCellsFrom(g[y-1],u-1,k++,1,!1),g[y-1].setCell(u-1,C))}g[y].replaceCells(k,u,C);let T=0;for(let E=g.length-1;E>0&&(E>y||g[E].getTrimmedLength()===0);E--)T++;T>0&&(A.push(x+g.length-T),A.push(T)),x+=g.length-1}return A},a.reflowLargerCreateNewLayout=function(h,p){const u=[];let S=0,C=p[S],A=0;for(let x=0;x<h.length;x++)if(C===x){const b=p[++S];h.onDeleteEmitter.fire({index:x-A,amount:b}),x+=b-1,A+=b,C=p[++S]}else u.push(x);return{layout:u,countRemoved:A}},a.reflowLargerApplyNewLayout=function(h,p){const u=[];for(let S=0;S<p.length;S++)u.push(h.get(p[S]));for(let S=0;S<u.length;S++)h.set(S,u[S]);h.length=p.length},a.reflowSmallerGetNewLineLengths=function(h,p,u){const S=[],C=h.map(((_,g)=>c(h,g,p))).reduce(((_,g)=>_+g));let A=0,x=0,b=0;for(;b<C;){if(C-b<u){S.push(C-b);break}A+=u;const _=c(h,x,p);A>_&&(A-=_,x++);const g=h[x].getWidth(A-1)===2;g&&A--;const y=g?u-1:u;S.push(y),b+=y}return S},a.getWrappedLineTrimmedLength=c},5295:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const h=c(8460),p=c(844),u=c(9092);class S extends p.Disposable{constructor(A,x){super(),this._optionsService=A,this._bufferService=x,this._onBufferActivate=this.register(new h.EventEmitter),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 u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!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(A){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(A),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(A,x){this._normal.resize(A,x),this._alt.resize(A,x),this.setupTabStops(A)}setupTabStops(A){this._normal.setupTabStops(A),this._alt.setupTabStops(A)}}a.BufferSet=S},511:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const h=c(482),p=c(643),u=c(3734);class S extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(A){const x=new S;return x.setFromCharData(A),x}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(A){this.fg=A[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let x=!1;if(A[p.CHAR_DATA_CHAR_INDEX].length>2)x=!0;else if(A[p.CHAR_DATA_CHAR_INDEX].length===2){const b=A[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=b&&b<=56319){const _=A[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=_&&_<=57343?this.content=1024*(b-55296)+_-56320+65536|A[p.CHAR_DATA_WIDTH_INDEX]<<22:x=!0}else x=!0}else this.content=A[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|A[p.CHAR_DATA_WIDTH_INDEX]<<22;x&&(this.combinedData=A[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|A[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=S},643:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const h=c(8460),p=c(844);class u{get id(){return this._id}constructor(C){this.line=C,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(C){return this._disposables.push(C),C}}a.Marker=u,u._nextId=1},7116:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.CHARSETS[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:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(f,a)=>{var c,h,p;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,(function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
|
|
58
|
+
`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""})(c||(a.C0=c={})),(function(u){u.PAD="",u.HOP="",u.BPH="",u.NBH="",u.IND="",u.NEL="
",u.SSA="",u.ESA="",u.HTS="",u.HTJ="",u.VTS="",u.PLD="",u.PLU="",u.RI="",u.SS2="",u.SS3="",u.DCS="",u.PU1="",u.PU2="",u.STS="",u.CCH="",u.MW="",u.SPA="",u.EPA="",u.SOS="",u.SGCI="",u.SCI="",u.CSI="",u.ST="",u.OSC="",u.PM="",u.APC=""})(h||(a.C1=h={})),(function(u){u.ST=`${c.ESC}\\`})(p||(a.C1_ESCAPED=p={}))},7399:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const h=c(2584),p={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:["'",'"']};a.evaluateKeyboardEvent=function(u,S,C,A){const x={type:0,cancel:!1,key:void 0},b=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?x.key=S?h.C0.ESC+"OA":h.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?x.key=S?h.C0.ESC+"OD":h.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?x.key=S?h.C0.ESC+"OC":h.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(x.key=S?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:x.key=u.ctrlKey?"\b":h.C0.DEL,u.altKey&&(x.key=h.C0.ESC+x.key);break;case 9:if(u.shiftKey){x.key=h.C0.ESC+"[Z";break}x.key=h.C0.HT,x.cancel=!0;break;case 13:x.key=u.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,x.cancel=!0;break;case 27:x.key=h.C0.ESC,u.altKey&&(x.key=h.C0.ESC+h.C0.ESC),x.cancel=!0;break;case 37:if(u.metaKey)break;b?(x.key=h.C0.ESC+"[1;"+(b+1)+"D",x.key===h.C0.ESC+"[1;3D"&&(x.key=h.C0.ESC+(C?"b":"[1;5D"))):x.key=S?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(u.metaKey)break;b?(x.key=h.C0.ESC+"[1;"+(b+1)+"C",x.key===h.C0.ESC+"[1;3C"&&(x.key=h.C0.ESC+(C?"f":"[1;5C"))):x.key=S?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(u.metaKey)break;b?(x.key=h.C0.ESC+"[1;"+(b+1)+"A",C||x.key!==h.C0.ESC+"[1;3A"||(x.key=h.C0.ESC+"[1;5A")):x.key=S?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(u.metaKey)break;b?(x.key=h.C0.ESC+"[1;"+(b+1)+"B",C||x.key!==h.C0.ESC+"[1;3B"||(x.key=h.C0.ESC+"[1;5B")):x.key=S?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(x.key=h.C0.ESC+"[2~");break;case 46:x.key=b?h.C0.ESC+"[3;"+(b+1)+"~":h.C0.ESC+"[3~";break;case 36:x.key=b?h.C0.ESC+"[1;"+(b+1)+"H":S?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:x.key=b?h.C0.ESC+"[1;"+(b+1)+"F":S?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:u.shiftKey?x.type=2:u.ctrlKey?x.key=h.C0.ESC+"[5;"+(b+1)+"~":x.key=h.C0.ESC+"[5~";break;case 34:u.shiftKey?x.type=3:u.ctrlKey?x.key=h.C0.ESC+"[6;"+(b+1)+"~":x.key=h.C0.ESC+"[6~";break;case 112:x.key=b?h.C0.ESC+"[1;"+(b+1)+"P":h.C0.ESC+"OP";break;case 113:x.key=b?h.C0.ESC+"[1;"+(b+1)+"Q":h.C0.ESC+"OQ";break;case 114:x.key=b?h.C0.ESC+"[1;"+(b+1)+"R":h.C0.ESC+"OR";break;case 115:x.key=b?h.C0.ESC+"[1;"+(b+1)+"S":h.C0.ESC+"OS";break;case 116:x.key=b?h.C0.ESC+"[15;"+(b+1)+"~":h.C0.ESC+"[15~";break;case 117:x.key=b?h.C0.ESC+"[17;"+(b+1)+"~":h.C0.ESC+"[17~";break;case 118:x.key=b?h.C0.ESC+"[18;"+(b+1)+"~":h.C0.ESC+"[18~";break;case 119:x.key=b?h.C0.ESC+"[19;"+(b+1)+"~":h.C0.ESC+"[19~";break;case 120:x.key=b?h.C0.ESC+"[20;"+(b+1)+"~":h.C0.ESC+"[20~";break;case 121:x.key=b?h.C0.ESC+"[21;"+(b+1)+"~":h.C0.ESC+"[21~";break;case 122:x.key=b?h.C0.ESC+"[23;"+(b+1)+"~":h.C0.ESC+"[23~";break;case 123:x.key=b?h.C0.ESC+"[24;"+(b+1)+"~":h.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(C&&!A||!u.altKey||u.metaKey)!C||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?x.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(x.key=h.C0.US),u.key==="@"&&(x.key=h.C0.NUL)):u.keyCode===65&&(x.type=1);else{const _=p[u.keyCode],g=_==null?void 0:_[u.shiftKey?1:0];if(g)x.key=h.C0.ESC+g;else if(u.keyCode>=65&&u.keyCode<=90){const y=u.ctrlKey?u.keyCode-64:u.keyCode+32;let k=String.fromCharCode(y);u.shiftKey&&(k=k.toUpperCase()),x.key=h.C0.ESC+k}else if(u.keyCode===32)x.key=h.C0.ESC+(u.ctrlKey?h.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let y=u.code.slice(3,4);u.shiftKey||(y=y.toLowerCase()),x.key=h.C0.ESC+y,x.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?x.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?x.key=h.C0.NUL:u.keyCode>=51&&u.keyCode<=55?x.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?x.key=h.C0.DEL:u.keyCode===219?x.key=h.C0.ESC:u.keyCode===220?x.key=h.C0.FS:u.keyCode===221&&(x.key=h.C0.GS)}return x}},482:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},a.utf32ToString=function(c,h=0,p=c.length){let u="";for(let S=h;S<p;++S){let C=c[S];C>65535?(C-=65536,u+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):u+=String.fromCharCode(C)}return u},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,h){const p=c.length;if(!p)return 0;let u=0,S=0;if(this._interim){const C=c.charCodeAt(S++);56320<=C&&C<=57343?h[u++]=1024*(this._interim-55296)+C-56320+65536:(h[u++]=this._interim,h[u++]=C),this._interim=0}for(let C=S;C<p;++C){const A=c.charCodeAt(C);if(55296<=A&&A<=56319){if(++C>=p)return this._interim=A,u;const x=c.charCodeAt(C);56320<=x&&x<=57343?h[u++]=1024*(A-55296)+x-56320+65536:(h[u++]=A,h[u++]=x)}else A!==65279&&(h[u++]=A)}return u}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,h){const p=c.length;if(!p)return 0;let u,S,C,A,x=0,b=0,_=0;if(this.interim[0]){let k=!1,M=this.interim[0];M&=(224&M)==192?31:(240&M)==224?15:7;let D,T=0;for(;(D=63&this.interim[++T])&&T<4;)M<<=6,M|=D;const E=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=E-T;for(;_<R;){if(_>=p)return 0;if(D=c[_++],(192&D)!=128){_--,k=!0;break}this.interim[T++]=D,M<<=6,M|=63&D}k||(E===2?M<128?_--:h[x++]=M:E===3?M<2048||M>=55296&&M<=57343||M===65279||(h[x++]=M):M<65536||M>1114111||(h[x++]=M)),this.interim.fill(0)}const g=p-4;let y=_;for(;y<p;){for(;!(!(y<g)||128&(u=c[y])||128&(S=c[y+1])||128&(C=c[y+2])||128&(A=c[y+3]));)h[x++]=u,h[x++]=S,h[x++]=C,h[x++]=A,y+=4;if(u=c[y++],u<128)h[x++]=u;else if((224&u)==192){if(y>=p)return this.interim[0]=u,x;if(S=c[y++],(192&S)!=128){y--;continue}if(b=(31&u)<<6|63&S,b<128){y--;continue}h[x++]=b}else if((240&u)==224){if(y>=p)return this.interim[0]=u,x;if(S=c[y++],(192&S)!=128){y--;continue}if(y>=p)return this.interim[0]=u,this.interim[1]=S,x;if(C=c[y++],(192&C)!=128){y--;continue}if(b=(15&u)<<12|(63&S)<<6|63&C,b<2048||b>=55296&&b<=57343||b===65279)continue;h[x++]=b}else if((248&u)==240){if(y>=p)return this.interim[0]=u,x;if(S=c[y++],(192&S)!=128){y--;continue}if(y>=p)return this.interim[0]=u,this.interim[1]=S,x;if(C=c[y++],(192&C)!=128){y--;continue}if(y>=p)return this.interim[0]=u,this.interim[1]=S,this.interim[2]=C,x;if(A=c[y++],(192&A)!=128){y--;continue}if(b=(7&u)<<18|(63&S)<<12|(63&C)<<6|63&A,b<65536||b>1114111)continue;h[x++]=b}}return x}}},225:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const h=c(1480),p=[[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]],u=[[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]];let S;a.UnicodeV6=class{constructor(){if(this.version="6",!S){S=new Uint8Array(65536),S.fill(1),S[0]=0,S.fill(0,1,32),S.fill(0,127,160),S.fill(2,4352,4448),S[9001]=2,S[9002]=2,S.fill(2,11904,42192),S[12351]=1,S.fill(2,44032,55204),S.fill(2,63744,64256),S.fill(2,65040,65050),S.fill(2,65072,65136),S.fill(2,65280,65377),S.fill(2,65504,65511);for(let C=0;C<p.length;++C)S.fill(0,p[C][0],p[C][1]+1)}}wcwidth(C){return C<32?0:C<127?1:C<65536?S[C]:(function(A,x){let b,_=0,g=x.length-1;if(A<x[0][0]||A>x[g][1])return!1;for(;g>=_;)if(b=_+g>>1,A>x[b][1])_=b+1;else{if(!(A<x[b][0]))return!0;g=b-1}return!1})(C,u)?0:C>=131072&&C<=196605||C>=196608&&C<=262141?2:1}charProperties(C,A){let x=this.wcwidth(C),b=x===0&&A!==0;if(b){const _=h.UnicodeService.extractWidth(A);_===0?b=!1:_>x&&(x=_)}return h.UnicodeService.createPropertyValue(0,x,b)}}},5981:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const h=c(8460),p=c(844);class u extends p.Disposable{constructor(C){super(),this._action=C,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(C,A){if(A!==void 0&&this._syncCalls>A)return void(this._syncCalls=0);if(this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let x;for(this._isSyncWriting=!0;x=this._writeBuffer.shift();){this._action(x);const b=this._callbacks.shift();b&&b()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(C,A){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(A),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(A)}_innerWrite(C=0,A=!0){const x=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const b=this._writeBuffer[this._bufferOffset],_=this._action(b,A);if(_){const y=k=>Date.now()-x>=12?setTimeout((()=>this._innerWrite(0,k))):this._innerWrite(x,k);return void _.catch((k=>(queueMicrotask((()=>{throw k})),Promise.resolve(!1)))).then(y)}const g=this._callbacks[this._bufferOffset];if(g&&g(),this._bufferOffset++,this._pendingData-=b.length,Date.now()-x>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(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()}}a.WriteBuffer=u},5941:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const c=/^([\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})$/,h=/^[\da-f]+$/;function p(u,S){const C=u.toString(16),A=C.length<2?"0"+C:C;switch(S){case 4:return C[0];case 8:return A;case 12:return(A+A).slice(0,3);default:return A+A}}a.parseColor=function(u){if(!u)return;let S=u.toLowerCase();if(S.indexOf("rgb:")===0){S=S.slice(4);const C=c.exec(S);if(C){const A=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/A*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/A*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/A*255)]}}else if(S.indexOf("#")===0&&(S=S.slice(1),h.exec(S)&&[3,6,9,12].includes(S.length))){const C=S.length/3,A=[0,0,0];for(let x=0;x<3;++x){const b=parseInt(S.slice(C*x,C*x+C),16);A[x]=C===1?b<<4:C===2?b:C===3?b>>4:b>>8}return A}},a.toRgbString=function(u,S=16){const[C,A,x]=u;return`rgb:${p(C,S)}/${p(A,S)}/${p(x,S)}`}},5770:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const h=c(482),p=c(8742),u=c(5770),S=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=S,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=S}registerHandler(A,x){this._handlers[A]===void 0&&(this._handlers[A]=[]);const b=this._handlers[A];return b.push(x),{dispose:()=>{const _=b.indexOf(x);_!==-1&&b.splice(_,1)}}}clearHandler(A){this._handlers[A]&&delete this._handlers[A]}setHandlerFallback(A){this._handlerFb=A}reset(){if(this._active.length)for(let A=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;A>=0;--A)this._active[A].unhook(!1);this._stack.paused=!1,this._active=S,this._ident=0}hook(A,x){if(this.reset(),this._ident=A,this._active=this._handlers[A]||S,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].hook(x);else this._handlerFb(this._ident,"HOOK",x)}put(A,x,b){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(A,x,b);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(A,x,b))}unhook(A,x=!0){if(this._active.length){let b=!1,_=this._active.length-1,g=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,b=x,g=this._stack.fallThrough,this._stack.paused=!1),!g&&b===!1){for(;_>=0&&(b=this._active[_].unhook(A),b!==!0);_--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,b;_--}for(;_>=0;_--)if(b=this._active[_].unhook(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,b}else this._handlerFb(this._ident,"UNHOOK",A);this._active=S,this._ident=0}};const C=new p.Params;C.addParam(0),a.DcsHandler=class{constructor(A){this._handler=A,this._data="",this._params=C,this._hitLimit=!1}hook(A){this._params=A.length>1||A.params[0]?A.clone():C,this._data="",this._hitLimit=!1}put(A,x,b){this._hitLimit||(this._data+=(0,h.utf32ToString)(A,x,b),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(A){let x=!1;if(this._hitLimit)x=!1;else if(A&&(x=this._handler(this._data,this._params),x instanceof Promise))return x.then((b=>(this._params=C,this._data="",this._hitLimit=!1,b)));return this._params=C,this._data="",this._hitLimit=!1,x}}},2015:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const h=c(844),p=c(8742),u=c(6242),S=c(6351);class C{constructor(_){this.table=new Uint8Array(_)}setDefault(_,g){this.table.fill(_<<4|g)}add(_,g,y,k){this.table[g<<8|_]=y<<4|k}addMany(_,g,y,k){for(let M=0;M<_.length;M++)this.table[g<<8|_[M]]=y<<4|k}}a.TransitionTable=C;const A=160;a.VT500_TRANSITION_TABLE=(function(){const b=new C(4095),_=Array.apply(null,Array(256)).map(((T,E)=>E)),g=(T,E)=>_.slice(T,E),y=g(32,127),k=g(0,24);k.push(25),k.push.apply(k,g(28,32));const M=g(0,14);let D;for(D in b.setDefault(1,0),b.addMany(y,0,2,0),M)b.addMany([24,26,153,154],D,3,0),b.addMany(g(128,144),D,3,0),b.addMany(g(144,152),D,3,0),b.add(156,D,0,0),b.add(27,D,11,1),b.add(157,D,4,8),b.addMany([152,158,159],D,0,7),b.add(155,D,11,3),b.add(144,D,11,9);return b.addMany(k,0,3,0),b.addMany(k,1,3,1),b.add(127,1,0,1),b.addMany(k,8,0,8),b.addMany(k,3,3,3),b.add(127,3,0,3),b.addMany(k,4,3,4),b.add(127,4,0,4),b.addMany(k,6,3,6),b.addMany(k,5,3,5),b.add(127,5,0,5),b.addMany(k,2,3,2),b.add(127,2,0,2),b.add(93,1,4,8),b.addMany(y,8,5,8),b.add(127,8,5,8),b.addMany([156,27,24,26,7],8,6,0),b.addMany(g(28,32),8,0,8),b.addMany([88,94,95],1,0,7),b.addMany(y,7,0,7),b.addMany(k,7,0,7),b.add(156,7,0,0),b.add(127,7,0,7),b.add(91,1,11,3),b.addMany(g(64,127),3,7,0),b.addMany(g(48,60),3,8,4),b.addMany([60,61,62,63],3,9,4),b.addMany(g(48,60),4,8,4),b.addMany(g(64,127),4,7,0),b.addMany([60,61,62,63],4,0,6),b.addMany(g(32,64),6,0,6),b.add(127,6,0,6),b.addMany(g(64,127),6,0,0),b.addMany(g(32,48),3,9,5),b.addMany(g(32,48),5,9,5),b.addMany(g(48,64),5,0,6),b.addMany(g(64,127),5,7,0),b.addMany(g(32,48),4,9,5),b.addMany(g(32,48),1,9,2),b.addMany(g(32,48),2,9,2),b.addMany(g(48,127),2,10,0),b.addMany(g(48,80),1,10,0),b.addMany(g(81,88),1,10,0),b.addMany([89,90,92],1,10,0),b.addMany(g(96,127),1,10,0),b.add(80,1,11,9),b.addMany(k,9,0,9),b.add(127,9,0,9),b.addMany(g(28,32),9,0,9),b.addMany(g(32,48),9,9,12),b.addMany(g(48,60),9,8,10),b.addMany([60,61,62,63],9,9,10),b.addMany(k,11,0,11),b.addMany(g(32,128),11,0,11),b.addMany(g(28,32),11,0,11),b.addMany(k,10,0,10),b.add(127,10,0,10),b.addMany(g(28,32),10,0,10),b.addMany(g(48,60),10,8,10),b.addMany([60,61,62,63],10,0,11),b.addMany(g(32,48),10,9,12),b.addMany(k,12,0,12),b.add(127,12,0,12),b.addMany(g(28,32),12,0,12),b.addMany(g(32,48),12,9,12),b.addMany(g(48,64),12,0,11),b.addMany(g(64,127),12,12,13),b.addMany(g(64,127),10,12,13),b.addMany(g(64,127),9,12,13),b.addMany(k,13,13,13),b.addMany(y,13,13,13),b.add(127,13,0,13),b.addMany([27,156,24,26],13,14,0),b.add(A,0,2,0),b.add(A,8,5,8),b.add(A,6,0,6),b.add(A,11,0,11),b.add(A,13,13,13),b})();class x extends h.Disposable{constructor(_=a.VT500_TRANSITION_TABLE){super(),this._transitions=_,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(g,y,k)=>{},this._executeHandlerFb=g=>{},this._csiHandlerFb=(g,y)=>{},this._escHandlerFb=g=>{},this._errorHandlerFb=g=>g,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new S.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(_,g=[64,126]){let y=0;if(_.prefix){if(_.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=_.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(_.intermediates){if(_.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let M=0;M<_.intermediates.length;++M){const D=_.intermediates.charCodeAt(M);if(32>D||D>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=D}}if(_.final.length!==1)throw new Error("final must be a single byte");const k=_.final.charCodeAt(0);if(g[0]>k||k>g[1])throw new Error(`final must be in range ${g[0]} .. ${g[1]}`);return y<<=8,y|=k,y}identToString(_){const g=[];for(;_;)g.push(String.fromCharCode(255&_)),_>>=8;return g.reverse().join("")}setPrintHandler(_){this._printHandler=_}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(_,g){const y=this._identifier(_,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const k=this._escHandlers[y];return k.push(g),{dispose:()=>{const M=k.indexOf(g);M!==-1&&k.splice(M,1)}}}clearEscHandler(_){this._escHandlers[this._identifier(_,[48,126])]&&delete this._escHandlers[this._identifier(_,[48,126])]}setEscHandlerFallback(_){this._escHandlerFb=_}setExecuteHandler(_,g){this._executeHandlers[_.charCodeAt(0)]=g}clearExecuteHandler(_){this._executeHandlers[_.charCodeAt(0)]&&delete this._executeHandlers[_.charCodeAt(0)]}setExecuteHandlerFallback(_){this._executeHandlerFb=_}registerCsiHandler(_,g){const y=this._identifier(_);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const k=this._csiHandlers[y];return k.push(g),{dispose:()=>{const M=k.indexOf(g);M!==-1&&k.splice(M,1)}}}clearCsiHandler(_){this._csiHandlers[this._identifier(_)]&&delete this._csiHandlers[this._identifier(_)]}setCsiHandlerFallback(_){this._csiHandlerFb=_}registerDcsHandler(_,g){return this._dcsParser.registerHandler(this._identifier(_),g)}clearDcsHandler(_){this._dcsParser.clearHandler(this._identifier(_))}setDcsHandlerFallback(_){this._dcsParser.setHandlerFallback(_)}registerOscHandler(_,g){return this._oscParser.registerHandler(_,g)}clearOscHandler(_){this._oscParser.clearHandler(_)}setOscHandlerFallback(_){this._oscParser.setHandlerFallback(_)}setErrorHandler(_){this._errorHandler=_}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(_,g,y,k,M){this._parseStack.state=_,this._parseStack.handlers=g,this._parseStack.handlerPos=y,this._parseStack.transition=k,this._parseStack.chunkPos=M}parse(_,g,y){let k,M=0,D=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const E=this._parseStack.handlers;let R=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&R>-1){for(;R>=0&&(k=E[R](this._params),k!==!0);R--)if(k instanceof Promise)return this._parseStack.handlerPos=R,k}this._parseStack.handlers=[];break;case 4:if(y===!1&&R>-1){for(;R>=0&&(k=E[R](),k!==!0);R--)if(k instanceof Promise)return this._parseStack.handlerPos=R,k}this._parseStack.handlers=[];break;case 6:if(M=_[this._parseStack.chunkPos],k=this._dcsParser.unhook(M!==24&&M!==26,y),k)return k;M===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(M=_[this._parseStack.chunkPos],k=this._oscParser.end(M!==24&&M!==26,y),k)return k;M===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,T=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let E=T;E<g;++E){switch(M=_[E],D=this._transitions.table[this.currentState<<8|(M<160?M:A)],D>>4){case 2:for(let F=E+1;;++F){if(F>=g||(M=_[F])<32||M>126&&M<A){this._printHandler(_,E,F),E=F-1;break}if(++F>=g||(M=_[F])<32||M>126&&M<A){this._printHandler(_,E,F),E=F-1;break}if(++F>=g||(M=_[F])<32||M>126&&M<A){this._printHandler(_,E,F),E=F-1;break}if(++F>=g||(M=_[F])<32||M>126&&M<A){this._printHandler(_,E,F),E=F-1;break}}break;case 3:this._executeHandlers[M]?this._executeHandlers[M]():this._executeHandlerFb(M),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:E,code:M,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const R=this._csiHandlers[this._collect<<8|M];let B=R?R.length-1:-1;for(;B>=0&&(k=R[B](this._params),k!==!0);B--)if(k instanceof Promise)return this._preserveStack(3,R,B,D,E),k;B<0&&this._csiHandlerFb(this._collect<<8|M,this._params),this.precedingJoinState=0;break;case 8:do switch(M){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(M-48)}while(++E<g&&(M=_[E])>47&&M<60);E--;break;case 9:this._collect<<=8,this._collect|=M;break;case 10:const H=this._escHandlers[this._collect<<8|M];let P=H?H.length-1:-1;for(;P>=0&&(k=H[P](),k!==!0);P--)if(k instanceof Promise)return this._preserveStack(4,H,P,D,E),k;P<0&&this._escHandlerFb(this._collect<<8|M),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|M,this._params);break;case 13:for(let F=E+1;;++F)if(F>=g||(M=_[F])===24||M===26||M===27||M>127&&M<A){this._dcsParser.put(_,E,F),E=F-1;break}break;case 14:if(k=this._dcsParser.unhook(M!==24&&M!==26),k)return this._preserveStack(6,[],0,D,E),k;M===27&&(D|=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 F=E+1;;F++)if(F>=g||(M=_[F])<32||M>127&&M<A){this._oscParser.put(_,E,F),E=F-1;break}break;case 6:if(k=this._oscParser.end(M!==24&&M!==26),k)return this._preserveStack(5,[],0,D,E),k;M===27&&(D|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&D}}}a.EscapeSequenceParser=x},6242:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const h=c(5770),p=c(482),u=[];a.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(S,C){this._handlers[S]===void 0&&(this._handlers[S]=[]);const A=this._handlers[S];return A.push(C),{dispose:()=>{const x=A.indexOf(C);x!==-1&&A.splice(x,1)}}}clearHandler(S){this._handlers[S]&&delete this._handlers[S]}setHandlerFallback(S){this._handlerFb=S}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let S=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;S>=0;--S)this._active[S].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].start();else this._handlerFb(this._id,"START")}_put(S,C,A){if(this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].put(S,C,A);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(S,C,A))}start(){this.reset(),this._state=1}put(S,C,A){if(this._state!==3){if(this._state===1)for(;C<A;){const x=S[C++];if(x===59){this._state=2,this._start();break}if(x<48||57<x)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+x-48}this._state===2&&A-C>0&&this._put(S,C,A)}}end(S,C=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let A=!1,x=this._active.length-1,b=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,A=C,b=this._stack.fallThrough,this._stack.paused=!1),!b&&A===!1){for(;x>=0&&(A=this._active[x].end(S),A!==!0);x--)if(A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!1,A;x--}for(;x>=0;x--)if(A=this._active[x].end(!1),A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!0,A}else this._handlerFb(this._id,"END",S);this._active=u,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(S){this._handler=S,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(S,C,A){this._hitLimit||(this._data+=(0,p.utf32ToString)(S,C,A),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(S){let C=!1;if(this._hitLimit)C=!1;else if(S&&(C=this._handler(this._data),C instanceof Promise))return C.then((A=>(this._data="",this._hitLimit=!1,A)));return this._data="",this._hitLimit=!1,C}}},8742:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const c=2147483647;class h{static fromArray(u){const S=new h;if(!u.length)return S;for(let C=Array.isArray(u[0])?1:0;C<u.length;++C){const A=u[C];if(Array.isArray(A))for(let x=0;x<A.length;++x)S.addSubParam(A[x]);else S.addParam(A)}return S}constructor(u=32,S=32){if(this.maxLength=u,this.maxSubParamsLength=S,S>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(S),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new h(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let S=0;S<this.length;++S){u.push(this.params[S]);const C=this._subParamsIdx[S]>>8,A=255&this._subParamsIdx[S];A-C>0&&u.push(Array.prototype.slice.call(this._subParams,C,A))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>c?c:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>c?c:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const S=this._subParamsIdx[u]>>8,C=255&this._subParamsIdx[u];return C-S>0?this._subParams.subarray(S,C):null}getSubParamsAll(){const u={};for(let S=0;S<this.length;++S){const C=this._subParamsIdx[S]>>8,A=255&this._subParamsIdx[S];A-C>0&&(u[S]=this._subParams.slice(C,A))}return u}addDigit(u){let S;if(this._rejectDigits||!(S=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const C=this._digitIsSub?this._subParams:this.params,A=C[S-1];C[S-1]=~A?Math.min(10*A+u,c):u}}a.Params=h},5741:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,h){const p={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(p),h.dispose=()=>this._wrappedAddonDispose(p),h.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let h=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===c){h=p;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(h,1)}}},8771:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const h=c(3785),p=c(511);a.BufferApiView=class{constructor(u,S){this._buffer=u,this.type=S}init(u){return this._buffer=u,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(u){const S=this._buffer.lines.get(u);if(S)return new h.BufferLineApiView(S)}getNullCell(){return new p.CellData}}},3785:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const h=c(511);a.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,u){if(!(p<0||p>=this._line.length))return u?(this._line.loadCell(p,u),u):this._line.loadCell(p,new h.CellData)}translateToString(p,u,S){return this._line.translateToString(p,u,S)}}},8285:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const h=c(8771),p=c(8460),u=c(844);class S extends u.Disposable{constructor(A){super(),this._core=A,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.BufferApiView(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)}}a.BufferNamespaceApi=S},7975:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,h){return this._core.registerCsiHandler(c,(p=>h(p.toArray())))}addCsiHandler(c,h){return this.registerCsiHandler(c,h)}registerDcsHandler(c,h){return this._core.registerDcsHandler(c,((p,u)=>h(p,u.toArray())))}addDcsHandler(c,h){return this.registerDcsHandler(c,h)}registerEscHandler(c,h){return this._core.registerEscHandler(c,h)}addEscHandler(c,h){return this.registerEscHandler(c,h)}registerOscHandler(c,h){return this._core.registerOscHandler(c,h)}addOscHandler(c,h){return this.registerOscHandler(c,h)}}},7090:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(f,a,c){var h=this&&this.__decorate||function(b,_,g,y){var k,M=arguments.length,D=M<3?_:y===null?y=Object.getOwnPropertyDescriptor(_,g):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(b,_,g,y);else for(var T=b.length-1;T>=0;T--)(k=b[T])&&(D=(M<3?k(D):M>3?k(_,g,D):k(_,g))||D);return M>3&&D&&Object.defineProperty(_,g,D),D},p=this&&this.__param||function(b,_){return function(g,y){_(g,y,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const u=c(8460),S=c(844),C=c(5295),A=c(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let x=a.BufferService=class extends S.Disposable{get buffer(){return this.buffers.active}constructor(b){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(b.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(b.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new C.BufferSet(b,this))}resize(b,_){this.cols=b,this.rows=_,this.buffers.resize(b,_),this._onResize.fire({cols:b,rows:_})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(b,_=!1){const g=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===b.fg&&y.getBg(0)===b.bg||(y=g.getBlankLine(b,_),this._cachedBlankLine=y),y.isWrapped=_;const k=g.ybase+g.scrollTop,M=g.ybase+g.scrollBottom;if(g.scrollTop===0){const D=g.lines.isFull;M===g.lines.length-1?D?g.lines.recycle().copyFrom(y):g.lines.push(y.clone()):g.lines.splice(M+1,0,y.clone()),D?this.isUserScrolling&&(g.ydisp=Math.max(g.ydisp-1,0)):(g.ybase++,this.isUserScrolling||g.ydisp++)}else{const D=M-k+1;g.lines.shiftElements(k+1,D-1,-1),g.lines.set(M,y.clone())}this.isUserScrolling||(g.ydisp=g.ybase),this._onScroll.fire(g.ydisp)}scrollLines(b,_,g){const y=this.buffer;if(b<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else b+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const k=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+b,y.ybase),0),k!==y.ydisp&&(_||this._onScroll.fire(y.ydisp))}};a.BufferService=x=h([p(0,A.IOptionsService)],x)},7994:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,h){this._charsets[c]=h,this.glevel===c&&(this.charset=h)}}},1753:function(f,a,c){var h=this&&this.__decorate||function(y,k,M,D){var T,E=arguments.length,R=E<3?k:D===null?D=Object.getOwnPropertyDescriptor(k,M):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,k,M,D);else for(var B=y.length-1;B>=0;B--)(T=y[B])&&(R=(E<3?T(R):E>3?T(k,M,R):T(k,M))||R);return E>3&&R&&Object.defineProperty(k,M,R),R},p=this&&this.__param||function(y,k){return function(M,D){k(M,D,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const u=c(2585),S=c(8460),C=c(844),A={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function x(y,k){let M=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(M|=64,M|=y.action):(M|=3&y.button,4&y.button&&(M|=64),8&y.button&&(M|=128),y.action===32?M|=32:y.action!==0||k||(M|=3)),M}const b=String.fromCharCode,_={DEFAULT:y=>{const k=[x(y,!1)+32,y.col+32,y.row+32];return k[0]>255||k[1]>255||k[2]>255?"":`\x1B[M${b(k[0])}${b(k[1])}${b(k[2])}`},SGR:y=>{const k=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${x(y,!0)};${y.col};${y.row}${k}`},SGR_PIXELS:y=>{const k=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${x(y,!0)};${y.x};${y.y}${k}`}};let g=a.CoreMouseService=class extends C.Disposable{constructor(y,k){super(),this._bufferService=y,this._coreService=k,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new S.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const M of Object.keys(A))this.addProtocol(M,A[M]);for(const M of Object.keys(_))this.addEncoding(M,_[M]);this.reset()}addProtocol(y,k){this._protocols[y]=k}addEncoding(y,k){this._encodings[y]=k}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const k=this._encodings[this._activeEncoding](y);return k&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(k):this._coreService.triggerDataEvent(k,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,k,M){if(M){if(y.x!==k.x||y.y!==k.y)return!1}else if(y.col!==k.col||y.row!==k.row)return!1;return y.button===k.button&&y.action===k.action&&y.ctrl===k.ctrl&&y.alt===k.alt&&y.shift===k.shift}};a.CoreMouseService=g=h([p(0,u.IBufferService),p(1,u.ICoreService)],g)},6975:function(f,a,c){var h=this&&this.__decorate||function(g,y,k,M){var D,T=arguments.length,E=T<3?y:M===null?M=Object.getOwnPropertyDescriptor(y,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(g,y,k,M);else for(var R=g.length-1;R>=0;R--)(D=g[R])&&(E=(T<3?D(E):T>3?D(y,k,E):D(y,k))||E);return T>3&&E&&Object.defineProperty(y,k,E),E},p=this&&this.__param||function(g,y){return function(k,M){y(k,M,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const u=c(1439),S=c(8460),C=c(844),A=c(2585),x=Object.freeze({insertMode:!1}),b=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let _=a.CoreService=class extends C.Disposable{constructor(g,y,k){super(),this._bufferService=g,this._logService=y,this._optionsService=k,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new S.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new S.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new S.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new S.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(x),this.decPrivateModes=(0,u.clone)(b)}reset(){this.modes=(0,u.clone)(x),this.decPrivateModes=(0,u.clone)(b)}triggerDataEvent(g,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const k=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&k.ybase!==k.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${g}"`,(()=>g.split("").map((M=>M.charCodeAt(0))))),this._onData.fire(g)}triggerBinaryEvent(g){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${g}"`,(()=>g.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(g))}};a.CoreService=_=h([p(0,A.IBufferService),p(1,A.ILogService),p(2,A.IOptionsService)],_)},9074:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const h=c(8055),p=c(8460),u=c(844),S=c(6106);let C=0,A=0;class x extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new S.SortedList((g=>g==null?void 0:g.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)((()=>this.reset())))}registerDecoration(g){if(g.marker.isDisposed)return;const y=new b(g);if(y){const k=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),k.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const g of this._decorations.values())g.dispose();this._decorations.clear()}*getDecorationsAtCell(g,y,k){let M=0,D=0;for(const T of this._decorations.getKeyIterator(y))M=T.options.x??0,D=M+(T.options.width??1),g>=M&&g<D&&(!k||(T.options.layer??"bottom")===k)&&(yield T)}forEachDecorationAtCell(g,y,k,M){this._decorations.forEachByKey(y,(D=>{C=D.options.x??0,A=C+(D.options.width??1),g>=C&&g<A&&(!k||(D.options.layer??"bottom")===k)&&M(D)}))}}a.DecorationService=x;class b extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(g){super(),this.options=g,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=g.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const h=c(2585),p=c(8343);class u{constructor(...C){this._entries=new Map;for(const[A,x]of C)this.set(A,x)}set(C,A){const x=this._entries.get(C);return this._entries.set(C,A),x}forEach(C){for(const[A,x]of this._entries.entries())C(A,x)}has(C){return this._entries.has(C)}get(C){return this._entries.get(C)}}a.ServiceCollection=u,a.InstantiationService=class{constructor(){this._services=new u,this._services.set(h.IInstantiationService,this)}setService(S,C){this._services.set(S,C)}getService(S){return this._services.get(S)}createInstance(S,...C){const A=(0,p.getServiceDependencies)(S).sort(((_,g)=>_.index-g.index)),x=[];for(const _ of A){const g=this._services.get(_.id);if(!g)throw new Error(`[createInstance] ${S.name} depends on UNKNOWN service ${_.id}.`);x.push(g)}const b=A.length>0?A[0].index:C.length;if(C.length!==b)throw new Error(`[createInstance] First service dependency of ${S.name} at position ${b+1} conflicts with ${C.length} static arguments`);return new S(...C,...x)}}},7866:function(f,a,c){var h=this&&this.__decorate||function(b,_,g,y){var k,M=arguments.length,D=M<3?_:y===null?y=Object.getOwnPropertyDescriptor(_,g):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(b,_,g,y);else for(var T=b.length-1;T>=0;T--)(k=b[T])&&(D=(M<3?k(D):M>3?k(_,g,D):k(_,g))||D);return M>3&&D&&Object.defineProperty(_,g,D),D},p=this&&this.__param||function(b,_){return function(g,y){_(g,y,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const u=c(844),S=c(2585),C={trace:S.LogLevelEnum.TRACE,debug:S.LogLevelEnum.DEBUG,info:S.LogLevelEnum.INFO,warn:S.LogLevelEnum.WARN,error:S.LogLevelEnum.ERROR,off:S.LogLevelEnum.OFF};let A,x=a.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(b){super(),this._optionsService=b,this._logLevel=S.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),A=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(b){for(let _=0;_<b.length;_++)typeof b[_]=="function"&&(b[_]=b[_]())}_log(b,_,g){this._evalLazyOptionalParams(g),b.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+_,...g)}trace(b,..._){var g;this._logLevel<=S.LogLevelEnum.TRACE&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.trace.bind(this._optionsService.options.logger))??console.log,b,_)}debug(b,..._){var g;this._logLevel<=S.LogLevelEnum.DEBUG&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.debug.bind(this._optionsService.options.logger))??console.log,b,_)}info(b,..._){var g;this._logLevel<=S.LogLevelEnum.INFO&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.info.bind(this._optionsService.options.logger))??console.info,b,_)}warn(b,..._){var g;this._logLevel<=S.LogLevelEnum.WARN&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.warn.bind(this._optionsService.options.logger))??console.warn,b,_)}error(b,..._){var g;this._logLevel<=S.LogLevelEnum.ERROR&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.error.bind(this._optionsService.options.logger))??console.error,b,_)}};a.LogService=x=h([p(0,S.IOptionsService)],x),a.setTraceLogger=function(b){A=b},a.traceCall=function(b,_,g){if(typeof g.value!="function")throw new Error("not supported");const y=g.value;g.value=function(...k){if(A.logLevel!==S.LogLevelEnum.TRACE)return y.apply(this,k);A.trace(`GlyphRenderer#${y.name}(${k.map((D=>JSON.stringify(D))).join(", ")})`);const M=y.apply(this,k);return A.trace(`GlyphRenderer#${y.name} return`,M),M}}},7302:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const h=c(8460),p=c(844),u=c(6114);a.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const S=["normal","bold","100","200","300","400","500","600","700","800","900"];class C extends p.Disposable{constructor(x){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const b={...a.DEFAULT_OPTIONS};for(const _ in x)if(_ in b)try{const g=x[_];b[_]=this._sanitizeAndValidateOption(_,g)}catch(g){console.error(g)}this.rawOptions=b,this.options={...b},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(x,b){return this.onOptionChange((_=>{_===x&&b(this.rawOptions[x])}))}onMultipleOptionChange(x,b){return this.onOptionChange((_=>{x.indexOf(_)!==-1&&b()}))}_setupOptions(){const x=_=>{if(!(_ in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${_}"`);return this.rawOptions[_]},b=(_,g)=>{if(!(_ in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${_}"`);g=this._sanitizeAndValidateOption(_,g),this.rawOptions[_]!==g&&(this.rawOptions[_]=g,this._onOptionChange.fire(_))};for(const _ in this.rawOptions){const g={get:x.bind(this,_),set:b.bind(this,_)};Object.defineProperty(this.options,_,g)}}_sanitizeAndValidateOption(x,b){switch(x){case"cursorStyle":if(b||(b=a.DEFAULT_OPTIONS[x]),!(function(_){return _==="block"||_==="underline"||_==="bar"})(b))throw new Error(`"${b}" is not a valid value for ${x}`);break;case"wordSeparator":b||(b=a.DEFAULT_OPTIONS[x]);break;case"fontWeight":case"fontWeightBold":if(typeof b=="number"&&1<=b&&b<=1e3)break;b=S.includes(b)?b:a.DEFAULT_OPTIONS[x];break;case"cursorWidth":b=Math.floor(b);case"lineHeight":case"tabStopWidth":if(b<1)throw new Error(`${x} cannot be less than 1, value: ${b}`);break;case"minimumContrastRatio":b=Math.max(1,Math.min(21,Math.round(10*b)/10));break;case"scrollback":if((b=Math.min(b,4294967295))<0)throw new Error(`${x} cannot be less than 0, value: ${b}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(b<=0)throw new Error(`${x} cannot be less than or equal to 0, value: ${b}`);break;case"rows":case"cols":if(!b&&b!==0)throw new Error(`${x} must be numeric, value: ${b}`);break;case"windowsPty":b=b??{}}return b}}a.OptionsService=C},2660:function(f,a,c){var h=this&&this.__decorate||function(C,A,x,b){var _,g=arguments.length,y=g<3?A:b===null?b=Object.getOwnPropertyDescriptor(A,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(C,A,x,b);else for(var k=C.length-1;k>=0;k--)(_=C[k])&&(y=(g<3?_(y):g>3?_(A,x,y):_(A,x))||y);return g>3&&y&&Object.defineProperty(A,x,y),y},p=this&&this.__param||function(C,A){return function(x,b){A(x,b,C)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const u=c(2585);let S=a.OscLinkService=class{constructor(C){this._bufferService=C,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(C){const A=this._bufferService.buffer;if(C.id===void 0){const k=A.addMarker(A.ybase+A.y),M={data:C,id:this._nextId++,lines:[k]};return k.onDispose((()=>this._removeMarkerFromLink(M,k))),this._dataByLinkId.set(M.id,M),M.id}const x=C,b=this._getEntryIdKey(x),_=this._entriesWithId.get(b);if(_)return this.addLineToLink(_.id,A.ybase+A.y),_.id;const g=A.addMarker(A.ybase+A.y),y={id:this._nextId++,key:this._getEntryIdKey(x),data:x,lines:[g]};return g.onDispose((()=>this._removeMarkerFromLink(y,g))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(C,A){const x=this._dataByLinkId.get(C);if(x&&x.lines.every((b=>b.line!==A))){const b=this._bufferService.buffer.addMarker(A);x.lines.push(b),b.onDispose((()=>this._removeMarkerFromLink(x,b)))}}getLinkData(C){var A;return(A=this._dataByLinkId.get(C))==null?void 0:A.data}_getEntryIdKey(C){return`${C.id};;${C.uri}`}_removeMarkerFromLink(C,A){const x=C.lines.indexOf(A);x!==-1&&(C.lines.splice(x,1),C.lines.length===0&&(C.data.id!==void 0&&this._entriesWithId.delete(C.key),this._dataByLinkId.delete(C.id)))}};a.OscLinkService=S=h([p(0,u.IBufferService)],S)},8343:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const c="di$target",h="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(p){return p[h]||[]},a.createDecorator=function(p){if(a.serviceRegistry.has(p))return a.serviceRegistry.get(p);const u=function(S,C,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(x,b,_){b[c]===b?b[h].push({id:x,index:_}):(b[h]=[{id:x,index:_}],b[c]=b)})(u,S,A)};return u.toString=()=>p,a.serviceRegistry.set(p,u),u}},2585:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const h=c(8343);var p;a.IBufferService=(0,h.createDecorator)("BufferService"),a.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),a.ICoreService=(0,h.createDecorator)("CoreService"),a.ICharsetService=(0,h.createDecorator)("CharsetService"),a.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"})(p||(a.LogLevelEnum=p={})),a.ILogService=(0,h.createDecorator)("LogService"),a.IOptionsService=(0,h.createDecorator)("OptionsService"),a.IOscLinkService=(0,h.createDecorator)("OscLinkService"),a.IUnicodeService=(0,h.createDecorator)("UnicodeService"),a.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const h=c(8460),p=c(225);class u{static extractShouldJoin(C){return(1&C)!=0}static extractWidth(C){return C>>1&3}static extractCharKind(C){return C>>3}static createPropertyValue(C,A,x=!1){return(16777215&C)<<3|(3&A)<<1|(x?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const C=new p.UnicodeV6;this.register(C),this._active=C.version,this._activeProvider=C}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(C){if(!this._providers[C])throw new Error(`unknown Unicode version "${C}"`);this._active=C,this._activeProvider=this._providers[C],this._onChange.fire(C)}register(C){this._providers[C.version]=C}wcwidth(C){return this._activeProvider.wcwidth(C)}getStringCellWidth(C){let A=0,x=0;const b=C.length;for(let _=0;_<b;++_){let g=C.charCodeAt(_);if(55296<=g&&g<=56319){if(++_>=b)return A+this.wcwidth(g);const M=C.charCodeAt(_);56320<=M&&M<=57343?g=1024*(g-55296)+M-56320+65536:A+=this.wcwidth(M)}const y=this.charProperties(g,x);let k=u.extractWidth(y);u.extractShouldJoin(y)&&(k-=u.extractWidth(x)),A+=k,x=y}return A}charProperties(C,A){return this._activeProvider.charProperties(C,A)}}a.UnicodeService=u}},o={};function d(f){var a=o[f];if(a!==void 0)return a.exports;var c=o[f]={exports:{}};return s[f].call(c.exports,c,c.exports,d),c.exports}var v={};return(()=>{var f=v;Object.defineProperty(f,"__esModule",{value:!0}),f.Terminal=void 0;const a=d(9042),c=d(3236),h=d(844),p=d(5741),u=d(8285),S=d(7975),C=d(7090),A=["cols","rows"];class x extends h.Disposable{constructor(_){super(),this._core=this.register(new c.Terminal(_)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const g=k=>this._core.options[k],y=(k,M)=>{this._checkReadonlyOptions(k),this._core.options[k]=M};for(const k in this._core.options){const M={get:g.bind(this,k),set:y.bind(this,k)};Object.defineProperty(this._publicOptions,k,M)}}_checkReadonlyOptions(_){if(A.includes(_))throw new Error(`Option "${_}" 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 S.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new C.UnicodeApi(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 u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const _=this._core.coreService.decPrivateModes;let g="none";switch(this._core.coreMouseService.activeProtocol){case"X10":g="x10";break;case"VT200":g="vt200";break;case"DRAG":g="drag";break;case"ANY":g="any"}return{applicationCursorKeysMode:_.applicationCursorKeys,applicationKeypadMode:_.applicationKeypad,bracketedPasteMode:_.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:g,originMode:_.origin,reverseWraparoundMode:_.reverseWraparound,sendFocusMode:_.sendFocus,wraparoundMode:_.wraparound}}get options(){return this._publicOptions}set options(_){for(const g in _)this._publicOptions[g]=_[g]}blur(){this._core.blur()}focus(){this._core.focus()}input(_,g=!0){this._core.input(_,g)}resize(_,g){this._verifyIntegers(_,g),this._core.resize(_,g)}open(_){this._core.open(_)}attachCustomKeyEventHandler(_){this._core.attachCustomKeyEventHandler(_)}attachCustomWheelEventHandler(_){this._core.attachCustomWheelEventHandler(_)}registerLinkProvider(_){return this._core.registerLinkProvider(_)}registerCharacterJoiner(_){return this._checkProposedApi(),this._core.registerCharacterJoiner(_)}deregisterCharacterJoiner(_){this._checkProposedApi(),this._core.deregisterCharacterJoiner(_)}registerMarker(_=0){return this._verifyIntegers(_),this._core.registerMarker(_)}registerDecoration(_){return this._checkProposedApi(),this._verifyPositiveIntegers(_.x??0,_.width??0,_.height??0),this._core.registerDecoration(_)}hasSelection(){return this._core.hasSelection()}select(_,g,y){this._verifyIntegers(_,g,y),this._core.select(_,g,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(_,g){this._verifyIntegers(_,g),this._core.selectLines(_,g)}dispose(){super.dispose()}scrollLines(_){this._verifyIntegers(_),this._core.scrollLines(_)}scrollPages(_){this._verifyIntegers(_),this._core.scrollPages(_)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(_){this._verifyIntegers(_),this._core.scrollToLine(_)}clear(){this._core.clear()}write(_,g){this._core.write(_,g)}writeln(_,g){this._core.write(_),this._core.write(`\r
|
|
59
|
+
`,g)}paste(_){this._core.paste(_)}refresh(_,g){this._verifyIntegers(_,g),this._core.refresh(_,g)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(_){this._addonManager.loadAddon(this,_)}static get strings(){return a}_verifyIntegers(..._){for(const g of _)if(g===1/0||isNaN(g)||g%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(..._){for(const g of _)if(g&&(g===1/0||isNaN(g)||g%1!=0||g<0))throw new Error("This API only accepts positive integers")}}f.Terminal=x})(),v})()))})(nu)),nu.exports}var y1=v1();class S1{constructor(r,s){Yp(this,"socket");const o=window.location.protocol==="https:"?"wss:":"ws:";this.socket=new WebSocket(`${o}//${window.location.host}/ws/terminal/${encodeURIComponent(r)}`),this.socket.addEventListener("message",d=>{var f,a;const v=JSON.parse(d.data);v.type==="output"?s.onOutput(v.data):v.type==="error"?(f=s.onError)==null||f.call(s,v.message):(a=s.onStatus)==null||a.call(s,v)}),this.socket.addEventListener("error",()=>{var d;(d=s.onError)==null||d.call(s,"Terminal connection failed.")})}sendInput(r){this.send({type:"input",data:r})}resize(r,s){this.send({type:"resize",cols:r,rows:s})}close(){this.socket.close()}send(r){const s=JSON.stringify(r);if(this.socket.readyState===WebSocket.OPEN){this.socket.send(s);return}this.socket.addEventListener("open",()=>this.socket.send(s),{once:!0})}}function fg({sessionId:n,active:r=!0,onEvent:s}){const o=ce.useRef(null),d=ce.useRef(null),v=ce.useRef(null),f=ce.useRef(null),a=ce.useRef(r),c=ce.useRef(s);function h(p={}){const u=o.current,S=d.current,C=v.current,A=f.current;if(!u||!S||!C||!A)return!1;const x=u.getBoundingClientRect();return x.width<b1||x.height<C1||(C.fit(),A.cols<w1||A.rows<x1)?!1:(S.resize(A.cols,A.rows),p.focus&&A.focus(),!0)}return ce.useEffect(()=>{c.current=s},[s]),ce.useEffect(()=>{a.current=r},[r]),ce.useEffect(()=>{if(!o.current)return;const p=new y1.Terminal({cursorBlink:!0,convertEol:!0,drawBoldTextInBrightColors:!0,fontFamily:"Menlo, Monaco, Consolas, monospace",fontSize:13,fontWeight:"400",fontWeightBold:"700",lineHeight:1.35,macOptionIsMeta:!0,scrollback:1e4,theme:E1}),u=new m1.FitAddon;p.loadAddon(u),p.loadAddon(new _1.WebLinksAddon),p.open(o.current),f.current=p,v.current=u;const S=new S1(n,{onOutput(y){p.write(y)},onStatus(y){var k;(k=c.current)==null||k.call(c,y.type)},onError(y){var k;p.writeln(`\r
|
|
60
|
+
[VCM] ${y}`),(k=c.current)==null||k.call(c,y)}});d.current=S;const C=p.onData(y=>{S.sendInput(y)});let A=0,x=0,b=0;const _=()=>{A&&window.cancelAnimationFrame(A),A=window.requestAnimationFrame(()=>{A=0,h({focus:a.current})})},g=new ResizeObserver(()=>{_()});return g.observe(o.current),x=window.requestAnimationFrame(_),b=window.setTimeout(_,120),()=>{A&&window.cancelAnimationFrame(A),x&&window.cancelAnimationFrame(x),b&&window.clearTimeout(b),g.disconnect(),C.dispose(),S.close(),p.dispose(),d.current=null,f.current=null,v.current=null}},[n]),ce.useEffect(()=>{if(!r)return;const p=[],u=[];return p.push(window.requestAnimationFrame(()=>{h({focus:!0}),p.push(window.requestAnimationFrame(()=>h({focus:!0})))})),u.push(window.setTimeout(()=>h({focus:!0}),160)),u.push(window.setTimeout(()=>h({focus:!0}),360)),()=>{for(const S of p)window.cancelAnimationFrame(S);for(const S of u)window.clearTimeout(S)}},[r]),ce.useEffect(()=>{const p=()=>{a.current&&h()};return window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]),N.jsx("div",{className:"terminal-frame",ref:o,onMouseDown:()=>{var p;return(p=f.current)==null?void 0:p.focus()}})}const b1=160,C1=80,w1=20,x1=5,E1={background:"#0d1117",foreground:"#d6deeb",cursor:"#ffd866",cursorAccent:"#0d1117",selectionBackground:"#264f78",selectionForeground:"#ffffff",black:"#1f2430",red:"#ff5c57",green:"#5af78e",yellow:"#f3f99d",blue:"#57c7ff",magenta:"#ff6ac1",cyan:"#9aedfe",white:"#f1f1f0",brightBlack:"#686868",brightRed:"#ff5c57",brightGreen:"#5af78e",brightYellow:"#f3f99d",brightBlue:"#57c7ff",brightMagenta:"#ff6ac1",brightCyan:"#9aedfe",brightWhite:"#ffffff"};function Gr({status:n}){return N.jsx("span",{className:`status-badge status-${n}`,children:n.replaceAll("_"," ")})}function k1({status:n,bootstrapStatus:r,applyResult:s,busy:o=!1,onRefresh:d,onApply:v,onStartBootstrap:f}){const[a,c]=ce.useState(!1),h=r==null?void 0:r.session;return ce.useEffect(()=>{h||c(!1)},[h]),n?N.jsxs("section",{className:"harness-panel",children:[N.jsxs("div",{className:"harness-stage",children:[N.jsxs("div",{className:"harness-panel-header",children:[N.jsxs("div",{children:[N.jsx("strong",{children:"Fixed install"}),N.jsx("p",{className:"muted",children:n.initialized?n.needsApply?`${n.plannedChanges.length} pending updates`:"Up to date":"Not initialized"})]}),N.jsx("div",{className:"harness-actions",children:n.initialized?N.jsxs(N.Fragment,{children:[N.jsx("button",{type:"button",disabled:o,onClick:()=>void d(),children:"Refresh"}),n.needsApply?N.jsx("button",{type:"button",disabled:o,onClick:()=>void v(),children:"Update"}):null]}):N.jsx("button",{type:"button",disabled:o,onClick:()=>void v(),children:"Initialize"})})]}),n.initialized&&n.needsApply?N.jsxs(N.Fragment,{children:[N.jsx("h3",{className:"harness-file-list-title",children:"Files to update"}),N.jsx("ol",{className:"harness-file-list",children:n.plannedChanges.map(p=>N.jsxs("li",{children:[N.jsx("span",{children:p.path}),N.jsx(Gr,{status:p.action})]},`${p.path}:${p.action}`))})]}):null]}),N.jsxs("div",{className:"harness-stage",children:[N.jsxs("div",{className:"harness-panel-header",children:[N.jsxs("div",{children:[N.jsx("strong",{children:"Bootstrap"}),N.jsx("p",{className:"muted",children:r?A1(r.status):"not loaded"})]}),N.jsx("div",{className:"harness-actions",children:N.jsx("button",{type:"button",disabled:o||!(r!=null&&r.canStart),onClick:()=>{c(!0),f()},children:"Run Bootstrap"})})]}),r?N.jsxs(N.Fragment,{children:[N.jsx("ol",{className:"harness-file-list",children:r.checks.map(p=>N.jsxs("li",{title:p.detail??p.path??"",children:[N.jsx("span",{children:p.path?`${p.label}: ${p.path}`:p.label}),N.jsx(Gr,{status:p.status})]},p.key))}),h?N.jsxs("div",{className:"harness-bootstrap-session",children:[N.jsxs("div",{children:[N.jsx("span",{children:h.command}),N.jsx(Gr,{status:h.status})]}),N.jsx("button",{type:"button",onClick:()=>c(!0),children:"Open Terminal"})]}):null]}):N.jsx("p",{className:"muted",children:"Refresh harness status to load bootstrap checks."})]}),s?N.jsxs("div",{className:"harness-result",children:[N.jsx("p",{children:s.message}),s.changedFiles.length>0?N.jsx("ul",{children:s.changedFiles.map(p=>N.jsxs("li",{children:[N.jsx("strong",{children:p.action})," ",p.path]},`${p.path}:${p.action}`))}):null]}):null,n.warnings.length>0?N.jsx("ul",{className:"warnings",children:n.warnings.map(p=>N.jsx("li",{children:p},p))}):null,r!=null&&r.warnings.length?N.jsx("ul",{className:"warnings",children:r.warnings.map(p=>N.jsx("li",{children:p},p))}):null,a&&h?N.jsx("div",{className:"harness-bootstrap-modal",role:"dialog","aria-modal":"true","aria-label":"Harness bootstrap terminal",children:N.jsxs("div",{className:"harness-bootstrap-modal-surface",children:[N.jsxs("header",{className:"harness-bootstrap-modal-header",children:[N.jsxs("div",{children:[N.jsx("strong",{children:"Harness Bootstrap Terminal"}),N.jsx("p",{className:"muted",children:h.command})]}),N.jsxs("div",{className:"harness-bootstrap-modal-actions",children:[N.jsx(Gr,{status:h.status}),N.jsx("button",{type:"button",onClick:()=>c(!1),children:"Close"})]})]}),N.jsx("div",{className:"harness-bootstrap-terminal",children:N.jsx(fg,{sessionId:h.id,active:a})})]})}):null]}):null}function A1(n){return n.replaceAll("_"," ")}function ju(n){return{total:n.length,accepted:n.filter(r=>r.acceptedAt).length,delivered:n.filter(r=>r.deliveredAt).length}}function T1(n,r=6){const s=[...n].sort(M1).map((d,v)=>({message:d,sequence:v+1}));return[...r===null?s:s.slice(-r)].sort((d,v)=>v.sequence-d.sequence)}function D1({messages:n,orchestration:r,busy:s,maxMessages:o=6,showControls:d=!0,showHeader:v=!0,onModeChange:f,onMarkAllDone:a}){const[c,h]=ce.useState(null),p=ju(n),u=(r==null?void 0:r.mode)??"auto",S=T1(n,o);async function C(A){await L1(A.body),h(A.id),window.setTimeout(()=>h(x=>x===A.id?null:x),1200)}return N.jsxs("section",{className:"message-panel",children:[v?N.jsxs("div",{className:"message-panel-header",children:[N.jsxs("div",{children:[N.jsx("h2",{children:"Messages"}),N.jsxs("p",{className:"muted",children:[p.total," total / ",p.accepted," accepted"]})]}),d&&f?N.jsx("div",{className:"message-controls",children:N.jsxs("label",{className:"message-mode-toggle",children:[N.jsx("input",{type:"checkbox",checked:u==="auto",disabled:s,onChange:A=>f(A.target.checked?"auto":"manual")}),N.jsx("span",{children:"Auto orchestration"})]})}):null,d&&a?N.jsx("button",{type:"button",disabled:s,onClick:a,children:"Mark All Done"}):null]}):null,n.length===0?N.jsx("p",{className:"muted",children:"No role messages yet."}):N.jsx("ol",{className:"message-list",children:S.map(({message:A,sequence:x})=>N.jsxs("li",{className:"message-item",children:[N.jsxs("div",{className:"message-item-main",children:[N.jsxs("div",{className:"message-meta",children:[N.jsxs("span",{className:"message-sequence",children:["#",x]}),N.jsx("time",{dateTime:ka(A),children:R1(ka(A))}),N.jsxs("strong",{children:[A.fromRole," ","->"," ",A.toRole]}),N.jsx("span",{children:A.type})]}),N.jsx("p",{children:A.body}),A.failureReason?N.jsx("span",{className:"message-reason",children:A.failureReason}):null,A.bodyPath?N.jsx("span",{className:"message-path",children:A.bodyPath}):null]}),N.jsx("div",{className:"message-actions",children:N.jsx("button",{type:"button",disabled:s,onClick:()=>void C(A),children:c===A.id?"Copied":"Copy"})})]},A.id))})]})}function R1(n){const r=new Date(n);return Number.isNaN(r.getTime())?n:r.toLocaleString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function ka(n){return n.acceptedAt??n.deliveredAt??n.dispatchingAt??n.createdAt}function M1(n,r){const s=ka(n).localeCompare(ka(r));if(s!==0)return s;const o=n.createdAt.localeCompare(r.createdAt);return o!==0?o:n.id.localeCompare(r.id)}async function L1(n){var s;if((s=navigator.clipboard)!=null&&s.writeText){await navigator.clipboard.writeText(n);return}const r=document.createElement("textarea");r.value=n,r.setAttribute("readonly","true"),r.style.position="fixed",r.style.left="-9999px",document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove()}function O1({defaultPath:n="",recentPaths:r=[],busy:s=!1,onConnect:o}){const[d,v]=ce.useState(n);ce.useEffect(()=>{n&&v(n)},[n]);async function f(a){a.preventDefault(),await o(d)}return N.jsx("form",{className:"repo-connect",onSubmit:f,children:N.jsxs("div",{className:r.length>0?"inline-form has-recent-paths":"inline-form",children:[N.jsx("input",{"aria-label":"Repository path",id:"repo-path",value:d,onChange:a=>v(a.target.value),placeholder:"/path/to/repo"}),r.length>0?N.jsxs("select",{"aria-label":"Recent repositories",className:"repo-recent-select",value:"",onChange:a=>{a.target.value&&v(a.target.value)},children:[N.jsx("option",{value:"",children:"Recent"}),r.map(a=>N.jsx("option",{value:a,children:a},a))]}):null,N.jsx("button",{type:"submit",disabled:s||!d.trim(),children:"Connect"})]})})}function B1({tasks:n,activeTaskSlug:r,onSelect:s}){return N.jsx("nav",{className:"task-nav","aria-label":"Tasks",children:n.map(o=>N.jsxs("button",{className:o.taskSlug===r?"task-nav-item is-active":"task-nav-item",type:"button",onClick:()=>s(o.taskSlug),children:[N.jsx("span",{children:o.title||o.taskSlug}),N.jsx(Gr,{status:o.status})]},o.taskSlug))})}function N1({project:n,recentRepositoryPaths:r,tasks:s,activeTaskSlug:o,messages:d,orchestration:v,events:f,roundState:a,codexReview:c,harnessStatus:h,harnessBootstrapStatus:p,harnessApplyResult:u,gatewayStatus:S,gatewayQrLogin:C,gatewayQrCheck:A,busy:x,onConnect:b,onRefreshConnectedRepository:_,onPullConnectedRepository:g,onRefreshHarness:y,onApplyHarness:k,onStartHarnessBootstrap:M,onRefreshGateway:D,onGatewayEnabledChange:T,onGatewayTranslationChange:E,onStartGatewayQrLogin:R,onResetGatewayBinding:B,onCodexGateEnabledChange:H,onCreateTask:P,onSelectTask:F,themeMode:$,onThemeModeChange:W,flowPauseAlerts:G,onFlowPauseAlertsChange:X,permissionRequestMode:te,onPermissionRequestModeChange:z,launchTemplate:O,canSaveLaunchTemplate:j,canOneClickStart:V,onSaveLaunchTemplate:I,onOneClickStart:ne,onTryFlowPauseAlert:_e,onMarkAllMessagesDone:me,onDeleteMessageHistory:Q}){const[q,J]=ce.useState(""),[Y,he]=ce.useState(!0),[de,be]=ce.useState(!1),[Pe,Fe]=ce.useState(!1),[We,De]=ce.useState(()=>o?null:"repository-path"),Rt=ju(d),ot=q.trim(),Tt=s.find(ae=>ae.taskSlug===o)??null;ce.useEffect(()=>{De(ae=>o&&ae==="repository-path"?null:!o&&ae===null?"repository-path":ae)},[o]);function nt(ae,tt){De(tt?ae:null)}async function Mt(ae){ae.preventDefault(),await P({taskSlug:ot,createWorktree:Y}),J(""),he(!0)}return N.jsxs("div",{className:"project-dashboard",children:[N.jsx("header",{className:"brand-header",children:N.jsx("strong",{children:"VibeCodingMaster"})}),N.jsx(Ri,{title:"Repository Path",open:We==="repository-path",onOpenChange:ae=>nt("repository-path",ae),children:N.jsx(O1,{defaultPath:(n==null?void 0:n.repoRoot)??"",recentPaths:r,busy:x,onConnect:b})}),n?N.jsx(Ri,{title:"Connected Repository",open:We==="connected-repository",onOpenChange:ae=>{nt("connected-repository",ae),ae&&_()},children:N.jsx(U1,{activeTask:Tt,busy:x,project:n,onPull:g})}):null,N.jsx(Ri,{title:"Settings",open:We==="settings",onOpenChange:ae=>nt("settings",ae),children:N.jsxs("div",{className:"sidebar-settings",children:[N.jsxs("button",{"aria-label":`Theme mode: ${hm($)}`,className:"settings-toggle theme-mode-toggle",disabled:x,title:"Cycle theme: system, light, dark",type:"button",onClick:()=>W(V1($)),children:[N.jsx("span",{children:"Theme"}),N.jsx("span",{children:hm($)})]}),N.jsxs("button",{"aria-pressed":!(S!=null&&S.enabled)&&G,className:!(S!=null&&S.enabled)&&G?"settings-toggle is-active":"settings-toggle",disabled:x||(S==null?void 0:S.enabled),title:S!=null&&S.enabled?"Disabled while Gateway is on":void 0,type:"button",onClick:()=>X(!G),children:[N.jsx("span",{children:"Flow pause alert"}),N.jsx("span",{children:S!=null&&S.enabled?"off":G?"on":"off"})]}),N.jsxs("button",{className:"settings-toggle",disabled:x||(S==null?void 0:S.enabled),title:S!=null&&S.enabled?"Disabled while Gateway is on":void 0,type:"button",onClick:_e,children:[N.jsx("span",{children:"Try alert"}),N.jsx("span",{children:"test"})]}),N.jsxs("label",{className:"settings-select-row",children:[N.jsx("span",{children:"Permission requests"}),N.jsxs("select",{value:te,disabled:x,onChange:ae=>z(ae.target.value),children:[N.jsx("option",{value:"off",children:"off"}),N.jsx("option",{value:"allowAll",children:"allow all"})]})]}),N.jsxs("button",{className:"settings-toggle",disabled:x||!j,title:"Save the current four role launch settings",type:"button",onClick:I,children:[N.jsx("span",{children:"Save launch template"}),N.jsx("span",{children:j?"ready":"needs 4 sessions"})]}),V?N.jsxs("button",{className:"settings-toggle is-active",disabled:x,title:j1(O),type:"button",onClick:ne,children:[N.jsx("span",{children:"One-click start"}),N.jsx("span",{children:dg(O)})]}):null,o?N.jsxs(N.Fragment,{children:[N.jsxs("button",{type:"button",onClick:()=>be(!0),children:[N.jsx("span",{children:"Messages"}),N.jsxs("span",{className:"muted",children:[Rt.total," total"]})]}),N.jsxs("button",{type:"button",onClick:()=>Fe(!0),children:[N.jsx("span",{children:"Events"}),N.jsxs("span",{className:"muted",children:[f.length," total"]})]})]}):null]})}),n&&o?N.jsx(Ri,{title:"Codex Review Gates",open:We==="codex-review-gates",onOpenChange:ae=>nt("codex-review-gates",ae),children:N.jsx(z1,{busy:x,state:c,onGateEnabledChange:H})}):null,N.jsx(Ri,{title:"Gateway",open:We==="gateway",onOpenChange:ae=>{nt("gateway",ae),ae&&D()},children:N.jsx(I1,{busy:x,qrCheck:A,qrLogin:C,status:S,onEnabledChange:T,onResetBinding:B,onStartQrLogin:R,onTranslationChange:E})}),n?N.jsx(Ri,{title:"VCM Harness",open:We==="vcm-harness",onOpenChange:ae=>nt("vcm-harness",ae),children:N.jsx(k1,{status:h,bootstrapStatus:p,applyResult:u,busy:x,onRefresh:y,onApply:k,onStartBootstrap:M})}):null,n?N.jsx(Ri,{title:"New Task",open:We==="new-task",onOpenChange:ae=>nt("new-task",ae),children:N.jsx("div",{className:"task-create",children:N.jsxs("form",{onSubmit:Mt,children:[N.jsx("input",{value:q,onChange:ae=>J(ae.target.value),placeholder:"task name"}),N.jsxs("label",{className:"task-create-option",children:[N.jsx("input",{type:"checkbox",checked:Y,onChange:ae=>he(ae.target.checked)}),N.jsx("span",{children:"Create worktree and branch"})]}),Y?N.jsxs("div",{className:"task-create-preview",children:[N.jsxs("small",{children:["branch: ",ot?`feature/${ot}`:"feature/<task>"]}),N.jsxs("small",{children:["worktree: ",ot?`.claude/worktrees/${ot}`:".claude/worktrees/<task>"]})]}):N.jsx("div",{className:"task-create-preview",children:N.jsx("small",{children:"uses current repository path and current branch"})}),N.jsx("button",{type:"submit",disabled:x||!ot,children:"Create"})]})})}):null,s.length>0?N.jsx(Ri,{title:"Tasks",open:We==="tasks",onOpenChange:ae=>nt("tasks",ae),children:N.jsx(B1,{tasks:s,activeTaskSlug:o,onSelect:F})}):null,n&&Tt?N.jsx(q1,{task:Tt,roundState:a}):null,de?N.jsx($1,{busy:x,messages:d,orchestration:v,onClose:()=>be(!1),onMarkAllDone:()=>{o&&me(o)},onDeleteMessageHistory:()=>{o&&Q(o)}}):null,Pe?N.jsx(G1,{events:f,onClose:()=>Fe(!1)}):null]})}function dg(n){return[n.autoOrchestration?"auto":"manual",n.translationEnabled?"tx":"no tx"].join(" + ")}function j1(n){const r=Object.entries(n.roles).map(([s,o])=>`${s}: ${o.permissionMode} / ${o.model} / ${o.effort}`).join("; ");return`Launch template: ${dg(n)}; ${r}`}function z1({busy:n,onGateEnabledChange:r,state:s}){return N.jsx("div",{className:"sidebar-settings",children:f1.map(o=>{const d=s==null?void 0:s.gates[o],v=!!(d!=null&&d.required);return N.jsxs("button",{"aria-pressed":v,className:v?"settings-toggle is-active":"settings-toggle",disabled:n||!s,title:d!=null&&d.status?`status: ${d.status}`:void 0,type:"button",onClick:()=>r(o,!v),children:[N.jsx("span",{children:H1(o)}),N.jsx("span",{children:v?"on":"off"})]},o)})})}function H1(n){switch(n){case"architecture-plan":return"Architecture plan";case"validation-adequacy":return"Validation adequacy";case"final-diff":return"Final diff"}return n}function I1({busy:n,onEnabledChange:r,onResetBinding:s,onStartQrLogin:o,onTranslationChange:d,qrCheck:v,qrLogin:f,status:a}){const c=!!(a!=null&&a.binding.tokenConfigured),h=!!(a!=null&&a.binding.tokenConfigured);return N.jsxs("div",{className:"gateway-panel",children:[N.jsxs("div",{className:"gateway-actions",children:[N.jsxs("button",{"aria-pressed":!!(a!=null&&a.enabled),className:a!=null&&a.enabled?"settings-toggle is-active":"settings-toggle",disabled:n||!a||!a.enabled&&!c,title:c?"Enable or disable PM messages and task-changing Gateway commands":"Scan and confirm iLink login first",type:"button",onClick:()=>a?r(!a.enabled):void 0,children:[N.jsx("span",{children:"Gateway"}),N.jsx("span",{children:a!=null&&a.enabled?"on":"off"})]}),N.jsxs("button",{"aria-pressed":!!(a!=null&&a.translationEnabled),className:a!=null&&a.translationEnabled?"settings-toggle is-active":"settings-toggle",disabled:n||!a,type:"button",onClick:()=>a?d(!a.translationEnabled):void 0,children:[N.jsx("span",{children:"Translation"}),N.jsx("span",{children:a!=null&&a.translationEnabled?"on":"off"})]}),h?N.jsx("button",{className:"danger-button",type:"button",disabled:n,onClick:s,children:"Reset Binding"}):N.jsx("button",{type:"button",disabled:n,onClick:o,children:"Start QR Login"})]}),f?N.jsx("p",{className:"muted",children:"QR login started. Use the login dialog to confirm binding."}):null,v?N.jsxs("p",{className:"muted",children:["QR status: ",v.status,v.message?` · ${v.message}`:""]}):null]})}function U1({activeTask:n,busy:r,onPull:s,project:o}){const d=!!(n&&!n.worktreePath&&n.cleanupStatus!=="cleaned"),v=d?`Inline task "${n==null?void 0:n.taskSlug}" uses the base repository.`:o.pullDisabledReason,f=!!(o.canPull&&!d);return N.jsxs("div",{className:"project-summary",children:[N.jsxs("dl",{children:[N.jsxs("div",{children:[N.jsx("dt",{children:"Base path"}),N.jsx("dd",{children:o.repoRoot})]}),N.jsxs("div",{children:[N.jsx("dt",{children:"Branch"}),N.jsx("dd",{children:P1(o)})]}),N.jsxs("div",{children:[N.jsx("dt",{children:"Remote"}),N.jsx("dd",{children:o.upstreamBranch??"no upstream"})]}),N.jsxs("div",{children:[N.jsx("dt",{children:"Status"}),N.jsx("dd",{children:F1(o)})]}),N.jsxs("div",{children:[N.jsx("dt",{children:"Commit"}),N.jsx("dd",{children:o.shortHeadCommit??o.headCommit??"unknown"})]}),N.jsxs("div",{children:[N.jsx("dt",{children:"Working tree"}),N.jsx("dd",{children:o.isDirty?"uncommitted changes":"clean"})]})]}),N.jsxs("div",{className:"connected-repo-actions",children:[N.jsx("button",{type:"button",disabled:r||!f,title:v??"Pull latest changes with git pull --ff-only",onClick:()=>void s(),children:"Pull"}),N.jsx("span",{className:"muted",children:o.checkedAt?`checked ${Su(o.checkedAt)}`:"status not refreshed"})]}),v?N.jsx("p",{className:"muted",children:v}):null,o.warnings.length>0?N.jsx("ul",{className:"warnings",children:o.warnings.map(a=>N.jsx("li",{children:a},a))}):null]})}function P1(n){return n.branch||"unknown"}function F1(n){if(!n.upstreamBranch)return"no upstream";const r=n.ahead??0,s=n.behind??0;return r===0&&s===0?"up to date":r>0&&s>0?`ahead ${r}, behind ${s}`:r>0?`ahead ${r}`:`behind ${s}`}function q1({roundState:n,task:r}){var p;const[s,o]=ce.useState(()=>Date.now()),d=!!(n!=null&&n.startedAt&&n.status==="running"),v=um(r.createdAt,s),f=cm(n,(n==null?void 0:n.totalCcActiveMs)??0,s),a=d&&n?cm(n,n.currentRoundCcActiveMs,s):0,c=d&&(n!=null&&n.startedAt)?um(n.startedAt,s):0,h=((p=r.title)==null?void 0:p.trim())||r.taskSlug;return ce.useEffect(()=>{const u=window.setInterval(()=>o(Date.now()),1e3);return()=>window.clearInterval(u)},[]),N.jsxs("section",{className:"task-status-dock","aria-label":"VCM Session status",children:[N.jsxs("div",{className:"task-status-dock-title",children:[N.jsx("strong",{title:h,children:h}),N.jsx("span",{className:`status-badge status-${r.status}`,children:r.status})]}),N.jsxs("dl",{className:"task-status-stats",children:[N.jsxs("div",{children:[N.jsx("dt",{children:"Session start"}),N.jsx("dd",{children:Su(r.createdAt)})]}),N.jsxs("div",{children:[N.jsx("dt",{children:"Session total"}),N.jsx("dd",{children:ya(v)})]}),N.jsxs("div",{children:[N.jsx("dt",{children:"Rounds"}),N.jsx("dd",{children:(n==null?void 0:n.totalRoundCount)??0})]}),N.jsxs("div",{children:[N.jsx("dt",{children:"Role runtime"}),N.jsx("dd",{children:ya(f)})]})]}),d&&n?N.jsxs("div",{className:"current-round-status",children:[N.jsxs("div",{className:"current-round-title",children:[N.jsx("span",{children:"Current Round"}),N.jsx("span",{className:`status-badge status-${n.status}`,children:n.status})]}),N.jsxs("dl",{className:"task-status-stats",children:[N.jsxs("div",{children:[N.jsx("dt",{children:"Started"}),N.jsx("dd",{children:Su(n.startedAt)})]}),N.jsxs("div",{children:[N.jsx("dt",{children:"Total"}),N.jsx("dd",{children:ya(c)})]}),N.jsxs("div",{children:[N.jsx("dt",{children:"Role runtime"}),N.jsx("dd",{children:ya(a)})]}),N.jsxs("div",{children:[N.jsx("dt",{children:"Turn count"}),N.jsx("dd",{children:n.turnCount})]})]})]}):null]})}function cm(n,r,s){if(!(n!=null&&n.activeTurnStartedAt)||n.status!=="running")return r;const o=Date.parse(n.updatedAt);return Number.isFinite(o)?r+Math.max(0,s-o):r}function um(n,r){const s=Date.parse(n);return Number.isFinite(s)?Math.max(0,r-s):0}function Su(n){if(!n)return"-";const r=new Date(n);return Number.isNaN(r.getTime())?"-":new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(r)}function ya(n){const r=Math.max(0,Math.floor(n/1e3)),s=Math.floor(r/3600),o=Math.floor(r%3600/60),d=r%60;return s>0?o>0?`${s}h ${o}m`:`${s}h`:o>0?d>0?`${o}m ${d}s`:`${o}m`:`${d}s`}function V1(n){return n==="system"?"light":n==="light"?"dark":"system"}function hm(n){return n==="system"?"System":n==="light"?"Light":"Dark"}function G1({events:n,onClose:r}){return N.jsx("div",{className:"modal-backdrop",children:N.jsxs("section",{className:"event-modal",role:"dialog","aria-modal":"true","aria-label":"Events",children:[N.jsxs("header",{children:[N.jsxs("div",{children:[N.jsx("h2",{children:"Events"}),N.jsxs("p",{className:"muted",children:[n.length," total"]})]}),N.jsx("button",{type:"button",onClick:r,children:"Close"})]}),N.jsx(d1,{events:n,maxEvents:null,showHeader:!1})]})})}function $1({busy:n,messages:r,orchestration:s,onClose:o,onMarkAllDone:d,onDeleteMessageHistory:v}){const f=ju(r);function a(){window.confirm(["Clear all pending route-file messages?","","Use this only after you manually copied or handled stuck route-file messages.","VCM will clear non-empty handoff message files so Stop-hook orchestration can continue."].join(`
|
|
61
61
|
`))&&d()}function c(){window.confirm([`Delete ${f.total} message histor${f.total===1?"y item":"y items"}?`,"","This removes message history from the Messages panel.","Pending route-file messages are not touched."].join(`
|
|
62
|
-
`))&&v()}return B.jsx("div",{className:"modal-backdrop",children:B.jsxs("section",{className:"message-modal",role:"dialog","aria-modal":"true","aria-label":"Messages",children:[B.jsxs("header",{children:[B.jsxs("div",{children:[B.jsx("h2",{children:"Messages"}),B.jsxs("p",{className:"muted",children:[f.total," total / ",f.accepted," accepted",s?` · ${s.mode}`:""]})]}),B.jsxs("div",{className:"modal-actions",children:[B.jsx("button",{type:"button",disabled:n,onClick:a,children:"Mark All Done"}),B.jsx("button",{type:"button",disabled:n||f.total===0,onClick:c,children:"Delete All"}),B.jsx("button",{type:"button",onClick:o,children:"Close"})]})]}),B.jsx(T1,{busy:n,maxMessages:null,messages:r,orchestration:s,showControls:!1,showHeader:!1})]})})}function Bi({children:n,onOpenChange:r,open:s,title:o}){return B.jsxs("section",{className:"sidebar-section",children:[B.jsxs("button",{"aria-expanded":s,className:"sidebar-section-toggle",type:"button",onClick:()=>{r==null||r(!s)},children:[B.jsx("span",{children:o}),B.jsx("span",{"aria-hidden":"true",className:"sidebar-section-chevron"})]}),s?B.jsx("div",{className:"sidebar-section-content",children:n}):null]})}function dg(n,r){return n.find(s=>s.role===r)}function $1({activeRole:n,roles:r=Bu,sessions:s,onSelect:o}){return B.jsx("div",{className:"role-tabs",role:"tablist","aria-label":"Role sessions",children:r.map(d=>{const v=dg(s,d.name),f=(v==null?void 0:v.status)==="running"?v.activityStatus??"idle":(v==null?void 0:v.status)??"not_started";return B.jsxs("button",{className:d.name===n?"role-tab is-active":"role-tab",type:"button",role:"tab","aria-selected":d.name===n,onClick:()=>o(d.name),children:[B.jsx("span",{children:d.label}),B.jsx(Yr,{status:f})]},d.name)})})}const pg=[{value:"default",label:"Default",description:"Account default"},{value:"best",label:"Best",description:"Fable 5 or latest Opus"},{value:"fable",label:"Fable 5",description:"1M context, v2.1.170+"},{value:"opus",label:"Opus",description:"latest Opus"},{value:"opus[1m]",label:"Opus 1M",description:"Force 1M context"},{value:"claude-opus-4-8",label:"Opus 4.8",description:"Current Opus"},{value:"claude-opus-4-8[1m]",label:"Opus 4.8 1M",description:"Opus 4.8 + 1M context"}],mg=[{value:"gpt-5.5",label:"GPT-5.5",description:"Strong Codex reviewer default"},{value:"default",label:"Default",description:"Codex account default"}],gg=[{value:"default",label:"Default",description:"CLI or project default"},{value:"low",label:"Low",description:"Fastest reasoning"},{value:"medium",label:"Medium",description:"Balanced reasoning"},{value:"high",label:"High",description:"Deeper reasoning"},{value:"xhigh",label:"XHigh",description:"Extra high reasoning"},{value:"max",label:"Max",description:"Maximum reasoning"}],_g=[...gg,{value:"ultracode",label:"Ultracode",description:"Claude Code dynamic workflows with xhigh reasoning"}],Y1=_g;function W1({role:n,session:r,permissionMode:s,model:o,effort:d,busy:v=!1,onPermissionModeChange:f,onModelChange:a,onEffortChange:c,onStart:h,onResume:p,onStop:u,onRestart:S}){const w=(r==null?void 0:r.status)==="running",A=!!(r!=null&&r.claudeSessionId&&!w),x=!w&&!(r!=null&&r.claudeSessionId),b=Nu(n),_=!!(r&&r.permissionMode!==s),g=(r==null?void 0:r.model)??"default",y=!!(r&&g!==o),k=(r==null?void 0:r.effort)??"default",M=!!(r&&k!==d),D=b?mg:pg,T=b?gg:_g;return B.jsxs("div",{className:"session-controls",children:[b?null:B.jsxs("label",{className:"session-option-field permission-mode-field",children:[B.jsxs("span",{children:["Permission",B.jsx("small",{children:r?`current: ${r.permissionMode}${_?" / next launch":""}`:"applies on start"})]}),B.jsxs("select",{value:s,onChange:E=>f(E.target.value),children:[B.jsx("option",{value:"default",children:"默认"}),B.jsx("option",{value:"bypassPermissions",children:"bypassPermissions"})]})]}),B.jsxs("label",{className:"session-option-field model-field",children:[B.jsxs("span",{children:["Model",B.jsx("small",{children:r?`current: ${K1(g,b)}${y?" / next launch":""}`:"applies on start"})]}),B.jsx("select",{value:o,onChange:E=>a(E.target.value),children:D.map(E=>B.jsx("option",{value:E.value,children:E.label},E.value))})]}),B.jsxs("label",{className:"session-option-field effort-field",children:[B.jsxs("span",{children:["Effort",B.jsx("small",{children:r?`current: ${X1(k)}${M?" / next launch":""}`:"applies on start"})]}),B.jsx("select",{value:d,onChange:E=>c(E.target.value),children:T.map(E=>B.jsx("option",{value:E.value,children:E.label},E.value))})]}),B.jsxs("div",{className:"session-toolbar",children:[B.jsx("button",{type:"button",disabled:v||!x,onClick:h,children:"Start"}),B.jsx("button",{type:"button",disabled:v||!A,onClick:p,children:"Resume"}),B.jsx("button",{type:"button",disabled:v||!r,onClick:S,children:"Restart"}),B.jsx("button",{type:"button",disabled:v||!r,onClick:u,children:"Stop"})]})]})}function K1(n,r){var s,o;return r?((s=mg.find(d=>d.value===n))==null?void 0:s.label)??n:((o=pg.find(d=>d.value===n))==null?void 0:o.label)??n}function X1(n){var r;return((r=Y1.find(s=>s.value===n))==null?void 0:r.label)??n}function Q1(n,r){const s={};return(n[n.length-1]===""?[...n,""]:n).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const Z1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,J1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ey={};function fm(n,r){return(ey.jsx?J1:Z1).test(n)}const ty=/[ \t\n\f\r]/g;function ny(n){return typeof n=="object"?n.type==="text"?dm(n.value):!1:dm(n)}function dm(n){return n.replace(ty,"")===""}class rl{constructor(r,s,o){this.normal=s,this.property=r,o&&(this.space=o)}}rl.prototype.normal={};rl.prototype.property={};rl.prototype.space=void 0;function vg(n,r){const s={},o={};for(const d of n)Object.assign(s,d.property),Object.assign(o,d.normal);return new rl(s,o,r)}function bu(n){return n.toLowerCase()}class sn{constructor(r,s){this.attribute=s,this.property=r}}sn.prototype.attribute="";sn.prototype.booleanish=!1;sn.prototype.boolean=!1;sn.prototype.commaOrSpaceSeparated=!1;sn.prototype.commaSeparated=!1;sn.prototype.defined=!1;sn.prototype.mustUseProperty=!1;sn.prototype.number=!1;sn.prototype.overloadedBoolean=!1;sn.prototype.property="";sn.prototype.spaceSeparated=!1;sn.prototype.space=void 0;let iy=0;const Ue=rr(),Mt=rr(),Cu=rr(),ye=rr(),pt=rr(),Kr=rr(),mn=rr();function rr(){return 2**++iy}const wu=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ue,booleanish:Mt,commaOrSpaceSeparated:mn,commaSeparated:Kr,number:ye,overloadedBoolean:Cu,spaceSeparated:pt},Symbol.toStringTag,{value:"Module"})),iu=Object.keys(wu);class zu extends sn{constructor(r,s,o,d){let v=-1;if(super(r,s),pm(this,"space",d),typeof o=="number")for(;++v<iu.length;){const f=iu[v];pm(this,iu[v],(o&wu[f])===wu[f])}}}zu.prototype.defined=!0;function pm(n,r,s){s&&(n[r]=s)}function Zr(n){const r={},s={};for(const[o,d]of Object.entries(n.properties)){const v=new zu(o,n.transform(n.attributes||{},o),d,n.space);n.mustUseProperty&&n.mustUseProperty.includes(o)&&(v.mustUseProperty=!0),r[o]=v,s[bu(o)]=o,s[bu(v.attribute)]=o}return new rl(r,s,n.space)}const yg=Zr({properties:{ariaActiveDescendant:null,ariaAtomic:Mt,ariaAutoComplete:null,ariaBusy:Mt,ariaChecked:Mt,ariaColCount:ye,ariaColIndex:ye,ariaColSpan:ye,ariaControls:pt,ariaCurrent:null,ariaDescribedBy:pt,ariaDetails:null,ariaDisabled:Mt,ariaDropEffect:pt,ariaErrorMessage:null,ariaExpanded:Mt,ariaFlowTo:pt,ariaGrabbed:Mt,ariaHasPopup:null,ariaHidden:Mt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:pt,ariaLevel:ye,ariaLive:null,ariaModal:Mt,ariaMultiLine:Mt,ariaMultiSelectable:Mt,ariaOrientation:null,ariaOwns:pt,ariaPlaceholder:null,ariaPosInSet:ye,ariaPressed:Mt,ariaReadOnly:Mt,ariaRelevant:null,ariaRequired:Mt,ariaRoleDescription:pt,ariaRowCount:ye,ariaRowIndex:ye,ariaRowSpan:ye,ariaSelected:Mt,ariaSetSize:ye,ariaSort:null,ariaValueMax:ye,ariaValueMin:ye,ariaValueNow:ye,ariaValueText:null,role:null},transform(n,r){return r==="role"?r:"aria-"+r.slice(4).toLowerCase()}});function Sg(n,r){return r in n?n[r]:r}function bg(n,r){return Sg(n,r.toLowerCase())}const ry=Zr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Kr,acceptCharset:pt,accessKey:pt,action:null,allow:null,allowFullScreen:Ue,allowPaymentRequest:Ue,allowUserMedia:Ue,alt:null,as:null,async:Ue,autoCapitalize:null,autoComplete:pt,autoFocus:Ue,autoPlay:Ue,blocking:pt,capture:null,charSet:null,checked:Ue,cite:null,className:pt,cols:ye,colSpan:null,content:null,contentEditable:Mt,controls:Ue,controlsList:pt,coords:ye|Kr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ue,defer:Ue,dir:null,dirName:null,disabled:Ue,download:Cu,draggable:Mt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ue,formTarget:null,headers:pt,height:ye,hidden:Cu,high:ye,href:null,hrefLang:null,htmlFor:pt,httpEquiv:pt,id:null,imageSizes:null,imageSrcSet:null,inert:Ue,inputMode:null,integrity:null,is:null,isMap:Ue,itemId:null,itemProp:pt,itemRef:pt,itemScope:Ue,itemType:pt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ue,low:ye,manifest:null,max:null,maxLength:ye,media:null,method:null,min:null,minLength:ye,multiple:Ue,muted:Ue,name:null,nonce:null,noModule:Ue,noValidate:Ue,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:Ue,optimum:ye,pattern:null,ping:pt,placeholder:null,playsInline:Ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ue,referrerPolicy:null,rel:pt,required:Ue,reversed:Ue,rows:ye,rowSpan:ye,sandbox:pt,scope:null,scoped:Ue,seamless:Ue,selected:Ue,shadowRootClonable:Ue,shadowRootDelegatesFocus:Ue,shadowRootMode:null,shape:null,size:ye,sizes:null,slot:null,span:ye,spellCheck:Mt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ye,step:null,style:null,tabIndex:ye,target:null,title:null,translate:null,type:null,typeMustMatch:Ue,useMap:null,value:Mt,width:ye,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:pt,axis:null,background:null,bgColor:null,border:ye,borderColor:null,bottomMargin:ye,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ue,declare:Ue,event:null,face:null,frame:null,frameBorder:null,hSpace:ye,leftMargin:ye,link:null,longDesc:null,lowSrc:null,marginHeight:ye,marginWidth:ye,noResize:Ue,noHref:Ue,noShade:Ue,noWrap:Ue,object:null,profile:null,prompt:null,rev:null,rightMargin:ye,rules:null,scheme:null,scrolling:Mt,standby:null,summary:null,text:null,topMargin:ye,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ye,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ue,disableRemotePlayback:Ue,prefix:null,property:null,results:ye,security:null,unselectable:null},space:"html",transform:bg}),sy=Zr({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:mn,accentHeight:ye,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ye,amplitude:ye,arabicForm:null,ascent:ye,attributeName:null,attributeType:null,azimuth:ye,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ye,by:null,calcMode:null,capHeight:ye,className:pt,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:ye,diffuseConstant:ye,direction:null,display:null,dur:null,divisor:ye,dominantBaseline:null,download:Ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:ye,enableBackground:null,end:null,event:null,exponent:ye,externalResourcesRequired:null,fill:null,fillOpacity:ye,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:Kr,g2:Kr,glyphName:Kr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ye,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ye,horizOriginX:ye,horizOriginY:ye,id:null,ideographic:ye,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ye,k:ye,k1:ye,k2:ye,k3:ye,k4:ye,kernelMatrix:mn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ye,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:ye,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:ye,overlineThickness:ye,paintOrder:null,panose1:null,path:null,pathLength:ye,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:pt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ye,pointsAtY:ye,pointsAtZ:ye,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:mn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:mn,rev:mn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:mn,requiredFeatures:mn,requiredFonts:mn,requiredFormats:mn,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:ye,specularExponent:ye,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ye,strikethroughThickness:ye,string:null,stroke:null,strokeDashArray:mn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ye,strokeOpacity:ye,strokeWidth:null,style:null,surfaceScale:ye,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:mn,tabIndex:ye,tableValues:null,target:null,targetX:ye,targetY:ye,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:mn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ye,underlineThickness:ye,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ye,values:null,vAlphabetic:ye,vMathematical:ye,vectorEffect:null,vHanging:ye,vIdeographic:ye,version:null,vertAdvY:ye,vertOriginX:ye,vertOriginY:ye,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ye,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Sg}),Cg=Zr({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(n,r){return"xlink:"+r.slice(5).toLowerCase()}}),wg=Zr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:bg}),xg=Zr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,r){return"xml:"+r.slice(3).toLowerCase()}}),ly={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"},ay=/[A-Z]/g,mm=/-[a-z]/g,oy=/^data[-\w.:]+$/i;function cy(n,r){const s=bu(r);let o=r,d=sn;if(s in n.normal)return n.property[n.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&oy.test(r)){if(r.charAt(4)==="-"){const v=r.slice(5).replace(mm,hy);o="data"+v.charAt(0).toUpperCase()+v.slice(1)}else{const v=r.slice(4);if(!mm.test(v)){let f=v.replace(ay,uy);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}d=zu}return new d(o,r)}function uy(n){return"-"+n.toLowerCase()}function hy(n){return n.charAt(1).toUpperCase()}const fy=vg([yg,ry,Cg,wg,xg],"html"),Hu=vg([yg,sy,Cg,wg,xg],"svg");function dy(n){return n.join(" ").trim()}var Vr={},ru,gm;function py(){if(gm)return ru;gm=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,s=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,d=/^:\s*/,v=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,a=/^\s+|\s+$/g,c=`
|
|
63
|
-
`,h="/",p="*",u="",S="comment",w="declaration";function A(b,_){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];_=_||{};var g=1,y=1;function k($){var K=$.match(r);K&&(g+=K.length);var G=$.lastIndexOf(c);y=~G?$.length-G:y+$.length}function M(){var $={line:g,column:y};return function(K){return K.position=new D($),R(),K}}function D($){this.start=$,this.end={line:g,column:y},this.source=_.source}D.prototype.content=b;function T($){var K=new Error(_.source+":"+g+":"+y+": "+$);if(K.reason=$,K.filename=_.source,K.line=g,K.column=y,K.source=b,!_.silent)throw K}function E($){var K=$.exec(b);if(K){var G=K[0];return k(G),b=b.slice(G.length),K}}function R(){E(s)}function N($){var K;for($=$||[];K=z();)K!==!1&&$.push(K);return $}function z(){var $=M();if(!(h!=b.charAt(0)||p!=b.charAt(1))){for(var K=2;u!=b.charAt(K)&&(p!=b.charAt(K)||h!=b.charAt(K+1));)++K;if(K+=2,u===b.charAt(K-1))return T("End of comment missing");var G=b.slice(2,K-2);return y+=2,k(G),b=b.slice(K),y+=2,$({type:S,comment:G})}}function F(){var $=M(),K=E(o);if(K){if(z(),!E(d))return T("property missing ':'");var G=E(v),X=$({type:w,property:x(K[0].replace(n,u)),value:G?x(G[0].replace(n,u)):u});return E(f),X}}function P(){var $=[];N($);for(var K;K=F();)K!==!1&&($.push(K),N($));return $}return R(),P()}function x(b){return b?b.replace(a,u):u}return ru=A,ru}var _m;function my(){if(_m)return Vr;_m=1;var n=Vr&&Vr.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.default=s;const r=n(py());function s(o,d){let v=null;if(!o||typeof o!="string")return v;const f=(0,r.default)(o),a=typeof d=="function";return f.forEach(c=>{if(c.type!=="declaration")return;const{property:h,value:p}=c;a?d(h,p,c):p&&(v=v||{},v[h]=p)}),v}return Vr}var Ys={},vm;function gy(){if(vm)return Ys;vm=1,Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,s=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,d=/^-(ms)-/,v=function(h){return!h||s.test(h)||n.test(h)},f=function(h,p){return p.toUpperCase()},a=function(h,p){return"".concat(p,"-")},c=function(h,p){return p===void 0&&(p={}),v(h)?h:(h=h.toLowerCase(),p.reactCompat?h=h.replace(d,a):h=h.replace(o,a),h.replace(r,f))};return Ys.camelCase=c,Ys}var Ws,ym;function _y(){if(ym)return Ws;ym=1;var n=Ws&&Ws.__importDefault||function(d){return d&&d.__esModule?d:{default:d}},r=n(my()),s=gy();function o(d,v){var f={};return!d||typeof d!="string"||(0,r.default)(d,function(a,c){a&&c&&(f[(0,s.camelCase)(a,v)]=c)}),f}return o.default=o,Ws=o,Ws}var vy=_y();const yy=sg(vy),Eg=kg("end"),Iu=kg("start");function kg(n){return r;function r(s){const o=s&&s.position&&s.position[n]||{};if(typeof o.line=="number"&&o.line>0&&typeof o.column=="number"&&o.column>0)return{line:o.line,column:o.column,offset:typeof o.offset=="number"&&o.offset>-1?o.offset:void 0}}}function Sy(n){const r=Iu(n),s=Eg(n);if(r&&s)return{start:r,end:s}}function Zs(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?Sm(n.position):"start"in n||"end"in n?Sm(n):"line"in n||"column"in n?xu(n):""}function xu(n){return bm(n&&n.line)+":"+bm(n&&n.column)}function Sm(n){return xu(n&&n.start)+"-"+xu(n&&n.end)}function bm(n){return n&&typeof n=="number"?n:1}class $t extends Error{constructor(r,s,o){super(),typeof s=="string"&&(o=s,s=void 0);let d="",v={},f=!1;if(s&&("line"in s&&"column"in s?v={place:s}:"start"in s&&"end"in s?v={place:s}:"type"in s?v={ancestors:[s],place:s.position}:v={...s}),typeof r=="string"?d=r:!v.cause&&r&&(f=!0,d=r.message,v.cause=r),!v.ruleId&&!v.source&&typeof o=="string"){const c=o.indexOf(":");c===-1?v.ruleId=o:(v.source=o.slice(0,c),v.ruleId=o.slice(c+1))}if(!v.place&&v.ancestors&&v.ancestors){const c=v.ancestors[v.ancestors.length-1];c&&(v.place=c.position)}const a=v.place&&"start"in v.place?v.place.start:v.place;this.ancestors=v.ancestors||void 0,this.cause=v.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=d,this.line=a?a.line:void 0,this.name=Zs(v.place)||"1:1",this.place=v.place||void 0,this.reason=this.message,this.ruleId=v.ruleId||void 0,this.source=v.source||void 0,this.stack=f&&v.cause&&typeof v.cause.stack=="string"?v.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}$t.prototype.file="";$t.prototype.name="";$t.prototype.reason="";$t.prototype.message="";$t.prototype.stack="";$t.prototype.column=void 0;$t.prototype.line=void 0;$t.prototype.ancestors=void 0;$t.prototype.cause=void 0;$t.prototype.fatal=void 0;$t.prototype.place=void 0;$t.prototype.ruleId=void 0;$t.prototype.source=void 0;const Uu={}.hasOwnProperty,by=new Map,Cy=/[A-Z]/g,wy=new Set(["table","tbody","thead","tfoot","tr"]),xy=new Set(["td","th"]),Ag="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Ey(n,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=r.filePath||void 0;let o;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");o=Oy(s,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");o=Ly(s,r.jsx,r.jsxs)}const d={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:o,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?Hu:fy,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},v=Tg(d,n,void 0);return v&&typeof v!="string"?v:d.create(n,d.Fragment,{children:v||void 0},void 0)}function Tg(n,r,s){if(r.type==="element")return ky(n,r,s);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return Ay(n,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return Dy(n,r,s);if(r.type==="mdxjsEsm")return Ty(n,r);if(r.type==="root")return Ry(n,r,s);if(r.type==="text")return My(n,r)}function ky(n,r,s){const o=n.schema;let d=o;r.tagName.toLowerCase()==="svg"&&o.space==="html"&&(d=Hu,n.schema=d),n.ancestors.push(r);const v=Rg(n,r.tagName,!1),f=By(n,r);let a=Fu(n,r);return wy.has(r.tagName)&&(a=a.filter(function(c){return typeof c=="string"?!ny(c):!0})),Dg(n,f,v,r),Pu(f,a),n.ancestors.pop(),n.schema=o,n.create(r,v,f,s)}function Ay(n,r){if(r.data&&r.data.estree&&n.evaluater){const o=r.data.estree.body[0];return o.type,n.evaluater.evaluateExpression(o.expression)}nl(n,r.position)}function Ty(n,r){if(r.data&&r.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(r.data.estree);nl(n,r.position)}function Dy(n,r,s){const o=n.schema;let d=o;r.name==="svg"&&o.space==="html"&&(d=Hu,n.schema=d),n.ancestors.push(r);const v=r.name===null?n.Fragment:Rg(n,r.name,!0),f=Ny(n,r),a=Fu(n,r);return Dg(n,f,v,r),Pu(f,a),n.ancestors.pop(),n.schema=o,n.create(r,v,f,s)}function Ry(n,r,s){const o={};return Pu(o,Fu(n,r)),n.create(r,n.Fragment,o,s)}function My(n,r){return r.value}function Dg(n,r,s,o){typeof s!="string"&&s!==n.Fragment&&n.passNode&&(r.node=o)}function Pu(n,r){if(r.length>0){const s=r.length>1?r:r[0];s&&(n.children=s)}}function Ly(n,r,s){return o;function o(d,v,f,a){const h=Array.isArray(f.children)?s:r;return a?h(v,f,a):h(v,f)}}function Oy(n,r){return s;function s(o,d,v,f){const a=Array.isArray(v.children),c=Iu(o);return r(d,v,f,a,{columnNumber:c?c.column-1:void 0,fileName:n,lineNumber:c?c.line:void 0},void 0)}}function By(n,r){const s={};let o,d;for(d in r.properties)if(d!=="children"&&Uu.call(r.properties,d)){const v=jy(n,d,r.properties[d]);if(v){const[f,a]=v;n.tableCellAlignToStyle&&f==="align"&&typeof a=="string"&&xy.has(r.tagName)?o=a:s[f]=a}}if(o){const v=s.style||(s.style={});v[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=o}return s}function Ny(n,r){const s={};for(const o of r.attributes)if(o.type==="mdxJsxExpressionAttribute")if(o.data&&o.data.estree&&n.evaluater){const v=o.data.estree.body[0];v.type;const f=v.expression;f.type;const a=f.properties[0];a.type,Object.assign(s,n.evaluater.evaluateExpression(a.argument))}else nl(n,r.position);else{const d=o.name;let v;if(o.value&&typeof o.value=="object")if(o.value.data&&o.value.data.estree&&n.evaluater){const a=o.value.data.estree.body[0];a.type,v=n.evaluater.evaluateExpression(a.expression)}else nl(n,r.position);else v=o.value===null?!0:o.value;s[d]=v}return s}function Fu(n,r){const s=[];let o=-1;const d=n.passKeys?new Map:by;for(;++o<r.children.length;){const v=r.children[o];let f;if(n.passKeys){const c=v.type==="element"?v.tagName:v.type==="mdxJsxFlowElement"||v.type==="mdxJsxTextElement"?v.name:void 0;if(c){const h=d.get(c)||0;f=c+"-"+h,d.set(c,h+1)}}const a=Tg(n,v,f);a!==void 0&&s.push(a)}return s}function jy(n,r,s){const o=cy(n.schema,r);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=o.commaSeparated?Q1(s):dy(s)),o.property==="style"){let d=typeof s=="object"?s:zy(n,String(s));return n.stylePropertyNameCase==="css"&&(d=Hy(d)),["style",d]}return[n.elementAttributeNameCase==="react"&&o.space?ly[o.property]||o.property:o.attribute,s]}}function zy(n,r){try{return yy(r,{reactCompat:!0})}catch(s){if(n.ignoreInvalidStyle)return{};const o=s,d=new $t("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw d.file=n.filePath||void 0,d.url=Ag+"#cannot-parse-style-attribute",d}}function Rg(n,r,s){let o;if(!s)o={type:"Literal",value:r};else if(r.includes(".")){const d=r.split(".");let v=-1,f;for(;++v<d.length;){const a=fm(d[v])?{type:"Identifier",name:d[v]}:{type:"Literal",value:d[v]};f=f?{type:"MemberExpression",object:f,property:a,computed:!!(v&&a.type==="Literal"),optional:!1}:a}o=f}else o=fm(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(o.type==="Literal"){const d=o.value;return Uu.call(n.components,d)?n.components[d]:d}if(n.evaluater)return n.evaluater.evaluateExpression(o);nl(n)}function nl(n,r){const s=new $t("Cannot handle MDX estrees without `createEvaluater`",{ancestors:n.ancestors,place:r,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw s.file=n.filePath||void 0,s.url=Ag+"#cannot-handle-mdx-estrees-without-createevaluater",s}function Hy(n){const r={};let s;for(s in n)Uu.call(n,s)&&(r[Iy(s)]=n[s]);return r}function Iy(n){let r=n.replace(Cy,Uy);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function Uy(n){return"-"+n.toLowerCase()}const su={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"]},Py={};function qu(n,r){const s=Py,o=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,d=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return Mg(n,o,d)}function Mg(n,r,s){if(Fy(n)){if("value"in n)return n.type==="html"&&!s?"":n.value;if(r&&"alt"in n&&n.alt)return n.alt;if("children"in n)return Cm(n.children,r,s)}return Array.isArray(n)?Cm(n,r,s):""}function Cm(n,r,s){const o=[];let d=-1;for(;++d<n.length;)o[d]=Mg(n[d],r,s);return o.join("")}function Fy(n){return!!(n&&typeof n=="object")}const wm=document.createElement("i");function Vu(n){const r="&"+n+";";wm.innerHTML=r;const s=wm.textContent;return s.charCodeAt(s.length-1)===59&&n!=="semi"||s===r?!1:s}function gn(n,r,s,o){const d=n.length;let v=0,f;if(r<0?r=-r>d?0:d+r:r=r>d?d:r,s=s>0?s:0,o.length<1e4)f=Array.from(o),f.unshift(r,s),n.splice(...f);else for(s&&n.splice(r,s);v<o.length;)f=o.slice(v,v+1e4),f.unshift(r,0),n.splice(...f),v+=1e4,r+=1e4}function Dn(n,r){return n.length>0?(gn(n,n.length,0,r),n):r}const xm={}.hasOwnProperty;function Lg(n){const r={};let s=-1;for(;++s<n.length;)qy(r,n[s]);return r}function qy(n,r){let s;for(s in r){const d=(xm.call(n,s)?n[s]:void 0)||(n[s]={}),v=r[s];let f;if(v)for(f in v){xm.call(d,f)||(d[f]=[]);const a=v[f];Vy(d[f],Array.isArray(a)?a:a?[a]:[])}}}function Vy(n,r){let s=-1;const o=[];for(;++s<r.length;)(r[s].add==="after"?n:o).push(r[s]);gn(n,0,0,o)}function Og(n,r){const s=Number.parseInt(n,r);return s<9||s===11||s>13&&s<32||s>126&&s<160||s>55295&&s<57344||s>64975&&s<65008||(s&65535)===65535||(s&65535)===65534||s>1114111?"�":String.fromCodePoint(s)}function Nn(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Kt=Hi(/[A-Za-z]/),Gt=Hi(/[\dA-Za-z]/),Gy=Hi(/[#-'*+\--9=?A-Z^-~]/);function Ta(n){return n!==null&&(n<32||n===127)}const Eu=Hi(/\d/),$y=Hi(/[\dA-Fa-f]/),Yy=Hi(/[!-/:-@[-`{-~]/);function Le(n){return n!==null&&n<-2}function dt(n){return n!==null&&(n<0||n===32)}function $e(n){return n===-2||n===-1||n===32}const La=Hi(new RegExp("\\p{P}|\\p{S}","u")),ir=Hi(/\s/);function Hi(n){return r;function r(s){return s!==null&&s>-1&&n.test(String.fromCharCode(s))}}function Jr(n){const r=[];let s=-1,o=0,d=0;for(;++s<n.length;){const v=n.charCodeAt(s);let f="";if(v===37&&Gt(n.charCodeAt(s+1))&&Gt(n.charCodeAt(s+2)))d=2;else if(v<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(v))||(f=String.fromCharCode(v));else if(v>55295&&v<57344){const a=n.charCodeAt(s+1);v<56320&&a>56319&&a<57344?(f=String.fromCharCode(v,a),d=1):f="�"}else f=String.fromCharCode(v);f&&(r.push(n.slice(o,s),encodeURIComponent(f)),o=s+d+1,f=""),d&&(s+=d,d=0)}return r.join("")+n.slice(o)}function Qe(n,r,s,o){const d=o?o-1:Number.POSITIVE_INFINITY;let v=0;return f;function f(c){return $e(c)?(n.enter(s),a(c)):r(c)}function a(c){return $e(c)&&v++<d?(n.consume(c),a):(n.exit(s),r(c))}}const Wy={tokenize:Ky};function Ky(n){const r=n.attempt(this.parser.constructs.contentInitial,o,d);let s;return r;function o(a){if(a===null){n.consume(a);return}return n.enter("lineEnding"),n.consume(a),n.exit("lineEnding"),Qe(n,r,"linePrefix")}function d(a){return n.enter("paragraph"),v(a)}function v(a){const c=n.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=c),s=c,f(a)}function f(a){if(a===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(a);return}return Le(a)?(n.consume(a),n.exit("chunkText"),v):(n.consume(a),f)}}const Xy={tokenize:Qy},Em={tokenize:Zy};function Qy(n){const r=this,s=[];let o=0,d,v,f;return a;function a(y){if(o<s.length){const k=s[o];return r.containerState=k[1],n.attempt(k[0].continuation,c,h)(y)}return h(y)}function c(y){if(o++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,d&&g();const k=r.events.length;let M=k,D;for(;M--;)if(r.events[M][0]==="exit"&&r.events[M][1].type==="chunkFlow"){D=r.events[M][1].end;break}_(o);let T=k;for(;T<r.events.length;)r.events[T][1].end={...D},T++;return gn(r.events,M+1,0,r.events.slice(k)),r.events.length=T,h(y)}return a(y)}function h(y){if(o===s.length){if(!d)return S(y);if(d.currentConstruct&&d.currentConstruct.concrete)return A(y);r.interrupt=!!(d.currentConstruct&&!d._gfmTableDynamicInterruptHack)}return r.containerState={},n.check(Em,p,u)(y)}function p(y){return d&&g(),_(o),S(y)}function u(y){return r.parser.lazy[r.now().line]=o!==s.length,f=r.now().offset,A(y)}function S(y){return r.containerState={},n.attempt(Em,w,A)(y)}function w(y){return o++,s.push([r.currentConstruct,r.containerState]),S(y)}function A(y){if(y===null){d&&g(),_(0),n.consume(y);return}return d=d||r.parser.flow(r.now()),n.enter("chunkFlow",{_tokenizer:d,contentType:"flow",previous:v}),x(y)}function x(y){if(y===null){b(n.exit("chunkFlow"),!0),_(0),n.consume(y);return}return Le(y)?(n.consume(y),b(n.exit("chunkFlow")),o=0,r.interrupt=void 0,a):(n.consume(y),x)}function b(y,k){const M=r.sliceStream(y);if(k&&M.push(null),y.previous=v,v&&(v.next=y),v=y,d.defineSkip(y.start),d.write(M),r.parser.lazy[y.start.line]){let D=d.events.length;for(;D--;)if(d.events[D][1].start.offset<f&&(!d.events[D][1].end||d.events[D][1].end.offset>f))return;const T=r.events.length;let E=T,R,N;for(;E--;)if(r.events[E][0]==="exit"&&r.events[E][1].type==="chunkFlow"){if(R){N=r.events[E][1].end;break}R=!0}for(_(o),D=T;D<r.events.length;)r.events[D][1].end={...N},D++;gn(r.events,E+1,0,r.events.slice(T)),r.events.length=D}}function _(y){let k=s.length;for(;k-- >y;){const M=s[k];r.containerState=M[1],M[0].exit.call(r,n)}s.length=y}function g(){d.write([null]),v=void 0,d=void 0,r.containerState._closeFlow=void 0}}function Zy(n,r,s){return Qe(n,n.attempt(this.parser.constructs.document,r,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Xr(n){if(n===null||dt(n)||ir(n))return 1;if(La(n))return 2}function Oa(n,r,s){const o=[];let d=-1;for(;++d<n.length;){const v=n[d].resolveAll;v&&!o.includes(v)&&(r=v(r,s),o.push(v))}return r}const ku={name:"attention",resolveAll:Jy,tokenize:eS};function Jy(n,r){let s=-1,o,d,v,f,a,c,h,p;for(;++s<n.length;)if(n[s][0]==="enter"&&n[s][1].type==="attentionSequence"&&n[s][1]._close){for(o=s;o--;)if(n[o][0]==="exit"&&n[o][1].type==="attentionSequence"&&n[o][1]._open&&r.sliceSerialize(n[o][1]).charCodeAt(0)===r.sliceSerialize(n[s][1]).charCodeAt(0)){if((n[o][1]._close||n[s][1]._open)&&(n[s][1].end.offset-n[s][1].start.offset)%3&&!((n[o][1].end.offset-n[o][1].start.offset+n[s][1].end.offset-n[s][1].start.offset)%3))continue;c=n[o][1].end.offset-n[o][1].start.offset>1&&n[s][1].end.offset-n[s][1].start.offset>1?2:1;const u={...n[o][1].end},S={...n[s][1].start};km(u,-c),km(S,c),f={type:c>1?"strongSequence":"emphasisSequence",start:u,end:{...n[o][1].end}},a={type:c>1?"strongSequence":"emphasisSequence",start:{...n[s][1].start},end:S},v={type:c>1?"strongText":"emphasisText",start:{...n[o][1].end},end:{...n[s][1].start}},d={type:c>1?"strong":"emphasis",start:{...f.start},end:{...a.end}},n[o][1].end={...f.start},n[s][1].start={...a.end},h=[],n[o][1].end.offset-n[o][1].start.offset&&(h=Dn(h,[["enter",n[o][1],r],["exit",n[o][1],r]])),h=Dn(h,[["enter",d,r],["enter",f,r],["exit",f,r],["enter",v,r]]),h=Dn(h,Oa(r.parser.constructs.insideSpan.null,n.slice(o+1,s),r)),h=Dn(h,[["exit",v,r],["enter",a,r],["exit",a,r],["exit",d,r]]),n[s][1].end.offset-n[s][1].start.offset?(p=2,h=Dn(h,[["enter",n[s][1],r],["exit",n[s][1],r]])):p=0,gn(n,o-1,s-o+3,h),s=o+h.length-p-2;break}}for(s=-1;++s<n.length;)n[s][1].type==="attentionSequence"&&(n[s][1].type="data");return n}function eS(n,r){const s=this.parser.constructs.attentionMarkers.null,o=this.previous,d=Xr(o);let v;return f;function f(c){return v=c,n.enter("attentionSequence"),a(c)}function a(c){if(c===v)return n.consume(c),a;const h=n.exit("attentionSequence"),p=Xr(c),u=!p||p===2&&d||s.includes(c),S=!d||d===2&&p||s.includes(o);return h._open=!!(v===42?u:u&&(d||!S)),h._close=!!(v===42?S:S&&(p||!u)),r(c)}}function km(n,r){n.column+=r,n.offset+=r,n._bufferIndex+=r}const tS={name:"autolink",tokenize:nS};function nS(n,r,s){let o=0;return d;function d(w){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(w),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),v}function v(w){return Kt(w)?(n.consume(w),f):w===64?s(w):h(w)}function f(w){return w===43||w===45||w===46||Gt(w)?(o=1,a(w)):h(w)}function a(w){return w===58?(n.consume(w),o=0,c):(w===43||w===45||w===46||Gt(w))&&o++<32?(n.consume(w),a):(o=0,h(w))}function c(w){return w===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(w),n.exit("autolinkMarker"),n.exit("autolink"),r):w===null||w===32||w===60||Ta(w)?s(w):(n.consume(w),c)}function h(w){return w===64?(n.consume(w),p):Gy(w)?(n.consume(w),h):s(w)}function p(w){return Gt(w)?u(w):s(w)}function u(w){return w===46?(n.consume(w),o=0,p):w===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(w),n.exit("autolinkMarker"),n.exit("autolink"),r):S(w)}function S(w){if((w===45||Gt(w))&&o++<63){const A=w===45?S:u;return n.consume(w),A}return s(w)}}const sl={partial:!0,tokenize:iS};function iS(n,r,s){return o;function o(v){return $e(v)?Qe(n,d,"linePrefix")(v):d(v)}function d(v){return v===null||Le(v)?r(v):s(v)}}const Bg={continuation:{tokenize:sS},exit:lS,name:"blockQuote",tokenize:rS};function rS(n,r,s){const o=this;return d;function d(f){if(f===62){const a=o.containerState;return a.open||(n.enter("blockQuote",{_container:!0}),a.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(f),n.exit("blockQuoteMarker"),v}return s(f)}function v(f){return $e(f)?(n.enter("blockQuotePrefixWhitespace"),n.consume(f),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),r):(n.exit("blockQuotePrefix"),r(f))}}function sS(n,r,s){const o=this;return d;function d(f){return $e(f)?Qe(n,v,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):v(f)}function v(f){return n.attempt(Bg,r,s)(f)}}function lS(n){n.exit("blockQuote")}const Ng={name:"characterEscape",tokenize:aS};function aS(n,r,s){return o;function o(v){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(v),n.exit("escapeMarker"),d}function d(v){return Yy(v)?(n.enter("characterEscapeValue"),n.consume(v),n.exit("characterEscapeValue"),n.exit("characterEscape"),r):s(v)}}const jg={name:"characterReference",tokenize:oS};function oS(n,r,s){const o=this;let d=0,v,f;return a;function a(u){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(u),n.exit("characterReferenceMarker"),c}function c(u){return u===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(u),n.exit("characterReferenceMarkerNumeric"),h):(n.enter("characterReferenceValue"),v=31,f=Gt,p(u))}function h(u){return u===88||u===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(u),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),v=6,f=$y,p):(n.enter("characterReferenceValue"),v=7,f=Eu,p(u))}function p(u){if(u===59&&d){const S=n.exit("characterReferenceValue");return f===Gt&&!Vu(o.sliceSerialize(S))?s(u):(n.enter("characterReferenceMarker"),n.consume(u),n.exit("characterReferenceMarker"),n.exit("characterReference"),r)}return f(u)&&d++<v?(n.consume(u),p):s(u)}}const Am={partial:!0,tokenize:uS},Tm={concrete:!0,name:"codeFenced",tokenize:cS};function cS(n,r,s){const o=this,d={partial:!0,tokenize:M};let v=0,f=0,a;return c;function c(D){return h(D)}function h(D){const T=o.events[o.events.length-1];return v=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,a=D,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),p(D)}function p(D){return D===a?(f++,n.consume(D),p):f<3?s(D):(n.exit("codeFencedFenceSequence"),$e(D)?Qe(n,u,"whitespace")(D):u(D))}function u(D){return D===null||Le(D)?(n.exit("codeFencedFence"),o.interrupt?r(D):n.check(Am,x,k)(D)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),S(D))}function S(D){return D===null||Le(D)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),u(D)):$e(D)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),Qe(n,w,"whitespace")(D)):D===96&&D===a?s(D):(n.consume(D),S)}function w(D){return D===null||Le(D)?u(D):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),A(D))}function A(D){return D===null||Le(D)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),u(D)):D===96&&D===a?s(D):(n.consume(D),A)}function x(D){return n.attempt(d,k,b)(D)}function b(D){return n.enter("lineEnding"),n.consume(D),n.exit("lineEnding"),_}function _(D){return v>0&&$e(D)?Qe(n,g,"linePrefix",v+1)(D):g(D)}function g(D){return D===null||Le(D)?n.check(Am,x,k)(D):(n.enter("codeFlowValue"),y(D))}function y(D){return D===null||Le(D)?(n.exit("codeFlowValue"),g(D)):(n.consume(D),y)}function k(D){return n.exit("codeFenced"),r(D)}function M(D,T,E){let R=0;return N;function N(K){return D.enter("lineEnding"),D.consume(K),D.exit("lineEnding"),z}function z(K){return D.enter("codeFencedFence"),$e(K)?Qe(D,F,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):F(K)}function F(K){return K===a?(D.enter("codeFencedFenceSequence"),P(K)):E(K)}function P(K){return K===a?(R++,D.consume(K),P):R>=f?(D.exit("codeFencedFenceSequence"),$e(K)?Qe(D,$,"whitespace")(K):$(K)):E(K)}function $(K){return K===null||Le(K)?(D.exit("codeFencedFence"),T(K)):E(K)}}}function uS(n,r,s){const o=this;return d;function d(f){return f===null?s(f):(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),v)}function v(f){return o.parser.lazy[o.now().line]?s(f):r(f)}}const lu={name:"codeIndented",tokenize:fS},hS={partial:!0,tokenize:dS};function fS(n,r,s){const o=this;return d;function d(h){return n.enter("codeIndented"),Qe(n,v,"linePrefix",5)(h)}function v(h){const p=o.events[o.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?f(h):s(h)}function f(h){return h===null?c(h):Le(h)?n.attempt(hS,f,c)(h):(n.enter("codeFlowValue"),a(h))}function a(h){return h===null||Le(h)?(n.exit("codeFlowValue"),f(h)):(n.consume(h),a)}function c(h){return n.exit("codeIndented"),r(h)}}function dS(n,r,s){const o=this;return d;function d(f){return o.parser.lazy[o.now().line]?s(f):Le(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),d):Qe(n,v,"linePrefix",5)(f)}function v(f){const a=o.events[o.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?r(f):Le(f)?d(f):s(f)}}const pS={name:"codeText",previous:gS,resolve:mS,tokenize:_S};function mS(n){let r=n.length-4,s=3,o,d;if((n[s][1].type==="lineEnding"||n[s][1].type==="space")&&(n[r][1].type==="lineEnding"||n[r][1].type==="space")){for(o=s;++o<r;)if(n[o][1].type==="codeTextData"){n[s][1].type="codeTextPadding",n[r][1].type="codeTextPadding",s+=2,r-=2;break}}for(o=s-1,r++;++o<=r;)d===void 0?o!==r&&n[o][1].type!=="lineEnding"&&(d=o):(o===r||n[o][1].type==="lineEnding")&&(n[d][1].type="codeTextData",o!==d+2&&(n[d][1].end=n[o-1][1].end,n.splice(d+2,o-d-2),r-=o-d-2,o=d+2),d=void 0);return n}function gS(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function _S(n,r,s){let o=0,d,v;return f;function f(u){return n.enter("codeText"),n.enter("codeTextSequence"),a(u)}function a(u){return u===96?(n.consume(u),o++,a):(n.exit("codeTextSequence"),c(u))}function c(u){return u===null?s(u):u===32?(n.enter("space"),n.consume(u),n.exit("space"),c):u===96?(v=n.enter("codeTextSequence"),d=0,p(u)):Le(u)?(n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),c):(n.enter("codeTextData"),h(u))}function h(u){return u===null||u===32||u===96||Le(u)?(n.exit("codeTextData"),c(u)):(n.consume(u),h)}function p(u){return u===96?(n.consume(u),d++,p):d===o?(n.exit("codeTextSequence"),n.exit("codeText"),r(u)):(v.type="codeTextData",h(u))}}class vS{constructor(r){this.left=r?[...r]:[],this.right=[]}get(r){if(r<0||r>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return r<this.left.length?this.left[r]:this.right[this.right.length-r+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(r,s){const o=s??Number.POSITIVE_INFINITY;return o<this.left.length?this.left.slice(r,o):r>this.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(r,s,o){const d=s||0;this.setCursor(Math.trunc(r));const v=this.right.splice(this.right.length-d,Number.POSITIVE_INFINITY);return o&&Ks(this.left,o),v.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),Ks(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Ks(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r<this.left.length){const s=this.left.splice(r,Number.POSITIVE_INFINITY);Ks(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);Ks(this.left,s.reverse())}}}function Ks(n,r){let s=0;if(r.length<1e4)n.push(...r);else for(;s<r.length;)n.push(...r.slice(s,s+1e4)),s+=1e4}function zg(n){const r={};let s=-1,o,d,v,f,a,c,h;const p=new vS(n);for(;++s<p.length;){for(;s in r;)s=r[s];if(o=p.get(s),s&&o[1].type==="chunkFlow"&&p.get(s-1)[1].type==="listItemPrefix"&&(c=o[1]._tokenizer.events,v=0,v<c.length&&c[v][1].type==="lineEndingBlank"&&(v+=2),v<c.length&&c[v][1].type==="content"))for(;++v<c.length&&c[v][1].type!=="content";)c[v][1].type==="chunkText"&&(c[v][1]._isInFirstContentOfListItem=!0,v++);if(o[0]==="enter")o[1].contentType&&(Object.assign(r,yS(p,s)),s=r[s],h=!0);else if(o[1]._container){for(v=s,d=void 0;v--;)if(f=p.get(v),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(d&&(p.get(d)[1].type="lineEndingBlank"),f[1].type="lineEnding",d=v);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;d&&(o[1].end={...p.get(d)[1].start},a=p.slice(d,s),a.unshift(o),p.splice(d,s-d+1,a))}}return gn(n,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function yS(n,r){const s=n.get(r)[1],o=n.get(r)[2];let d=r-1;const v=[];let f=s._tokenizer;f||(f=o.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const a=f.events,c=[],h={};let p,u,S=-1,w=s,A=0,x=0;const b=[x];for(;w;){for(;n.get(++d)[1]!==w;);v.push(d),w._tokenizer||(p=o.sliceStream(w),w.next||p.push(null),u&&f.defineSkip(w.start),w._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(p),w._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),u=w,w=w.next}for(w=s;++S<a.length;)a[S][0]==="exit"&&a[S-1][0]==="enter"&&a[S][1].type===a[S-1][1].type&&a[S][1].start.line!==a[S][1].end.line&&(x=S+1,b.push(x),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(f.events=[],w?(w._tokenizer=void 0,w.previous=void 0):b.pop(),S=b.length;S--;){const _=a.slice(b[S],b[S+1]),g=v.pop();c.push([g,g+_.length-1]),n.splice(g,2,_)}for(c.reverse(),S=-1;++S<c.length;)h[A+c[S][0]]=A+c[S][1],A+=c[S][1]-c[S][0]-1;return h}const SS={resolve:CS,tokenize:wS},bS={partial:!0,tokenize:xS};function CS(n){return zg(n),n}function wS(n,r){let s;return o;function o(a){return n.enter("content"),s=n.enter("chunkContent",{contentType:"content"}),d(a)}function d(a){return a===null?v(a):Le(a)?n.check(bS,f,v)(a):(n.consume(a),d)}function v(a){return n.exit("chunkContent"),n.exit("content"),r(a)}function f(a){return n.consume(a),n.exit("chunkContent"),s.next=n.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,d}}function xS(n,r,s){const o=this;return d;function d(f){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),Qe(n,v,"linePrefix")}function v(f){if(f===null||Le(f))return s(f);const a=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?r(f):n.interrupt(o.parser.constructs.flow,s,r)(f)}}function Hg(n,r,s,o,d,v,f,a,c){const h=c||Number.POSITIVE_INFINITY;let p=0;return u;function u(_){return _===60?(n.enter(o),n.enter(d),n.enter(v),n.consume(_),n.exit(v),S):_===null||_===32||_===41||Ta(_)?s(_):(n.enter(o),n.enter(f),n.enter(a),n.enter("chunkString",{contentType:"string"}),x(_))}function S(_){return _===62?(n.enter(v),n.consume(_),n.exit(v),n.exit(d),n.exit(o),r):(n.enter(a),n.enter("chunkString",{contentType:"string"}),w(_))}function w(_){return _===62?(n.exit("chunkString"),n.exit(a),S(_)):_===null||_===60||Le(_)?s(_):(n.consume(_),_===92?A:w)}function A(_){return _===60||_===62||_===92?(n.consume(_),w):w(_)}function x(_){return!p&&(_===null||_===41||dt(_))?(n.exit("chunkString"),n.exit(a),n.exit(f),n.exit(o),r(_)):p<h&&_===40?(n.consume(_),p++,x):_===41?(n.consume(_),p--,x):_===null||_===32||_===40||Ta(_)?s(_):(n.consume(_),_===92?b:x)}function b(_){return _===40||_===41||_===92?(n.consume(_),x):x(_)}}function Ig(n,r,s,o,d,v){const f=this;let a=0,c;return h;function h(w){return n.enter(o),n.enter(d),n.consume(w),n.exit(d),n.enter(v),p}function p(w){return a>999||w===null||w===91||w===93&&!c||w===94&&!a&&"_hiddenFootnoteSupport"in f.parser.constructs?s(w):w===93?(n.exit(v),n.enter(d),n.consume(w),n.exit(d),n.exit(o),r):Le(w)?(n.enter("lineEnding"),n.consume(w),n.exit("lineEnding"),p):(n.enter("chunkString",{contentType:"string"}),u(w))}function u(w){return w===null||w===91||w===93||Le(w)||a++>999?(n.exit("chunkString"),p(w)):(n.consume(w),c||(c=!$e(w)),w===92?S:u)}function S(w){return w===91||w===92||w===93?(n.consume(w),a++,u):u(w)}}function Ug(n,r,s,o,d,v){let f;return a;function a(S){return S===34||S===39||S===40?(n.enter(o),n.enter(d),n.consume(S),n.exit(d),f=S===40?41:S,c):s(S)}function c(S){return S===f?(n.enter(d),n.consume(S),n.exit(d),n.exit(o),r):(n.enter(v),h(S))}function h(S){return S===f?(n.exit(v),c(f)):S===null?s(S):Le(S)?(n.enter("lineEnding"),n.consume(S),n.exit("lineEnding"),Qe(n,h,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),p(S))}function p(S){return S===f||S===null||Le(S)?(n.exit("chunkString"),h(S)):(n.consume(S),S===92?u:p)}function u(S){return S===f||S===92?(n.consume(S),p):p(S)}}function Js(n,r){let s;return o;function o(d){return Le(d)?(n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),s=!0,o):$e(d)?Qe(n,o,s?"linePrefix":"lineSuffix")(d):r(d)}}const ES={name:"definition",tokenize:AS},kS={partial:!0,tokenize:TS};function AS(n,r,s){const o=this;let d;return v;function v(w){return n.enter("definition"),f(w)}function f(w){return Ig.call(o,n,a,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function a(w){return d=Nn(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),w===58?(n.enter("definitionMarker"),n.consume(w),n.exit("definitionMarker"),c):s(w)}function c(w){return dt(w)?Js(n,h)(w):h(w)}function h(w){return Hg(n,p,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function p(w){return n.attempt(kS,u,u)(w)}function u(w){return $e(w)?Qe(n,S,"whitespace")(w):S(w)}function S(w){return w===null||Le(w)?(n.exit("definition"),o.parser.defined.push(d),r(w)):s(w)}}function TS(n,r,s){return o;function o(a){return dt(a)?Js(n,d)(a):s(a)}function d(a){return Ug(n,v,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function v(a){return $e(a)?Qe(n,f,"whitespace")(a):f(a)}function f(a){return a===null||Le(a)?r(a):s(a)}}const DS={name:"hardBreakEscape",tokenize:RS};function RS(n,r,s){return o;function o(v){return n.enter("hardBreakEscape"),n.consume(v),d}function d(v){return Le(v)?(n.exit("hardBreakEscape"),r(v)):s(v)}}const MS={name:"headingAtx",resolve:LS,tokenize:OS};function LS(n,r){let s=n.length-2,o=3,d,v;return n[o][1].type==="whitespace"&&(o+=2),s-2>o&&n[s][1].type==="whitespace"&&(s-=2),n[s][1].type==="atxHeadingSequence"&&(o===s-1||s-4>o&&n[s-2][1].type==="whitespace")&&(s-=o+1===s?2:4),s>o&&(d={type:"atxHeadingText",start:n[o][1].start,end:n[s][1].end},v={type:"chunkText",start:n[o][1].start,end:n[s][1].end,contentType:"text"},gn(n,o,s-o+1,[["enter",d,r],["enter",v,r],["exit",v,r],["exit",d,r]])),n}function OS(n,r,s){let o=0;return d;function d(p){return n.enter("atxHeading"),v(p)}function v(p){return n.enter("atxHeadingSequence"),f(p)}function f(p){return p===35&&o++<6?(n.consume(p),f):p===null||dt(p)?(n.exit("atxHeadingSequence"),a(p)):s(p)}function a(p){return p===35?(n.enter("atxHeadingSequence"),c(p)):p===null||Le(p)?(n.exit("atxHeading"),r(p)):$e(p)?Qe(n,a,"whitespace")(p):(n.enter("atxHeadingText"),h(p))}function c(p){return p===35?(n.consume(p),c):(n.exit("atxHeadingSequence"),a(p))}function h(p){return p===null||p===35||dt(p)?(n.exit("atxHeadingText"),a(p)):(n.consume(p),h)}}const BS=["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"],Dm=["pre","script","style","textarea"],NS={concrete:!0,name:"htmlFlow",resolveTo:HS,tokenize:IS},jS={partial:!0,tokenize:PS},zS={partial:!0,tokenize:US};function HS(n){let r=n.length;for(;r--&&!(n[r][0]==="enter"&&n[r][1].type==="htmlFlow"););return r>1&&n[r-2][1].type==="linePrefix"&&(n[r][1].start=n[r-2][1].start,n[r+1][1].start=n[r-2][1].start,n.splice(r-2,2)),n}function IS(n,r,s){const o=this;let d,v,f,a,c;return h;function h(I){return p(I)}function p(I){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(I),u}function u(I){return I===33?(n.consume(I),S):I===47?(n.consume(I),v=!0,x):I===63?(n.consume(I),d=3,o.interrupt?r:O):Kt(I)?(n.consume(I),f=String.fromCharCode(I),b):s(I)}function S(I){return I===45?(n.consume(I),d=2,w):I===91?(n.consume(I),d=5,a=0,A):Kt(I)?(n.consume(I),d=4,o.interrupt?r:O):s(I)}function w(I){return I===45?(n.consume(I),o.interrupt?r:O):s(I)}function A(I){const ne="CDATA[";return I===ne.charCodeAt(a++)?(n.consume(I),a===ne.length?o.interrupt?r:F:A):s(I)}function x(I){return Kt(I)?(n.consume(I),f=String.fromCharCode(I),b):s(I)}function b(I){if(I===null||I===47||I===62||dt(I)){const ne=I===47,_e=f.toLowerCase();return!ne&&!v&&Dm.includes(_e)?(d=1,o.interrupt?r(I):F(I)):BS.includes(f.toLowerCase())?(d=6,ne?(n.consume(I),_):o.interrupt?r(I):F(I)):(d=7,o.interrupt&&!o.parser.lazy[o.now().line]?s(I):v?g(I):y(I))}return I===45||Gt(I)?(n.consume(I),f+=String.fromCharCode(I),b):s(I)}function _(I){return I===62?(n.consume(I),o.interrupt?r:F):s(I)}function g(I){return $e(I)?(n.consume(I),g):N(I)}function y(I){return I===47?(n.consume(I),N):I===58||I===95||Kt(I)?(n.consume(I),k):$e(I)?(n.consume(I),y):N(I)}function k(I){return I===45||I===46||I===58||I===95||Gt(I)?(n.consume(I),k):M(I)}function M(I){return I===61?(n.consume(I),D):$e(I)?(n.consume(I),M):y(I)}function D(I){return I===null||I===60||I===61||I===62||I===96?s(I):I===34||I===39?(n.consume(I),c=I,T):$e(I)?(n.consume(I),D):E(I)}function T(I){return I===c?(n.consume(I),c=null,R):I===null||Le(I)?s(I):(n.consume(I),T)}function E(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||dt(I)?M(I):(n.consume(I),E)}function R(I){return I===47||I===62||$e(I)?y(I):s(I)}function N(I){return I===62?(n.consume(I),z):s(I)}function z(I){return I===null||Le(I)?F(I):$e(I)?(n.consume(I),z):s(I)}function F(I){return I===45&&d===2?(n.consume(I),G):I===60&&d===1?(n.consume(I),X):I===62&&d===4?(n.consume(I),j):I===63&&d===3?(n.consume(I),O):I===93&&d===5?(n.consume(I),H):Le(I)&&(d===6||d===7)?(n.exit("htmlFlowData"),n.check(jS,V,P)(I)):I===null||Le(I)?(n.exit("htmlFlowData"),P(I)):(n.consume(I),F)}function P(I){return n.check(zS,$,V)(I)}function $(I){return n.enter("lineEnding"),n.consume(I),n.exit("lineEnding"),K}function K(I){return I===null||Le(I)?P(I):(n.enter("htmlFlowData"),F(I))}function G(I){return I===45?(n.consume(I),O):F(I)}function X(I){return I===47?(n.consume(I),f="",ee):F(I)}function ee(I){if(I===62){const ne=f.toLowerCase();return Dm.includes(ne)?(n.consume(I),j):F(I)}return Kt(I)&&f.length<8?(n.consume(I),f+=String.fromCharCode(I),ee):F(I)}function H(I){return I===93?(n.consume(I),O):F(I)}function O(I){return I===62?(n.consume(I),j):I===45&&d===2?(n.consume(I),O):F(I)}function j(I){return I===null||Le(I)?(n.exit("htmlFlowData"),V(I)):(n.consume(I),j)}function V(I){return n.exit("htmlFlow"),r(I)}}function US(n,r,s){const o=this;return d;function d(f){return Le(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),v):s(f)}function v(f){return o.parser.lazy[o.now().line]?s(f):r(f)}}function PS(n,r,s){return o;function o(d){return n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),n.attempt(sl,r,s)}}const FS={name:"htmlText",tokenize:qS};function qS(n,r,s){const o=this;let d,v,f;return a;function a(O){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(O),c}function c(O){return O===33?(n.consume(O),h):O===47?(n.consume(O),M):O===63?(n.consume(O),y):Kt(O)?(n.consume(O),E):s(O)}function h(O){return O===45?(n.consume(O),p):O===91?(n.consume(O),v=0,A):Kt(O)?(n.consume(O),g):s(O)}function p(O){return O===45?(n.consume(O),w):s(O)}function u(O){return O===null?s(O):O===45?(n.consume(O),S):Le(O)?(f=u,X(O)):(n.consume(O),u)}function S(O){return O===45?(n.consume(O),w):u(O)}function w(O){return O===62?G(O):O===45?S(O):u(O)}function A(O){const j="CDATA[";return O===j.charCodeAt(v++)?(n.consume(O),v===j.length?x:A):s(O)}function x(O){return O===null?s(O):O===93?(n.consume(O),b):Le(O)?(f=x,X(O)):(n.consume(O),x)}function b(O){return O===93?(n.consume(O),_):x(O)}function _(O){return O===62?G(O):O===93?(n.consume(O),_):x(O)}function g(O){return O===null||O===62?G(O):Le(O)?(f=g,X(O)):(n.consume(O),g)}function y(O){return O===null?s(O):O===63?(n.consume(O),k):Le(O)?(f=y,X(O)):(n.consume(O),y)}function k(O){return O===62?G(O):y(O)}function M(O){return Kt(O)?(n.consume(O),D):s(O)}function D(O){return O===45||Gt(O)?(n.consume(O),D):T(O)}function T(O){return Le(O)?(f=T,X(O)):$e(O)?(n.consume(O),T):G(O)}function E(O){return O===45||Gt(O)?(n.consume(O),E):O===47||O===62||dt(O)?R(O):s(O)}function R(O){return O===47?(n.consume(O),G):O===58||O===95||Kt(O)?(n.consume(O),N):Le(O)?(f=R,X(O)):$e(O)?(n.consume(O),R):G(O)}function N(O){return O===45||O===46||O===58||O===95||Gt(O)?(n.consume(O),N):z(O)}function z(O){return O===61?(n.consume(O),F):Le(O)?(f=z,X(O)):$e(O)?(n.consume(O),z):R(O)}function F(O){return O===null||O===60||O===61||O===62||O===96?s(O):O===34||O===39?(n.consume(O),d=O,P):Le(O)?(f=F,X(O)):$e(O)?(n.consume(O),F):(n.consume(O),$)}function P(O){return O===d?(n.consume(O),d=void 0,K):O===null?s(O):Le(O)?(f=P,X(O)):(n.consume(O),P)}function $(O){return O===null||O===34||O===39||O===60||O===61||O===96?s(O):O===47||O===62||dt(O)?R(O):(n.consume(O),$)}function K(O){return O===47||O===62||dt(O)?R(O):s(O)}function G(O){return O===62?(n.consume(O),n.exit("htmlTextData"),n.exit("htmlText"),r):s(O)}function X(O){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(O),n.exit("lineEnding"),ee}function ee(O){return $e(O)?Qe(n,H,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):H(O)}function H(O){return n.enter("htmlTextData"),f(O)}}const Gu={name:"labelEnd",resolveAll:YS,resolveTo:WS,tokenize:KS},VS={tokenize:XS},GS={tokenize:QS},$S={tokenize:ZS};function YS(n){let r=-1;const s=[];for(;++r<n.length;){const o=n[r][1];if(s.push(n[r]),o.type==="labelImage"||o.type==="labelLink"||o.type==="labelEnd"){const d=o.type==="labelImage"?4:2;o.type="data",r+=d}}return n.length!==s.length&&gn(n,0,n.length,s),n}function WS(n,r){let s=n.length,o=0,d,v,f,a;for(;s--;)if(d=n[s][1],v){if(d.type==="link"||d.type==="labelLink"&&d._inactive)break;n[s][0]==="enter"&&d.type==="labelLink"&&(d._inactive=!0)}else if(f){if(n[s][0]==="enter"&&(d.type==="labelImage"||d.type==="labelLink")&&!d._balanced&&(v=s,d.type!=="labelLink")){o=2;break}}else d.type==="labelEnd"&&(f=s);const c={type:n[v][1].type==="labelLink"?"link":"image",start:{...n[v][1].start},end:{...n[n.length-1][1].end}},h={type:"label",start:{...n[v][1].start},end:{...n[f][1].end}},p={type:"labelText",start:{...n[v+o+2][1].end},end:{...n[f-2][1].start}};return a=[["enter",c,r],["enter",h,r]],a=Dn(a,n.slice(v+1,v+o+3)),a=Dn(a,[["enter",p,r]]),a=Dn(a,Oa(r.parser.constructs.insideSpan.null,n.slice(v+o+4,f-3),r)),a=Dn(a,[["exit",p,r],n[f-2],n[f-1],["exit",h,r]]),a=Dn(a,n.slice(f+1)),a=Dn(a,[["exit",c,r]]),gn(n,v,n.length,a),n}function KS(n,r,s){const o=this;let d=o.events.length,v,f;for(;d--;)if((o.events[d][1].type==="labelImage"||o.events[d][1].type==="labelLink")&&!o.events[d][1]._balanced){v=o.events[d][1];break}return a;function a(S){return v?v._inactive?u(S):(f=o.parser.defined.includes(Nn(o.sliceSerialize({start:v.end,end:o.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(S),n.exit("labelMarker"),n.exit("labelEnd"),c):s(S)}function c(S){return S===40?n.attempt(VS,p,f?p:u)(S):S===91?n.attempt(GS,p,f?h:u)(S):f?p(S):u(S)}function h(S){return n.attempt($S,p,u)(S)}function p(S){return r(S)}function u(S){return v._balanced=!0,s(S)}}function XS(n,r,s){return o;function o(u){return n.enter("resource"),n.enter("resourceMarker"),n.consume(u),n.exit("resourceMarker"),d}function d(u){return dt(u)?Js(n,v)(u):v(u)}function v(u){return u===41?p(u):Hg(n,f,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function f(u){return dt(u)?Js(n,c)(u):p(u)}function a(u){return s(u)}function c(u){return u===34||u===39||u===40?Ug(n,h,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):p(u)}function h(u){return dt(u)?Js(n,p)(u):p(u)}function p(u){return u===41?(n.enter("resourceMarker"),n.consume(u),n.exit("resourceMarker"),n.exit("resource"),r):s(u)}}function QS(n,r,s){const o=this;return d;function d(a){return Ig.call(o,n,v,f,"reference","referenceMarker","referenceString")(a)}function v(a){return o.parser.defined.includes(Nn(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?r(a):s(a)}function f(a){return s(a)}}function ZS(n,r,s){return o;function o(v){return n.enter("reference"),n.enter("referenceMarker"),n.consume(v),n.exit("referenceMarker"),d}function d(v){return v===93?(n.enter("referenceMarker"),n.consume(v),n.exit("referenceMarker"),n.exit("reference"),r):s(v)}}const JS={name:"labelStartImage",resolveAll:Gu.resolveAll,tokenize:eb};function eb(n,r,s){const o=this;return d;function d(a){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(a),n.exit("labelImageMarker"),v}function v(a){return a===91?(n.enter("labelMarker"),n.consume(a),n.exit("labelMarker"),n.exit("labelImage"),f):s(a)}function f(a){return a===94&&"_hiddenFootnoteSupport"in o.parser.constructs?s(a):r(a)}}const tb={name:"labelStartLink",resolveAll:Gu.resolveAll,tokenize:nb};function nb(n,r,s){const o=this;return d;function d(f){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(f),n.exit("labelMarker"),n.exit("labelLink"),v}function v(f){return f===94&&"_hiddenFootnoteSupport"in o.parser.constructs?s(f):r(f)}}const au={name:"lineEnding",tokenize:ib};function ib(n,r){return s;function s(o){return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),Qe(n,r,"linePrefix")}}const ka={name:"thematicBreak",tokenize:rb};function rb(n,r,s){let o=0,d;return v;function v(h){return n.enter("thematicBreak"),f(h)}function f(h){return d=h,a(h)}function a(h){return h===d?(n.enter("thematicBreakSequence"),c(h)):o>=3&&(h===null||Le(h))?(n.exit("thematicBreak"),r(h)):s(h)}function c(h){return h===d?(n.consume(h),o++,c):(n.exit("thematicBreakSequence"),$e(h)?Qe(n,a,"whitespace")(h):a(h))}}const rn={continuation:{tokenize:ob},exit:ub,name:"list",tokenize:ab},sb={partial:!0,tokenize:hb},lb={partial:!0,tokenize:cb};function ab(n,r,s){const o=this,d=o.events[o.events.length-1];let v=d&&d[1].type==="linePrefix"?d[2].sliceSerialize(d[1],!0).length:0,f=0;return a;function a(w){const A=o.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(A==="listUnordered"?!o.containerState.marker||w===o.containerState.marker:Eu(w)){if(o.containerState.type||(o.containerState.type=A,n.enter(A,{_container:!0})),A==="listUnordered")return n.enter("listItemPrefix"),w===42||w===45?n.check(ka,s,h)(w):h(w);if(!o.interrupt||w===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),c(w)}return s(w)}function c(w){return Eu(w)&&++f<10?(n.consume(w),c):(!o.interrupt||f<2)&&(o.containerState.marker?w===o.containerState.marker:w===41||w===46)?(n.exit("listItemValue"),h(w)):s(w)}function h(w){return n.enter("listItemMarker"),n.consume(w),n.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||w,n.check(sl,o.interrupt?s:p,n.attempt(sb,S,u))}function p(w){return o.containerState.initialBlankLine=!0,v++,S(w)}function u(w){return $e(w)?(n.enter("listItemPrefixWhitespace"),n.consume(w),n.exit("listItemPrefixWhitespace"),S):s(w)}function S(w){return o.containerState.size=v+o.sliceSerialize(n.exit("listItemPrefix"),!0).length,r(w)}}function ob(n,r,s){const o=this;return o.containerState._closeFlow=void 0,n.check(sl,d,v);function d(a){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,Qe(n,r,"listItemIndent",o.containerState.size+1)(a)}function v(a){return o.containerState.furtherBlankLines||!$e(a)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,f(a)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,n.attempt(lb,r,f)(a))}function f(a){return o.containerState._closeFlow=!0,o.interrupt=void 0,Qe(n,n.attempt(rn,r,s),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function cb(n,r,s){const o=this;return Qe(n,d,"listItemIndent",o.containerState.size+1);function d(v){const f=o.events[o.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===o.containerState.size?r(v):s(v)}}function ub(n){n.exit(this.containerState.type)}function hb(n,r,s){const o=this;return Qe(n,d,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function d(v){const f=o.events[o.events.length-1];return!$e(v)&&f&&f[1].type==="listItemPrefixWhitespace"?r(v):s(v)}}const Rm={name:"setextUnderline",resolveTo:fb,tokenize:db};function fb(n,r){let s=n.length,o,d,v;for(;s--;)if(n[s][0]==="enter"){if(n[s][1].type==="content"){o=s;break}n[s][1].type==="paragraph"&&(d=s)}else n[s][1].type==="content"&&n.splice(s,1),!v&&n[s][1].type==="definition"&&(v=s);const f={type:"setextHeading",start:{...n[o][1].start},end:{...n[n.length-1][1].end}};return n[d][1].type="setextHeadingText",v?(n.splice(d,0,["enter",f,r]),n.splice(v+1,0,["exit",n[o][1],r]),n[o][1].end={...n[v][1].end}):n[o][1]=f,n.push(["exit",f,r]),n}function db(n,r,s){const o=this;let d;return v;function v(h){let p=o.events.length,u;for(;p--;)if(o.events[p][1].type!=="lineEnding"&&o.events[p][1].type!=="linePrefix"&&o.events[p][1].type!=="content"){u=o.events[p][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||u)?(n.enter("setextHeadingLine"),d=h,f(h)):s(h)}function f(h){return n.enter("setextHeadingLineSequence"),a(h)}function a(h){return h===d?(n.consume(h),a):(n.exit("setextHeadingLineSequence"),$e(h)?Qe(n,c,"lineSuffix")(h):c(h))}function c(h){return h===null||Le(h)?(n.exit("setextHeadingLine"),r(h)):s(h)}}const pb={tokenize:mb};function mb(n){const r=this,s=n.attempt(sl,o,n.attempt(this.parser.constructs.flowInitial,d,Qe(n,n.attempt(this.parser.constructs.flow,d,n.attempt(SS,d)),"linePrefix")));return s;function o(v){if(v===null){n.consume(v);return}return n.enter("lineEndingBlank"),n.consume(v),n.exit("lineEndingBlank"),r.currentConstruct=void 0,s}function d(v){if(v===null){n.consume(v);return}return n.enter("lineEnding"),n.consume(v),n.exit("lineEnding"),r.currentConstruct=void 0,s}}const gb={resolveAll:Fg()},_b=Pg("string"),vb=Pg("text");function Pg(n){return{resolveAll:Fg(n==="text"?yb:void 0),tokenize:r};function r(s){const o=this,d=this.parser.constructs[n],v=s.attempt(d,f,a);return f;function f(p){return h(p)?v(p):a(p)}function a(p){if(p===null){s.consume(p);return}return s.enter("data"),s.consume(p),c}function c(p){return h(p)?(s.exit("data"),v(p)):(s.consume(p),c)}function h(p){if(p===null)return!0;const u=d[p];let S=-1;if(u)for(;++S<u.length;){const w=u[S];if(!w.previous||w.previous.call(o,o.previous))return!0}return!1}}}function Fg(n){return r;function r(s,o){let d=-1,v;for(;++d<=s.length;)v===void 0?s[d]&&s[d][1].type==="data"&&(v=d,d++):(!s[d]||s[d][1].type!=="data")&&(d!==v+2&&(s[v][1].end=s[d-1][1].end,s.splice(v+2,d-v-2),d=v+2),v=void 0);return n?n(s,o):s}}function yb(n,r){let s=0;for(;++s<=n.length;)if((s===n.length||n[s][1].type==="lineEnding")&&n[s-1][1].type==="data"){const o=n[s-1][1],d=r.sliceStream(o);let v=d.length,f=-1,a=0,c;for(;v--;){const h=d[v];if(typeof h=="string"){for(f=h.length;h.charCodeAt(f-1)===32;)a++,f--;if(f)break;f=-1}else if(h===-2)c=!0,a++;else if(h!==-1){v++;break}}if(r._contentTypeTextTrailing&&s===n.length&&(a=0),a){const h={type:s===n.length||c||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:v?f:o.start._bufferIndex+f,_index:o.start._index+v,line:o.end.line,column:o.end.column-a,offset:o.end.offset-a},end:{...o.end}};o.end={...h.start},o.start.offset===o.end.offset?Object.assign(o,h):(n.splice(s,0,["enter",h,r],["exit",h,r]),s+=2)}s++}return n}const Sb={42:rn,43:rn,45:rn,48:rn,49:rn,50:rn,51:rn,52:rn,53:rn,54:rn,55:rn,56:rn,57:rn,62:Bg},bb={91:ES},Cb={[-2]:lu,[-1]:lu,32:lu},wb={35:MS,42:ka,45:[Rm,ka],60:NS,61:Rm,95:ka,96:Tm,126:Tm},xb={38:jg,92:Ng},Eb={[-5]:au,[-4]:au,[-3]:au,33:JS,38:jg,42:ku,60:[tS,FS],91:tb,92:[DS,Ng],93:Gu,95:ku,96:pS},kb={null:[ku,gb]},Ab={null:[42,95]},Tb={null:[]},Db=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Ab,contentInitial:bb,disable:Tb,document:Sb,flow:wb,flowInitial:Cb,insideSpan:kb,string:xb,text:Eb},Symbol.toStringTag,{value:"Module"}));function Rb(n,r,s){let o={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const d={},v=[];let f=[],a=[];const c={attempt:T(M),check:T(D),consume:g,enter:y,exit:k,interrupt:T(D,{interrupt:!0})},h={code:null,containerState:{},defineSkip:x,events:[],now:A,parser:n,previous:null,sliceSerialize:S,sliceStream:w,write:u};let p=r.tokenize.call(h,c);return r.resolveAll&&v.push(r),h;function u(z){return f=Dn(f,z),b(),f[f.length-1]!==null?[]:(E(r,0),h.events=Oa(v,h.events,h),h.events)}function S(z,F){return Lb(w(z),F)}function w(z){return Mb(f,z)}function A(){const{_bufferIndex:z,_index:F,line:P,column:$,offset:K}=o;return{_bufferIndex:z,_index:F,line:P,column:$,offset:K}}function x(z){d[z.line]=z.column,N()}function b(){let z;for(;o._index<f.length;){const F=f[o._index];if(typeof F=="string")for(z=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===z&&o._bufferIndex<F.length;)_(F.charCodeAt(o._bufferIndex));else _(F)}}function _(z){p=p(z)}function g(z){Le(z)?(o.line++,o.column=1,o.offset+=z===-3?2:1,N()):z!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===f[o._index].length&&(o._bufferIndex=-1,o._index++)),h.previous=z}function y(z,F){const P=F||{};return P.type=z,P.start=A(),h.events.push(["enter",P,h]),a.push(P),P}function k(z){const F=a.pop();return F.end=A(),h.events.push(["exit",F,h]),F}function M(z,F){E(z,F.from)}function D(z,F){F.restore()}function T(z,F){return P;function P($,K,G){let X,ee,H,O;return Array.isArray($)?V($):"tokenize"in $?V([$]):j($);function j(ge){return Q;function Q(q){const J=q!==null&&ge[q],Y=q!==null&&ge.null,he=[...Array.isArray(J)?J:J?[J]:[],...Array.isArray(Y)?Y:Y?[Y]:[]];return V(he)(q)}}function V(ge){return X=ge,ee=0,ge.length===0?G:I(ge[ee])}function I(ge){return Q;function Q(q){return O=R(),H=ge,ge.partial||(h.currentConstruct=ge),ge.name&&h.parser.constructs.disable.null.includes(ge.name)?_e():ge.tokenize.call(F?Object.assign(Object.create(h),F):h,c,ne,_e)(q)}}function ne(ge){return z(H,O),K}function _e(ge){return O.restore(),++ee<X.length?I(X[ee]):G}}}function E(z,F){z.resolveAll&&!v.includes(z)&&v.push(z),z.resolve&&gn(h.events,F,h.events.length-F,z.resolve(h.events.slice(F),h)),z.resolveTo&&(h.events=z.resolveTo(h.events,h))}function R(){const z=A(),F=h.previous,P=h.currentConstruct,$=h.events.length,K=Array.from(a);return{from:$,restore:G};function G(){o=z,h.previous=F,h.currentConstruct=P,h.events.length=$,a=K,N()}}function N(){o.line in d&&o.column<2&&(o.column=d[o.line],o.offset+=d[o.line]-1)}}function Mb(n,r){const s=r.start._index,o=r.start._bufferIndex,d=r.end._index,v=r.end._bufferIndex;let f;if(s===d)f=[n[s].slice(o,v)];else{if(f=n.slice(s,d),o>-1){const a=f[0];typeof a=="string"?f[0]=a.slice(o):f.shift()}v>0&&f.push(n[d].slice(0,v))}return f}function Lb(n,r){let s=-1;const o=[];let d;for(;++s<n.length;){const v=n[s];let f;if(typeof v=="string")f=v;else switch(v){case-5:{f="\r";break}case-4:{f=`
|
|
62
|
+
`))&&v()}return N.jsx("div",{className:"modal-backdrop",children:N.jsxs("section",{className:"message-modal",role:"dialog","aria-modal":"true","aria-label":"Messages",children:[N.jsxs("header",{children:[N.jsxs("div",{children:[N.jsx("h2",{children:"Messages"}),N.jsxs("p",{className:"muted",children:[f.total," total / ",f.accepted," accepted",s?` · ${s.mode}`:""]})]}),N.jsxs("div",{className:"modal-actions",children:[N.jsx("button",{type:"button",disabled:n,onClick:a,children:"Mark All Done"}),N.jsx("button",{type:"button",disabled:n||f.total===0,onClick:c,children:"Delete All"}),N.jsx("button",{type:"button",onClick:o,children:"Close"})]})]}),N.jsx(D1,{busy:n,maxMessages:null,messages:r,orchestration:s,showControls:!1,showHeader:!1})]})})}function Ri({children:n,onOpenChange:r,open:s,title:o}){return N.jsxs("section",{className:"sidebar-section",children:[N.jsxs("button",{"aria-expanded":s,className:"sidebar-section-toggle",type:"button",onClick:()=>{r==null||r(!s)},children:[N.jsx("span",{children:o}),N.jsx("span",{"aria-hidden":"true",className:"sidebar-section-chevron"})]}),s?N.jsx("div",{className:"sidebar-section-content",children:n}):null]})}function pg(n,r){return n.find(s=>s.role===r)}function Y1({activeRole:n,roles:r=Bu,sessions:s,onSelect:o}){return N.jsx("div",{className:"role-tabs",role:"tablist","aria-label":"Role sessions",children:r.map(d=>{const v=pg(s,d.name),f=(v==null?void 0:v.status)==="running"?v.activityStatus??"idle":(v==null?void 0:v.status)??"not_started";return N.jsxs("button",{className:d.name===n?"role-tab is-active":"role-tab",type:"button",role:"tab","aria-selected":d.name===n,onClick:()=>o(d.name),children:[N.jsx("span",{children:d.label}),N.jsx(Gr,{status:f})]},d.name)})})}const mg=[{value:"default",label:"Default",description:"Account default"},{value:"best",label:"Best",description:"Fable 5 or latest Opus"},{value:"fable",label:"Fable 5",description:"1M context, v2.1.170+"},{value:"opus",label:"Opus",description:"latest Opus"},{value:"opus[1m]",label:"Opus 1M",description:"Force 1M context"},{value:"claude-opus-4-8",label:"Opus 4.8",description:"Current Opus"},{value:"claude-opus-4-8[1m]",label:"Opus 4.8 1M",description:"Opus 4.8 + 1M context"}],gg=[{value:"gpt-5.5",label:"GPT-5.5",description:"Strong Codex reviewer default"},{value:"default",label:"Default",description:"Codex account default"}],_g=[{value:"default",label:"Default",description:"CLI or project default"},{value:"low",label:"Low",description:"Fastest reasoning"},{value:"medium",label:"Medium",description:"Balanced reasoning"},{value:"high",label:"High",description:"Deeper reasoning"},{value:"xhigh",label:"XHigh",description:"Extra high reasoning"},{value:"max",label:"Max",description:"Maximum reasoning"}],vg=[..._g,{value:"ultracode",label:"Ultracode",description:"Claude Code dynamic workflows with xhigh reasoning"}],W1=vg;function K1({role:n,session:r,permissionMode:s,model:o,effort:d,busy:v=!1,onPermissionModeChange:f,onModelChange:a,onEffortChange:c,onStart:h,onResume:p,onStop:u,onRestart:S}){const C=(r==null?void 0:r.status)==="running",A=!!(r!=null&&r.claudeSessionId&&!C),x=!C&&!(r!=null&&r.claudeSessionId),b=Nu(n),_=!!(r&&r.permissionMode!==s),g=(r==null?void 0:r.model)??"default",y=!!(r&&g!==o),k=(r==null?void 0:r.effort)??"default",M=!!(r&&k!==d),D=b?gg:mg,T=b?_g:vg;return N.jsxs("div",{className:"session-controls",children:[b?null:N.jsxs("label",{className:"session-option-field permission-mode-field",children:[N.jsxs("span",{children:["Permission",N.jsx("small",{children:r?`current: ${r.permissionMode}${_?" / next launch":""}`:"applies on start"})]}),N.jsxs("select",{value:s,onChange:E=>f(E.target.value),children:[N.jsx("option",{value:"default",children:"默认"}),N.jsx("option",{value:"bypassPermissions",children:"bypassPermissions"})]})]}),N.jsxs("label",{className:"session-option-field model-field",children:[N.jsxs("span",{children:["Model",N.jsx("small",{children:r?`current: ${X1(g,b)}${y?" / next launch":""}`:"applies on start"})]}),N.jsx("select",{value:o,onChange:E=>a(E.target.value),children:D.map(E=>N.jsx("option",{value:E.value,children:E.label},E.value))})]}),N.jsxs("label",{className:"session-option-field effort-field",children:[N.jsxs("span",{children:["Effort",N.jsx("small",{children:r?`current: ${Q1(k)}${M?" / next launch":""}`:"applies on start"})]}),N.jsx("select",{value:d,onChange:E=>c(E.target.value),children:T.map(E=>N.jsx("option",{value:E.value,children:E.label},E.value))})]}),N.jsxs("div",{className:"session-toolbar",children:[N.jsx("button",{type:"button",disabled:v||!x,onClick:h,children:"Start"}),N.jsx("button",{type:"button",disabled:v||!A,onClick:p,children:"Resume"}),N.jsx("button",{type:"button",disabled:v||!r,onClick:S,children:"Restart"}),N.jsx("button",{type:"button",disabled:v||!r,onClick:u,children:"Stop"})]})]})}function X1(n,r){var s,o;return r?((s=gg.find(d=>d.value===n))==null?void 0:s.label)??n:((o=mg.find(d=>d.value===n))==null?void 0:o.label)??n}function Q1(n){var r;return((r=W1.find(s=>s.value===n))==null?void 0:r.label)??n}function Z1(n,r){const s={};return(n[n.length-1]===""?[...n,""]:n).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const J1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ey=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ty={};function fm(n,r){return(ty.jsx?ey:J1).test(n)}const ny=/[ \t\n\f\r]/g;function iy(n){return typeof n=="object"?n.type==="text"?dm(n.value):!1:dm(n)}function dm(n){return n.replace(ny,"")===""}class il{constructor(r,s,o){this.normal=s,this.property=r,o&&(this.space=o)}}il.prototype.normal={};il.prototype.property={};il.prototype.space=void 0;function yg(n,r){const s={},o={};for(const d of n)Object.assign(s,d.property),Object.assign(o,d.normal);return new il(s,o,r)}function bu(n){return n.toLowerCase()}class nn{constructor(r,s){this.attribute=s,this.property=r}}nn.prototype.attribute="";nn.prototype.booleanish=!1;nn.prototype.boolean=!1;nn.prototype.commaOrSpaceSeparated=!1;nn.prototype.commaSeparated=!1;nn.prototype.defined=!1;nn.prototype.mustUseProperty=!1;nn.prototype.number=!1;nn.prototype.overloadedBoolean=!1;nn.prototype.property="";nn.prototype.spaceSeparated=!1;nn.prototype.space=void 0;let ry=0;const Ue=tr(),At=tr(),Cu=tr(),ye=tr(),ft=tr(),Yr=tr(),hn=tr();function tr(){return 2**++ry}const wu=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ue,booleanish:At,commaOrSpaceSeparated:hn,commaSeparated:Yr,number:ye,overloadedBoolean:Cu,spaceSeparated:ft},Symbol.toStringTag,{value:"Module"})),iu=Object.keys(wu);class zu extends nn{constructor(r,s,o,d){let v=-1;if(super(r,s),pm(this,"space",d),typeof o=="number")for(;++v<iu.length;){const f=iu[v];pm(this,iu[v],(o&wu[f])===wu[f])}}}zu.prototype.defined=!0;function pm(n,r,s){s&&(n[r]=s)}function Xr(n){const r={},s={};for(const[o,d]of Object.entries(n.properties)){const v=new zu(o,n.transform(n.attributes||{},o),d,n.space);n.mustUseProperty&&n.mustUseProperty.includes(o)&&(v.mustUseProperty=!0),r[o]=v,s[bu(o)]=o,s[bu(v.attribute)]=o}return new il(r,s,n.space)}const Sg=Xr({properties:{ariaActiveDescendant:null,ariaAtomic:At,ariaAutoComplete:null,ariaBusy:At,ariaChecked:At,ariaColCount:ye,ariaColIndex:ye,ariaColSpan:ye,ariaControls:ft,ariaCurrent:null,ariaDescribedBy:ft,ariaDetails:null,ariaDisabled:At,ariaDropEffect:ft,ariaErrorMessage:null,ariaExpanded:At,ariaFlowTo:ft,ariaGrabbed:At,ariaHasPopup:null,ariaHidden:At,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ft,ariaLevel:ye,ariaLive:null,ariaModal:At,ariaMultiLine:At,ariaMultiSelectable:At,ariaOrientation:null,ariaOwns:ft,ariaPlaceholder:null,ariaPosInSet:ye,ariaPressed:At,ariaReadOnly:At,ariaRelevant:null,ariaRequired:At,ariaRoleDescription:ft,ariaRowCount:ye,ariaRowIndex:ye,ariaRowSpan:ye,ariaSelected:At,ariaSetSize:ye,ariaSort:null,ariaValueMax:ye,ariaValueMin:ye,ariaValueNow:ye,ariaValueText:null,role:null},transform(n,r){return r==="role"?r:"aria-"+r.slice(4).toLowerCase()}});function bg(n,r){return r in n?n[r]:r}function Cg(n,r){return bg(n,r.toLowerCase())}const sy=Xr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Yr,acceptCharset:ft,accessKey:ft,action:null,allow:null,allowFullScreen:Ue,allowPaymentRequest:Ue,allowUserMedia:Ue,alt:null,as:null,async:Ue,autoCapitalize:null,autoComplete:ft,autoFocus:Ue,autoPlay:Ue,blocking:ft,capture:null,charSet:null,checked:Ue,cite:null,className:ft,cols:ye,colSpan:null,content:null,contentEditable:At,controls:Ue,controlsList:ft,coords:ye|Yr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ue,defer:Ue,dir:null,dirName:null,disabled:Ue,download:Cu,draggable:At,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ue,formTarget:null,headers:ft,height:ye,hidden:Cu,high:ye,href:null,hrefLang:null,htmlFor:ft,httpEquiv:ft,id:null,imageSizes:null,imageSrcSet:null,inert:Ue,inputMode:null,integrity:null,is:null,isMap:Ue,itemId:null,itemProp:ft,itemRef:ft,itemScope:Ue,itemType:ft,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ue,low:ye,manifest:null,max:null,maxLength:ye,media:null,method:null,min:null,minLength:ye,multiple:Ue,muted:Ue,name:null,nonce:null,noModule:Ue,noValidate:Ue,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:Ue,optimum:ye,pattern:null,ping:ft,placeholder:null,playsInline:Ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ue,referrerPolicy:null,rel:ft,required:Ue,reversed:Ue,rows:ye,rowSpan:ye,sandbox:ft,scope:null,scoped:Ue,seamless:Ue,selected:Ue,shadowRootClonable:Ue,shadowRootDelegatesFocus:Ue,shadowRootMode:null,shape:null,size:ye,sizes:null,slot:null,span:ye,spellCheck:At,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ye,step:null,style:null,tabIndex:ye,target:null,title:null,translate:null,type:null,typeMustMatch:Ue,useMap:null,value:At,width:ye,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ft,axis:null,background:null,bgColor:null,border:ye,borderColor:null,bottomMargin:ye,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ue,declare:Ue,event:null,face:null,frame:null,frameBorder:null,hSpace:ye,leftMargin:ye,link:null,longDesc:null,lowSrc:null,marginHeight:ye,marginWidth:ye,noResize:Ue,noHref:Ue,noShade:Ue,noWrap:Ue,object:null,profile:null,prompt:null,rev:null,rightMargin:ye,rules:null,scheme:null,scrolling:At,standby:null,summary:null,text:null,topMargin:ye,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ye,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ue,disableRemotePlayback:Ue,prefix:null,property:null,results:ye,security:null,unselectable:null},space:"html",transform:Cg}),ly=Xr({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:hn,accentHeight:ye,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ye,amplitude:ye,arabicForm:null,ascent:ye,attributeName:null,attributeType:null,azimuth:ye,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ye,by:null,calcMode:null,capHeight:ye,className:ft,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:ye,diffuseConstant:ye,direction:null,display:null,dur:null,divisor:ye,dominantBaseline:null,download:Ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:ye,enableBackground:null,end:null,event:null,exponent:ye,externalResourcesRequired:null,fill:null,fillOpacity:ye,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:Yr,g2:Yr,glyphName:Yr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ye,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ye,horizOriginX:ye,horizOriginY:ye,id:null,ideographic:ye,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ye,k:ye,k1:ye,k2:ye,k3:ye,k4:ye,kernelMatrix:hn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ye,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:ye,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:ye,overlineThickness:ye,paintOrder:null,panose1:null,path:null,pathLength:ye,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ft,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ye,pointsAtY:ye,pointsAtZ:ye,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:hn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:hn,rev:hn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:hn,requiredFeatures:hn,requiredFonts:hn,requiredFormats:hn,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:ye,specularExponent:ye,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ye,strikethroughThickness:ye,string:null,stroke:null,strokeDashArray:hn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ye,strokeOpacity:ye,strokeWidth:null,style:null,surfaceScale:ye,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:hn,tabIndex:ye,tableValues:null,target:null,targetX:ye,targetY:ye,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:hn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ye,underlineThickness:ye,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ye,values:null,vAlphabetic:ye,vMathematical:ye,vectorEffect:null,vHanging:ye,vIdeographic:ye,version:null,vertAdvY:ye,vertOriginX:ye,vertOriginY:ye,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ye,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:bg}),wg=Xr({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(n,r){return"xlink:"+r.slice(5).toLowerCase()}}),xg=Xr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Cg}),Eg=Xr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,r){return"xml:"+r.slice(3).toLowerCase()}}),ay={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"},oy=/[A-Z]/g,mm=/-[a-z]/g,cy=/^data[-\w.:]+$/i;function uy(n,r){const s=bu(r);let o=r,d=nn;if(s in n.normal)return n.property[n.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&cy.test(r)){if(r.charAt(4)==="-"){const v=r.slice(5).replace(mm,fy);o="data"+v.charAt(0).toUpperCase()+v.slice(1)}else{const v=r.slice(4);if(!mm.test(v)){let f=v.replace(oy,hy);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}d=zu}return new d(o,r)}function hy(n){return"-"+n.toLowerCase()}function fy(n){return n.charAt(1).toUpperCase()}const dy=yg([Sg,sy,wg,xg,Eg],"html"),Hu=yg([Sg,ly,wg,xg,Eg],"svg");function py(n){return n.join(" ").trim()}var Fr={},ru,gm;function my(){if(gm)return ru;gm=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,s=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,d=/^:\s*/,v=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,a=/^\s+|\s+$/g,c=`
|
|
63
|
+
`,h="/",p="*",u="",S="comment",C="declaration";function A(b,_){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];_=_||{};var g=1,y=1;function k($){var W=$.match(r);W&&(g+=W.length);var G=$.lastIndexOf(c);y=~G?$.length-G:y+$.length}function M(){var $={line:g,column:y};return function(W){return W.position=new D($),R(),W}}function D($){this.start=$,this.end={line:g,column:y},this.source=_.source}D.prototype.content=b;function T($){var W=new Error(_.source+":"+g+":"+y+": "+$);if(W.reason=$,W.filename=_.source,W.line=g,W.column=y,W.source=b,!_.silent)throw W}function E($){var W=$.exec(b);if(W){var G=W[0];return k(G),b=b.slice(G.length),W}}function R(){E(s)}function B($){var W;for($=$||[];W=H();)W!==!1&&$.push(W);return $}function H(){var $=M();if(!(h!=b.charAt(0)||p!=b.charAt(1))){for(var W=2;u!=b.charAt(W)&&(p!=b.charAt(W)||h!=b.charAt(W+1));)++W;if(W+=2,u===b.charAt(W-1))return T("End of comment missing");var G=b.slice(2,W-2);return y+=2,k(G),b=b.slice(W),y+=2,$({type:S,comment:G})}}function P(){var $=M(),W=E(o);if(W){if(H(),!E(d))return T("property missing ':'");var G=E(v),X=$({type:C,property:x(W[0].replace(n,u)),value:G?x(G[0].replace(n,u)):u});return E(f),X}}function F(){var $=[];B($);for(var W;W=P();)W!==!1&&($.push(W),B($));return $}return R(),F()}function x(b){return b?b.replace(a,u):u}return ru=A,ru}var _m;function gy(){if(_m)return Fr;_m=1;var n=Fr&&Fr.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Fr,"__esModule",{value:!0}),Fr.default=s;const r=n(my());function s(o,d){let v=null;if(!o||typeof o!="string")return v;const f=(0,r.default)(o),a=typeof d=="function";return f.forEach(c=>{if(c.type!=="declaration")return;const{property:h,value:p}=c;a?d(h,p,c):p&&(v=v||{},v[h]=p)}),v}return Fr}var $s={},vm;function _y(){if(vm)return $s;vm=1,Object.defineProperty($s,"__esModule",{value:!0}),$s.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,s=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,d=/^-(ms)-/,v=function(h){return!h||s.test(h)||n.test(h)},f=function(h,p){return p.toUpperCase()},a=function(h,p){return"".concat(p,"-")},c=function(h,p){return p===void 0&&(p={}),v(h)?h:(h=h.toLowerCase(),p.reactCompat?h=h.replace(d,a):h=h.replace(o,a),h.replace(r,f))};return $s.camelCase=c,$s}var Ys,ym;function vy(){if(ym)return Ys;ym=1;var n=Ys&&Ys.__importDefault||function(d){return d&&d.__esModule?d:{default:d}},r=n(gy()),s=_y();function o(d,v){var f={};return!d||typeof d!="string"||(0,r.default)(d,function(a,c){a&&c&&(f[(0,s.camelCase)(a,v)]=c)}),f}return o.default=o,Ys=o,Ys}var yy=vy();const Sy=lg(yy),kg=Ag("end"),Iu=Ag("start");function Ag(n){return r;function r(s){const o=s&&s.position&&s.position[n]||{};if(typeof o.line=="number"&&o.line>0&&typeof o.column=="number"&&o.column>0)return{line:o.line,column:o.column,offset:typeof o.offset=="number"&&o.offset>-1?o.offset:void 0}}}function by(n){const r=Iu(n),s=kg(n);if(r&&s)return{start:r,end:s}}function Qs(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?Sm(n.position):"start"in n||"end"in n?Sm(n):"line"in n||"column"in n?xu(n):""}function xu(n){return bm(n&&n.line)+":"+bm(n&&n.column)}function Sm(n){return xu(n&&n.start)+"-"+xu(n&&n.end)}function bm(n){return n&&typeof n=="number"?n:1}class Vt extends Error{constructor(r,s,o){super(),typeof s=="string"&&(o=s,s=void 0);let d="",v={},f=!1;if(s&&("line"in s&&"column"in s?v={place:s}:"start"in s&&"end"in s?v={place:s}:"type"in s?v={ancestors:[s],place:s.position}:v={...s}),typeof r=="string"?d=r:!v.cause&&r&&(f=!0,d=r.message,v.cause=r),!v.ruleId&&!v.source&&typeof o=="string"){const c=o.indexOf(":");c===-1?v.ruleId=o:(v.source=o.slice(0,c),v.ruleId=o.slice(c+1))}if(!v.place&&v.ancestors&&v.ancestors){const c=v.ancestors[v.ancestors.length-1];c&&(v.place=c.position)}const a=v.place&&"start"in v.place?v.place.start:v.place;this.ancestors=v.ancestors||void 0,this.cause=v.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=d,this.line=a?a.line:void 0,this.name=Qs(v.place)||"1:1",this.place=v.place||void 0,this.reason=this.message,this.ruleId=v.ruleId||void 0,this.source=v.source||void 0,this.stack=f&&v.cause&&typeof v.cause.stack=="string"?v.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 Uu={}.hasOwnProperty,Cy=new Map,wy=/[A-Z]/g,xy=new Set(["table","tbody","thead","tfoot","tr"]),Ey=new Set(["td","th"]),Tg="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ky(n,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=r.filePath||void 0;let o;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");o=By(s,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");o=Oy(s,r.jsx,r.jsxs)}const d={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:o,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?Hu:dy,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},v=Dg(d,n,void 0);return v&&typeof v!="string"?v:d.create(n,d.Fragment,{children:v||void 0},void 0)}function Dg(n,r,s){if(r.type==="element")return Ay(n,r,s);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return Ty(n,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return Ry(n,r,s);if(r.type==="mdxjsEsm")return Dy(n,r);if(r.type==="root")return My(n,r,s);if(r.type==="text")return Ly(n,r)}function Ay(n,r,s){const o=n.schema;let d=o;r.tagName.toLowerCase()==="svg"&&o.space==="html"&&(d=Hu,n.schema=d),n.ancestors.push(r);const v=Mg(n,r.tagName,!1),f=Ny(n,r);let a=Fu(n,r);return xy.has(r.tagName)&&(a=a.filter(function(c){return typeof c=="string"?!iy(c):!0})),Rg(n,f,v,r),Pu(f,a),n.ancestors.pop(),n.schema=o,n.create(r,v,f,s)}function Ty(n,r){if(r.data&&r.data.estree&&n.evaluater){const o=r.data.estree.body[0];return o.type,n.evaluater.evaluateExpression(o.expression)}tl(n,r.position)}function Dy(n,r){if(r.data&&r.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(r.data.estree);tl(n,r.position)}function Ry(n,r,s){const o=n.schema;let d=o;r.name==="svg"&&o.space==="html"&&(d=Hu,n.schema=d),n.ancestors.push(r);const v=r.name===null?n.Fragment:Mg(n,r.name,!0),f=jy(n,r),a=Fu(n,r);return Rg(n,f,v,r),Pu(f,a),n.ancestors.pop(),n.schema=o,n.create(r,v,f,s)}function My(n,r,s){const o={};return Pu(o,Fu(n,r)),n.create(r,n.Fragment,o,s)}function Ly(n,r){return r.value}function Rg(n,r,s,o){typeof s!="string"&&s!==n.Fragment&&n.passNode&&(r.node=o)}function Pu(n,r){if(r.length>0){const s=r.length>1?r:r[0];s&&(n.children=s)}}function Oy(n,r,s){return o;function o(d,v,f,a){const h=Array.isArray(f.children)?s:r;return a?h(v,f,a):h(v,f)}}function By(n,r){return s;function s(o,d,v,f){const a=Array.isArray(v.children),c=Iu(o);return r(d,v,f,a,{columnNumber:c?c.column-1:void 0,fileName:n,lineNumber:c?c.line:void 0},void 0)}}function Ny(n,r){const s={};let o,d;for(d in r.properties)if(d!=="children"&&Uu.call(r.properties,d)){const v=zy(n,d,r.properties[d]);if(v){const[f,a]=v;n.tableCellAlignToStyle&&f==="align"&&typeof a=="string"&&Ey.has(r.tagName)?o=a:s[f]=a}}if(o){const v=s.style||(s.style={});v[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=o}return s}function jy(n,r){const s={};for(const o of r.attributes)if(o.type==="mdxJsxExpressionAttribute")if(o.data&&o.data.estree&&n.evaluater){const v=o.data.estree.body[0];v.type;const f=v.expression;f.type;const a=f.properties[0];a.type,Object.assign(s,n.evaluater.evaluateExpression(a.argument))}else tl(n,r.position);else{const d=o.name;let v;if(o.value&&typeof o.value=="object")if(o.value.data&&o.value.data.estree&&n.evaluater){const a=o.value.data.estree.body[0];a.type,v=n.evaluater.evaluateExpression(a.expression)}else tl(n,r.position);else v=o.value===null?!0:o.value;s[d]=v}return s}function Fu(n,r){const s=[];let o=-1;const d=n.passKeys?new Map:Cy;for(;++o<r.children.length;){const v=r.children[o];let f;if(n.passKeys){const c=v.type==="element"?v.tagName:v.type==="mdxJsxFlowElement"||v.type==="mdxJsxTextElement"?v.name:void 0;if(c){const h=d.get(c)||0;f=c+"-"+h,d.set(c,h+1)}}const a=Dg(n,v,f);a!==void 0&&s.push(a)}return s}function zy(n,r,s){const o=uy(n.schema,r);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=o.commaSeparated?Z1(s):py(s)),o.property==="style"){let d=typeof s=="object"?s:Hy(n,String(s));return n.stylePropertyNameCase==="css"&&(d=Iy(d)),["style",d]}return[n.elementAttributeNameCase==="react"&&o.space?ay[o.property]||o.property:o.attribute,s]}}function Hy(n,r){try{return Sy(r,{reactCompat:!0})}catch(s){if(n.ignoreInvalidStyle)return{};const o=s,d=new Vt("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw d.file=n.filePath||void 0,d.url=Tg+"#cannot-parse-style-attribute",d}}function Mg(n,r,s){let o;if(!s)o={type:"Literal",value:r};else if(r.includes(".")){const d=r.split(".");let v=-1,f;for(;++v<d.length;){const a=fm(d[v])?{type:"Identifier",name:d[v]}:{type:"Literal",value:d[v]};f=f?{type:"MemberExpression",object:f,property:a,computed:!!(v&&a.type==="Literal"),optional:!1}:a}o=f}else o=fm(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(o.type==="Literal"){const d=o.value;return Uu.call(n.components,d)?n.components[d]:d}if(n.evaluater)return n.evaluater.evaluateExpression(o);tl(n)}function tl(n,r){const s=new Vt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:n.ancestors,place:r,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw s.file=n.filePath||void 0,s.url=Tg+"#cannot-handle-mdx-estrees-without-createevaluater",s}function Iy(n){const r={};let s;for(s in n)Uu.call(n,s)&&(r[Uy(s)]=n[s]);return r}function Uy(n){let r=n.replace(wy,Py);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function Py(n){return"-"+n.toLowerCase()}const su={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"]},Fy={};function qu(n,r){const s=Fy,o=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,d=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return Lg(n,o,d)}function Lg(n,r,s){if(qy(n)){if("value"in n)return n.type==="html"&&!s?"":n.value;if(r&&"alt"in n&&n.alt)return n.alt;if("children"in n)return Cm(n.children,r,s)}return Array.isArray(n)?Cm(n,r,s):""}function Cm(n,r,s){const o=[];let d=-1;for(;++d<n.length;)o[d]=Lg(n[d],r,s);return o.join("")}function qy(n){return!!(n&&typeof n=="object")}const wm=document.createElement("i");function Vu(n){const r="&"+n+";";wm.innerHTML=r;const s=wm.textContent;return s.charCodeAt(s.length-1)===59&&n!=="semi"||s===r?!1:s}function fn(n,r,s,o){const d=n.length;let v=0,f;if(r<0?r=-r>d?0:d+r:r=r>d?d:r,s=s>0?s:0,o.length<1e4)f=Array.from(o),f.unshift(r,s),n.splice(...f);else for(s&&n.splice(r,s);v<o.length;)f=o.slice(v,v+1e4),f.unshift(r,0),n.splice(...f),v+=1e4,r+=1e4}function wn(n,r){return n.length>0?(fn(n,n.length,0,r),n):r}const xm={}.hasOwnProperty;function Og(n){const r={};let s=-1;for(;++s<n.length;)Vy(r,n[s]);return r}function Vy(n,r){let s;for(s in r){const d=(xm.call(n,s)?n[s]:void 0)||(n[s]={}),v=r[s];let f;if(v)for(f in v){xm.call(d,f)||(d[f]=[]);const a=v[f];Gy(d[f],Array.isArray(a)?a:a?[a]:[])}}}function Gy(n,r){let s=-1;const o=[];for(;++s<r.length;)(r[s].add==="after"?n:o).push(r[s]);fn(n,0,0,o)}function Bg(n,r){const s=Number.parseInt(n,r);return s<9||s===11||s>13&&s<32||s>126&&s<160||s>55295&&s<57344||s>64975&&s<65008||(s&65535)===65535||(s&65535)===65534||s>1114111?"�":String.fromCodePoint(s)}function Tn(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const $t=Bi(/[A-Za-z]/),qt=Bi(/[\dA-Za-z]/),$y=Bi(/[#-'*+\--9=?A-Z^-~]/);function Aa(n){return n!==null&&(n<32||n===127)}const Eu=Bi(/\d/),Yy=Bi(/[\dA-Fa-f]/),Wy=Bi(/[!-/:-@[-`{-~]/);function Oe(n){return n!==null&&n<-2}function ut(n){return n!==null&&(n<0||n===32)}function Ge(n){return n===-2||n===-1||n===32}const Ma=Bi(new RegExp("\\p{P}|\\p{S}","u")),er=Bi(/\s/);function Bi(n){return r;function r(s){return s!==null&&s>-1&&n.test(String.fromCharCode(s))}}function Qr(n){const r=[];let s=-1,o=0,d=0;for(;++s<n.length;){const v=n.charCodeAt(s);let f="";if(v===37&&qt(n.charCodeAt(s+1))&&qt(n.charCodeAt(s+2)))d=2;else if(v<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(v))||(f=String.fromCharCode(v));else if(v>55295&&v<57344){const a=n.charCodeAt(s+1);v<56320&&a>56319&&a<57344?(f=String.fromCharCode(v,a),d=1):f="�"}else f=String.fromCharCode(v);f&&(r.push(n.slice(o,s),encodeURIComponent(f)),o=s+d+1,f=""),d&&(s+=d,d=0)}return r.join("")+n.slice(o)}function Xe(n,r,s,o){const d=o?o-1:Number.POSITIVE_INFINITY;let v=0;return f;function f(c){return Ge(c)?(n.enter(s),a(c)):r(c)}function a(c){return Ge(c)&&v++<d?(n.consume(c),a):(n.exit(s),r(c))}}const Ky={tokenize:Xy};function Xy(n){const r=n.attempt(this.parser.constructs.contentInitial,o,d);let s;return r;function o(a){if(a===null){n.consume(a);return}return n.enter("lineEnding"),n.consume(a),n.exit("lineEnding"),Xe(n,r,"linePrefix")}function d(a){return n.enter("paragraph"),v(a)}function v(a){const c=n.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=c),s=c,f(a)}function f(a){if(a===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(a);return}return Oe(a)?(n.consume(a),n.exit("chunkText"),v):(n.consume(a),f)}}const Qy={tokenize:Zy},Em={tokenize:Jy};function Zy(n){const r=this,s=[];let o=0,d,v,f;return a;function a(y){if(o<s.length){const k=s[o];return r.containerState=k[1],n.attempt(k[0].continuation,c,h)(y)}return h(y)}function c(y){if(o++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,d&&g();const k=r.events.length;let M=k,D;for(;M--;)if(r.events[M][0]==="exit"&&r.events[M][1].type==="chunkFlow"){D=r.events[M][1].end;break}_(o);let T=k;for(;T<r.events.length;)r.events[T][1].end={...D},T++;return fn(r.events,M+1,0,r.events.slice(k)),r.events.length=T,h(y)}return a(y)}function h(y){if(o===s.length){if(!d)return S(y);if(d.currentConstruct&&d.currentConstruct.concrete)return A(y);r.interrupt=!!(d.currentConstruct&&!d._gfmTableDynamicInterruptHack)}return r.containerState={},n.check(Em,p,u)(y)}function p(y){return d&&g(),_(o),S(y)}function u(y){return r.parser.lazy[r.now().line]=o!==s.length,f=r.now().offset,A(y)}function S(y){return r.containerState={},n.attempt(Em,C,A)(y)}function C(y){return o++,s.push([r.currentConstruct,r.containerState]),S(y)}function A(y){if(y===null){d&&g(),_(0),n.consume(y);return}return d=d||r.parser.flow(r.now()),n.enter("chunkFlow",{_tokenizer:d,contentType:"flow",previous:v}),x(y)}function x(y){if(y===null){b(n.exit("chunkFlow"),!0),_(0),n.consume(y);return}return Oe(y)?(n.consume(y),b(n.exit("chunkFlow")),o=0,r.interrupt=void 0,a):(n.consume(y),x)}function b(y,k){const M=r.sliceStream(y);if(k&&M.push(null),y.previous=v,v&&(v.next=y),v=y,d.defineSkip(y.start),d.write(M),r.parser.lazy[y.start.line]){let D=d.events.length;for(;D--;)if(d.events[D][1].start.offset<f&&(!d.events[D][1].end||d.events[D][1].end.offset>f))return;const T=r.events.length;let E=T,R,B;for(;E--;)if(r.events[E][0]==="exit"&&r.events[E][1].type==="chunkFlow"){if(R){B=r.events[E][1].end;break}R=!0}for(_(o),D=T;D<r.events.length;)r.events[D][1].end={...B},D++;fn(r.events,E+1,0,r.events.slice(T)),r.events.length=D}}function _(y){let k=s.length;for(;k-- >y;){const M=s[k];r.containerState=M[1],M[0].exit.call(r,n)}s.length=y}function g(){d.write([null]),v=void 0,d=void 0,r.containerState._closeFlow=void 0}}function Jy(n,r,s){return Xe(n,n.attempt(this.parser.constructs.document,r,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Wr(n){if(n===null||ut(n)||er(n))return 1;if(Ma(n))return 2}function La(n,r,s){const o=[];let d=-1;for(;++d<n.length;){const v=n[d].resolveAll;v&&!o.includes(v)&&(r=v(r,s),o.push(v))}return r}const ku={name:"attention",resolveAll:eS,tokenize:tS};function eS(n,r){let s=-1,o,d,v,f,a,c,h,p;for(;++s<n.length;)if(n[s][0]==="enter"&&n[s][1].type==="attentionSequence"&&n[s][1]._close){for(o=s;o--;)if(n[o][0]==="exit"&&n[o][1].type==="attentionSequence"&&n[o][1]._open&&r.sliceSerialize(n[o][1]).charCodeAt(0)===r.sliceSerialize(n[s][1]).charCodeAt(0)){if((n[o][1]._close||n[s][1]._open)&&(n[s][1].end.offset-n[s][1].start.offset)%3&&!((n[o][1].end.offset-n[o][1].start.offset+n[s][1].end.offset-n[s][1].start.offset)%3))continue;c=n[o][1].end.offset-n[o][1].start.offset>1&&n[s][1].end.offset-n[s][1].start.offset>1?2:1;const u={...n[o][1].end},S={...n[s][1].start};km(u,-c),km(S,c),f={type:c>1?"strongSequence":"emphasisSequence",start:u,end:{...n[o][1].end}},a={type:c>1?"strongSequence":"emphasisSequence",start:{...n[s][1].start},end:S},v={type:c>1?"strongText":"emphasisText",start:{...n[o][1].end},end:{...n[s][1].start}},d={type:c>1?"strong":"emphasis",start:{...f.start},end:{...a.end}},n[o][1].end={...f.start},n[s][1].start={...a.end},h=[],n[o][1].end.offset-n[o][1].start.offset&&(h=wn(h,[["enter",n[o][1],r],["exit",n[o][1],r]])),h=wn(h,[["enter",d,r],["enter",f,r],["exit",f,r],["enter",v,r]]),h=wn(h,La(r.parser.constructs.insideSpan.null,n.slice(o+1,s),r)),h=wn(h,[["exit",v,r],["enter",a,r],["exit",a,r],["exit",d,r]]),n[s][1].end.offset-n[s][1].start.offset?(p=2,h=wn(h,[["enter",n[s][1],r],["exit",n[s][1],r]])):p=0,fn(n,o-1,s-o+3,h),s=o+h.length-p-2;break}}for(s=-1;++s<n.length;)n[s][1].type==="attentionSequence"&&(n[s][1].type="data");return n}function tS(n,r){const s=this.parser.constructs.attentionMarkers.null,o=this.previous,d=Wr(o);let v;return f;function f(c){return v=c,n.enter("attentionSequence"),a(c)}function a(c){if(c===v)return n.consume(c),a;const h=n.exit("attentionSequence"),p=Wr(c),u=!p||p===2&&d||s.includes(c),S=!d||d===2&&p||s.includes(o);return h._open=!!(v===42?u:u&&(d||!S)),h._close=!!(v===42?S:S&&(p||!u)),r(c)}}function km(n,r){n.column+=r,n.offset+=r,n._bufferIndex+=r}const nS={name:"autolink",tokenize:iS};function iS(n,r,s){let o=0;return d;function d(C){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(C),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),v}function v(C){return $t(C)?(n.consume(C),f):C===64?s(C):h(C)}function f(C){return C===43||C===45||C===46||qt(C)?(o=1,a(C)):h(C)}function a(C){return C===58?(n.consume(C),o=0,c):(C===43||C===45||C===46||qt(C))&&o++<32?(n.consume(C),a):(o=0,h(C))}function c(C){return C===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(C),n.exit("autolinkMarker"),n.exit("autolink"),r):C===null||C===32||C===60||Aa(C)?s(C):(n.consume(C),c)}function h(C){return C===64?(n.consume(C),p):$y(C)?(n.consume(C),h):s(C)}function p(C){return qt(C)?u(C):s(C)}function u(C){return C===46?(n.consume(C),o=0,p):C===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(C),n.exit("autolinkMarker"),n.exit("autolink"),r):S(C)}function S(C){if((C===45||qt(C))&&o++<63){const A=C===45?S:u;return n.consume(C),A}return s(C)}}const rl={partial:!0,tokenize:rS};function rS(n,r,s){return o;function o(v){return Ge(v)?Xe(n,d,"linePrefix")(v):d(v)}function d(v){return v===null||Oe(v)?r(v):s(v)}}const Ng={continuation:{tokenize:lS},exit:aS,name:"blockQuote",tokenize:sS};function sS(n,r,s){const o=this;return d;function d(f){if(f===62){const a=o.containerState;return a.open||(n.enter("blockQuote",{_container:!0}),a.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(f),n.exit("blockQuoteMarker"),v}return s(f)}function v(f){return Ge(f)?(n.enter("blockQuotePrefixWhitespace"),n.consume(f),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),r):(n.exit("blockQuotePrefix"),r(f))}}function lS(n,r,s){const o=this;return d;function d(f){return Ge(f)?Xe(n,v,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):v(f)}function v(f){return n.attempt(Ng,r,s)(f)}}function aS(n){n.exit("blockQuote")}const jg={name:"characterEscape",tokenize:oS};function oS(n,r,s){return o;function o(v){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(v),n.exit("escapeMarker"),d}function d(v){return Wy(v)?(n.enter("characterEscapeValue"),n.consume(v),n.exit("characterEscapeValue"),n.exit("characterEscape"),r):s(v)}}const zg={name:"characterReference",tokenize:cS};function cS(n,r,s){const o=this;let d=0,v,f;return a;function a(u){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(u),n.exit("characterReferenceMarker"),c}function c(u){return u===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(u),n.exit("characterReferenceMarkerNumeric"),h):(n.enter("characterReferenceValue"),v=31,f=qt,p(u))}function h(u){return u===88||u===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(u),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),v=6,f=Yy,p):(n.enter("characterReferenceValue"),v=7,f=Eu,p(u))}function p(u){if(u===59&&d){const S=n.exit("characterReferenceValue");return f===qt&&!Vu(o.sliceSerialize(S))?s(u):(n.enter("characterReferenceMarker"),n.consume(u),n.exit("characterReferenceMarker"),n.exit("characterReference"),r)}return f(u)&&d++<v?(n.consume(u),p):s(u)}}const Am={partial:!0,tokenize:hS},Tm={concrete:!0,name:"codeFenced",tokenize:uS};function uS(n,r,s){const o=this,d={partial:!0,tokenize:M};let v=0,f=0,a;return c;function c(D){return h(D)}function h(D){const T=o.events[o.events.length-1];return v=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,a=D,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),p(D)}function p(D){return D===a?(f++,n.consume(D),p):f<3?s(D):(n.exit("codeFencedFenceSequence"),Ge(D)?Xe(n,u,"whitespace")(D):u(D))}function u(D){return D===null||Oe(D)?(n.exit("codeFencedFence"),o.interrupt?r(D):n.check(Am,x,k)(D)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),S(D))}function S(D){return D===null||Oe(D)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),u(D)):Ge(D)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),Xe(n,C,"whitespace")(D)):D===96&&D===a?s(D):(n.consume(D),S)}function C(D){return D===null||Oe(D)?u(D):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),A(D))}function A(D){return D===null||Oe(D)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),u(D)):D===96&&D===a?s(D):(n.consume(D),A)}function x(D){return n.attempt(d,k,b)(D)}function b(D){return n.enter("lineEnding"),n.consume(D),n.exit("lineEnding"),_}function _(D){return v>0&&Ge(D)?Xe(n,g,"linePrefix",v+1)(D):g(D)}function g(D){return D===null||Oe(D)?n.check(Am,x,k)(D):(n.enter("codeFlowValue"),y(D))}function y(D){return D===null||Oe(D)?(n.exit("codeFlowValue"),g(D)):(n.consume(D),y)}function k(D){return n.exit("codeFenced"),r(D)}function M(D,T,E){let R=0;return B;function B(W){return D.enter("lineEnding"),D.consume(W),D.exit("lineEnding"),H}function H(W){return D.enter("codeFencedFence"),Ge(W)?Xe(D,P,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):P(W)}function P(W){return W===a?(D.enter("codeFencedFenceSequence"),F(W)):E(W)}function F(W){return W===a?(R++,D.consume(W),F):R>=f?(D.exit("codeFencedFenceSequence"),Ge(W)?Xe(D,$,"whitespace")(W):$(W)):E(W)}function $(W){return W===null||Oe(W)?(D.exit("codeFencedFence"),T(W)):E(W)}}}function hS(n,r,s){const o=this;return d;function d(f){return f===null?s(f):(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),v)}function v(f){return o.parser.lazy[o.now().line]?s(f):r(f)}}const lu={name:"codeIndented",tokenize:dS},fS={partial:!0,tokenize:pS};function dS(n,r,s){const o=this;return d;function d(h){return n.enter("codeIndented"),Xe(n,v,"linePrefix",5)(h)}function v(h){const p=o.events[o.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?f(h):s(h)}function f(h){return h===null?c(h):Oe(h)?n.attempt(fS,f,c)(h):(n.enter("codeFlowValue"),a(h))}function a(h){return h===null||Oe(h)?(n.exit("codeFlowValue"),f(h)):(n.consume(h),a)}function c(h){return n.exit("codeIndented"),r(h)}}function pS(n,r,s){const o=this;return d;function d(f){return o.parser.lazy[o.now().line]?s(f):Oe(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),d):Xe(n,v,"linePrefix",5)(f)}function v(f){const a=o.events[o.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?r(f):Oe(f)?d(f):s(f)}}const mS={name:"codeText",previous:_S,resolve:gS,tokenize:vS};function gS(n){let r=n.length-4,s=3,o,d;if((n[s][1].type==="lineEnding"||n[s][1].type==="space")&&(n[r][1].type==="lineEnding"||n[r][1].type==="space")){for(o=s;++o<r;)if(n[o][1].type==="codeTextData"){n[s][1].type="codeTextPadding",n[r][1].type="codeTextPadding",s+=2,r-=2;break}}for(o=s-1,r++;++o<=r;)d===void 0?o!==r&&n[o][1].type!=="lineEnding"&&(d=o):(o===r||n[o][1].type==="lineEnding")&&(n[d][1].type="codeTextData",o!==d+2&&(n[d][1].end=n[o-1][1].end,n.splice(d+2,o-d-2),r-=o-d-2,o=d+2),d=void 0);return n}function _S(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function vS(n,r,s){let o=0,d,v;return f;function f(u){return n.enter("codeText"),n.enter("codeTextSequence"),a(u)}function a(u){return u===96?(n.consume(u),o++,a):(n.exit("codeTextSequence"),c(u))}function c(u){return u===null?s(u):u===32?(n.enter("space"),n.consume(u),n.exit("space"),c):u===96?(v=n.enter("codeTextSequence"),d=0,p(u)):Oe(u)?(n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),c):(n.enter("codeTextData"),h(u))}function h(u){return u===null||u===32||u===96||Oe(u)?(n.exit("codeTextData"),c(u)):(n.consume(u),h)}function p(u){return u===96?(n.consume(u),d++,p):d===o?(n.exit("codeTextSequence"),n.exit("codeText"),r(u)):(v.type="codeTextData",h(u))}}class yS{constructor(r){this.left=r?[...r]:[],this.right=[]}get(r){if(r<0||r>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return r<this.left.length?this.left[r]:this.right[this.right.length-r+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(r,s){const o=s??Number.POSITIVE_INFINITY;return o<this.left.length?this.left.slice(r,o):r>this.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(r,s,o){const d=s||0;this.setCursor(Math.trunc(r));const v=this.right.splice(this.right.length-d,Number.POSITIVE_INFINITY);return o&&Ws(this.left,o),v.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),Ws(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Ws(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r<this.left.length){const s=this.left.splice(r,Number.POSITIVE_INFINITY);Ws(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);Ws(this.left,s.reverse())}}}function Ws(n,r){let s=0;if(r.length<1e4)n.push(...r);else for(;s<r.length;)n.push(...r.slice(s,s+1e4)),s+=1e4}function Hg(n){const r={};let s=-1,o,d,v,f,a,c,h;const p=new yS(n);for(;++s<p.length;){for(;s in r;)s=r[s];if(o=p.get(s),s&&o[1].type==="chunkFlow"&&p.get(s-1)[1].type==="listItemPrefix"&&(c=o[1]._tokenizer.events,v=0,v<c.length&&c[v][1].type==="lineEndingBlank"&&(v+=2),v<c.length&&c[v][1].type==="content"))for(;++v<c.length&&c[v][1].type!=="content";)c[v][1].type==="chunkText"&&(c[v][1]._isInFirstContentOfListItem=!0,v++);if(o[0]==="enter")o[1].contentType&&(Object.assign(r,SS(p,s)),s=r[s],h=!0);else if(o[1]._container){for(v=s,d=void 0;v--;)if(f=p.get(v),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(d&&(p.get(d)[1].type="lineEndingBlank"),f[1].type="lineEnding",d=v);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;d&&(o[1].end={...p.get(d)[1].start},a=p.slice(d,s),a.unshift(o),p.splice(d,s-d+1,a))}}return fn(n,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function SS(n,r){const s=n.get(r)[1],o=n.get(r)[2];let d=r-1;const v=[];let f=s._tokenizer;f||(f=o.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const a=f.events,c=[],h={};let p,u,S=-1,C=s,A=0,x=0;const b=[x];for(;C;){for(;n.get(++d)[1]!==C;);v.push(d),C._tokenizer||(p=o.sliceStream(C),C.next||p.push(null),u&&f.defineSkip(C.start),C._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(p),C._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),u=C,C=C.next}for(C=s;++S<a.length;)a[S][0]==="exit"&&a[S-1][0]==="enter"&&a[S][1].type===a[S-1][1].type&&a[S][1].start.line!==a[S][1].end.line&&(x=S+1,b.push(x),C._tokenizer=void 0,C.previous=void 0,C=C.next);for(f.events=[],C?(C._tokenizer=void 0,C.previous=void 0):b.pop(),S=b.length;S--;){const _=a.slice(b[S],b[S+1]),g=v.pop();c.push([g,g+_.length-1]),n.splice(g,2,_)}for(c.reverse(),S=-1;++S<c.length;)h[A+c[S][0]]=A+c[S][1],A+=c[S][1]-c[S][0]-1;return h}const bS={resolve:wS,tokenize:xS},CS={partial:!0,tokenize:ES};function wS(n){return Hg(n),n}function xS(n,r){let s;return o;function o(a){return n.enter("content"),s=n.enter("chunkContent",{contentType:"content"}),d(a)}function d(a){return a===null?v(a):Oe(a)?n.check(CS,f,v)(a):(n.consume(a),d)}function v(a){return n.exit("chunkContent"),n.exit("content"),r(a)}function f(a){return n.consume(a),n.exit("chunkContent"),s.next=n.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,d}}function ES(n,r,s){const o=this;return d;function d(f){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),Xe(n,v,"linePrefix")}function v(f){if(f===null||Oe(f))return s(f);const a=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?r(f):n.interrupt(o.parser.constructs.flow,s,r)(f)}}function Ig(n,r,s,o,d,v,f,a,c){const h=c||Number.POSITIVE_INFINITY;let p=0;return u;function u(_){return _===60?(n.enter(o),n.enter(d),n.enter(v),n.consume(_),n.exit(v),S):_===null||_===32||_===41||Aa(_)?s(_):(n.enter(o),n.enter(f),n.enter(a),n.enter("chunkString",{contentType:"string"}),x(_))}function S(_){return _===62?(n.enter(v),n.consume(_),n.exit(v),n.exit(d),n.exit(o),r):(n.enter(a),n.enter("chunkString",{contentType:"string"}),C(_))}function C(_){return _===62?(n.exit("chunkString"),n.exit(a),S(_)):_===null||_===60||Oe(_)?s(_):(n.consume(_),_===92?A:C)}function A(_){return _===60||_===62||_===92?(n.consume(_),C):C(_)}function x(_){return!p&&(_===null||_===41||ut(_))?(n.exit("chunkString"),n.exit(a),n.exit(f),n.exit(o),r(_)):p<h&&_===40?(n.consume(_),p++,x):_===41?(n.consume(_),p--,x):_===null||_===32||_===40||Aa(_)?s(_):(n.consume(_),_===92?b:x)}function b(_){return _===40||_===41||_===92?(n.consume(_),x):x(_)}}function Ug(n,r,s,o,d,v){const f=this;let a=0,c;return h;function h(C){return n.enter(o),n.enter(d),n.consume(C),n.exit(d),n.enter(v),p}function p(C){return a>999||C===null||C===91||C===93&&!c||C===94&&!a&&"_hiddenFootnoteSupport"in f.parser.constructs?s(C):C===93?(n.exit(v),n.enter(d),n.consume(C),n.exit(d),n.exit(o),r):Oe(C)?(n.enter("lineEnding"),n.consume(C),n.exit("lineEnding"),p):(n.enter("chunkString",{contentType:"string"}),u(C))}function u(C){return C===null||C===91||C===93||Oe(C)||a++>999?(n.exit("chunkString"),p(C)):(n.consume(C),c||(c=!Ge(C)),C===92?S:u)}function S(C){return C===91||C===92||C===93?(n.consume(C),a++,u):u(C)}}function Pg(n,r,s,o,d,v){let f;return a;function a(S){return S===34||S===39||S===40?(n.enter(o),n.enter(d),n.consume(S),n.exit(d),f=S===40?41:S,c):s(S)}function c(S){return S===f?(n.enter(d),n.consume(S),n.exit(d),n.exit(o),r):(n.enter(v),h(S))}function h(S){return S===f?(n.exit(v),c(f)):S===null?s(S):Oe(S)?(n.enter("lineEnding"),n.consume(S),n.exit("lineEnding"),Xe(n,h,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),p(S))}function p(S){return S===f||S===null||Oe(S)?(n.exit("chunkString"),h(S)):(n.consume(S),S===92?u:p)}function u(S){return S===f||S===92?(n.consume(S),p):p(S)}}function Zs(n,r){let s;return o;function o(d){return Oe(d)?(n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),s=!0,o):Ge(d)?Xe(n,o,s?"linePrefix":"lineSuffix")(d):r(d)}}const kS={name:"definition",tokenize:TS},AS={partial:!0,tokenize:DS};function TS(n,r,s){const o=this;let d;return v;function v(C){return n.enter("definition"),f(C)}function f(C){return Ug.call(o,n,a,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(C)}function a(C){return d=Tn(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),C===58?(n.enter("definitionMarker"),n.consume(C),n.exit("definitionMarker"),c):s(C)}function c(C){return ut(C)?Zs(n,h)(C):h(C)}function h(C){return Ig(n,p,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(C)}function p(C){return n.attempt(AS,u,u)(C)}function u(C){return Ge(C)?Xe(n,S,"whitespace")(C):S(C)}function S(C){return C===null||Oe(C)?(n.exit("definition"),o.parser.defined.push(d),r(C)):s(C)}}function DS(n,r,s){return o;function o(a){return ut(a)?Zs(n,d)(a):s(a)}function d(a){return Pg(n,v,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function v(a){return Ge(a)?Xe(n,f,"whitespace")(a):f(a)}function f(a){return a===null||Oe(a)?r(a):s(a)}}const RS={name:"hardBreakEscape",tokenize:MS};function MS(n,r,s){return o;function o(v){return n.enter("hardBreakEscape"),n.consume(v),d}function d(v){return Oe(v)?(n.exit("hardBreakEscape"),r(v)):s(v)}}const LS={name:"headingAtx",resolve:OS,tokenize:BS};function OS(n,r){let s=n.length-2,o=3,d,v;return n[o][1].type==="whitespace"&&(o+=2),s-2>o&&n[s][1].type==="whitespace"&&(s-=2),n[s][1].type==="atxHeadingSequence"&&(o===s-1||s-4>o&&n[s-2][1].type==="whitespace")&&(s-=o+1===s?2:4),s>o&&(d={type:"atxHeadingText",start:n[o][1].start,end:n[s][1].end},v={type:"chunkText",start:n[o][1].start,end:n[s][1].end,contentType:"text"},fn(n,o,s-o+1,[["enter",d,r],["enter",v,r],["exit",v,r],["exit",d,r]])),n}function BS(n,r,s){let o=0;return d;function d(p){return n.enter("atxHeading"),v(p)}function v(p){return n.enter("atxHeadingSequence"),f(p)}function f(p){return p===35&&o++<6?(n.consume(p),f):p===null||ut(p)?(n.exit("atxHeadingSequence"),a(p)):s(p)}function a(p){return p===35?(n.enter("atxHeadingSequence"),c(p)):p===null||Oe(p)?(n.exit("atxHeading"),r(p)):Ge(p)?Xe(n,a,"whitespace")(p):(n.enter("atxHeadingText"),h(p))}function c(p){return p===35?(n.consume(p),c):(n.exit("atxHeadingSequence"),a(p))}function h(p){return p===null||p===35||ut(p)?(n.exit("atxHeadingText"),a(p)):(n.consume(p),h)}}const NS=["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"],Dm=["pre","script","style","textarea"],jS={concrete:!0,name:"htmlFlow",resolveTo:IS,tokenize:US},zS={partial:!0,tokenize:FS},HS={partial:!0,tokenize:PS};function IS(n){let r=n.length;for(;r--&&!(n[r][0]==="enter"&&n[r][1].type==="htmlFlow"););return r>1&&n[r-2][1].type==="linePrefix"&&(n[r][1].start=n[r-2][1].start,n[r+1][1].start=n[r-2][1].start,n.splice(r-2,2)),n}function US(n,r,s){const o=this;let d,v,f,a,c;return h;function h(I){return p(I)}function p(I){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(I),u}function u(I){return I===33?(n.consume(I),S):I===47?(n.consume(I),v=!0,x):I===63?(n.consume(I),d=3,o.interrupt?r:O):$t(I)?(n.consume(I),f=String.fromCharCode(I),b):s(I)}function S(I){return I===45?(n.consume(I),d=2,C):I===91?(n.consume(I),d=5,a=0,A):$t(I)?(n.consume(I),d=4,o.interrupt?r:O):s(I)}function C(I){return I===45?(n.consume(I),o.interrupt?r:O):s(I)}function A(I){const ne="CDATA[";return I===ne.charCodeAt(a++)?(n.consume(I),a===ne.length?o.interrupt?r:P:A):s(I)}function x(I){return $t(I)?(n.consume(I),f=String.fromCharCode(I),b):s(I)}function b(I){if(I===null||I===47||I===62||ut(I)){const ne=I===47,_e=f.toLowerCase();return!ne&&!v&&Dm.includes(_e)?(d=1,o.interrupt?r(I):P(I)):NS.includes(f.toLowerCase())?(d=6,ne?(n.consume(I),_):o.interrupt?r(I):P(I)):(d=7,o.interrupt&&!o.parser.lazy[o.now().line]?s(I):v?g(I):y(I))}return I===45||qt(I)?(n.consume(I),f+=String.fromCharCode(I),b):s(I)}function _(I){return I===62?(n.consume(I),o.interrupt?r:P):s(I)}function g(I){return Ge(I)?(n.consume(I),g):B(I)}function y(I){return I===47?(n.consume(I),B):I===58||I===95||$t(I)?(n.consume(I),k):Ge(I)?(n.consume(I),y):B(I)}function k(I){return I===45||I===46||I===58||I===95||qt(I)?(n.consume(I),k):M(I)}function M(I){return I===61?(n.consume(I),D):Ge(I)?(n.consume(I),M):y(I)}function D(I){return I===null||I===60||I===61||I===62||I===96?s(I):I===34||I===39?(n.consume(I),c=I,T):Ge(I)?(n.consume(I),D):E(I)}function T(I){return I===c?(n.consume(I),c=null,R):I===null||Oe(I)?s(I):(n.consume(I),T)}function E(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||ut(I)?M(I):(n.consume(I),E)}function R(I){return I===47||I===62||Ge(I)?y(I):s(I)}function B(I){return I===62?(n.consume(I),H):s(I)}function H(I){return I===null||Oe(I)?P(I):Ge(I)?(n.consume(I),H):s(I)}function P(I){return I===45&&d===2?(n.consume(I),G):I===60&&d===1?(n.consume(I),X):I===62&&d===4?(n.consume(I),j):I===63&&d===3?(n.consume(I),O):I===93&&d===5?(n.consume(I),z):Oe(I)&&(d===6||d===7)?(n.exit("htmlFlowData"),n.check(zS,V,F)(I)):I===null||Oe(I)?(n.exit("htmlFlowData"),F(I)):(n.consume(I),P)}function F(I){return n.check(HS,$,V)(I)}function $(I){return n.enter("lineEnding"),n.consume(I),n.exit("lineEnding"),W}function W(I){return I===null||Oe(I)?F(I):(n.enter("htmlFlowData"),P(I))}function G(I){return I===45?(n.consume(I),O):P(I)}function X(I){return I===47?(n.consume(I),f="",te):P(I)}function te(I){if(I===62){const ne=f.toLowerCase();return Dm.includes(ne)?(n.consume(I),j):P(I)}return $t(I)&&f.length<8?(n.consume(I),f+=String.fromCharCode(I),te):P(I)}function z(I){return I===93?(n.consume(I),O):P(I)}function O(I){return I===62?(n.consume(I),j):I===45&&d===2?(n.consume(I),O):P(I)}function j(I){return I===null||Oe(I)?(n.exit("htmlFlowData"),V(I)):(n.consume(I),j)}function V(I){return n.exit("htmlFlow"),r(I)}}function PS(n,r,s){const o=this;return d;function d(f){return Oe(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),v):s(f)}function v(f){return o.parser.lazy[o.now().line]?s(f):r(f)}}function FS(n,r,s){return o;function o(d){return n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),n.attempt(rl,r,s)}}const qS={name:"htmlText",tokenize:VS};function VS(n,r,s){const o=this;let d,v,f;return a;function a(O){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(O),c}function c(O){return O===33?(n.consume(O),h):O===47?(n.consume(O),M):O===63?(n.consume(O),y):$t(O)?(n.consume(O),E):s(O)}function h(O){return O===45?(n.consume(O),p):O===91?(n.consume(O),v=0,A):$t(O)?(n.consume(O),g):s(O)}function p(O){return O===45?(n.consume(O),C):s(O)}function u(O){return O===null?s(O):O===45?(n.consume(O),S):Oe(O)?(f=u,X(O)):(n.consume(O),u)}function S(O){return O===45?(n.consume(O),C):u(O)}function C(O){return O===62?G(O):O===45?S(O):u(O)}function A(O){const j="CDATA[";return O===j.charCodeAt(v++)?(n.consume(O),v===j.length?x:A):s(O)}function x(O){return O===null?s(O):O===93?(n.consume(O),b):Oe(O)?(f=x,X(O)):(n.consume(O),x)}function b(O){return O===93?(n.consume(O),_):x(O)}function _(O){return O===62?G(O):O===93?(n.consume(O),_):x(O)}function g(O){return O===null||O===62?G(O):Oe(O)?(f=g,X(O)):(n.consume(O),g)}function y(O){return O===null?s(O):O===63?(n.consume(O),k):Oe(O)?(f=y,X(O)):(n.consume(O),y)}function k(O){return O===62?G(O):y(O)}function M(O){return $t(O)?(n.consume(O),D):s(O)}function D(O){return O===45||qt(O)?(n.consume(O),D):T(O)}function T(O){return Oe(O)?(f=T,X(O)):Ge(O)?(n.consume(O),T):G(O)}function E(O){return O===45||qt(O)?(n.consume(O),E):O===47||O===62||ut(O)?R(O):s(O)}function R(O){return O===47?(n.consume(O),G):O===58||O===95||$t(O)?(n.consume(O),B):Oe(O)?(f=R,X(O)):Ge(O)?(n.consume(O),R):G(O)}function B(O){return O===45||O===46||O===58||O===95||qt(O)?(n.consume(O),B):H(O)}function H(O){return O===61?(n.consume(O),P):Oe(O)?(f=H,X(O)):Ge(O)?(n.consume(O),H):R(O)}function P(O){return O===null||O===60||O===61||O===62||O===96?s(O):O===34||O===39?(n.consume(O),d=O,F):Oe(O)?(f=P,X(O)):Ge(O)?(n.consume(O),P):(n.consume(O),$)}function F(O){return O===d?(n.consume(O),d=void 0,W):O===null?s(O):Oe(O)?(f=F,X(O)):(n.consume(O),F)}function $(O){return O===null||O===34||O===39||O===60||O===61||O===96?s(O):O===47||O===62||ut(O)?R(O):(n.consume(O),$)}function W(O){return O===47||O===62||ut(O)?R(O):s(O)}function G(O){return O===62?(n.consume(O),n.exit("htmlTextData"),n.exit("htmlText"),r):s(O)}function X(O){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(O),n.exit("lineEnding"),te}function te(O){return Ge(O)?Xe(n,z,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):z(O)}function z(O){return n.enter("htmlTextData"),f(O)}}const Gu={name:"labelEnd",resolveAll:WS,resolveTo:KS,tokenize:XS},GS={tokenize:QS},$S={tokenize:ZS},YS={tokenize:JS};function WS(n){let r=-1;const s=[];for(;++r<n.length;){const o=n[r][1];if(s.push(n[r]),o.type==="labelImage"||o.type==="labelLink"||o.type==="labelEnd"){const d=o.type==="labelImage"?4:2;o.type="data",r+=d}}return n.length!==s.length&&fn(n,0,n.length,s),n}function KS(n,r){let s=n.length,o=0,d,v,f,a;for(;s--;)if(d=n[s][1],v){if(d.type==="link"||d.type==="labelLink"&&d._inactive)break;n[s][0]==="enter"&&d.type==="labelLink"&&(d._inactive=!0)}else if(f){if(n[s][0]==="enter"&&(d.type==="labelImage"||d.type==="labelLink")&&!d._balanced&&(v=s,d.type!=="labelLink")){o=2;break}}else d.type==="labelEnd"&&(f=s);const c={type:n[v][1].type==="labelLink"?"link":"image",start:{...n[v][1].start},end:{...n[n.length-1][1].end}},h={type:"label",start:{...n[v][1].start},end:{...n[f][1].end}},p={type:"labelText",start:{...n[v+o+2][1].end},end:{...n[f-2][1].start}};return a=[["enter",c,r],["enter",h,r]],a=wn(a,n.slice(v+1,v+o+3)),a=wn(a,[["enter",p,r]]),a=wn(a,La(r.parser.constructs.insideSpan.null,n.slice(v+o+4,f-3),r)),a=wn(a,[["exit",p,r],n[f-2],n[f-1],["exit",h,r]]),a=wn(a,n.slice(f+1)),a=wn(a,[["exit",c,r]]),fn(n,v,n.length,a),n}function XS(n,r,s){const o=this;let d=o.events.length,v,f;for(;d--;)if((o.events[d][1].type==="labelImage"||o.events[d][1].type==="labelLink")&&!o.events[d][1]._balanced){v=o.events[d][1];break}return a;function a(S){return v?v._inactive?u(S):(f=o.parser.defined.includes(Tn(o.sliceSerialize({start:v.end,end:o.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(S),n.exit("labelMarker"),n.exit("labelEnd"),c):s(S)}function c(S){return S===40?n.attempt(GS,p,f?p:u)(S):S===91?n.attempt($S,p,f?h:u)(S):f?p(S):u(S)}function h(S){return n.attempt(YS,p,u)(S)}function p(S){return r(S)}function u(S){return v._balanced=!0,s(S)}}function QS(n,r,s){return o;function o(u){return n.enter("resource"),n.enter("resourceMarker"),n.consume(u),n.exit("resourceMarker"),d}function d(u){return ut(u)?Zs(n,v)(u):v(u)}function v(u){return u===41?p(u):Ig(n,f,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function f(u){return ut(u)?Zs(n,c)(u):p(u)}function a(u){return s(u)}function c(u){return u===34||u===39||u===40?Pg(n,h,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):p(u)}function h(u){return ut(u)?Zs(n,p)(u):p(u)}function p(u){return u===41?(n.enter("resourceMarker"),n.consume(u),n.exit("resourceMarker"),n.exit("resource"),r):s(u)}}function ZS(n,r,s){const o=this;return d;function d(a){return Ug.call(o,n,v,f,"reference","referenceMarker","referenceString")(a)}function v(a){return o.parser.defined.includes(Tn(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?r(a):s(a)}function f(a){return s(a)}}function JS(n,r,s){return o;function o(v){return n.enter("reference"),n.enter("referenceMarker"),n.consume(v),n.exit("referenceMarker"),d}function d(v){return v===93?(n.enter("referenceMarker"),n.consume(v),n.exit("referenceMarker"),n.exit("reference"),r):s(v)}}const eb={name:"labelStartImage",resolveAll:Gu.resolveAll,tokenize:tb};function tb(n,r,s){const o=this;return d;function d(a){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(a),n.exit("labelImageMarker"),v}function v(a){return a===91?(n.enter("labelMarker"),n.consume(a),n.exit("labelMarker"),n.exit("labelImage"),f):s(a)}function f(a){return a===94&&"_hiddenFootnoteSupport"in o.parser.constructs?s(a):r(a)}}const nb={name:"labelStartLink",resolveAll:Gu.resolveAll,tokenize:ib};function ib(n,r,s){const o=this;return d;function d(f){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(f),n.exit("labelMarker"),n.exit("labelLink"),v}function v(f){return f===94&&"_hiddenFootnoteSupport"in o.parser.constructs?s(f):r(f)}}const au={name:"lineEnding",tokenize:rb};function rb(n,r){return s;function s(o){return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),Xe(n,r,"linePrefix")}}const Ea={name:"thematicBreak",tokenize:sb};function sb(n,r,s){let o=0,d;return v;function v(h){return n.enter("thematicBreak"),f(h)}function f(h){return d=h,a(h)}function a(h){return h===d?(n.enter("thematicBreakSequence"),c(h)):o>=3&&(h===null||Oe(h))?(n.exit("thematicBreak"),r(h)):s(h)}function c(h){return h===d?(n.consume(h),o++,c):(n.exit("thematicBreakSequence"),Ge(h)?Xe(n,a,"whitespace")(h):a(h))}}const tn={continuation:{tokenize:cb},exit:hb,name:"list",tokenize:ob},lb={partial:!0,tokenize:fb},ab={partial:!0,tokenize:ub};function ob(n,r,s){const o=this,d=o.events[o.events.length-1];let v=d&&d[1].type==="linePrefix"?d[2].sliceSerialize(d[1],!0).length:0,f=0;return a;function a(C){const A=o.containerState.type||(C===42||C===43||C===45?"listUnordered":"listOrdered");if(A==="listUnordered"?!o.containerState.marker||C===o.containerState.marker:Eu(C)){if(o.containerState.type||(o.containerState.type=A,n.enter(A,{_container:!0})),A==="listUnordered")return n.enter("listItemPrefix"),C===42||C===45?n.check(Ea,s,h)(C):h(C);if(!o.interrupt||C===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),c(C)}return s(C)}function c(C){return Eu(C)&&++f<10?(n.consume(C),c):(!o.interrupt||f<2)&&(o.containerState.marker?C===o.containerState.marker:C===41||C===46)?(n.exit("listItemValue"),h(C)):s(C)}function h(C){return n.enter("listItemMarker"),n.consume(C),n.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||C,n.check(rl,o.interrupt?s:p,n.attempt(lb,S,u))}function p(C){return o.containerState.initialBlankLine=!0,v++,S(C)}function u(C){return Ge(C)?(n.enter("listItemPrefixWhitespace"),n.consume(C),n.exit("listItemPrefixWhitespace"),S):s(C)}function S(C){return o.containerState.size=v+o.sliceSerialize(n.exit("listItemPrefix"),!0).length,r(C)}}function cb(n,r,s){const o=this;return o.containerState._closeFlow=void 0,n.check(rl,d,v);function d(a){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,Xe(n,r,"listItemIndent",o.containerState.size+1)(a)}function v(a){return o.containerState.furtherBlankLines||!Ge(a)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,f(a)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,n.attempt(ab,r,f)(a))}function f(a){return o.containerState._closeFlow=!0,o.interrupt=void 0,Xe(n,n.attempt(tn,r,s),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function ub(n,r,s){const o=this;return Xe(n,d,"listItemIndent",o.containerState.size+1);function d(v){const f=o.events[o.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===o.containerState.size?r(v):s(v)}}function hb(n){n.exit(this.containerState.type)}function fb(n,r,s){const o=this;return Xe(n,d,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function d(v){const f=o.events[o.events.length-1];return!Ge(v)&&f&&f[1].type==="listItemPrefixWhitespace"?r(v):s(v)}}const Rm={name:"setextUnderline",resolveTo:db,tokenize:pb};function db(n,r){let s=n.length,o,d,v;for(;s--;)if(n[s][0]==="enter"){if(n[s][1].type==="content"){o=s;break}n[s][1].type==="paragraph"&&(d=s)}else n[s][1].type==="content"&&n.splice(s,1),!v&&n[s][1].type==="definition"&&(v=s);const f={type:"setextHeading",start:{...n[o][1].start},end:{...n[n.length-1][1].end}};return n[d][1].type="setextHeadingText",v?(n.splice(d,0,["enter",f,r]),n.splice(v+1,0,["exit",n[o][1],r]),n[o][1].end={...n[v][1].end}):n[o][1]=f,n.push(["exit",f,r]),n}function pb(n,r,s){const o=this;let d;return v;function v(h){let p=o.events.length,u;for(;p--;)if(o.events[p][1].type!=="lineEnding"&&o.events[p][1].type!=="linePrefix"&&o.events[p][1].type!=="content"){u=o.events[p][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||u)?(n.enter("setextHeadingLine"),d=h,f(h)):s(h)}function f(h){return n.enter("setextHeadingLineSequence"),a(h)}function a(h){return h===d?(n.consume(h),a):(n.exit("setextHeadingLineSequence"),Ge(h)?Xe(n,c,"lineSuffix")(h):c(h))}function c(h){return h===null||Oe(h)?(n.exit("setextHeadingLine"),r(h)):s(h)}}const mb={tokenize:gb};function gb(n){const r=this,s=n.attempt(rl,o,n.attempt(this.parser.constructs.flowInitial,d,Xe(n,n.attempt(this.parser.constructs.flow,d,n.attempt(bS,d)),"linePrefix")));return s;function o(v){if(v===null){n.consume(v);return}return n.enter("lineEndingBlank"),n.consume(v),n.exit("lineEndingBlank"),r.currentConstruct=void 0,s}function d(v){if(v===null){n.consume(v);return}return n.enter("lineEnding"),n.consume(v),n.exit("lineEnding"),r.currentConstruct=void 0,s}}const _b={resolveAll:qg()},vb=Fg("string"),yb=Fg("text");function Fg(n){return{resolveAll:qg(n==="text"?Sb:void 0),tokenize:r};function r(s){const o=this,d=this.parser.constructs[n],v=s.attempt(d,f,a);return f;function f(p){return h(p)?v(p):a(p)}function a(p){if(p===null){s.consume(p);return}return s.enter("data"),s.consume(p),c}function c(p){return h(p)?(s.exit("data"),v(p)):(s.consume(p),c)}function h(p){if(p===null)return!0;const u=d[p];let S=-1;if(u)for(;++S<u.length;){const C=u[S];if(!C.previous||C.previous.call(o,o.previous))return!0}return!1}}}function qg(n){return r;function r(s,o){let d=-1,v;for(;++d<=s.length;)v===void 0?s[d]&&s[d][1].type==="data"&&(v=d,d++):(!s[d]||s[d][1].type!=="data")&&(d!==v+2&&(s[v][1].end=s[d-1][1].end,s.splice(v+2,d-v-2),d=v+2),v=void 0);return n?n(s,o):s}}function Sb(n,r){let s=0;for(;++s<=n.length;)if((s===n.length||n[s][1].type==="lineEnding")&&n[s-1][1].type==="data"){const o=n[s-1][1],d=r.sliceStream(o);let v=d.length,f=-1,a=0,c;for(;v--;){const h=d[v];if(typeof h=="string"){for(f=h.length;h.charCodeAt(f-1)===32;)a++,f--;if(f)break;f=-1}else if(h===-2)c=!0,a++;else if(h!==-1){v++;break}}if(r._contentTypeTextTrailing&&s===n.length&&(a=0),a){const h={type:s===n.length||c||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:v?f:o.start._bufferIndex+f,_index:o.start._index+v,line:o.end.line,column:o.end.column-a,offset:o.end.offset-a},end:{...o.end}};o.end={...h.start},o.start.offset===o.end.offset?Object.assign(o,h):(n.splice(s,0,["enter",h,r],["exit",h,r]),s+=2)}s++}return n}const bb={42:tn,43:tn,45:tn,48:tn,49:tn,50:tn,51:tn,52:tn,53:tn,54:tn,55:tn,56:tn,57:tn,62:Ng},Cb={91:kS},wb={[-2]:lu,[-1]:lu,32:lu},xb={35:LS,42:Ea,45:[Rm,Ea],60:jS,61:Rm,95:Ea,96:Tm,126:Tm},Eb={38:zg,92:jg},kb={[-5]:au,[-4]:au,[-3]:au,33:eb,38:zg,42:ku,60:[nS,qS],91:nb,92:[RS,jg],93:Gu,95:ku,96:mS},Ab={null:[ku,_b]},Tb={null:[42,95]},Db={null:[]},Rb=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Tb,contentInitial:Cb,disable:Db,document:bb,flow:xb,flowInitial:wb,insideSpan:Ab,string:Eb,text:kb},Symbol.toStringTag,{value:"Module"}));function Mb(n,r,s){let o={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const d={},v=[];let f=[],a=[];const c={attempt:T(M),check:T(D),consume:g,enter:y,exit:k,interrupt:T(D,{interrupt:!0})},h={code:null,containerState:{},defineSkip:x,events:[],now:A,parser:n,previous:null,sliceSerialize:S,sliceStream:C,write:u};let p=r.tokenize.call(h,c);return r.resolveAll&&v.push(r),h;function u(H){return f=wn(f,H),b(),f[f.length-1]!==null?[]:(E(r,0),h.events=La(v,h.events,h),h.events)}function S(H,P){return Ob(C(H),P)}function C(H){return Lb(f,H)}function A(){const{_bufferIndex:H,_index:P,line:F,column:$,offset:W}=o;return{_bufferIndex:H,_index:P,line:F,column:$,offset:W}}function x(H){d[H.line]=H.column,B()}function b(){let H;for(;o._index<f.length;){const P=f[o._index];if(typeof P=="string")for(H=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===H&&o._bufferIndex<P.length;)_(P.charCodeAt(o._bufferIndex));else _(P)}}function _(H){p=p(H)}function g(H){Oe(H)?(o.line++,o.column=1,o.offset+=H===-3?2:1,B()):H!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===f[o._index].length&&(o._bufferIndex=-1,o._index++)),h.previous=H}function y(H,P){const F=P||{};return F.type=H,F.start=A(),h.events.push(["enter",F,h]),a.push(F),F}function k(H){const P=a.pop();return P.end=A(),h.events.push(["exit",P,h]),P}function M(H,P){E(H,P.from)}function D(H,P){P.restore()}function T(H,P){return F;function F($,W,G){let X,te,z,O;return Array.isArray($)?V($):"tokenize"in $?V([$]):j($);function j(me){return Q;function Q(q){const J=q!==null&&me[q],Y=q!==null&&me.null,he=[...Array.isArray(J)?J:J?[J]:[],...Array.isArray(Y)?Y:Y?[Y]:[]];return V(he)(q)}}function V(me){return X=me,te=0,me.length===0?G:I(me[te])}function I(me){return Q;function Q(q){return O=R(),z=me,me.partial||(h.currentConstruct=me),me.name&&h.parser.constructs.disable.null.includes(me.name)?_e():me.tokenize.call(P?Object.assign(Object.create(h),P):h,c,ne,_e)(q)}}function ne(me){return H(z,O),W}function _e(me){return O.restore(),++te<X.length?I(X[te]):G}}}function E(H,P){H.resolveAll&&!v.includes(H)&&v.push(H),H.resolve&&fn(h.events,P,h.events.length-P,H.resolve(h.events.slice(P),h)),H.resolveTo&&(h.events=H.resolveTo(h.events,h))}function R(){const H=A(),P=h.previous,F=h.currentConstruct,$=h.events.length,W=Array.from(a);return{from:$,restore:G};function G(){o=H,h.previous=P,h.currentConstruct=F,h.events.length=$,a=W,B()}}function B(){o.line in d&&o.column<2&&(o.column=d[o.line],o.offset+=d[o.line]-1)}}function Lb(n,r){const s=r.start._index,o=r.start._bufferIndex,d=r.end._index,v=r.end._bufferIndex;let f;if(s===d)f=[n[s].slice(o,v)];else{if(f=n.slice(s,d),o>-1){const a=f[0];typeof a=="string"?f[0]=a.slice(o):f.shift()}v>0&&f.push(n[d].slice(0,v))}return f}function Ob(n,r){let s=-1;const o=[];let d;for(;++s<n.length;){const v=n[s];let f;if(typeof v=="string")f=v;else switch(v){case-5:{f="\r";break}case-4:{f=`
|
|
64
64
|
`;break}case-3:{f=`\r
|
|
65
|
-
`;break}case-2:{f=r?" ":" ";break}case-1:{if(!r&&d)continue;f=" ";break}default:f=String.fromCharCode(v)}d=v===-2,o.push(f)}return o.join("")}function Ob(n){const o={constructs:Lg([Db,...(n||{}).extensions||[]]),content:d(Wy),defined:[],document:d(Xy),flow:d(pb),lazy:{},string:d(_b),text:d(vb)};return o;function d(v){return f;function f(a){return Rb(o,v,a)}}}function Bb(n){for(;!zg(n););return n}const Mm=/[\0\t\n\r]/g;function Nb(){let n=1,r="",s=!0,o;return d;function d(v,f,a){const c=[];let h,p,u,S,w;for(v=r+(typeof v=="string"?v.toString():new TextDecoder(f||void 0).decode(v)),u=0,r="",s&&(v.charCodeAt(0)===65279&&u++,s=void 0);u<v.length;){if(Mm.lastIndex=u,h=Mm.exec(v),S=h&&h.index!==void 0?h.index:v.length,w=v.charCodeAt(S),!h){r=v.slice(u);break}if(w===10&&u===S&&o)c.push(-3),o=void 0;else switch(o&&(c.push(-5),o=void 0),u<S&&(c.push(v.slice(u,S)),n+=S-u),w){case 0:{c.push(65533),n++;break}case 9:{for(p=Math.ceil(n/4)*4,c.push(-2);n++<p;)c.push(-1);break}case 10:{c.push(-4),n=1;break}default:o=!0,n=1}u=S+1}return a&&(o&&c.push(-5),r&&c.push(r),c.push(null)),c}}const jb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function zb(n){return n.replace(jb,Hb)}function Hb(n,r,s){if(r)return r;if(s.charCodeAt(0)===35){const d=s.charCodeAt(1),v=d===120||d===88;return Og(s.slice(v?2:1),v?16:10)}return Vu(s)||n}const qg={}.hasOwnProperty;function Ib(n,r,s){return r&&typeof r=="object"&&(s=r,r=void 0),Ub(s)(Bb(Ob(s).document().write(Nb()(n,r,!0))))}function Ub(n){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:v(ht),autolinkProtocol:R,autolinkEmail:R,atxHeading:v(qe),blockQuote:v(Y),characterEscape:R,characterReference:R,codeFenced:v(he),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:v(he,f),codeText:v(de,f),codeTextData:R,data:R,codeFlowValue:R,definition:v(be),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:v(Pe),hardBreakEscape:v(Ke),hardBreakTrailing:v(Ke),htmlFlow:v(Ae,f),htmlFlowData:R,htmlText:v(Ae,f),htmlTextData:R,image:v(jt),label:f,link:v(ht),listItem:v(it),listItemValue:S,listOrdered:v(Lt,u),listUnordered:v(Lt),paragraph:v(kt),reference:I,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:v(qe),strong:v(ae),thematicBreak:v(Ze)},exit:{atxHeading:c(),atxHeadingSequence:M,autolink:c(),autolinkEmail:J,autolinkProtocol:q,blockQuote:c(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:_e,characterReferenceMarkerNumeric:_e,characterReferenceValue:ge,characterReference:Q,codeFenced:c(b),codeFencedFence:x,codeFencedFenceInfo:w,codeFencedFenceMeta:A,codeFlowValue:N,codeIndented:c(_),codeText:c(K),codeTextData:N,data:N,definition:c(),definitionDestinationString:k,definitionLabelString:g,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(F),hardBreakTrailing:c(F),htmlFlow:c(P),htmlFlowData:N,htmlText:c($),htmlTextData:N,image:c(X),label:H,labelText:ee,lineEnding:z,link:c(G),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ne,resourceDestinationString:O,resourceTitleString:j,resource:V,setextHeading:c(E),setextHeadingLineSequence:T,setextHeadingText:D,strong:c(),thematicBreak:c()}};Vg(r,(n||{}).mdastExtensions||[]);const s={};return o;function o(ue){let Se={type:"root",children:[]};const Ce={stack:[Se],tokenStack:[],config:r,enter:a,exit:h,buffer:f,resume:p,data:s},De=[];let Ne=-1;for(;++Ne<ue.length;)if(ue[Ne][1].type==="listOrdered"||ue[Ne][1].type==="listUnordered")if(ue[Ne][0]==="enter")De.push(Ne);else{const _t=De.pop();Ne=d(ue,_t,Ne)}for(Ne=-1;++Ne<ue.length;){const _t=r[ue[Ne][0]];qg.call(_t,ue[Ne][1].type)&&_t[ue[Ne][1].type].call(Object.assign({sliceSerialize:ue[Ne][2].sliceSerialize},Ce),ue[Ne][1])}if(Ce.tokenStack.length>0){const _t=Ce.tokenStack[Ce.tokenStack.length-1];(_t[1]||Lm).call(Ce,void 0,_t[0])}for(Se.position={start:Ni(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:Ni(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},Ne=-1;++Ne<r.transforms.length;)Se=r.transforms[Ne](Se)||Se;return Se}function d(ue,Se,Ce){let De=Se-1,Ne=-1,_t=!1,Fe,bt,rt,Ct;for(;++De<=Ce;){const tt=ue[De];switch(tt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{tt[0]==="enter"?Ne++:Ne--,Ct=void 0;break}case"lineEndingBlank":{tt[0]==="enter"&&(Fe&&!Ct&&!Ne&&!rt&&(rt=De),Ct=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ct=void 0}if(!Ne&&tt[0]==="enter"&&tt[1].type==="listItemPrefix"||Ne===-1&&tt[0]==="exit"&&(tt[1].type==="listUnordered"||tt[1].type==="listOrdered")){if(Fe){let ln=De;for(bt=void 0;ln--;){const Yt=ue[ln];if(Yt[1].type==="lineEnding"||Yt[1].type==="lineEndingBlank"){if(Yt[0]==="exit")continue;bt&&(ue[bt][1].type="lineEndingBlank",_t=!0),Yt[1].type="lineEnding",bt=ln}else if(!(Yt[1].type==="linePrefix"||Yt[1].type==="blockQuotePrefix"||Yt[1].type==="blockQuotePrefixWhitespace"||Yt[1].type==="blockQuoteMarker"||Yt[1].type==="listItemIndent"))break}rt&&(!bt||rt<bt)&&(Fe._spread=!0),Fe.end=Object.assign({},bt?ue[bt][1].start:tt[1].end),ue.splice(bt||De,0,["exit",Fe,tt[2]]),De++,Ce++}if(tt[1].type==="listItemPrefix"){const ln={type:"listItem",_spread:!1,start:Object.assign({},tt[1].start),end:void 0};Fe=ln,ue.splice(De,0,["enter",ln,tt[2]]),De++,Ce++,rt=void 0,Ct=!0}}}return ue[Se][1]._spread=_t,Ce}function v(ue,Se){return Ce;function Ce(De){a.call(this,ue(De),De),Se&&Se.call(this,De)}}function f(){this.stack.push({type:"fragment",children:[]})}function a(ue,Se,Ce){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([Se,Ce||void 0]),ue.position={start:Ni(Se.start),end:void 0}}function c(ue){return Se;function Se(Ce){ue&&ue.call(this,Ce),h.call(this,Ce)}}function h(ue,Se){const Ce=this.stack.pop(),De=this.tokenStack.pop();if(De)De[0].type!==ue.type&&(Se?Se.call(this,ue,De[0]):(De[1]||Lm).call(this,ue,De[0]));else throw new Error("Cannot close `"+ue.type+"` ("+Zs({start:ue.start,end:ue.end})+"): it’s not open");Ce.position.end=Ni(ue.end)}function p(){return qu(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function S(ue){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function w(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=ue}function A(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=ue}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue.replace(/(\r?\n|\r)$/g,"")}function g(ue){const Se=this.resume(),Ce=this.stack[this.stack.length-1];Ce.label=Se,Ce.identifier=Nn(this.sliceSerialize(ue)).toLowerCase()}function y(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.title=ue}function k(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.url=ue}function M(ue){const Se=this.stack[this.stack.length-1];if(!Se.depth){const Ce=this.sliceSerialize(ue).length;Se.depth=Ce}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function T(ue){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function R(ue){const Ce=this.stack[this.stack.length-1].children;let De=Ce[Ce.length-1];(!De||De.type!=="text")&&(De=at(),De.position={start:Ni(ue.start),end:void 0},Ce.push(De)),this.stack.push(De)}function N(ue){const Se=this.stack.pop();Se.value+=this.sliceSerialize(ue),Se.position.end=Ni(ue.end)}function z(ue){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ce=Se.children[Se.children.length-1];Ce.position.end=Ni(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(Se.type)&&(R.call(this,ue),N.call(this,ue))}function F(){this.data.atHardBreak=!0}function P(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue}function $(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue}function K(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue}function G(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=Se,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function X(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=Se,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function ee(ue){const Se=this.sliceSerialize(ue),Ce=this.stack[this.stack.length-2];Ce.label=zb(Se),Ce.identifier=Nn(Se).toLowerCase()}function H(){const ue=this.stack[this.stack.length-1],Se=this.resume(),Ce=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ce.type==="link"){const De=ue.children;Ce.children=De}else Ce.alt=Se}function O(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.url=ue}function j(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.title=ue}function V(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function ne(ue){const Se=this.resume(),Ce=this.stack[this.stack.length-1];Ce.label=Se,Ce.identifier=Nn(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function _e(ue){this.data.characterReferenceType=ue.type}function ge(ue){const Se=this.sliceSerialize(ue),Ce=this.data.characterReferenceType;let De;Ce?(De=Og(Se,Ce==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):De=Vu(Se);const Ne=this.stack[this.stack.length-1];Ne.value+=De}function Q(ue){const Se=this.stack.pop();Se.position.end=Ni(ue.end)}function q(ue){N.call(this,ue);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(ue)}function J(ue){N.call(this,ue);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(ue)}function Y(){return{type:"blockquote",children:[]}}function he(){return{type:"code",lang:null,meta:null,value:""}}function de(){return{type:"inlineCode",value:""}}function be(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Pe(){return{type:"emphasis",children:[]}}function qe(){return{type:"heading",depth:0,children:[]}}function Ke(){return{type:"break"}}function Ae(){return{type:"html",value:""}}function jt(){return{type:"image",title:null,url:"",alt:null}}function ht(){return{type:"link",title:null,url:"",children:[]}}function Lt(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function it(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function kt(){return{type:"paragraph",children:[]}}function ae(){return{type:"strong",children:[]}}function at(){return{type:"text",value:""}}function Ze(){return{type:"thematicBreak"}}}function Ni(n){return{line:n.line,column:n.column,offset:n.offset}}function Vg(n,r){let s=-1;for(;++s<r.length;){const o=r[s];Array.isArray(o)?Vg(n,o):Pb(n,o)}}function Pb(n,r){let s;for(s in r)if(qg.call(r,s))switch(s){case"canContainEols":{const o=r[s];o&&n[s].push(...o);break}case"transforms":{const o=r[s];o&&n[s].push(...o);break}case"enter":case"exit":{const o=r[s];o&&Object.assign(n[s],o);break}}}function Lm(n,r){throw n?new Error("Cannot close `"+n.type+"` ("+Zs({start:n.start,end:n.end})+"): a different token (`"+r.type+"`, "+Zs({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+Zs({start:r.start,end:r.end})+") is still open")}function Fb(n){const r=this;r.parser=s;function s(o){return Ib(o,{...r.data("settings"),...n,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function qb(n,r){const s={type:"element",tagName:"blockquote",properties:{},children:n.wrap(n.all(r),!0)};return n.patch(r,s),n.applyData(r,s)}function Vb(n,r){const s={type:"element",tagName:"br",properties:{},children:[]};return n.patch(r,s),[n.applyData(r,s),{type:"text",value:`
|
|
66
|
-
`}]}function
|
|
67
|
-
`:"",o={},d=r.lang?r.lang.split(/\s+/):[];d.length>0&&(o.className=["language-"+d[0]]);let v={type:"element",tagName:"code",properties:o,children:[{type:"text",value:s}]};return r.meta&&(v.data={meta:r.meta}),n.patch(r,v),v=n.applyData(r,v),v={type:"element",tagName:"pre",properties:{},children:[v]},n.patch(r,v),v}function
|
|
65
|
+
`;break}case-2:{f=r?" ":" ";break}case-1:{if(!r&&d)continue;f=" ";break}default:f=String.fromCharCode(v)}d=v===-2,o.push(f)}return o.join("")}function Bb(n){const o={constructs:Og([Rb,...(n||{}).extensions||[]]),content:d(Ky),defined:[],document:d(Qy),flow:d(mb),lazy:{},string:d(vb),text:d(yb)};return o;function d(v){return f;function f(a){return Mb(o,v,a)}}}function Nb(n){for(;!Hg(n););return n}const Mm=/[\0\t\n\r]/g;function jb(){let n=1,r="",s=!0,o;return d;function d(v,f,a){const c=[];let h,p,u,S,C;for(v=r+(typeof v=="string"?v.toString():new TextDecoder(f||void 0).decode(v)),u=0,r="",s&&(v.charCodeAt(0)===65279&&u++,s=void 0);u<v.length;){if(Mm.lastIndex=u,h=Mm.exec(v),S=h&&h.index!==void 0?h.index:v.length,C=v.charCodeAt(S),!h){r=v.slice(u);break}if(C===10&&u===S&&o)c.push(-3),o=void 0;else switch(o&&(c.push(-5),o=void 0),u<S&&(c.push(v.slice(u,S)),n+=S-u),C){case 0:{c.push(65533),n++;break}case 9:{for(p=Math.ceil(n/4)*4,c.push(-2);n++<p;)c.push(-1);break}case 10:{c.push(-4),n=1;break}default:o=!0,n=1}u=S+1}return a&&(o&&c.push(-5),r&&c.push(r),c.push(null)),c}}const zb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Hb(n){return n.replace(zb,Ib)}function Ib(n,r,s){if(r)return r;if(s.charCodeAt(0)===35){const d=s.charCodeAt(1),v=d===120||d===88;return Bg(s.slice(v?2:1),v?16:10)}return Vu(s)||n}const Vg={}.hasOwnProperty;function Ub(n,r,s){return r&&typeof r=="object"&&(s=r,r=void 0),Pb(s)(Nb(Bb(s).document().write(jb()(n,r,!0))))}function Pb(n){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:v(ot),autolinkProtocol:R,autolinkEmail:R,atxHeading:v(Fe),blockQuote:v(Y),characterEscape:R,characterReference:R,codeFenced:v(he),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:v(he,f),codeText:v(de,f),codeTextData:R,data:R,codeFlowValue:R,definition:v(be),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:v(Pe),hardBreakEscape:v(We),hardBreakTrailing:v(We),htmlFlow:v(De,f),htmlFlowData:R,htmlText:v(De,f),htmlTextData:R,image:v(Rt),label:f,link:v(ot),listItem:v(nt),listItemValue:S,listOrdered:v(Tt,u),listUnordered:v(Tt),paragraph:v(Mt),reference:I,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:v(Fe),strong:v(ae),thematicBreak:v(Je)},exit:{atxHeading:c(),atxHeadingSequence:M,autolink:c(),autolinkEmail:J,autolinkProtocol:q,blockQuote:c(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:_e,characterReferenceMarkerNumeric:_e,characterReferenceValue:me,characterReference:Q,codeFenced:c(b),codeFencedFence:x,codeFencedFenceInfo:C,codeFencedFenceMeta:A,codeFlowValue:B,codeIndented:c(_),codeText:c(W),codeTextData:B,data:B,definition:c(),definitionDestinationString:k,definitionLabelString:g,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(P),hardBreakTrailing:c(P),htmlFlow:c(F),htmlFlowData:B,htmlText:c($),htmlTextData:B,image:c(X),label:z,labelText:te,lineEnding:H,link:c(G),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ne,resourceDestinationString:O,resourceTitleString:j,resource:V,setextHeading:c(E),setextHeadingLineSequence:T,setextHeadingText:D,strong:c(),thematicBreak:c()}};Gg(r,(n||{}).mdastExtensions||[]);const s={};return o;function o(ue){let Se={type:"root",children:[]};const we={stack:[Se],tokenStack:[],config:r,enter:a,exit:h,buffer:f,resume:p,data:s},Me=[];let je=-1;for(;++je<ue.length;)if(ue[je][1].type==="listOrdered"||ue[je][1].type==="listUnordered")if(ue[je][0]==="enter")Me.push(je);else{const ht=Me.pop();je=d(ue,ht,je)}for(je=-1;++je<ue.length;){const ht=r[ue[je][0]];Vg.call(ht,ue[je][1].type)&&ht[ue[je][1].type].call(Object.assign({sliceSerialize:ue[je][2].sliceSerialize},we),ue[je][1])}if(we.tokenStack.length>0){const ht=we.tokenStack[we.tokenStack.length-1];(ht[1]||Lm).call(we,void 0,ht[0])}for(Se.position={start:Mi(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:Mi(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},je=-1;++je<r.transforms.length;)Se=r.transforms[je](Se)||Se;return Se}function d(ue,Se,we){let Me=Se-1,je=-1,ht=!1,ve,ke,Re,yt;for(;++Me<=we;){const Ne=ue[Me];switch(Ne[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ne[0]==="enter"?je++:je--,yt=void 0;break}case"lineEndingBlank":{Ne[0]==="enter"&&(ve&&!yt&&!je&&!Re&&(Re=Me),yt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:yt=void 0}if(!je&&Ne[0]==="enter"&&Ne[1].type==="listItemPrefix"||je===-1&&Ne[0]==="exit"&&(Ne[1].type==="listUnordered"||Ne[1].type==="listOrdered")){if(ve){let Yt=Me;for(ke=void 0;Yt--;){const Bt=ue[Yt];if(Bt[1].type==="lineEnding"||Bt[1].type==="lineEndingBlank"){if(Bt[0]==="exit")continue;ke&&(ue[ke][1].type="lineEndingBlank",ht=!0),Bt[1].type="lineEnding",ke=Yt}else if(!(Bt[1].type==="linePrefix"||Bt[1].type==="blockQuotePrefix"||Bt[1].type==="blockQuotePrefixWhitespace"||Bt[1].type==="blockQuoteMarker"||Bt[1].type==="listItemIndent"))break}Re&&(!ke||Re<ke)&&(ve._spread=!0),ve.end=Object.assign({},ke?ue[ke][1].start:Ne[1].end),ue.splice(ke||Me,0,["exit",ve,Ne[2]]),Me++,we++}if(Ne[1].type==="listItemPrefix"){const Yt={type:"listItem",_spread:!1,start:Object.assign({},Ne[1].start),end:void 0};ve=Yt,ue.splice(Me,0,["enter",Yt,Ne[2]]),Me++,we++,Re=void 0,yt=!0}}}return ue[Se][1]._spread=ht,we}function v(ue,Se){return we;function we(Me){a.call(this,ue(Me),Me),Se&&Se.call(this,Me)}}function f(){this.stack.push({type:"fragment",children:[]})}function a(ue,Se,we){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([Se,we||void 0]),ue.position={start:Mi(Se.start),end:void 0}}function c(ue){return Se;function Se(we){ue&&ue.call(this,we),h.call(this,we)}}function h(ue,Se){const we=this.stack.pop(),Me=this.tokenStack.pop();if(Me)Me[0].type!==ue.type&&(Se?Se.call(this,ue,Me[0]):(Me[1]||Lm).call(this,ue,Me[0]));else throw new Error("Cannot close `"+ue.type+"` ("+Qs({start:ue.start,end:ue.end})+"): it’s not open");we.position.end=Mi(ue.end)}function p(){return qu(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function S(ue){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function C(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=ue}function A(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=ue}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue.replace(/(\r?\n|\r)$/g,"")}function g(ue){const Se=this.resume(),we=this.stack[this.stack.length-1];we.label=Se,we.identifier=Tn(this.sliceSerialize(ue)).toLowerCase()}function y(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.title=ue}function k(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.url=ue}function M(ue){const Se=this.stack[this.stack.length-1];if(!Se.depth){const we=this.sliceSerialize(ue).length;Se.depth=we}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function T(ue){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function R(ue){const we=this.stack[this.stack.length-1].children;let Me=we[we.length-1];(!Me||Me.type!=="text")&&(Me=tt(),Me.position={start:Mi(ue.start),end:void 0},we.push(Me)),this.stack.push(Me)}function B(ue){const Se=this.stack.pop();Se.value+=this.sliceSerialize(ue),Se.position.end=Mi(ue.end)}function H(ue){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const we=Se.children[Se.children.length-1];we.position.end=Mi(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(Se.type)&&(R.call(this,ue),B.call(this,ue))}function P(){this.data.atHardBreak=!0}function F(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue}function $(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue}function W(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue}function G(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=Se,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function X(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=Se,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function te(ue){const Se=this.sliceSerialize(ue),we=this.stack[this.stack.length-2];we.label=Hb(Se),we.identifier=Tn(Se).toLowerCase()}function z(){const ue=this.stack[this.stack.length-1],Se=this.resume(),we=this.stack[this.stack.length-1];if(this.data.inReference=!0,we.type==="link"){const Me=ue.children;we.children=Me}else we.alt=Se}function O(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.url=ue}function j(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.title=ue}function V(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function ne(ue){const Se=this.resume(),we=this.stack[this.stack.length-1];we.label=Se,we.identifier=Tn(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function _e(ue){this.data.characterReferenceType=ue.type}function me(ue){const Se=this.sliceSerialize(ue),we=this.data.characterReferenceType;let Me;we?(Me=Bg(Se,we==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Me=Vu(Se);const je=this.stack[this.stack.length-1];je.value+=Me}function Q(ue){const Se=this.stack.pop();Se.position.end=Mi(ue.end)}function q(ue){B.call(this,ue);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(ue)}function J(ue){B.call(this,ue);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(ue)}function Y(){return{type:"blockquote",children:[]}}function he(){return{type:"code",lang:null,meta:null,value:""}}function de(){return{type:"inlineCode",value:""}}function be(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Pe(){return{type:"emphasis",children:[]}}function Fe(){return{type:"heading",depth:0,children:[]}}function We(){return{type:"break"}}function De(){return{type:"html",value:""}}function Rt(){return{type:"image",title:null,url:"",alt:null}}function ot(){return{type:"link",title:null,url:"",children:[]}}function Tt(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function nt(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function Mt(){return{type:"paragraph",children:[]}}function ae(){return{type:"strong",children:[]}}function tt(){return{type:"text",value:""}}function Je(){return{type:"thematicBreak"}}}function Mi(n){return{line:n.line,column:n.column,offset:n.offset}}function Gg(n,r){let s=-1;for(;++s<r.length;){const o=r[s];Array.isArray(o)?Gg(n,o):Fb(n,o)}}function Fb(n,r){let s;for(s in r)if(Vg.call(r,s))switch(s){case"canContainEols":{const o=r[s];o&&n[s].push(...o);break}case"transforms":{const o=r[s];o&&n[s].push(...o);break}case"enter":case"exit":{const o=r[s];o&&Object.assign(n[s],o);break}}}function Lm(n,r){throw n?new Error("Cannot close `"+n.type+"` ("+Qs({start:n.start,end:n.end})+"): a different token (`"+r.type+"`, "+Qs({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+Qs({start:r.start,end:r.end})+") is still open")}function qb(n){const r=this;r.parser=s;function s(o){return Ub(o,{...r.data("settings"),...n,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function Vb(n,r){const s={type:"element",tagName:"blockquote",properties:{},children:n.wrap(n.all(r),!0)};return n.patch(r,s),n.applyData(r,s)}function Gb(n,r){const s={type:"element",tagName:"br",properties:{},children:[]};return n.patch(r,s),[n.applyData(r,s),{type:"text",value:`
|
|
66
|
+
`}]}function $b(n,r){const s=r.value?r.value+`
|
|
67
|
+
`:"",o={},d=r.lang?r.lang.split(/\s+/):[];d.length>0&&(o.className=["language-"+d[0]]);let v={type:"element",tagName:"code",properties:o,children:[{type:"text",value:s}]};return r.meta&&(v.data={meta:r.meta}),n.patch(r,v),v=n.applyData(r,v),v={type:"element",tagName:"pre",properties:{},children:[v]},n.patch(r,v),v}function Yb(n,r){const s={type:"element",tagName:"del",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function Wb(n,r){const s={type:"element",tagName:"em",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function Kb(n,r){const s=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",o=String(r.identifier).toUpperCase(),d=Qr(o.toLowerCase()),v=n.footnoteOrder.indexOf(o);let f,a=n.footnoteCounts.get(o);a===void 0?(a=0,n.footnoteOrder.push(o),f=n.footnoteOrder.length):f=v+1,a+=1,n.footnoteCounts.set(o,a);const c={type:"element",tagName:"a",properties:{href:"#"+s+"fn-"+d,id:s+"fnref-"+d+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};n.patch(r,c);const h={type:"element",tagName:"sup",properties:{},children:[c]};return n.patch(r,h),n.applyData(r,h)}function Xb(n,r){const s={type:"element",tagName:"h"+r.depth,properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function Qb(n,r){if(n.options.allowDangerousHtml){const s={type:"raw",value:r.value};return n.patch(r,s),n.applyData(r,s)}}function $g(n,r){const s=r.referenceType;let o="]";if(s==="collapsed"?o+="[]":s==="full"&&(o+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+o}];const d=n.all(r),v=d[0];v&&v.type==="text"?v.value="["+v.value:d.unshift({type:"text",value:"["});const f=d[d.length-1];return f&&f.type==="text"?f.value+=o:d.push({type:"text",value:o}),d}function Zb(n,r){const s=String(r.identifier).toUpperCase(),o=n.definitionById.get(s);if(!o)return $g(n,r);const d={src:Qr(o.url||""),alt:r.alt};o.title!==null&&o.title!==void 0&&(d.title=o.title);const v={type:"element",tagName:"img",properties:d,children:[]};return n.patch(r,v),n.applyData(r,v)}function Jb(n,r){const s={src:Qr(r.url)};r.alt!==null&&r.alt!==void 0&&(s.alt=r.alt),r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"img",properties:s,children:[]};return n.patch(r,o),n.applyData(r,o)}function eC(n,r){const s={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};n.patch(r,s);const o={type:"element",tagName:"code",properties:{},children:[s]};return n.patch(r,o),n.applyData(r,o)}function tC(n,r){const s=String(r.identifier).toUpperCase(),o=n.definitionById.get(s);if(!o)return $g(n,r);const d={href:Qr(o.url||"")};o.title!==null&&o.title!==void 0&&(d.title=o.title);const v={type:"element",tagName:"a",properties:d,children:n.all(r)};return n.patch(r,v),n.applyData(r,v)}function nC(n,r){const s={href:Qr(r.url)};r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"a",properties:s,children:n.all(r)};return n.patch(r,o),n.applyData(r,o)}function iC(n,r,s){const o=n.all(r),d=s?rC(s):Yg(r),v={},f=[];if(typeof r.checked=="boolean"){const p=o[0];let u;p&&p.type==="element"&&p.tagName==="p"?u=p:(u={type:"element",tagName:"p",properties:{},children:[]},o.unshift(u)),u.children.length>0&&u.children.unshift({type:"text",value:" "}),u.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),v.className=["task-list-item"]}let a=-1;for(;++a<o.length;){const p=o[a];(d||a!==0||p.type!=="element"||p.tagName!=="p")&&f.push({type:"text",value:`
|
|
68
68
|
`}),p.type==="element"&&p.tagName==="p"&&!d?f.push(...p.children):f.push(p)}const c=o[o.length-1];c&&(d||c.type!=="element"||c.tagName!=="p")&&f.push({type:"text",value:`
|
|
69
|
-
`});const h={type:"element",tagName:"li",properties:v,children:f};return n.patch(r,h),n.applyData(r,h)}function
|
|
69
|
+
`});const h={type:"element",tagName:"li",properties:v,children:f};return n.patch(r,h),n.applyData(r,h)}function rC(n){let r=!1;if(n.type==="list"){r=n.spread||!1;const s=n.children;let o=-1;for(;!r&&++o<s.length;)r=Yg(s[o])}return r}function Yg(n){const r=n.spread;return r??n.children.length>1}function sC(n,r){const s={},o=n.all(r);let d=-1;for(typeof r.start=="number"&&r.start!==1&&(s.start=r.start);++d<o.length;){const f=o[d];if(f.type==="element"&&f.tagName==="li"&&f.properties&&Array.isArray(f.properties.className)&&f.properties.className.includes("task-list-item")){s.className=["contains-task-list"];break}}const v={type:"element",tagName:r.ordered?"ol":"ul",properties:s,children:n.wrap(o,!0)};return n.patch(r,v),n.applyData(r,v)}function lC(n,r){const s={type:"element",tagName:"p",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function aC(n,r){const s={type:"root",children:n.wrap(n.all(r))};return n.patch(r,s),n.applyData(r,s)}function oC(n,r){const s={type:"element",tagName:"strong",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function cC(n,r){const s=n.all(r),o=s.shift(),d=[];if(o){const f={type:"element",tagName:"thead",properties:{},children:n.wrap([o],!0)};n.patch(r.children[0],f),d.push(f)}if(s.length>0){const f={type:"element",tagName:"tbody",properties:{},children:n.wrap(s,!0)},a=Iu(r.children[1]),c=kg(r.children[r.children.length-1]);a&&c&&(f.position={start:a,end:c}),d.push(f)}const v={type:"element",tagName:"table",properties:{},children:n.wrap(d,!0)};return n.patch(r,v),n.applyData(r,v)}function uC(n,r,s){const o=s?s.children:void 0,v=(o?o.indexOf(r):1)===0?"th":"td",f=s&&s.type==="table"?s.align:void 0,a=f?f.length:r.children.length;let c=-1;const h=[];for(;++c<a;){const u=r.children[c],S={},C=f?f[c]:void 0;C&&(S.align=C);let A={type:"element",tagName:v,properties:S,children:[]};u&&(A.children=n.all(u),n.patch(u,A),A=n.applyData(u,A)),h.push(A)}const p={type:"element",tagName:"tr",properties:{},children:n.wrap(h,!0)};return n.patch(r,p),n.applyData(r,p)}function hC(n,r){const s={type:"element",tagName:"td",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}const Om=9,Bm=32;function fC(n){const r=String(n),s=/\r?\n|\r/g;let o=s.exec(r),d=0;const v=[];for(;o;)v.push(Nm(r.slice(d,o.index),d>0,!0),o[0]),d=o.index+o[0].length,o=s.exec(r);return v.push(Nm(r.slice(d),d>0,!1)),v.join("")}function Nm(n,r,s){let o=0,d=n.length;if(r){let v=n.codePointAt(o);for(;v===Om||v===Bm;)o++,v=n.codePointAt(o)}if(s){let v=n.codePointAt(d-1);for(;v===Om||v===Bm;)d--,v=n.codePointAt(d-1)}return d>o?n.slice(o,d):""}function dC(n,r){const s={type:"text",value:fC(String(r.value))};return n.patch(r,s),n.applyData(r,s)}function pC(n,r){const s={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(r,s),n.applyData(r,s)}const mC={blockquote:Vb,break:Gb,code:$b,delete:Yb,emphasis:Wb,footnoteReference:Kb,heading:Xb,html:Qb,imageReference:Zb,image:Jb,inlineCode:eC,linkReference:tC,link:nC,listItem:iC,list:sC,paragraph:lC,root:aC,strong:oC,table:cC,tableCell:hC,tableRow:uC,text:dC,thematicBreak:pC,toml:Sa,yaml:Sa,definition:Sa,footnoteDefinition:Sa};function Sa(){}const Wg=-1,Oa=0,Js=1,Ta=2,$u=3,Yu=4,Wu=5,Ku=6,Kg=7,Xg=8,gC=typeof self=="object"?self:globalThis,jm=(n,r)=>{switch(n){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+n)}return new gC[n](r)},_C=(n,r)=>{const s=(d,v)=>(n.set(v,d),d),o=d=>{if(n.has(d))return n.get(d);const[v,f]=r[d];switch(v){case Oa:case Wg:return s(f,d);case Js:{const a=s([],d);for(const c of f)a.push(o(c));return a}case Ta:{const a=s({},d);for(const[c,h]of f)a[o(c)]=o(h);return a}case $u:return s(new Date(f),d);case Yu:{const{source:a,flags:c}=f;return s(new RegExp(a,c),d)}case Wu:{const a=s(new Map,d);for(const[c,h]of f)a.set(o(c),o(h));return a}case Ku:{const a=s(new Set,d);for(const c of f)a.add(o(c));return a}case Kg:{const{name:a,message:c}=f;return s(jm(a,c),d)}case Xg:return s(BigInt(f),d);case"BigInt":return s(Object(BigInt(f)),d);case"ArrayBuffer":return s(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:a}=new Uint8Array(f);return s(new DataView(a),f)}}return s(jm(v,f),d)};return o},zm=n=>_C(new Map,n)(0),qr="",{toString:vC}={},{keys:yC}=Object,Ks=n=>{const r=typeof n;if(r!=="object"||!n)return[Oa,r];const s=vC.call(n).slice(8,-1);switch(s){case"Array":return[Js,qr];case"Object":return[Ta,qr];case"Date":return[$u,qr];case"RegExp":return[Yu,qr];case"Map":return[Wu,qr];case"Set":return[Ku,qr];case"DataView":return[Js,s]}return s.includes("Array")?[Js,s]:s.includes("Error")?[Kg,s]:[Ta,s]},ba=([n,r])=>n===Oa&&(r==="function"||r==="symbol"),SC=(n,r,s,o)=>{const d=(f,a)=>{const c=o.push(f)-1;return s.set(a,c),c},v=f=>{if(s.has(f))return s.get(f);let[a,c]=Ks(f);switch(a){case Oa:{let p=f;switch(c){case"bigint":a=Xg,p=f.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+c);p=null;break;case"undefined":return d([Wg],f)}return d([a,p],f)}case Js:{if(c){let S=f;return c==="DataView"?S=new Uint8Array(f.buffer):c==="ArrayBuffer"&&(S=new Uint8Array(f)),d([c,[...S]],f)}const p=[],u=d([a,p],f);for(const S of f)p.push(v(S));return u}case Ta:{if(c)switch(c){case"BigInt":return d([c,f.toString()],f);case"Boolean":case"Number":case"String":return d([c,f.valueOf()],f)}if(r&&"toJSON"in f)return v(f.toJSON());const p=[],u=d([a,p],f);for(const S of yC(f))(n||!ba(Ks(f[S])))&&p.push([v(S),v(f[S])]);return u}case $u:return d([a,f.toISOString()],f);case Yu:{const{source:p,flags:u}=f;return d([a,{source:p,flags:u}],f)}case Wu:{const p=[],u=d([a,p],f);for(const[S,C]of f)(n||!(ba(Ks(S))||ba(Ks(C))))&&p.push([v(S),v(C)]);return u}case Ku:{const p=[],u=d([a,p],f);for(const S of f)(n||!ba(Ks(S)))&&p.push(v(S));return u}}const{message:h}=f;return d([a,{name:c,message:h}],f)};return v},Hm=(n,{json:r,lossy:s}={})=>{const o=[];return SC(!(r||s),!!r,new Map,o)(n),o},Da=typeof structuredClone=="function"?(n,r)=>r&&("json"in r||"lossy"in r)?zm(Hm(n,r)):structuredClone(n):(n,r)=>zm(Hm(n,r));function bC(n,r){const s=[{type:"text",value:"↩"}];return r>1&&s.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),s}function CC(n,r){return"Back to reference "+(n+1)+(r>1?"-"+r:"")}function wC(n){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",s=n.options.footnoteBackContent||bC,o=n.options.footnoteBackLabel||CC,d=n.options.footnoteLabel||"Footnotes",v=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let c=-1;for(;++c<n.footnoteOrder.length;){const h=n.footnoteById.get(n.footnoteOrder[c]);if(!h)continue;const p=n.all(h),u=String(h.identifier).toUpperCase(),S=Qr(u.toLowerCase());let C=0;const A=[],x=n.footnoteCounts.get(u);for(;x!==void 0&&++C<=x;){A.length>0&&A.push({type:"text",value:" "});let g=typeof s=="string"?s:s(c,C);typeof g=="string"&&(g={type:"text",value:g}),A.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+S+(C>1?"-"+C:""),dataFootnoteBackref:"",ariaLabel:typeof o=="string"?o:o(c,C),className:["data-footnote-backref"]},children:Array.isArray(g)?g:[g]})}const b=p[p.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const g=b.children[b.children.length-1];g&&g.type==="text"?g.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...A)}else p.push(...A);const _={type:"element",tagName:"li",properties:{id:r+"fn-"+S},children:n.wrap(p,!0)};n.patch(h,_),a.push(_)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:v,properties:{...Da(f),id:"footnote-label"},children:[{type:"text",value:d}]},{type:"text",value:`
|
|
70
70
|
`},{type:"element",tagName:"ol",properties:{},children:n.wrap(a,!0)},{type:"text",value:`
|
|
71
|
-
`}]}}const
|
|
71
|
+
`}]}}const Ba=(function(n){if(n==null)return AC;if(typeof n=="function")return Na(n);if(typeof n=="object")return Array.isArray(n)?xC(n):EC(n);if(typeof n=="string")return kC(n);throw new Error("Expected function, string, or object as test")});function xC(n){const r=[];let s=-1;for(;++s<n.length;)r[s]=Ba(n[s]);return Na(o);function o(...d){let v=-1;for(;++v<r.length;)if(r[v].apply(this,d))return!0;return!1}}function EC(n){const r=n;return Na(s);function s(o){const d=o;let v;for(v in n)if(d[v]!==r[v])return!1;return!0}}function kC(n){return Na(r);function r(s){return s&&s.type===n}}function Na(n){return r;function r(s,o,d){return!!(TC(s)&&n.call(this,s,typeof o=="number"?o:void 0,d||void 0))}}function AC(){return!0}function TC(n){return n!==null&&typeof n=="object"&&"type"in n}const Qg=[],DC=!0,Au=!1,RC="skip";function Zg(n,r,s,o){let d;typeof r=="function"&&typeof s!="function"?(o=s,s=r):d=r;const v=Ba(d),f=o?-1:1;a(n,void 0,[])();function a(c,h,p){const u=c&&typeof c=="object"?c:{};if(typeof u.type=="string"){const C=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(S,"name",{value:"node ("+(c.type+(C?"<"+C+">":""))+")"})}return S;function S(){let C=Qg,A,x,b;if((!r||v(c,h,p[p.length-1]||void 0))&&(C=MC(s(c,p)),C[0]===Au))return C;if("children"in c&&c.children){const _=c;if(_.children&&C[0]!==RC)for(x=(o?_.children.length:-1)+f,b=p.concat(_);x>-1&&x<_.children.length;){const g=_.children[x];if(A=a(g,x,b)(),A[0]===Au)return A;x=typeof A[1]=="number"?A[1]:x+f}}return C}}}function MC(n){return Array.isArray(n)?n:typeof n=="number"?[DC,n]:n==null?Qg:[n]}function Xu(n,r,s,o){let d,v,f;typeof r=="function"&&typeof s!="function"?(v=void 0,f=r,d=s):(v=r,f=s,d=o),Zg(n,v,a,d);function a(c,h){const p=h[h.length-1],u=p?p.children.indexOf(c):void 0;return f(c,u,p)}}const Tu={}.hasOwnProperty,LC={};function OC(n,r){const s=r||LC,o=new Map,d=new Map,v=new Map,f={...mC,...s.handlers},a={all:h,applyData:NC,definitionById:o,footnoteById:d,footnoteCounts:v,footnoteOrder:[],handlers:f,one:c,options:s,patch:BC,wrap:zC};return Xu(n,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const u=p.type==="definition"?o:d,S=String(p.identifier).toUpperCase();u.has(S)||u.set(S,p)}}),a;function c(p,u){const S=p.type,C=a.handlers[S];if(Tu.call(a.handlers,S)&&C)return C(a,p,u);if(a.options.passThrough&&a.options.passThrough.includes(S)){if("children"in p){const{children:x,...b}=p,_=Da(b);return _.children=a.all(p),_}return Da(p)}return(a.options.unknownHandler||jC)(a,p,u)}function h(p){const u=[];if("children"in p){const S=p.children;let C=-1;for(;++C<S.length;){const A=a.one(S[C],p);if(A){if(C&&S[C-1].type==="break"&&(!Array.isArray(A)&&A.type==="text"&&(A.value=Im(A.value)),!Array.isArray(A)&&A.type==="element")){const x=A.children[0];x&&x.type==="text"&&(x.value=Im(x.value))}Array.isArray(A)?u.push(...A):u.push(A)}}}return u}}function BC(n,r){n.position&&(r.position=by(n))}function NC(n,r){let s=r;if(n&&n.data){const o=n.data.hName,d=n.data.hChildren,v=n.data.hProperties;if(typeof o=="string")if(s.type==="element")s.tagName=o;else{const f="children"in s?s.children:[s];s={type:"element",tagName:o,properties:{},children:f}}s.type==="element"&&v&&Object.assign(s.properties,Da(v)),"children"in s&&s.children&&d!==null&&d!==void 0&&(s.children=d)}return s}function jC(n,r){const s=r.data||{},o="value"in r&&!(Tu.call(s,"hProperties")||Tu.call(s,"hChildren"))?{type:"text",value:r.value}:{type:"element",tagName:"div",properties:{},children:n.all(r)};return n.patch(r,o),n.applyData(r,o)}function zC(n,r){const s=[];let o=-1;for(r&&s.push({type:"text",value:`
|
|
72
72
|
`});++o<n.length;)o&&s.push({type:"text",value:`
|
|
73
73
|
`}),s.push(n[o]);return r&&n.length>0&&s.push({type:"text",value:`
|
|
74
|
-
`}),s}function Im(n){let r=0,s=n.charCodeAt(r);for(;s===9||s===32;)r++,s=n.charCodeAt(r);return n.slice(r)}function Um(n,r){const s=
|
|
75
|
-
`},d),v}function zC(n,r){return n&&"run"in n?async function(s,o){const d=Um(s,{file:o,...r});await n.run(d,o)}:function(s,o){return Um(s,{file:o,...n||r})}}function Pm(n){if(n)throw n}var ou,Fm;function HC(){if(Fm)return ou;Fm=1;var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,d=function(h){return typeof Array.isArray=="function"?Array.isArray(h):r.call(h)==="[object Array]"},v=function(h){if(!h||r.call(h)!=="[object Object]")return!1;var p=n.call(h,"constructor"),u=h.constructor&&h.constructor.prototype&&n.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!p&&!u)return!1;var S;for(S in h);return typeof S>"u"||n.call(h,S)},f=function(h,p){s&&p.name==="__proto__"?s(h,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):h[p.name]=p.newValue},a=function(h,p){if(p==="__proto__")if(n.call(h,p)){if(o)return o(h,p).value}else return;return h[p]};return ou=function c(){var h,p,u,S,w,A,x=arguments[0],b=1,_=arguments.length,g=!1;for(typeof x=="boolean"&&(g=x,x=arguments[1]||{},b=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});b<_;++b)if(h=arguments[b],h!=null)for(p in h)u=a(x,p),S=a(h,p),x!==S&&(g&&S&&(v(S)||(w=d(S)))?(w?(w=!1,A=u&&d(u)?u:[]):A=u&&v(u)?u:{},f(x,{name:p,newValue:c(g,A,S)})):typeof S<"u"&&f(x,{name:p,newValue:S}));return x},ou}var IC=HC();const cu=sg(IC);function Du(n){if(typeof n!="object"||n===null)return!1;const r=Object.getPrototypeOf(n);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function UC(){const n=[],r={run:s,use:o};return r;function s(...d){let v=-1;const f=d.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);a(null,...d);function a(c,...h){const p=n[++v];let u=-1;if(c){f(c);return}for(;++u<d.length;)(h[u]===null||h[u]===void 0)&&(h[u]=d[u]);d=h,p?PC(p,a)(...h):f(null,...h)}}function o(d){if(typeof d!="function")throw new TypeError("Expected `middelware` to be a function, not "+d);return n.push(d),r}}function PC(n,r){let s;return o;function o(...f){const a=n.length>f.length;let c;a&&f.push(d);try{c=n.apply(this,f)}catch(h){const p=h;if(a&&s)throw p;return d(p)}a||(c&&c.then&&typeof c.then=="function"?c.then(v,d):c instanceof Error?d(c):v(c))}function d(f,...a){s||(s=!0,r(f,...a))}function v(f){d(null,f)}}const Un={basename:FC,dirname:qC,extname:VC,join:GC,sep:"/"};function FC(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');ll(n);let s=0,o=-1,d=n.length,v;if(r===void 0||r.length===0||r.length>n.length){for(;d--;)if(n.codePointAt(d)===47){if(v){s=d+1;break}}else o<0&&(v=!0,o=d+1);return o<0?"":n.slice(s,o)}if(r===n)return"";let f=-1,a=r.length-1;for(;d--;)if(n.codePointAt(d)===47){if(v){s=d+1;break}}else f<0&&(v=!0,f=d+1),a>-1&&(n.codePointAt(d)===r.codePointAt(a--)?a<0&&(o=d):(a=-1,o=f));return s===o?o=f:o<0&&(o=n.length),n.slice(s,o)}function qC(n){if(ll(n),n.length===0)return".";let r=-1,s=n.length,o;for(;--s;)if(n.codePointAt(s)===47){if(o){r=s;break}}else o||(o=!0);return r<0?n.codePointAt(0)===47?"/":".":r===1&&n.codePointAt(0)===47?"//":n.slice(0,r)}function VC(n){ll(n);let r=n.length,s=-1,o=0,d=-1,v=0,f;for(;r--;){const a=n.codePointAt(r);if(a===47){if(f){o=r+1;break}continue}s<0&&(f=!0,s=r+1),a===46?d<0?d=r:v!==1&&(v=1):d>-1&&(v=-1)}return d<0||s<0||v===0||v===1&&d===s-1&&d===o+1?"":n.slice(d,s)}function GC(...n){let r=-1,s;for(;++r<n.length;)ll(n[r]),n[r]&&(s=s===void 0?n[r]:s+"/"+n[r]);return s===void 0?".":$C(s)}function $C(n){ll(n);const r=n.codePointAt(0)===47;let s=YC(n,!r);return s.length===0&&!r&&(s="."),s.length>0&&n.codePointAt(n.length-1)===47&&(s+="/"),r?"/"+s:s}function YC(n,r){let s="",o=0,d=-1,v=0,f=-1,a,c;for(;++f<=n.length;){if(f<n.length)a=n.codePointAt(f);else{if(a===47)break;a=47}if(a===47){if(!(d===f-1||v===1))if(d!==f-1&&v===2){if(s.length<2||o!==2||s.codePointAt(s.length-1)!==46||s.codePointAt(s.length-2)!==46){if(s.length>2){if(c=s.lastIndexOf("/"),c!==s.length-1){c<0?(s="",o=0):(s=s.slice(0,c),o=s.length-1-s.lastIndexOf("/")),d=f,v=0;continue}}else if(s.length>0){s="",o=0,d=f,v=0;continue}}r&&(s=s.length>0?s+"/..":"..",o=2)}else s.length>0?s+="/"+n.slice(d+1,f):s=n.slice(d+1,f),o=f-d-1;d=f,v=0}else a===46&&v>-1?v++:v=-1}return s}function ll(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const WC={cwd:KC};function KC(){return"/"}function Ru(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function XC(n){if(typeof n=="string")n=new URL(n);else if(!Ru(n)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(n.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return QC(n)}function QC(n){if(n.hostname!==""){const o=new TypeError('File URL host must be "localhost" or empty on darwin');throw o.code="ERR_INVALID_FILE_URL_HOST",o}const r=n.pathname;let s=-1;for(;++s<r.length;)if(r.codePointAt(s)===37&&r.codePointAt(s+1)===50){const o=r.codePointAt(s+2);if(o===70||o===102){const d=new TypeError("File URL path must not include encoded / characters");throw d.code="ERR_INVALID_FILE_URL_PATH",d}}return decodeURIComponent(r)}const uu=["history","path","basename","stem","extname","dirname"];class Zg{constructor(r){let s;r?Ru(r)?s={path:r}:typeof r=="string"||ZC(r)?s={value:r}:s=r:s={},this.cwd="cwd"in s?"":WC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let o=-1;for(;++o<uu.length;){const v=uu[o];v in s&&s[v]!==void 0&&s[v]!==null&&(this[v]=v==="history"?[...s[v]]:s[v])}let d;for(d in s)uu.includes(d)||(this[d]=s[d])}get basename(){return typeof this.path=="string"?Un.basename(this.path):void 0}set basename(r){fu(r,"basename"),hu(r,"basename"),this.path=Un.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?Un.dirname(this.path):void 0}set dirname(r){qm(this.basename,"dirname"),this.path=Un.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?Un.extname(this.path):void 0}set extname(r){if(hu(r,"extname"),qm(this.dirname,"extname"),r){if(r.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(r.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Un.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){Ru(r)&&(r=XC(r)),fu(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?Un.basename(this.path,this.extname):void 0}set stem(r){fu(r,"stem"),hu(r,"stem"),this.path=Un.join(this.dirname||"",r+(this.extname||""))}fail(r,s,o){const d=this.message(r,s,o);throw d.fatal=!0,d}info(r,s,o){const d=this.message(r,s,o);return d.fatal=void 0,d}message(r,s,o){const d=new $t(r,s,o);return this.path&&(d.name=this.path+":"+d.name,d.file=this.path),d.fatal=!1,this.messages.push(d),d}toString(r){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(r||void 0).decode(this.value)}}function hu(n,r){if(n&&n.includes(Un.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+Un.sep+"`")}function fu(n,r){if(!n)throw new Error("`"+r+"` cannot be empty")}function qm(n,r){if(!n)throw new Error("Setting `"+r+"` requires `path` to be set too")}function ZC(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const JC=(function(n){const o=this.constructor.prototype,d=o[n],v=function(){return d.apply(v,arguments)};return Object.setPrototypeOf(v,o),v}),ew={}.hasOwnProperty;class Qu extends JC{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=UC()}copy(){const r=new Qu;let s=-1;for(;++s<this.attachers.length;){const o=this.attachers[s];r.use(...o)}return r.data(cu(!0,{},this.namespace)),r}data(r,s){return typeof r=="string"?arguments.length===2?(mu("data",this.frozen),this.namespace[r]=s,this):ew.call(this.namespace,r)&&this.namespace[r]||void 0:r?(mu("data",this.frozen),this.namespace=r,this):this.namespace}freeze(){if(this.frozen)return this;const r=this;for(;++this.freezeIndex<this.attachers.length;){const[s,...o]=this.attachers[this.freezeIndex];if(o[0]===!1)continue;o[0]===!0&&(o[0]=void 0);const d=s.call(r,...o);typeof d=="function"&&this.transformers.use(d)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const s=wa(r),o=this.parser||this.Parser;return du("parse",o),o(String(s),s)}process(r,s){const o=this;return this.freeze(),du("process",this.parser||this.Parser),pu("process",this.compiler||this.Compiler),s?d(void 0,s):new Promise(d);function d(v,f){const a=wa(r),c=o.parse(a);o.run(c,a,function(p,u,S){if(p||!u||!S)return h(p);const w=u,A=o.stringify(w,S);iw(A)?S.value=A:S.result=A,h(p,S)});function h(p,u){p||!u?f(p):v?v(u):s(void 0,u)}}}processSync(r){let s=!1,o;return this.freeze(),du("processSync",this.parser||this.Parser),pu("processSync",this.compiler||this.Compiler),this.process(r,d),Gm("processSync","process",s),o;function d(v,f){s=!0,Pm(v),o=f}}run(r,s,o){Vm(r),this.freeze();const d=this.transformers;return!o&&typeof s=="function"&&(o=s,s=void 0),o?v(void 0,o):new Promise(v);function v(f,a){const c=wa(s);d.run(r,c,h);function h(p,u,S){const w=u||r;p?a(p):f?f(w):o(void 0,w,S)}}}runSync(r,s){let o=!1,d;return this.run(r,s,v),Gm("runSync","run",o),d;function v(f,a){Pm(f),d=a,o=!0}}stringify(r,s){this.freeze();const o=wa(s),d=this.compiler||this.Compiler;return pu("stringify",d),Vm(r),d(r,o)}use(r,...s){const o=this.attachers,d=this.namespace;if(mu("use",this.frozen),r!=null)if(typeof r=="function")c(r,s);else if(typeof r=="object")Array.isArray(r)?a(r):f(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function v(h){if(typeof h=="function")c(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[p,...u]=h;c(p,u)}else f(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function f(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");a(h.plugins),h.settings&&(d.settings=cu(!0,d.settings,h.settings))}function a(h){let p=-1;if(h!=null)if(Array.isArray(h))for(;++p<h.length;){const u=h[p];v(u)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function c(h,p){let u=-1,S=-1;for(;++u<o.length;)if(o[u][0]===h){S=u;break}if(S===-1)o.push([h,...p]);else if(p.length>0){let[w,...A]=p;const x=o[S][1];Du(x)&&Du(w)&&(w=cu(!0,x,w)),o[S]=[h,w,...A]}}}}const tw=new Qu().freeze();function du(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function pu(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function mu(n,r){if(r)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Vm(n){if(!Du(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function Gm(n,r,s){if(!s)throw new Error("`"+n+"` finished async. Use `"+r+"` instead")}function wa(n){return nw(n)?n:new Zg(n)}function nw(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function iw(n){return typeof n=="string"||rw(n)}function rw(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const sw="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",$m=[],Ym={allowDangerousHtml:!0},lw=/^(https?|ircs?|mailto|xmpp)$/i,aw=[{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 Jg(n){const r=ow(n),s=cw(n);return uw(r.runSync(r.parse(s),s),n)}function ow(n){const r=n.rehypePlugins||$m,s=n.remarkPlugins||$m,o=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...Ym}:Ym;return tw().use(Fb).use(s).use(zC,o).use(r)}function cw(n){const r=n.children||"",s=new Zg;return typeof r=="string"&&(s.value=r),s}function uw(n,r){const s=r.allowedElements,o=r.allowElement,d=r.components,v=r.disallowedElements,f=r.skipHtml,a=r.unwrapDisallowed,c=r.urlTransform||hw;for(const p of aw)Object.hasOwn(r,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+sw+p.id,void 0);return Xu(n,h),Ey(n,{Fragment:B.Fragment,components:d,ignoreInvalidStyle:!0,jsx:B.jsx,jsxs:B.jsxs,passKeys:!0,passNode:!0});function h(p,u,S){if(p.type==="raw"&&S&&typeof u=="number")return f?S.children.splice(u,1):S.children[u]={type:"text",value:p.value},u;if(p.type==="element"){let w;for(w in su)if(Object.hasOwn(su,w)&&Object.hasOwn(p.properties,w)){const A=p.properties[w],x=su[w];(x===null||x.includes(p.tagName))&&(p.properties[w]=c(String(A||""),w,p))}}if(p.type==="element"){let w=s?!s.includes(p.tagName):v?v.includes(p.tagName):!1;if(!w&&o&&typeof u=="number"&&(w=!o(p,u,S)),w&&S&&typeof u=="number")return a&&p.children?S.children.splice(u,1,...p.children):S.children.splice(u,1),u}}}function hw(n){const r=n.indexOf(":"),s=n.indexOf("?"),o=n.indexOf("#"),d=n.indexOf("/");return r===-1||d!==-1&&r>d||s!==-1&&r>s||o!==-1&&r>o||lw.test(n.slice(0,r))?n:""}function Wm(n,r){const s=String(n);if(typeof r!="string")throw new TypeError("Expected character");let o=0,d=s.indexOf(r);for(;d!==-1;)o++,d=s.indexOf(r,d+r.length);return o}function fw(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function dw(n,r,s){const d=Na((s||{}).ignore||[]),v=pw(r);let f=-1;for(;++f<v.length;)Qg(n,"text",a);function a(h,p){let u=-1,S;for(;++u<p.length;){const w=p[u],A=S?S.children:void 0;if(d(w,A?A.indexOf(w):void 0,S))return;S=w}if(S)return c(h,p)}function c(h,p){const u=p[p.length-1],S=v[f][0],w=v[f][1];let A=0;const b=u.children.indexOf(h);let _=!1,g=[];S.lastIndex=0;let y=S.exec(h.value);for(;y;){const k=y.index,M={index:y.index,input:y.input,stack:[...p,h]};let D=w(...y,M);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?S.lastIndex=k+1:(A!==k&&g.push({type:"text",value:h.value.slice(A,k)}),Array.isArray(D)?g.push(...D):D&&g.push(D),A=k+y[0].length,_=!0),!S.global)break;y=S.exec(h.value)}return _?(A<h.value.length&&g.push({type:"text",value:h.value.slice(A)}),u.children.splice(b,1,...g)):g=[h],b+g.length}}function pw(n){const r=[];if(!Array.isArray(n))throw new TypeError("Expected find and replace tuple or list of tuples");const s=!n[0]||Array.isArray(n[0])?n:[n];let o=-1;for(;++o<s.length;){const d=s[o];r.push([mw(d[0]),gw(d[1])])}return r}function mw(n){return typeof n=="string"?new RegExp(fw(n),"g"):n}function gw(n){return typeof n=="function"?n:function(){return n}}const gu="phrasing",_u=["autolink","link","image","label"];function _w(){return{transforms:[xw],enter:{literalAutolink:yw,literalAutolinkEmail:vu,literalAutolinkHttp:vu,literalAutolinkWww:vu},exit:{literalAutolink:ww,literalAutolinkEmail:Cw,literalAutolinkHttp:Sw,literalAutolinkWww:bw}}}function vw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:gu,notInConstruct:_u},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:gu,notInConstruct:_u},{character:":",before:"[ps]",after:"\\/",inConstruct:gu,notInConstruct:_u}]}}function yw(n){this.enter({type:"link",title:null,url:"",children:[]},n)}function vu(n){this.config.enter.autolinkProtocol.call(this,n)}function Sw(n){this.config.exit.autolinkProtocol.call(this,n)}function bw(n){this.config.exit.data.call(this,n);const r=this.stack[this.stack.length-1];r.type,r.url="http://"+this.sliceSerialize(n)}function Cw(n){this.config.exit.autolinkEmail.call(this,n)}function ww(n){this.exit(n)}function xw(n){dw(n,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Ew],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),kw]],{ignore:["link","linkReference"]})}function Ew(n,r,s,o,d){let v="";if(!e_(d)||(/^w/i.test(r)&&(s=r+s,r="",v="http://"),!Aw(s)))return!1;const f=Tw(s+o);if(!f[0])return!1;const a={type:"link",title:null,url:v+r+f[0],children:[{type:"text",value:r+f[0]}]};return f[1]?[a,{type:"text",value:f[1]}]:a}function kw(n,r,s,o){return!e_(o,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+s,children:[{type:"text",value:r+"@"+s}]}}function Aw(n){const r=n.split(".");return!(r.length<2||r[r.length-1]&&(/_/.test(r[r.length-1])||!/[a-zA-Z\d]/.test(r[r.length-1]))||r[r.length-2]&&(/_/.test(r[r.length-2])||!/[a-zA-Z\d]/.test(r[r.length-2])))}function Tw(n){const r=/[!"&'),.:;<>?\]}]+$/.exec(n);if(!r)return[n,void 0];n=n.slice(0,r.index);let s=r[0],o=s.indexOf(")");const d=Wm(n,"(");let v=Wm(n,")");for(;o!==-1&&d>v;)n+=s.slice(0,o+1),s=s.slice(o+1),o=s.indexOf(")"),v++;return[n,s]}function e_(n,r){const s=n.input.charCodeAt(n.index-1);return(n.index===0||ir(s)||La(s))&&(!r||s!==47)}t_.peek=zw;function Dw(){this.buffer()}function Rw(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function Mw(){this.buffer()}function Lw(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function Ow(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=Nn(this.sliceSerialize(n)).toLowerCase(),s.label=r}function Bw(n){this.exit(n)}function Nw(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=Nn(this.sliceSerialize(n)).toLowerCase(),s.label=r}function jw(n){this.exit(n)}function zw(){return"["}function t_(n,r,s,o){const d=s.createTracker(o);let v=d.move("[^");const f=s.enter("footnoteReference"),a=s.enter("reference");return v+=d.move(s.safe(s.associationId(n),{after:"]",before:v})),a(),f(),v+=d.move("]"),v}function Hw(){return{enter:{gfmFootnoteCallString:Dw,gfmFootnoteCall:Rw,gfmFootnoteDefinitionLabelString:Mw,gfmFootnoteDefinition:Lw},exit:{gfmFootnoteCallString:Ow,gfmFootnoteCall:Bw,gfmFootnoteDefinitionLabelString:Nw,gfmFootnoteDefinition:jw}}}function Iw(n){let r=!1;return n&&n.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:s,footnoteReference:t_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(o,d,v,f){const a=v.createTracker(f);let c=a.move("[^");const h=v.enter("footnoteDefinition"),p=v.enter("label");return c+=a.move(v.safe(v.associationId(o),{before:c,after:"]"})),p(),c+=a.move("]:"),o.children&&o.children.length>0&&(a.shift(4),c+=a.move((r?`
|
|
76
|
-
`:" ")+v.indentLines(v.containerFlow(o,a.current()),r?
|
|
77
|
-
`)}function
|
|
78
|
-
`&&
|
|
79
|
-
`}function
|
|
74
|
+
`}),s}function Im(n){let r=0,s=n.charCodeAt(r);for(;s===9||s===32;)r++,s=n.charCodeAt(r);return n.slice(r)}function Um(n,r){const s=OC(n,r),o=s.one(n,void 0),d=wC(s),v=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return d&&v.children.push({type:"text",value:`
|
|
75
|
+
`},d),v}function HC(n,r){return n&&"run"in n?async function(s,o){const d=Um(s,{file:o,...r});await n.run(d,o)}:function(s,o){return Um(s,{file:o,...n||r})}}function Pm(n){if(n)throw n}var ou,Fm;function IC(){if(Fm)return ou;Fm=1;var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,d=function(h){return typeof Array.isArray=="function"?Array.isArray(h):r.call(h)==="[object Array]"},v=function(h){if(!h||r.call(h)!=="[object Object]")return!1;var p=n.call(h,"constructor"),u=h.constructor&&h.constructor.prototype&&n.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!p&&!u)return!1;var S;for(S in h);return typeof S>"u"||n.call(h,S)},f=function(h,p){s&&p.name==="__proto__"?s(h,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):h[p.name]=p.newValue},a=function(h,p){if(p==="__proto__")if(n.call(h,p)){if(o)return o(h,p).value}else return;return h[p]};return ou=function c(){var h,p,u,S,C,A,x=arguments[0],b=1,_=arguments.length,g=!1;for(typeof x=="boolean"&&(g=x,x=arguments[1]||{},b=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});b<_;++b)if(h=arguments[b],h!=null)for(p in h)u=a(x,p),S=a(h,p),x!==S&&(g&&S&&(v(S)||(C=d(S)))?(C?(C=!1,A=u&&d(u)?u:[]):A=u&&v(u)?u:{},f(x,{name:p,newValue:c(g,A,S)})):typeof S<"u"&&f(x,{name:p,newValue:S}));return x},ou}var UC=IC();const cu=lg(UC);function Du(n){if(typeof n!="object"||n===null)return!1;const r=Object.getPrototypeOf(n);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function PC(){const n=[],r={run:s,use:o};return r;function s(...d){let v=-1;const f=d.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);a(null,...d);function a(c,...h){const p=n[++v];let u=-1;if(c){f(c);return}for(;++u<d.length;)(h[u]===null||h[u]===void 0)&&(h[u]=d[u]);d=h,p?FC(p,a)(...h):f(null,...h)}}function o(d){if(typeof d!="function")throw new TypeError("Expected `middelware` to be a function, not "+d);return n.push(d),r}}function FC(n,r){let s;return o;function o(...f){const a=n.length>f.length;let c;a&&f.push(d);try{c=n.apply(this,f)}catch(h){const p=h;if(a&&s)throw p;return d(p)}a||(c&&c.then&&typeof c.then=="function"?c.then(v,d):c instanceof Error?d(c):v(c))}function d(f,...a){s||(s=!0,r(f,...a))}function v(f){d(null,f)}}const Bn={basename:qC,dirname:VC,extname:GC,join:$C,sep:"/"};function qC(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');sl(n);let s=0,o=-1,d=n.length,v;if(r===void 0||r.length===0||r.length>n.length){for(;d--;)if(n.codePointAt(d)===47){if(v){s=d+1;break}}else o<0&&(v=!0,o=d+1);return o<0?"":n.slice(s,o)}if(r===n)return"";let f=-1,a=r.length-1;for(;d--;)if(n.codePointAt(d)===47){if(v){s=d+1;break}}else f<0&&(v=!0,f=d+1),a>-1&&(n.codePointAt(d)===r.codePointAt(a--)?a<0&&(o=d):(a=-1,o=f));return s===o?o=f:o<0&&(o=n.length),n.slice(s,o)}function VC(n){if(sl(n),n.length===0)return".";let r=-1,s=n.length,o;for(;--s;)if(n.codePointAt(s)===47){if(o){r=s;break}}else o||(o=!0);return r<0?n.codePointAt(0)===47?"/":".":r===1&&n.codePointAt(0)===47?"//":n.slice(0,r)}function GC(n){sl(n);let r=n.length,s=-1,o=0,d=-1,v=0,f;for(;r--;){const a=n.codePointAt(r);if(a===47){if(f){o=r+1;break}continue}s<0&&(f=!0,s=r+1),a===46?d<0?d=r:v!==1&&(v=1):d>-1&&(v=-1)}return d<0||s<0||v===0||v===1&&d===s-1&&d===o+1?"":n.slice(d,s)}function $C(...n){let r=-1,s;for(;++r<n.length;)sl(n[r]),n[r]&&(s=s===void 0?n[r]:s+"/"+n[r]);return s===void 0?".":YC(s)}function YC(n){sl(n);const r=n.codePointAt(0)===47;let s=WC(n,!r);return s.length===0&&!r&&(s="."),s.length>0&&n.codePointAt(n.length-1)===47&&(s+="/"),r?"/"+s:s}function WC(n,r){let s="",o=0,d=-1,v=0,f=-1,a,c;for(;++f<=n.length;){if(f<n.length)a=n.codePointAt(f);else{if(a===47)break;a=47}if(a===47){if(!(d===f-1||v===1))if(d!==f-1&&v===2){if(s.length<2||o!==2||s.codePointAt(s.length-1)!==46||s.codePointAt(s.length-2)!==46){if(s.length>2){if(c=s.lastIndexOf("/"),c!==s.length-1){c<0?(s="",o=0):(s=s.slice(0,c),o=s.length-1-s.lastIndexOf("/")),d=f,v=0;continue}}else if(s.length>0){s="",o=0,d=f,v=0;continue}}r&&(s=s.length>0?s+"/..":"..",o=2)}else s.length>0?s+="/"+n.slice(d+1,f):s=n.slice(d+1,f),o=f-d-1;d=f,v=0}else a===46&&v>-1?v++:v=-1}return s}function sl(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const KC={cwd:XC};function XC(){return"/"}function Ru(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function QC(n){if(typeof n=="string")n=new URL(n);else if(!Ru(n)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(n.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return ZC(n)}function ZC(n){if(n.hostname!==""){const o=new TypeError('File URL host must be "localhost" or empty on darwin');throw o.code="ERR_INVALID_FILE_URL_HOST",o}const r=n.pathname;let s=-1;for(;++s<r.length;)if(r.codePointAt(s)===37&&r.codePointAt(s+1)===50){const o=r.codePointAt(s+2);if(o===70||o===102){const d=new TypeError("File URL path must not include encoded / characters");throw d.code="ERR_INVALID_FILE_URL_PATH",d}}return decodeURIComponent(r)}const uu=["history","path","basename","stem","extname","dirname"];class Jg{constructor(r){let s;r?Ru(r)?s={path:r}:typeof r=="string"||JC(r)?s={value:r}:s=r:s={},this.cwd="cwd"in s?"":KC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let o=-1;for(;++o<uu.length;){const v=uu[o];v in s&&s[v]!==void 0&&s[v]!==null&&(this[v]=v==="history"?[...s[v]]:s[v])}let d;for(d in s)uu.includes(d)||(this[d]=s[d])}get basename(){return typeof this.path=="string"?Bn.basename(this.path):void 0}set basename(r){fu(r,"basename"),hu(r,"basename"),this.path=Bn.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?Bn.dirname(this.path):void 0}set dirname(r){qm(this.basename,"dirname"),this.path=Bn.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?Bn.extname(this.path):void 0}set extname(r){if(hu(r,"extname"),qm(this.dirname,"extname"),r){if(r.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(r.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Bn.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){Ru(r)&&(r=QC(r)),fu(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?Bn.basename(this.path,this.extname):void 0}set stem(r){fu(r,"stem"),hu(r,"stem"),this.path=Bn.join(this.dirname||"",r+(this.extname||""))}fail(r,s,o){const d=this.message(r,s,o);throw d.fatal=!0,d}info(r,s,o){const d=this.message(r,s,o);return d.fatal=void 0,d}message(r,s,o){const d=new Vt(r,s,o);return this.path&&(d.name=this.path+":"+d.name,d.file=this.path),d.fatal=!1,this.messages.push(d),d}toString(r){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(r||void 0).decode(this.value)}}function hu(n,r){if(n&&n.includes(Bn.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+Bn.sep+"`")}function fu(n,r){if(!n)throw new Error("`"+r+"` cannot be empty")}function qm(n,r){if(!n)throw new Error("Setting `"+r+"` requires `path` to be set too")}function JC(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const ew=(function(n){const o=this.constructor.prototype,d=o[n],v=function(){return d.apply(v,arguments)};return Object.setPrototypeOf(v,o),v}),tw={}.hasOwnProperty;class Qu extends ew{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=PC()}copy(){const r=new Qu;let s=-1;for(;++s<this.attachers.length;){const o=this.attachers[s];r.use(...o)}return r.data(cu(!0,{},this.namespace)),r}data(r,s){return typeof r=="string"?arguments.length===2?(mu("data",this.frozen),this.namespace[r]=s,this):tw.call(this.namespace,r)&&this.namespace[r]||void 0:r?(mu("data",this.frozen),this.namespace=r,this):this.namespace}freeze(){if(this.frozen)return this;const r=this;for(;++this.freezeIndex<this.attachers.length;){const[s,...o]=this.attachers[this.freezeIndex];if(o[0]===!1)continue;o[0]===!0&&(o[0]=void 0);const d=s.call(r,...o);typeof d=="function"&&this.transformers.use(d)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const s=Ca(r),o=this.parser||this.Parser;return du("parse",o),o(String(s),s)}process(r,s){const o=this;return this.freeze(),du("process",this.parser||this.Parser),pu("process",this.compiler||this.Compiler),s?d(void 0,s):new Promise(d);function d(v,f){const a=Ca(r),c=o.parse(a);o.run(c,a,function(p,u,S){if(p||!u||!S)return h(p);const C=u,A=o.stringify(C,S);rw(A)?S.value=A:S.result=A,h(p,S)});function h(p,u){p||!u?f(p):v?v(u):s(void 0,u)}}}processSync(r){let s=!1,o;return this.freeze(),du("processSync",this.parser||this.Parser),pu("processSync",this.compiler||this.Compiler),this.process(r,d),Gm("processSync","process",s),o;function d(v,f){s=!0,Pm(v),o=f}}run(r,s,o){Vm(r),this.freeze();const d=this.transformers;return!o&&typeof s=="function"&&(o=s,s=void 0),o?v(void 0,o):new Promise(v);function v(f,a){const c=Ca(s);d.run(r,c,h);function h(p,u,S){const C=u||r;p?a(p):f?f(C):o(void 0,C,S)}}}runSync(r,s){let o=!1,d;return this.run(r,s,v),Gm("runSync","run",o),d;function v(f,a){Pm(f),d=a,o=!0}}stringify(r,s){this.freeze();const o=Ca(s),d=this.compiler||this.Compiler;return pu("stringify",d),Vm(r),d(r,o)}use(r,...s){const o=this.attachers,d=this.namespace;if(mu("use",this.frozen),r!=null)if(typeof r=="function")c(r,s);else if(typeof r=="object")Array.isArray(r)?a(r):f(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function v(h){if(typeof h=="function")c(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[p,...u]=h;c(p,u)}else f(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function f(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");a(h.plugins),h.settings&&(d.settings=cu(!0,d.settings,h.settings))}function a(h){let p=-1;if(h!=null)if(Array.isArray(h))for(;++p<h.length;){const u=h[p];v(u)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function c(h,p){let u=-1,S=-1;for(;++u<o.length;)if(o[u][0]===h){S=u;break}if(S===-1)o.push([h,...p]);else if(p.length>0){let[C,...A]=p;const x=o[S][1];Du(x)&&Du(C)&&(C=cu(!0,x,C)),o[S]=[h,C,...A]}}}}const nw=new Qu().freeze();function du(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function pu(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function mu(n,r){if(r)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Vm(n){if(!Du(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function Gm(n,r,s){if(!s)throw new Error("`"+n+"` finished async. Use `"+r+"` instead")}function Ca(n){return iw(n)?n:new Jg(n)}function iw(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function rw(n){return typeof n=="string"||sw(n)}function sw(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const lw="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",$m=[],Ym={allowDangerousHtml:!0},aw=/^(https?|ircs?|mailto|xmpp)$/i,ow=[{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 e_(n){const r=cw(n),s=uw(n);return hw(r.runSync(r.parse(s),s),n)}function cw(n){const r=n.rehypePlugins||$m,s=n.remarkPlugins||$m,o=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...Ym}:Ym;return nw().use(qb).use(s).use(HC,o).use(r)}function uw(n){const r=n.children||"",s=new Jg;return typeof r=="string"&&(s.value=r),s}function hw(n,r){const s=r.allowedElements,o=r.allowElement,d=r.components,v=r.disallowedElements,f=r.skipHtml,a=r.unwrapDisallowed,c=r.urlTransform||fw;for(const p of ow)Object.hasOwn(r,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+lw+p.id,void 0);return Xu(n,h),ky(n,{Fragment:N.Fragment,components:d,ignoreInvalidStyle:!0,jsx:N.jsx,jsxs:N.jsxs,passKeys:!0,passNode:!0});function h(p,u,S){if(p.type==="raw"&&S&&typeof u=="number")return f?S.children.splice(u,1):S.children[u]={type:"text",value:p.value},u;if(p.type==="element"){let C;for(C in su)if(Object.hasOwn(su,C)&&Object.hasOwn(p.properties,C)){const A=p.properties[C],x=su[C];(x===null||x.includes(p.tagName))&&(p.properties[C]=c(String(A||""),C,p))}}if(p.type==="element"){let C=s?!s.includes(p.tagName):v?v.includes(p.tagName):!1;if(!C&&o&&typeof u=="number"&&(C=!o(p,u,S)),C&&S&&typeof u=="number")return a&&p.children?S.children.splice(u,1,...p.children):S.children.splice(u,1),u}}}function fw(n){const r=n.indexOf(":"),s=n.indexOf("?"),o=n.indexOf("#"),d=n.indexOf("/");return r===-1||d!==-1&&r>d||s!==-1&&r>s||o!==-1&&r>o||aw.test(n.slice(0,r))?n:""}function Wm(n,r){const s=String(n);if(typeof r!="string")throw new TypeError("Expected character");let o=0,d=s.indexOf(r);for(;d!==-1;)o++,d=s.indexOf(r,d+r.length);return o}function dw(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function pw(n,r,s){const d=Ba((s||{}).ignore||[]),v=mw(r);let f=-1;for(;++f<v.length;)Zg(n,"text",a);function a(h,p){let u=-1,S;for(;++u<p.length;){const C=p[u],A=S?S.children:void 0;if(d(C,A?A.indexOf(C):void 0,S))return;S=C}if(S)return c(h,p)}function c(h,p){const u=p[p.length-1],S=v[f][0],C=v[f][1];let A=0;const b=u.children.indexOf(h);let _=!1,g=[];S.lastIndex=0;let y=S.exec(h.value);for(;y;){const k=y.index,M={index:y.index,input:y.input,stack:[...p,h]};let D=C(...y,M);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?S.lastIndex=k+1:(A!==k&&g.push({type:"text",value:h.value.slice(A,k)}),Array.isArray(D)?g.push(...D):D&&g.push(D),A=k+y[0].length,_=!0),!S.global)break;y=S.exec(h.value)}return _?(A<h.value.length&&g.push({type:"text",value:h.value.slice(A)}),u.children.splice(b,1,...g)):g=[h],b+g.length}}function mw(n){const r=[];if(!Array.isArray(n))throw new TypeError("Expected find and replace tuple or list of tuples");const s=!n[0]||Array.isArray(n[0])?n:[n];let o=-1;for(;++o<s.length;){const d=s[o];r.push([gw(d[0]),_w(d[1])])}return r}function gw(n){return typeof n=="string"?new RegExp(dw(n),"g"):n}function _w(n){return typeof n=="function"?n:function(){return n}}const gu="phrasing",_u=["autolink","link","image","label"];function vw(){return{transforms:[Ew],enter:{literalAutolink:Sw,literalAutolinkEmail:vu,literalAutolinkHttp:vu,literalAutolinkWww:vu},exit:{literalAutolink:xw,literalAutolinkEmail:ww,literalAutolinkHttp:bw,literalAutolinkWww:Cw}}}function yw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:gu,notInConstruct:_u},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:gu,notInConstruct:_u},{character:":",before:"[ps]",after:"\\/",inConstruct:gu,notInConstruct:_u}]}}function Sw(n){this.enter({type:"link",title:null,url:"",children:[]},n)}function vu(n){this.config.enter.autolinkProtocol.call(this,n)}function bw(n){this.config.exit.autolinkProtocol.call(this,n)}function Cw(n){this.config.exit.data.call(this,n);const r=this.stack[this.stack.length-1];r.type,r.url="http://"+this.sliceSerialize(n)}function ww(n){this.config.exit.autolinkEmail.call(this,n)}function xw(n){this.exit(n)}function Ew(n){pw(n,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,kw],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Aw]],{ignore:["link","linkReference"]})}function kw(n,r,s,o,d){let v="";if(!t_(d)||(/^w/i.test(r)&&(s=r+s,r="",v="http://"),!Tw(s)))return!1;const f=Dw(s+o);if(!f[0])return!1;const a={type:"link",title:null,url:v+r+f[0],children:[{type:"text",value:r+f[0]}]};return f[1]?[a,{type:"text",value:f[1]}]:a}function Aw(n,r,s,o){return!t_(o,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+s,children:[{type:"text",value:r+"@"+s}]}}function Tw(n){const r=n.split(".");return!(r.length<2||r[r.length-1]&&(/_/.test(r[r.length-1])||!/[a-zA-Z\d]/.test(r[r.length-1]))||r[r.length-2]&&(/_/.test(r[r.length-2])||!/[a-zA-Z\d]/.test(r[r.length-2])))}function Dw(n){const r=/[!"&'),.:;<>?\]}]+$/.exec(n);if(!r)return[n,void 0];n=n.slice(0,r.index);let s=r[0],o=s.indexOf(")");const d=Wm(n,"(");let v=Wm(n,")");for(;o!==-1&&d>v;)n+=s.slice(0,o+1),s=s.slice(o+1),o=s.indexOf(")"),v++;return[n,s]}function t_(n,r){const s=n.input.charCodeAt(n.index-1);return(n.index===0||er(s)||Ma(s))&&(!r||s!==47)}n_.peek=Hw;function Rw(){this.buffer()}function Mw(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function Lw(){this.buffer()}function Ow(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function Bw(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=Tn(this.sliceSerialize(n)).toLowerCase(),s.label=r}function Nw(n){this.exit(n)}function jw(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=Tn(this.sliceSerialize(n)).toLowerCase(),s.label=r}function zw(n){this.exit(n)}function Hw(){return"["}function n_(n,r,s,o){const d=s.createTracker(o);let v=d.move("[^");const f=s.enter("footnoteReference"),a=s.enter("reference");return v+=d.move(s.safe(s.associationId(n),{after:"]",before:v})),a(),f(),v+=d.move("]"),v}function Iw(){return{enter:{gfmFootnoteCallString:Rw,gfmFootnoteCall:Mw,gfmFootnoteDefinitionLabelString:Lw,gfmFootnoteDefinition:Ow},exit:{gfmFootnoteCallString:Bw,gfmFootnoteCall:Nw,gfmFootnoteDefinitionLabelString:jw,gfmFootnoteDefinition:zw}}}function Uw(n){let r=!1;return n&&n.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:s,footnoteReference:n_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(o,d,v,f){const a=v.createTracker(f);let c=a.move("[^");const h=v.enter("footnoteDefinition"),p=v.enter("label");return c+=a.move(v.safe(v.associationId(o),{before:c,after:"]"})),p(),c+=a.move("]:"),o.children&&o.children.length>0&&(a.shift(4),c+=a.move((r?`
|
|
76
|
+
`:" ")+v.indentLines(v.containerFlow(o,a.current()),r?i_:Pw))),h(),c}}function Pw(n,r,s){return r===0?n:i_(n,r,s)}function i_(n,r,s){return(s?"":" ")+n}const Fw=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];r_.peek=Yw;function qw(){return{canContainEols:["delete"],enter:{strikethrough:Gw},exit:{strikethrough:$w}}}function Vw(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Fw}],handlers:{delete:r_}}}function Gw(n){this.enter({type:"delete",children:[]},n)}function $w(n){this.exit(n)}function r_(n,r,s,o){const d=s.createTracker(o),v=s.enter("strikethrough");let f=d.move("~~");return f+=s.containerPhrasing(n,{...d.current(),before:f,after:"~"}),f+=d.move("~~"),v(),f}function Yw(){return"~"}function Ww(n){return n.length}function Kw(n,r){const s=r||{},o=(s.align||[]).concat(),d=s.stringLength||Ww,v=[],f=[],a=[],c=[];let h=0,p=-1;for(;++p<n.length;){const x=[],b=[];let _=-1;for(n[p].length>h&&(h=n[p].length);++_<n[p].length;){const g=Xw(n[p][_]);if(s.alignDelimiters!==!1){const y=d(g);b[_]=y,(c[_]===void 0||y>c[_])&&(c[_]=y)}x.push(g)}f[p]=x,a[p]=b}let u=-1;if(typeof o=="object"&&"length"in o)for(;++u<h;)v[u]=Km(o[u]);else{const x=Km(o);for(;++u<h;)v[u]=x}u=-1;const S=[],C=[];for(;++u<h;){const x=v[u];let b="",_="";x===99?(b=":",_=":"):x===108?b=":":x===114&&(_=":");let g=s.alignDelimiters===!1?1:Math.max(1,c[u]-b.length-_.length);const y=b+"-".repeat(g)+_;s.alignDelimiters!==!1&&(g=b.length+g+_.length,g>c[u]&&(c[u]=g),C[u]=g),S[u]=y}f.splice(1,0,S),a.splice(1,0,C),p=-1;const A=[];for(;++p<f.length;){const x=f[p],b=a[p];u=-1;const _=[];for(;++u<h;){const g=x[u]||"";let y="",k="";if(s.alignDelimiters!==!1){const M=c[u]-(b[u]||0),D=v[u];D===114?y=" ".repeat(M):D===99?M%2?(y=" ".repeat(M/2+.5),k=" ".repeat(M/2-.5)):(y=" ".repeat(M/2),k=y):k=" ".repeat(M)}s.delimiterStart!==!1&&!u&&_.push("|"),s.padding!==!1&&!(s.alignDelimiters===!1&&g==="")&&(s.delimiterStart!==!1||u)&&_.push(" "),s.alignDelimiters!==!1&&_.push(y),_.push(g),s.alignDelimiters!==!1&&_.push(k),s.padding!==!1&&_.push(" "),(s.delimiterEnd!==!1||u!==h-1)&&_.push("|")}A.push(s.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return A.join(`
|
|
77
|
+
`)}function Xw(n){return n==null?"":String(n)}function Km(n){const r=typeof n=="string"?n.codePointAt(0):0;return r===67||r===99?99:r===76||r===108?108:r===82||r===114?114:0}function Qw(n,r,s,o){const d=s.enter("blockquote"),v=s.createTracker(o);v.move("> "),v.shift(2);const f=s.indentLines(s.containerFlow(n,v.current()),Zw);return d(),f}function Zw(n,r,s){return">"+(s?"":" ")+n}function Jw(n,r){return Xm(n,r.inConstruct,!0)&&!Xm(n,r.notInConstruct,!1)}function Xm(n,r,s){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return s;let o=-1;for(;++o<r.length;)if(n.includes(r[o]))return!0;return!1}function Qm(n,r,s,o){let d=-1;for(;++d<s.unsafe.length;)if(s.unsafe[d].character===`
|
|
78
|
+
`&&Jw(s.stack,s.unsafe[d]))return/[ \t]/.test(o.before)?"":" ";return`\\
|
|
79
|
+
`}function ex(n,r){const s=String(n);let o=s.indexOf(r),d=o,v=0,f=0;if(typeof r!="string")throw new TypeError("Expected substring");for(;o!==-1;)o===d?++v>f&&(f=v):v=1,d=o+r.length,o=s.indexOf(r,d);return f}function tx(n,r){return!!(r.options.fences===!1&&n.value&&!n.lang&&/[^ \r\n]/.test(n.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(n.value))}function nx(n){const r=n.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function ix(n,r,s,o){const d=nx(s),v=n.value||"",f=d==="`"?"GraveAccent":"Tilde";if(tx(n,s)){const u=s.enter("codeIndented"),S=s.indentLines(v,rx);return u(),S}const a=s.createTracker(o),c=d.repeat(Math.max(ex(v,d)+1,3)),h=s.enter("codeFenced");let p=a.move(c);if(n.lang){const u=s.enter(`codeFencedLang${f}`);p+=a.move(s.safe(n.lang,{before:p,after:" ",encode:["`"],...a.current()})),u()}if(n.lang&&n.meta){const u=s.enter(`codeFencedMeta${f}`);p+=a.move(" "),p+=a.move(s.safe(n.meta,{before:p,after:`
|
|
80
80
|
`,encode:["`"],...a.current()})),u()}return p+=a.move(`
|
|
81
81
|
`),v&&(p+=a.move(v+`
|
|
82
|
-
`)),p+=a.move(c),h(),p}function
|
|
83
|
-
`,...c.current()}))),a(),n.title&&(a=s.enter(`title${v}`),h+=c.move(" "+d),h+=c.move(s.safe(n.title,{before:h,after:d,...c.current()})),h+=c.move(d),a()),f(),h}function
|
|
82
|
+
`)),p+=a.move(c),h(),p}function rx(n,r,s){return(s?"":" ")+n}function Zu(n){const r=n.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function sx(n,r,s,o){const d=Zu(s),v=d==='"'?"Quote":"Apostrophe",f=s.enter("definition");let a=s.enter("label");const c=s.createTracker(o);let h=c.move("[");return h+=c.move(s.safe(s.associationId(n),{before:h,after:"]",...c.current()})),h+=c.move("]: "),a(),!n.url||/[\0- \u007F]/.test(n.url)?(a=s.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(s.safe(n.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(a=s.enter("destinationRaw"),h+=c.move(s.safe(n.url,{before:h,after:n.title?" ":`
|
|
83
|
+
`,...c.current()}))),a(),n.title&&(a=s.enter(`title${v}`),h+=c.move(" "+d),h+=c.move(s.safe(n.title,{before:h,after:d,...c.current()})),h+=c.move(d),a()),f(),h}function lx(n){const r=n.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function nl(n){return"&#x"+n.toString(16).toUpperCase()+";"}function Ra(n,r,s){const o=Wr(n),d=Wr(r);return o===void 0?d===void 0?s==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:d===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:o===1?d===void 0?{inside:!1,outside:!1}:d===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:d===void 0?{inside:!1,outside:!1}:d===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}s_.peek=ax;function s_(n,r,s,o){const d=lx(s),v=s.enter("emphasis"),f=s.createTracker(o),a=f.move(d);let c=f.move(s.containerPhrasing(n,{after:d,before:a,...f.current()}));const h=c.charCodeAt(0),p=Ra(o.before.charCodeAt(o.before.length-1),h,d);p.inside&&(c=nl(h)+c.slice(1));const u=c.charCodeAt(c.length-1),S=Ra(o.after.charCodeAt(0),u,d);S.inside&&(c=c.slice(0,-1)+nl(u));const C=f.move(d);return v(),s.attentionEncodeSurroundingInfo={after:S.outside,before:p.outside},a+c+C}function ax(n,r,s){return s.options.emphasis||"*"}function ox(n,r){let s=!1;return Xu(n,function(o){if("value"in o&&/\r?\n|\r/.test(o.value)||o.type==="break")return s=!0,Au}),!!((!n.depth||n.depth<3)&&qu(n)&&(r.options.setext||s))}function cx(n,r,s,o){const d=Math.max(Math.min(6,n.depth||1),1),v=s.createTracker(o);if(ox(n,s)){const p=s.enter("headingSetext"),u=s.enter("phrasing"),S=s.containerPhrasing(n,{...v.current(),before:`
|
|
84
84
|
`,after:`
|
|
85
85
|
`});return u(),p(),S+`
|
|
86
86
|
`+(d===1?"=":"-").repeat(S.length-(Math.max(S.lastIndexOf("\r"),S.lastIndexOf(`
|
|
87
87
|
`))+1))}const f="#".repeat(d),a=s.enter("headingAtx"),c=s.enter("phrasing");v.move(f+" ");let h=s.containerPhrasing(n,{before:"# ",after:`
|
|
88
|
-
`,...v.current()});return/^[\t ]/.test(h)&&(h=
|
|
89
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:S,table:f,tableCell:c,tableRow:a}};function f(
|
|
90
|
-
`))}function c(w,A,x,b){const _=x.enter("tableCell"),g=x.enter("phrasing"),y=x.containerPhrasing(w,{...b,before:v,after:v});return g(),_(),y}function h(w,A){return Ww(w,{align:A,alignDelimiters:o,padding:s,stringLength:d})}function p(w,A,x){const b=w.children;let _=-1;const g=[],y=A.enter("table");for(;++_<b.length;)g[_]=u(b[_],A,x);return y(),g}function u(w,A,x){const b=w.children;let _=-1;const g=[],y=A.enter("tableRow");for(;++_<b.length;)g[_]=c(b[_],w,A,x);return y(),g}function S(w,A,x){let b=p_.inlineCode(w,A,x);return x.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function Nx(){return{exit:{taskListCheckValueChecked:Jm,taskListCheckValueUnchecked:Jm,paragraph:zx}}}function jx(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Hx}}}function Jm(n){const r=this.stack[this.stack.length-2];r.type,r.checked=n.type==="taskListCheckValueChecked"}function zx(n){const r=this.stack[this.stack.length-2];if(r&&r.type==="listItem"&&typeof r.checked=="boolean"){const s=this.stack[this.stack.length-1];s.type;const o=s.children[0];if(o&&o.type==="text"){const d=r.children;let v=-1,f;for(;++v<d.length;){const a=d[v];if(a.type==="paragraph"){f=a;break}}f===s&&(o.value=o.value.slice(1),o.value.length===0?s.children.shift():s.position&&o.position&&typeof o.position.start.offset=="number"&&(o.position.start.column++,o.position.start.offset++,s.position.start=Object.assign({},o.position.start)))}}this.exit(n)}function Hx(n,r,s,o){const d=n.children[0],v=typeof n.checked=="boolean"&&d&&d.type==="paragraph",f="["+(n.checked?"x":" ")+"] ",a=s.createTracker(o);v&&a.move(f);let c=p_.listItem(n,r,s,{...o,...a.current()});return v&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),c;function h(p){return p+f}}function Ix(){return[_w(),Hw(),Fw(),Tx(),Nx()]}function Ux(n){return{extensions:[vw(),Iw(n),qw(),Bx(n),jx()]}}const Px={tokenize:Yx,partial:!0},m_={tokenize:Wx,partial:!0},g_={tokenize:Kx,partial:!0},__={tokenize:Xx,partial:!0},Fx={tokenize:Qx,partial:!0},v_={name:"wwwAutolink",tokenize:Gx,previous:S_},y_={name:"protocolAutolink",tokenize:$x,previous:b_},ai={name:"emailAutolink",tokenize:Vx,previous:C_},Pn={};function qx(){return{text:Pn}}let nr=48;for(;nr<123;)Pn[nr]=ai,nr++,nr===58?nr=65:nr===91&&(nr=97);Pn[43]=ai;Pn[45]=ai;Pn[46]=ai;Pn[95]=ai;Pn[72]=[ai,y_];Pn[104]=[ai,y_];Pn[87]=[ai,v_];Pn[119]=[ai,v_];function Vx(n,r,s){const o=this;let d,v;return f;function f(u){return!Mu(u)||!C_.call(o,o.previous)||eh(o.events)?s(u):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),a(u))}function a(u){return Mu(u)?(n.consume(u),a):u===64?(n.consume(u),c):s(u)}function c(u){return u===46?n.check(Fx,p,h)(u):u===45||u===95||Gt(u)?(v=!0,n.consume(u),c):p(u)}function h(u){return n.consume(u),d=!0,c}function p(u){return v&&d&&Kt(o.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),r(u)):s(u)}}function Gx(n,r,s){const o=this;return d;function d(f){return f!==87&&f!==119||!S_.call(o,o.previous)||eh(o.events)?s(f):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(Px,n.attempt(m_,n.attempt(g_,v),s),s)(f))}function v(f){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),r(f)}}function $x(n,r,s){const o=this;let d="",v=!1;return f;function f(u){return(u===72||u===104)&&b_.call(o,o.previous)&&!eh(o.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),d+=String.fromCodePoint(u),n.consume(u),a):s(u)}function a(u){if(Kt(u)&&d.length<5)return d+=String.fromCodePoint(u),n.consume(u),a;if(u===58){const S=d.toLowerCase();if(S==="http"||S==="https")return n.consume(u),c}return s(u)}function c(u){return u===47?(n.consume(u),v?h:(v=!0,c)):s(u)}function h(u){return u===null||Ta(u)||dt(u)||ir(u)||La(u)?s(u):n.attempt(m_,n.attempt(g_,p),s)(u)}function p(u){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),r(u)}}function Yx(n,r,s){let o=0;return d;function d(f){return(f===87||f===119)&&o<3?(o++,n.consume(f),d):f===46&&o===3?(n.consume(f),v):s(f)}function v(f){return f===null?s(f):r(f)}}function Wx(n,r,s){let o,d,v;return f;function f(h){return h===46||h===95?n.check(__,c,a)(h):h===null||dt(h)||ir(h)||h!==45&&La(h)?c(h):(v=!0,n.consume(h),f)}function a(h){return h===95?o=!0:(d=o,o=void 0),n.consume(h),f}function c(h){return d||o||!v?s(h):r(h)}}function Kx(n,r){let s=0,o=0;return d;function d(f){return f===40?(s++,n.consume(f),d):f===41&&o<s?v(f):f===33||f===34||f===38||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===60||f===63||f===93||f===95||f===126?n.check(__,r,v)(f):f===null||dt(f)||ir(f)?r(f):(n.consume(f),d)}function v(f){return f===41&&o++,n.consume(f),d}}function Xx(n,r,s){return o;function o(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(n.consume(a),o):a===38?(n.consume(a),v):a===93?(n.consume(a),d):a===60||a===null||dt(a)||ir(a)?r(a):s(a)}function d(a){return a===null||a===40||a===91||dt(a)||ir(a)?r(a):o(a)}function v(a){return Kt(a)?f(a):s(a)}function f(a){return a===59?(n.consume(a),o):Kt(a)?(n.consume(a),f):s(a)}}function Qx(n,r,s){return o;function o(v){return n.consume(v),d}function d(v){return Gt(v)?s(v):r(v)}}function S_(n){return n===null||n===40||n===42||n===95||n===91||n===93||n===126||dt(n)}function b_(n){return!Kt(n)}function C_(n){return!(n===47||Mu(n))}function Mu(n){return n===43||n===45||n===46||n===95||Gt(n)}function eh(n){let r=n.length,s=!1;for(;r--;){const o=n[r][1];if((o.type==="labelLink"||o.type==="labelImage")&&!o._balanced){s=!0;break}if(o._gfmAutolinkLiteralWalkedInto){s=!1;break}}return n.length>0&&!s&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}const Zx={tokenize:l2,partial:!0};function Jx(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:i2,continuation:{tokenize:r2},exit:s2}},text:{91:{name:"gfmFootnoteCall",tokenize:n2},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:e2,resolveTo:t2}}}}function e2(n,r,s){const o=this;let d=o.events.length;const v=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let f;for(;d--;){const c=o.events[d][1];if(c.type==="labelImage"){f=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return a;function a(c){if(!f||!f._balanced)return s(c);const h=Nn(o.sliceSerialize({start:f.end,end:o.now()}));return h.codePointAt(0)!==94||!v.includes(h.slice(1))?s(c):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(c),n.exit("gfmFootnoteCallLabelMarker"),r(c))}}function t2(n,r){let s=n.length;for(;s--;)if(n[s][1].type==="labelImage"&&n[s][0]==="enter"){n[s][1];break}n[s+1][1].type="data",n[s+3][1].type="gfmFootnoteCallLabelMarker";const o={type:"gfmFootnoteCall",start:Object.assign({},n[s+3][1].start),end:Object.assign({},n[n.length-1][1].end)},d={type:"gfmFootnoteCallMarker",start:Object.assign({},n[s+3][1].end),end:Object.assign({},n[s+3][1].end)};d.end.column++,d.end.offset++,d.end._bufferIndex++;const v={type:"gfmFootnoteCallString",start:Object.assign({},d.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},v.start),end:Object.assign({},v.end)},a=[n[s+1],n[s+2],["enter",o,r],n[s+3],n[s+4],["enter",d,r],["exit",d,r],["enter",v,r],["enter",f,r],["exit",f,r],["exit",v,r],n[n.length-2],n[n.length-1],["exit",o,r]];return n.splice(s,n.length-s+1,...a),n}function n2(n,r,s){const o=this,d=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let v=0,f;return a;function a(u){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),c}function c(u){return u!==94?s(u):(n.enter("gfmFootnoteCallMarker"),n.consume(u),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",h)}function h(u){if(v>999||u===93&&!f||u===null||u===91||dt(u))return s(u);if(u===93){n.exit("chunkString");const S=n.exit("gfmFootnoteCallString");return d.includes(Nn(o.sliceSerialize(S)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),r):s(u)}return dt(u)||(f=!0),v++,n.consume(u),u===92?p:h}function p(u){return u===91||u===92||u===93?(n.consume(u),v++,h):h(u)}}function i2(n,r,s){const o=this,d=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let v,f=0,a;return c;function c(A){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(A),n.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(A){return A===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(A),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",p):s(A)}function p(A){if(f>999||A===93&&!a||A===null||A===91||dt(A))return s(A);if(A===93){n.exit("chunkString");const x=n.exit("gfmFootnoteDefinitionLabelString");return v=Nn(o.sliceSerialize(x)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(A),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),S}return dt(A)||(a=!0),f++,n.consume(A),A===92?u:p}function u(A){return A===91||A===92||A===93?(n.consume(A),f++,p):p(A)}function S(A){return A===58?(n.enter("definitionMarker"),n.consume(A),n.exit("definitionMarker"),d.includes(v)||d.push(v),Qe(n,w,"gfmFootnoteDefinitionWhitespace")):s(A)}function w(A){return r(A)}}function r2(n,r,s){return n.check(sl,r,n.attempt(Zx,r,s))}function s2(n){n.exit("gfmFootnoteDefinition")}function l2(n,r,s){const o=this;return Qe(n,d,"gfmFootnoteDefinitionIndent",5);function d(v){const f=o.events[o.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(v):s(v)}}function a2(n){let s=(n||{}).singleTilde;const o={name:"strikethrough",tokenize:v,resolveAll:d};return s==null&&(s=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function d(f,a){let c=-1;for(;++c<f.length;)if(f[c][0]==="enter"&&f[c][1].type==="strikethroughSequenceTemporary"&&f[c][1]._close){let h=c;for(;h--;)if(f[h][0]==="exit"&&f[h][1].type==="strikethroughSequenceTemporary"&&f[h][1]._open&&f[c][1].end.offset-f[c][1].start.offset===f[h][1].end.offset-f[h][1].start.offset){f[c][1].type="strikethroughSequence",f[h][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},f[h][1].start),end:Object.assign({},f[c][1].end)},u={type:"strikethroughText",start:Object.assign({},f[h][1].end),end:Object.assign({},f[c][1].start)},S=[["enter",p,a],["enter",f[h][1],a],["exit",f[h][1],a],["enter",u,a]],w=a.parser.constructs.insideSpan.null;w&&gn(S,S.length,0,Oa(w,f.slice(h+1,c),a)),gn(S,S.length,0,[["exit",u,a],["enter",f[c][1],a],["exit",f[c][1],a],["exit",p,a]]),gn(f,h-1,c-h+3,S),c=h+S.length-2;break}}for(c=-1;++c<f.length;)f[c][1].type==="strikethroughSequenceTemporary"&&(f[c][1].type="data");return f}function v(f,a,c){const h=this.previous,p=this.events;let u=0;return S;function S(A){return h===126&&p[p.length-1][1].type!=="characterEscape"?c(A):(f.enter("strikethroughSequenceTemporary"),w(A))}function w(A){const x=Xr(h);if(A===126)return u>1?c(A):(f.consume(A),u++,w);if(u<2&&!s)return c(A);const b=f.exit("strikethroughSequenceTemporary"),_=Xr(A);return b._open=!_||_===2&&!!x,b._close=!x||x===2&&!!_,a(A)}}}class o2{constructor(){this.map=[]}add(r,s,o){c2(this,r,s,o)}consume(r){if(this.map.sort(function(v,f){return v[0]-f[0]}),this.map.length===0)return;let s=this.map.length;const o=[];for(;s>0;)s-=1,o.push(r.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),r.length=this.map[s][0];o.push(r.slice()),r.length=0;let d=o.pop();for(;d;){for(const v of d)r.push(v);d=o.pop()}this.map.length=0}}function c2(n,r,s,o){let d=0;if(!(s===0&&o.length===0)){for(;d<n.map.length;){if(n.map[d][0]===r){n.map[d][1]+=s,n.map[d][2].push(...o);return}d+=1}n.map.push([r,s,o])}}function u2(n,r){let s=!1;const o=[];for(;r<n.length;){const d=n[r];if(s){if(d[0]==="enter")d[1].type==="tableContent"&&o.push(n[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(d[1].type==="tableContent"){if(n[r-1][1].type==="tableDelimiterMarker"){const v=o.length-1;o[v]=o[v]==="left"?"center":"right"}}else if(d[1].type==="tableDelimiterRow")break}else d[0]==="enter"&&d[1].type==="tableDelimiterRow"&&(s=!0);r+=1}return o}function h2(){return{flow:{null:{name:"table",tokenize:f2,resolveAll:d2}}}}function f2(n,r,s){const o=this;let d=0,v=0,f;return a;function a(N){let z=o.events.length-1;for(;z>-1;){const $=o.events[z][1].type;if($==="lineEnding"||$==="linePrefix")z--;else break}const F=z>-1?o.events[z][1].type:null,P=F==="tableHead"||F==="tableRow"?D:c;return P===D&&o.parser.lazy[o.now().line]?s(N):P(N)}function c(N){return n.enter("tableHead"),n.enter("tableRow"),h(N)}function h(N){return N===124||(f=!0,v+=1),p(N)}function p(N){return N===null?s(N):Le(N)?v>1?(v=0,o.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(N),n.exit("lineEnding"),w):s(N):$e(N)?Qe(n,p,"whitespace")(N):(v+=1,f&&(f=!1,d+=1),N===124?(n.enter("tableCellDivider"),n.consume(N),n.exit("tableCellDivider"),f=!0,p):(n.enter("data"),u(N)))}function u(N){return N===null||N===124||dt(N)?(n.exit("data"),p(N)):(n.consume(N),N===92?S:u)}function S(N){return N===92||N===124?(n.consume(N),u):u(N)}function w(N){return o.interrupt=!1,o.parser.lazy[o.now().line]?s(N):(n.enter("tableDelimiterRow"),f=!1,$e(N)?Qe(n,A,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):A(N))}function A(N){return N===45||N===58?b(N):N===124?(f=!0,n.enter("tableCellDivider"),n.consume(N),n.exit("tableCellDivider"),x):M(N)}function x(N){return $e(N)?Qe(n,b,"whitespace")(N):b(N)}function b(N){return N===58?(v+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(N),n.exit("tableDelimiterMarker"),_):N===45?(v+=1,_(N)):N===null||Le(N)?k(N):M(N)}function _(N){return N===45?(n.enter("tableDelimiterFiller"),g(N)):M(N)}function g(N){return N===45?(n.consume(N),g):N===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(N),n.exit("tableDelimiterMarker"),y):(n.exit("tableDelimiterFiller"),y(N))}function y(N){return $e(N)?Qe(n,k,"whitespace")(N):k(N)}function k(N){return N===124?A(N):N===null||Le(N)?!f||d!==v?M(N):(n.exit("tableDelimiterRow"),n.exit("tableHead"),r(N)):M(N)}function M(N){return s(N)}function D(N){return n.enter("tableRow"),T(N)}function T(N){return N===124?(n.enter("tableCellDivider"),n.consume(N),n.exit("tableCellDivider"),T):N===null||Le(N)?(n.exit("tableRow"),r(N)):$e(N)?Qe(n,T,"whitespace")(N):(n.enter("data"),E(N))}function E(N){return N===null||N===124||dt(N)?(n.exit("data"),T(N)):(n.consume(N),N===92?R:E)}function R(N){return N===92||N===124?(n.consume(N),E):E(N)}}function d2(n,r){let s=-1,o=!0,d=0,v=[0,0,0,0],f=[0,0,0,0],a=!1,c=0,h,p,u;const S=new o2;for(;++s<n.length;){const w=n[s],A=w[1];w[0]==="enter"?A.type==="tableHead"?(a=!1,c!==0&&(eg(S,r,c,h,p),p=void 0,c=0),h={type:"table",start:Object.assign({},A.start),end:Object.assign({},A.end)},S.add(s,0,[["enter",h,r]])):A.type==="tableRow"||A.type==="tableDelimiterRow"?(o=!0,u=void 0,v=[0,0,0,0],f=[0,s+1,0,0],a&&(a=!1,p={type:"tableBody",start:Object.assign({},A.start),end:Object.assign({},A.end)},S.add(s,0,[["enter",p,r]])),d=A.type==="tableDelimiterRow"?2:p?3:1):d&&(A.type==="data"||A.type==="tableDelimiterMarker"||A.type==="tableDelimiterFiller")?(o=!1,f[2]===0&&(v[1]!==0&&(f[0]=f[1],u=xa(S,r,v,d,void 0,u),v=[0,0,0,0]),f[2]=s)):A.type==="tableCellDivider"&&(o?o=!1:(v[1]!==0&&(f[0]=f[1],u=xa(S,r,v,d,void 0,u)),v=f,f=[v[1],s,0,0])):A.type==="tableHead"?(a=!0,c=s):A.type==="tableRow"||A.type==="tableDelimiterRow"?(c=s,v[1]!==0?(f[0]=f[1],u=xa(S,r,v,d,s,u)):f[1]!==0&&(u=xa(S,r,f,d,s,u)),d=0):d&&(A.type==="data"||A.type==="tableDelimiterMarker"||A.type==="tableDelimiterFiller")&&(f[3]=s)}for(c!==0&&eg(S,r,c,h,p),S.consume(r.events),s=-1;++s<r.events.length;){const w=r.events[s];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=u2(r.events,s))}return n}function xa(n,r,s,o,d,v){const f=o===1?"tableHeader":o===2?"tableDelimiter":"tableData",a="tableContent";s[0]!==0&&(v.end=Object.assign({},$r(r.events,s[0])),n.add(s[0],0,[["exit",v,r]]));const c=$r(r.events,s[1]);if(v={type:f,start:Object.assign({},c),end:Object.assign({},c)},n.add(s[1],0,[["enter",v,r]]),s[2]!==0){const h=$r(r.events,s[2]),p=$r(r.events,s[3]),u={type:a,start:Object.assign({},h),end:Object.assign({},p)};if(n.add(s[2],0,[["enter",u,r]]),o!==2){const S=r.events[s[2]],w=r.events[s[3]];if(S[1].end=Object.assign({},w[1].end),S[1].type="chunkText",S[1].contentType="text",s[3]>s[2]+1){const A=s[2]+1,x=s[3]-s[2]-1;n.add(A,x,[])}}n.add(s[3]+1,0,[["exit",u,r]])}return d!==void 0&&(v.end=Object.assign({},$r(r.events,d)),n.add(d,0,[["exit",v,r]]),v=void 0),v}function eg(n,r,s,o,d){const v=[],f=$r(r.events,s);d&&(d.end=Object.assign({},f),v.push(["exit",d,r])),o.end=Object.assign({},f),v.push(["exit",o,r]),n.add(s+1,0,v)}function $r(n,r){const s=n[r],o=s[0]==="enter"?"start":"end";return s[1][o]}const p2={name:"tasklistCheck",tokenize:g2};function m2(){return{text:{91:p2}}}function g2(n,r,s){const o=this;return d;function d(c){return o.previous!==null||!o._gfmTasklistFirstContentOfListItem?s(c):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(c),n.exit("taskListCheckMarker"),v)}function v(c){return dt(c)?(n.enter("taskListCheckValueUnchecked"),n.consume(c),n.exit("taskListCheckValueUnchecked"),f):c===88||c===120?(n.enter("taskListCheckValueChecked"),n.consume(c),n.exit("taskListCheckValueChecked"),f):s(c)}function f(c){return c===93?(n.enter("taskListCheckMarker"),n.consume(c),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),a):s(c)}function a(c){return Le(c)?r(c):$e(c)?n.check({tokenize:_2},r,s)(c):s(c)}}function _2(n,r,s){return Qe(n,o,"whitespace");function o(d){return d===null?s(d):r(d)}}function v2(n){return Lg([qx(),Jx(),a2(n),h2(),m2()])}const y2={};function w_(n){const r=this,s=n||y2,o=r.data(),d=o.micromarkExtensions||(o.micromarkExtensions=[]),v=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),f=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);d.push(v2(s)),v.push(Ix()),f.push(Ux(s))}const S2=500;function b2({settings:n,busy:r=!1,onSave:s,onClose:o}){const[d,v]=ce.useState(n);return ce.useEffect(()=>{v(n)},[n]),B.jsx("div",{className:"modal-backdrop",children:B.jsxs("section",{className:"translation-settings-modal",role:"dialog","aria-modal":"true","aria-label":"Translation Settings",children:[B.jsxs("header",{children:[B.jsx("div",{children:B.jsx("h2",{children:"Translation Settings"})}),B.jsx("button",{type:"button",onClick:o,children:"Close"})]}),B.jsxs("div",{className:"translation-settings-grid",children:[B.jsxs("label",{children:[B.jsx("span",{children:"Target language"}),B.jsx("input",{value:d.targetLanguage,onChange:f=>v({...d,targetLanguage:f.target.value})})]}),B.jsxs("label",{children:[B.jsx("span",{children:"Source language"}),B.jsx("input",{value:d.sourceLanguage,onChange:f=>v({...d,sourceLanguage:f.target.value})})]}),B.jsxs("label",{children:[B.jsx("span",{children:"Use context"}),B.jsx("input",{checked:d.contextEnabled,type:"checkbox",onChange:f=>v({...d,contextEnabled:f.target.checked})})]}),B.jsxs("label",{children:[B.jsx("span",{children:"Timeout ms"}),B.jsx("input",{min:3e3,type:"number",value:d.requestTimeoutMs,onChange:f=>v({...d,requestTimeoutMs:Number(f.target.value)})})]})]}),B.jsx("footer",{children:B.jsx("button",{type:"button",disabled:r,onClick:()=>void s({targetLanguage:d.targetLanguage,sourceLanguage:d.sourceLanguage,contextEnabled:d.contextEnabled,requestTimeoutMs:d.requestTimeoutMs,enabled:!0,translateOutput:!0,translateUserInput:!0,inputMode:"review-before-send"}),children:"Save"})})]})})}function C2({active:n=!0,taskSlug:r,role:s,sessionId:o}){const[d,v]=ce.useState(null),[f,a]=ce.useState([]),[c,h]=ce.useState([]),[p,u]=ce.useState(""),[S,w]=ce.useState(!1),[A,x]=ce.useState(!1),[b,_]=ce.useState(!1),[g,y]=ce.useState("ready"),[k,M]=ce.useState(""),[D,T]=ce.useState(Date.now()),[E,R]=ce.useState(!1),[N,z]=ce.useState(""),[F,P]=ce.useState(!1),[$,K]=ce.useState(!1),[G,X]=ce.useState(null),[ee,H]=ce.useState(""),[O,j]=ce.useState(""),[V,I]=ce.useState(""),[ne,_e]=ce.useState(!1),[ge,Q]=ce.useState(null),[q,J]=ce.useState(""),[Y,he]=ce.useState(""),[de,be]=ce.useState(""),[Pe,qe]=ce.useState("zh-CN"),[Ke,Ae]=ce.useState(!1),[jt,ht]=ce.useState(0),[Lt,it]=ce.useState(0),kt=ce.useRef(n),ae=ce.useRef(1),at=ce.useRef(null);ce.useEffect(()=>{kt.current=n},[n]),ce.useEffect(()=>{xe.getTranslationSettings().then(ve=>{v(ve)}).catch(ve=>z(ve.message))},[]),ce.useEffect(()=>{if(!$)return;let ve=!1,Me;const Be=async()=>{ve||(await rt(!0),ve||(Me=window.setTimeout(Be,2e3)))};return Be(),()=>{ve=!0,Me!==void 0&&window.clearTimeout(Me)}},[$,ee]),ce.useEffect(()=>{a([]),h([]),z(""),y("ready"),M(""),ae.current=1;let ve=!1,Me;const Be=()=>{ve||(Me=window.setTimeout(vn,kt.current?200:1e3))},vn=async()=>{if(!ve)try{const He=await xe.pollTranslationSession(o,ae.current);if(ve)return;Se(He.events),ae.current=He.nextCursor,y(He.status),kt.current&&M(B2(new Date().toISOString()))}catch(He){ve||z(He instanceof Error?He.message:"Translation poll failed.")}finally{Be()}};return xe.startTranslationSession(r,s).then(He=>{ve||(y(He.status),ae.current=He.nextCursor,vn())}).catch(He=>{ve||z(He instanceof Error?He.message:"Translation start failed.")}),()=>{ve=!0,Me!==void 0&&window.clearTimeout(Me),xe.stopTranslationSession(o).catch(()=>{})}},[o,r,s,jt]),ce.useEffect(()=>{if(!n)return;const ve=at.current;if(!ve)return;const Me=window.requestAnimationFrame(()=>{ve.scrollTop=ve.scrollHeight});return()=>window.cancelAnimationFrame(Me)},[n,Lt]);const Ze=A2(f);ce.useEffect(()=>{if(!Ze)return;T(Date.now());const ve=window.setInterval(()=>T(Date.now()),250);return()=>window.clearInterval(ve)},[Ze]);async function ue(ve=!1){if(d){R(!0),z(""),w(!1);try{const Me=await xe.translateUserInput(r,s,{text:p,mode:ve?"auto-send":"review-before-send",useContext:d.contextEnabled,send:ve});_(Me.contextUsed),Me.sent?(u(""),w(!1)):(u(Me.englishPreview),w(!0))}catch(Me){z(Me instanceof Error?Me.message:"Translation failed.")}finally{R(!1)}}}function Se(ve){if(ve.length===0)return;for(const Be of ve)Be.type==="status"?y(Be.status):Be.type==="error"?z(Be.message):Be.type==="failures"&&h(Be.failures);const Me=ve.filter(Be=>Be.type==="entry");Me.length>0&&(a(Be=>{const vn=Me.reduce((Fn,Mn)=>L2(Fn,Mn.entry),Be),He=D2(vn);return He.removedIds.size>0&&h(Fn=>Fn.filter(Mn=>!He.removedIds.has(Mn.translationId))),He.entries}),it(Be=>Be+1))}async function Ce(){if(p.trim()){R(!0),z("");try{await xe.sendTranslatedInput(r,s,{englishText:p}),u(""),w(!1),_(!1)}catch(ve){z(ve instanceof Error?ve.message:"Failed to send English input.")}finally{R(!1)}}}function De(ve){ve.key!=="Enter"||ve.shiftKey||ve.nativeEvent.isComposing||(ve.preventDefault(),!E&&p.trim()&&(S?Ce():ue(A)))}async function Ne(ve,Me){R(!0),z("");try{const Be=await xe.updateTranslationSettings({...ve,...Me!==void 0?{apiKey:Me}:{}});v(Be),P(!1),ht(vn=>vn+1)}catch(Be){z(Be instanceof Error?Be.message:"Failed to save translation settings.")}finally{R(!1)}}async function _t(){a([]),h([]),ae.current=1,await xe.clearTranslationSession(o).catch(ve=>z(ve.message))}async function Fe(){R(!0),z("");try{const ve=await xe.ignoreTranslationFailures(o);h(ve.failures)}catch(ve){z(ve instanceof Error?ve.message:"Failed to ignore translation failures.")}finally{R(!1)}}async function bt(){R(!0),z("");try{const ve=await xe.retryTranslationFailures(o);h(ve.failures)}catch(ve){z(ve instanceof Error?ve.message:"Failed to retry translation failures.")}finally{R(!1)}}async function rt(ve=!1){try{const Me=await xe.getCodexTranslationState();if(X(Me),!ee&&Me.fileIndex.jobs[0])Ct(Me.fileIndex.jobs[0].id);else if(ve&&ee){const Be=await xe.readCodexFileTranslation(ee);j(Be.output),I(Be.report)}}catch(Me){z(Me instanceof Error?Me.message:"Failed to load file translations.")}}async function Ct(ve){H(ve),j(""),I("");try{const Me=await xe.readCodexFileTranslation(ve);j(Me.output),I(Me.report)}catch(Me){z(Me instanceof Error?Me.message:"Failed to read translated file.")}}async function tt(){_e(!0),qe((d==null?void 0:d.targetLanguage)??"zh-CN"),await ln(q,Y)}async function ln(ve="",Me=""){Ae(!0),z("");try{const Be=await xe.browseCodexTranslationSourceFiles({path:ve,query:Me,limit:250});Q(Be),J(Be.currentPath),he(Me)}catch(Be){z(Be instanceof Error?Be.message:"Failed to browse source files.")}finally{Ae(!1)}}async function Yt(ve=de){const Me=ve.trim();if(Me){R(!0),z("");try{const Be=await xe.createCodexFileTranslation({taskSlug:r,sourcePath:Me,targetLanguage:Pe.trim()||(d==null?void 0:d.targetLanguage)||"zh-CN"});_e(!1),await rt(),await Ct(Be.id)}catch(Be){z(Be instanceof Error?Be.message:"Failed to create file translation.")}finally{R(!1)}}}async function es(){R(!0),z("");try{await xe.createCodexBootstrap({taskSlug:r,targetLanguage:(d==null?void 0:d.targetLanguage)??"zh-CN"}),await rt()}catch(ve){z(ve instanceof Error?ve.message:"Failed to create translation bootstrap.")}finally{R(!1)}}async function _n(){if(!ee)return;const ve=window.prompt("Promote translation to project path:");if(ve!=null&&ve.trim()){R(!0),z("");try{await xe.promoteCodexTranslation(ee,ve),await Ct(ee)}catch(Me){z(Me instanceof Error?Me.message:"Failed to promote translation.")}finally{R(!1)}}}if(!d)return B.jsx("aside",{className:"translation-panel",children:B.jsx("p",{className:"muted",children:"Loading translation settings..."})});const Rn=T2(f,g,D),an=c.length;return B.jsxs("aside",{className:"translation-panel",children:[B.jsxs("header",{className:"translation-panel-header",children:[B.jsxs("div",{className:"translation-panel-titlebar",children:[B.jsx("h2",{children:"Translation"}),B.jsxs("div",{className:"translation-panel-actions",children:[B.jsx("button",{"aria-pressed":A,className:`auto-send-toggle${A?" is-active":""}`,type:"button",onClick:()=>x(ve=>!ve),children:A?"✅ Auto-send":"× Auto-send"}),an>0?B.jsxs(B.Fragment,{children:[B.jsxs("button",{type:"button",disabled:E,onClick:()=>void Fe(),children:["Ignore ",an]}),B.jsxs("button",{type:"button",disabled:E,onClick:()=>void bt(),children:["Retry ",an]})]}):null,B.jsx("button",{type:"button",onClick:()=>P(!0),children:"Settings"}),B.jsx("button",{"aria-pressed":$,type:"button",onClick:()=>K(ve=>!ve),children:"File"}),B.jsx("button",{type:"button",onClick:()=>void _t(),children:"Clear"})]})]}),B.jsxs("div",{className:"translation-status-row",children:[B.jsxs("p",{children:["Codex · ",d.targetLanguage," · ",Rn,b?" · context used":""]}),B.jsx("p",{children:k?`poll ${k}`:"poll -"})]})]}),N?B.jsx("div",{className:"error-banner",children:N}):null,$?B.jsx(x2,{busy:E,state:G,selectedJobId:ee,output:O,report:V,onBootstrap:()=>void es(),onRefresh:()=>void rt(),onSelectJob:ve=>void Ct(ve),onTranslate:()=>void tt(),onPromote:()=>void _n()}):null,B.jsxs("div",{className:"translation-entry-list",ref:at,children:[f.length===0?B.jsx("p",{className:"muted",children:"Translated Claude Code output will appear here."}):null,f.map(ve=>B.jsx(E2,{entry:ve},ve.id))]}),B.jsx("div",{className:"translation-composer",children:B.jsxs("div",{className:"translation-composer-row",children:[B.jsx("textarea",{value:p,onChange:ve=>{u(ve.target.value),ve.target.value.trim()||w(!1)},onKeyDown:De,placeholder:"输入中文,先翻译成英文工程指令..."}),B.jsx("div",{className:"translation-composer-actions",children:B.jsx("button",{type:"button",disabled:E||!S||!p.trim(),onClick:()=>void Ce(),children:"Send English"})})]})}),F?B.jsx(b2,{settings:d,busy:E,onSave:Ne,onClose:()=>P(!1)}):null,ne?B.jsx(w2,{busy:E||Ke,state:ge,currentPath:q,query:Y,selectedPath:de,targetLanguage:Pe,onBrowse:(ve,Me)=>void ln(ve,Me),onClose:()=>_e(!1),onQueryChange:he,onSelectPath:be,onTargetLanguageChange:qe,onTranslate:()=>void Yt()}):null]})}function w2({busy:n,state:r,currentPath:s,query:o,selectedPath:d,targetLanguage:v,onBrowse:f,onClose:a,onQueryChange:c,onSelectPath:h,onTargetLanguageChange:p,onTranslate:u}){const S=(r==null?void 0:r.entries)??[],w=S.filter(x=>x.type==="directory"),A=S.filter(x=>x.type==="file");return B.jsx("div",{className:"modal-backdrop",children:B.jsxs("section",{className:"translation-file-browser-modal",role:"dialog","aria-modal":"true","aria-label":"Select Source File",children:[B.jsxs("header",{children:[B.jsxs("div",{children:[B.jsx("h2",{children:"Select Source File"}),B.jsx("p",{children:s||"."})]}),B.jsx("button",{type:"button",onClick:a,children:"Close"})]}),B.jsxs("div",{className:"translation-file-browser-controls",children:[B.jsxs("div",{className:"translation-file-browser-nav",children:[B.jsx("button",{type:"button",disabled:n||!s,onClick:()=>f((r==null?void 0:r.parentPath)??"",""),children:"Up"}),B.jsx("button",{type:"button",disabled:n||!s,onClick:()=>f("",""),children:"Root"})]}),B.jsxs("form",{className:"translation-file-browser-search",onSubmit:x=>{x.preventDefault(),f(s,o)},children:[B.jsx("input",{value:o,onChange:x=>c(x.target.value),placeholder:"Search files"}),B.jsx("button",{type:"submit",disabled:n,children:"Search"}),B.jsx("button",{type:"button",disabled:n||!o,onClick:()=>f(s,""),children:"Clear"})]})]}),B.jsxs("div",{className:"translation-file-browser-layout",children:[B.jsxs("div",{className:"translation-file-browser-list",children:[n&&!r?B.jsx("p",{className:"muted",children:"Loading files..."}):null,!n&&S.length===0?B.jsx("p",{className:"muted",children:"No source files found."}):null,w.length>0?B.jsxs("div",{className:"translation-file-browser-group",children:[B.jsx("h3",{children:"Folders"}),w.map(x=>B.jsx(tg,{entry:x,selected:d===x.path,onBrowse:f,onSelectPath:h},x.path))]}):null,A.length>0?B.jsxs("div",{className:"translation-file-browser-group",children:[B.jsx("h3",{children:"Files"}),A.map(x=>B.jsx(tg,{entry:x,selected:d===x.path,onBrowse:f,onSelectPath:h},x.path))]}):null,r!=null&&r.truncated?B.jsx("p",{className:"translation-entry-note",children:"Result limit reached."}):null]}),B.jsxs("aside",{className:"translation-file-browser-selection",children:[B.jsxs("label",{children:[B.jsx("span",{children:"Source path"}),B.jsx("input",{value:d,onChange:x=>h(x.target.value)})]}),B.jsxs("label",{children:[B.jsx("span",{children:"Target language"}),B.jsx("input",{value:v,onChange:x=>p(x.target.value)})]}),B.jsx("button",{type:"button",disabled:n||!d.trim(),onClick:u,children:"Translate File"})]})]})]})})}function tg({entry:n,selected:r,onBrowse:s,onSelectPath:o}){const d=n.type==="directory";return B.jsxs("button",{className:r?"translation-file-browser-entry is-selected":"translation-file-browser-entry",type:"button",onClick:()=>d?s(n.path,""):o(n.path),onDoubleClick:()=>d?s(n.path,""):void 0,children:[B.jsx("span",{children:d?"DIR":"FILE"}),B.jsx("strong",{children:n.name}),B.jsx("small",{children:n.path})]})}function x2({busy:n,state:r,selectedJobId:s,output:o,report:d,onBootstrap:v,onRefresh:f,onSelectJob:a,onTranslate:c,onPromote:h}){const p=(r==null?void 0:r.fileIndex.jobs)??[],u=p.find(S=>S.id===s);return B.jsxs("section",{className:"file-translation-panel",children:[B.jsxs("div",{className:"file-translation-toolbar",children:[B.jsx("button",{type:"button",disabled:n,onClick:c,children:"Translate"}),B.jsx("button",{type:"button",disabled:n,onClick:v,children:"Bootstrap"}),B.jsx("button",{type:"button",disabled:n,onClick:f,children:"Refresh"}),B.jsx("button",{type:"button",disabled:n||!u,onClick:h,children:"Promote"})]}),r!=null&&r.memoryInitialized?null:B.jsx("p",{className:"translation-entry-note",children:"Translation memory is not initialized. Run Bootstrap before important file translations."}),B.jsxs("div",{className:"file-translation-layout",children:[B.jsxs("div",{className:"file-translation-list",children:[p.length===0?B.jsx("p",{className:"muted",children:"No translated files yet."}):null,p.map(S=>B.jsxs("button",{className:S.id===s?"file-translation-item is-active":"file-translation-item",type:"button",onClick:()=>a(S.id),children:[B.jsx("strong",{children:S.sourcePath}),B.jsxs("span",{children:[S.status," · ",S.targetLanguage]})]},S.id))]}),B.jsx("div",{className:"file-translation-preview",children:u?B.jsxs(B.Fragment,{children:[B.jsxs("header",{children:[B.jsx("strong",{children:u.sourcePath}),B.jsx("span",{children:u.status})]}),B.jsx("div",{className:"translation-markdown",children:B.jsx(Jg,{remarkPlugins:[w_],children:o||d||"Translation output is not available yet."})})]}):B.jsx("p",{className:"muted",children:"Select a translated file to preview it."})})]})]})}function E2({entry:n}){if(n.sourceKind==="conversation-boundary")return B.jsx(k2,{entry:n});const r=M2(n),s=n.sourceKind==="tool-output",o=n.direction==="user-input-to-english",d=["translation-entry",`is-${n.sourceKind}`,o?"is-user-input":""].filter(Boolean).join(" ");return B.jsxs("article",{className:d,children:[s?B.jsx("pre",{children:r}):B.jsx("div",{className:"translation-markdown",children:B.jsx(Jg,{remarkPlugins:[w_],children:r})}),n.warning?B.jsx("p",{className:"translation-entry-note",children:n.warning}):null,n.error?B.jsx("p",{className:"translation-entry-note is-error",children:n.error}):null]})}function k2({entry:n}){const r=n.boundaryKind==="end"?"结束":"开始",s=n.conversationTurn??0,o=N2(n.occurredAt??n.createdAt);return B.jsxs("div",{className:"translation-conversation-boundary","aria-label":`${r} 第 ${s} 轮 ${o}`,children:[B.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"}),B.jsx("span",{children:r}),B.jsxs("span",{children:["第 ",s," 轮"]}),B.jsx("time",{children:o}),B.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"})]})}function A2(n){const r=n.find(th);return(r==null?void 0:r.translationStartedAt)??(r==null?void 0:r.createdAt)}function T2(n,r,s){const o=n.find(th);if(o)return`translating ${O2(Math.max(0,s-R2(o)))}`;const d=n.at(-1);return(d==null?void 0:d.status)==="failed"||r==="failed"?"error":r}function th(n){return n.status==="queued"||n.status==="translating"}function D2(n){const r=n.length-S2;if(r<=0)return{entries:n,removedIds:new Set};const s=new Set;for(const o of n){if(s.size>=r)break;th(o)||s.add(o.id)}return s.size===0?{entries:n,removedIds:s}:{entries:n.filter(o=>!s.has(o.id)),removedIds:s}}function R2(n){const r=Date.parse(n.translationStartedAt??n.createdAt);return Number.isFinite(r)?r:Date.now()}function M2(n){return n.status==="queued"||n.status==="translating"?n.sourceText:n.status==="translated"?n.translatedText:n.translatedText||n.sourceText}function L2(n,r){return n.findIndex(o=>o.id===r.id)===-1?[...n,r]:n.map(o=>o.id===r.id?r:o)}function O2(n){if(n<1e3)return`${Math.max(.1,n/1e3).toFixed(1)}s`;const r=n/1e3;if(r<60)return`${r.toFixed(1)}s`;const s=Math.floor(r/60),o=Math.floor(r%60).toString().padStart(2,"0");return`${s}:${o}`}function B2(n){const r=new Date(n);return Number.isNaN(r.getTime())?n:r.toLocaleTimeString()}function N2(n){const r=new Date(n);return Number.isNaN(r.getTime())?n:r.toLocaleTimeString()}function j2({role:n,session:r,permissionMode:s,model:o,effort:d,active:v=!0,busy:f,orchestrationMode:a,translationEnabled:c,onPermissionModeChange:h,onModelChange:p,onEffortChange:u,onOrchestrationModeChange:S,onStart:w,onResume:A,onStop:x,onRestart:b,onTerminalEvent:_}){const g=a==="auto",y=Nu(n);return B.jsxs("section",{className:"session-console",children:[B.jsxs("div",{className:"session-console-top",children:[B.jsx(W1,{role:n,session:r,permissionMode:s,model:o,effort:d,busy:f,onPermissionModeChange:h,onModelChange:p,onEffortChange:u,onStart:w,onResume:A,onStop:x,onRestart:b}),y?null:B.jsx("div",{className:"session-console-actions",children:B.jsx("button",{"aria-label":`Auto orchestration is ${g?"on":"off"}`,"aria-pressed":g,className:`translation-toggle${g?" is-active":""}`,disabled:f,type:"button",onClick:()=>S(g?"manual":"auto"),children:g?"✅ Auto orchestration":"× Auto orchestration"})})]}),(r==null?void 0:r.status)==="running"?B.jsx(z2,{active:v,onTerminalEvent:_,role:n,session:r,taskSlug:r.taskSlug,translationEnabled:!y&&c}):B.jsxs("div",{className:"terminal-empty",children:[B.jsx("strong",{children:n}),B.jsx("span",{children:y?r!=null&&r.claudeSessionId?`Resume this role to reconnect the ${n==="codex-translator"?"Codex Translator":"Codex Reviewer"} terminal.`:`Start this role to open an embedded ${n==="codex-translator"?"Codex Translator":"Codex Reviewer"} terminal.`:r!=null&&r.claudeSessionId?"Resume this role to reconnect its Claude Code conversation.":"Start this role to open an embedded Claude Code terminal."})]})]})}function z2({active:n,onTerminalEvent:r,role:s,session:o,taskSlug:d,translationEnabled:v}){return B.jsxs("div",{className:v?"session-console-body has-translation":"session-console-body",children:[B.jsx("div",{className:"terminal-pane",children:B.jsx(hg,{sessionId:o.id,active:n,onEvent:r},o.id)}),v?B.jsx("div",{className:"translation-pane",children:B.jsx(C2,{active:n,taskSlug:d,role:s,sessionId:o.id},o.id)}):null]})}function H2(n,r,s){var v;if(!n||s.mode!=="auto")return null;const o=new Map(n.map(f=>[f.id,f])),d=r.filter(f=>{var a;return f.dispatchingAt?((a=o.get(f.id))==null?void 0:a.dispatchingAt)!==f.dispatchingAt:!1});return d.length===0?null:((v=d.sort(I2)[d.length-1])==null?void 0:v.toRole)??null}function I2(n,r){const s=n.dispatchingAt??n.deliveredAt??n.acceptedAt??"",o=r.dispatchingAt??r.deliveredAt??r.acceptedAt??"";return s!==o?s.localeCompare(o):n.createdAt.localeCompare(r.createdAt)}const U2=2e3;function P2({task:n,activeRole:r,codexReviewerEnabled:s,translationEnabled:o,refreshNonce:d=0,onTaskChanged:v,onActiveRoleChange:f,onTranslationEnabledChange:a,onMessagesChanged:c,onOrchestrationChanged:h,onRoundStateChanged:p,onEventsChanged:u,onLaunchStateChanged:S}){const[w,A]=ce.useState(null),[x,b]=ce.useState({"project-manager":"default",architect:"default",coder:"default",reviewer:"default","codex-reviewer":"default","codex-translator":"default"}),[_,g]=ce.useState({"project-manager":"default",architect:"default",coder:"default",reviewer:"default","codex-reviewer":"gpt-5.5","codex-translator":"gpt-5.5"}),[y,k]=ce.useState({"project-manager":"default",architect:"default",coder:"default",reviewer:"default","codex-reviewer":"xhigh","codex-translator":"xhigh"}),[M,D]=ce.useState(!1),[T,E]=ce.useState(""),[R,N]=ce.useState([]),[z,F]=ce.useState(null),P=ce.useRef(null),$=!!(w!=null&&w.sessions.some(J=>J.role==="codex-reviewer")),K=!!(w!=null&&w.sessions.some(J=>J.role==="codex-translator")),G=s||$,X=o||K,ee=[...Wr,...G?[ag]:[],...X?[og]:[]],H=ce.useCallback((J,Y)=>{var be;const he=((be=P.current)==null?void 0:be.taskSlug)===n.taskSlug?P.current.messages:null,de=H2(he,J,Y);P.current={taskSlug:n.taskSlug,messages:J},F(Y),c==null||c(J),h==null||h(Y),de&&(f(de),ne(`auto switched to ${de} before VCM dispatch`))},[f,c,h,n.taskSlug]),O=ce.useCallback((J,Y,he,de)=>{A(J),H(Y,he),p==null||p(de)},[H,p]),j=ce.useCallback(async()=>{const[J,Y,he,de]=await Promise.all([xe.getTaskStatus(n.taskSlug),xe.listMessages(n.taskSlug),xe.getOrchestrationState(n.taskSlug),xe.getSessionRoundState(n.taskSlug)]);O(J,Y,he,de)},[O,n.taskSlug]);ce.useEffect(()=>{j().catch(J=>E(J.message))},[j,d]),ce.useEffect(()=>{N([]),u==null||u([])},[u,n.taskSlug]),ce.useEffect(()=>{w&&!G&&r==="codex-reviewer"&&f("project-manager"),w&&!X&&r==="codex-translator"&&f("project-manager")},[r,G,X,f,w]),ce.useEffect(()=>{b(J=>{let Y=!1;const he={...J};for(const de of(w==null?void 0:w.sessions)??[])he[de.role]!==de.permissionMode&&(he[de.role]=de.permissionMode,Y=!0);return Y?he:J})},[w==null?void 0:w.sessions]),ce.useEffect(()=>{g(J=>{let Y=!1;const he={...J};for(const de of(w==null?void 0:w.sessions)??[]){const be=de.model??"default";he[de.role]!==be&&(he[de.role]=be,Y=!0)}return Y?he:J})},[w==null?void 0:w.sessions]),ce.useEffect(()=>{k(J=>{let Y=!1;const he={...J};for(const de of(w==null?void 0:w.sessions)??[]){const be=de.effort??"default";he[de.role]!==be&&(he[de.role]=be,Y=!0)}return Y?he:J})},[w==null?void 0:w.sessions]),ce.useEffect(()=>{const J=(w==null?void 0:w.sessions)??[],Y=J.filter(be=>!Nu(be.role)),he=new Set(Y.map(be=>be.role)),de={};for(const be of Wr)de[be.name]={permissionMode:x[be.name],model:_[be.name],effort:y[be.name]};S==null||S({taskSlug:n.taskSlug,roles:de,autoOrchestration:((z==null?void 0:z.mode)??"auto")==="auto",translationEnabled:o,statusLoaded:!!w,sessionCount:J.length,hasAnySession:J.length>0,allRolesHaveSession:Wr.every(be=>he.has(be.name))})},[_,y,S,z==null?void 0:z.mode,x,w,n.taskSlug,o]),ce.useEffect(()=>{const J=window.setInterval(()=>{Promise.all([xe.getTaskStatus(n.taskSlug),xe.listMessages(n.taskSlug),xe.getOrchestrationState(n.taskSlug),xe.getSessionRoundState(n.taskSlug)]).then(([Y,he,de,be])=>{O(Y,he,de,be)}).catch(Y=>E(Y.message))},3e3);return()=>window.clearInterval(J)},[O,n.taskSlug]),ce.useEffect(()=>{let J=!1,Y=!1;const he=window.setInterval(()=>{Y||(Y=!0,Promise.all([xe.listMessages(n.taskSlug),xe.getOrchestrationState(n.taskSlug)]).then(([de,be])=>{J||H(de,be)}).catch(de=>{J||E(de.message)}).finally(()=>{Y=!1}))},U2);return()=>{J=!0,window.clearInterval(he)}},[H,n.taskSlug]);async function V(J){D(!0),E("");try{await J(),await j(),await v()}catch(Y){E(Y instanceof Error?Y.message:"Action failed.")}finally{D(!1)}}async function I(){const J=n.worktreePath?[`Close task "${n.taskSlug}"?`,"","This is destructive:","- stops VCM-managed running role sessions for this task",`- deletes the task worktree: ${n.worktreePath}`,`- deletes the Git branch: ${n.branch}`,"- deletes VCM task/session/message/orchestration state","","VCM will not check running sessions or uncommitted changes before closing."].join(`
|
|
88
|
+
`,...v.current()});return/^[\t ]/.test(h)&&(h=nl(h.charCodeAt(0))+h.slice(1)),h=h?f+" "+h:f,s.options.closeAtx&&(h+=" "+f),c(),a(),h}l_.peek=ux;function l_(n){return n.value||""}function ux(){return"<"}a_.peek=hx;function a_(n,r,s,o){const d=Zu(s),v=d==='"'?"Quote":"Apostrophe",f=s.enter("image");let a=s.enter("label");const c=s.createTracker(o);let h=c.move("![");return h+=c.move(s.safe(n.alt,{before:h,after:"]",...c.current()})),h+=c.move("]("),a(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(a=s.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(s.safe(n.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(a=s.enter("destinationRaw"),h+=c.move(s.safe(n.url,{before:h,after:n.title?" ":")",...c.current()}))),a(),n.title&&(a=s.enter(`title${v}`),h+=c.move(" "+d),h+=c.move(s.safe(n.title,{before:h,after:d,...c.current()})),h+=c.move(d),a()),h+=c.move(")"),f(),h}function hx(){return"!"}o_.peek=fx;function o_(n,r,s,o){const d=n.referenceType,v=s.enter("imageReference");let f=s.enter("label");const a=s.createTracker(o);let c=a.move("![");const h=s.safe(n.alt,{before:c,after:"]",...a.current()});c+=a.move(h+"]["),f();const p=s.stack;s.stack=[],f=s.enter("reference");const u=s.safe(s.associationId(n),{before:c,after:"]",...a.current()});return f(),s.stack=p,v(),d==="full"||!h||h!==u?c+=a.move(u+"]"):d==="shortcut"?c=c.slice(0,-1):c+=a.move("]"),c}function fx(){return"!"}c_.peek=dx;function c_(n,r,s){let o=n.value||"",d="`",v=-1;for(;new RegExp("(^|[^`])"+d+"([^`]|$)").test(o);)d+="`";for(/[^ \r\n]/.test(o)&&(/^[ \r\n]/.test(o)&&/[ \r\n]$/.test(o)||/^`|`$/.test(o))&&(o=" "+o+" ");++v<s.unsafe.length;){const f=s.unsafe[v],a=s.compilePattern(f);let c;if(f.atBreak)for(;c=a.exec(o);){let h=c.index;o.charCodeAt(h)===10&&o.charCodeAt(h-1)===13&&h--,o=o.slice(0,h)+" "+o.slice(c.index+1)}}return d+o+d}function dx(){return"`"}function u_(n,r){const s=qu(n);return!!(!r.options.resourceLink&&n.url&&!n.title&&n.children&&n.children.length===1&&n.children[0].type==="text"&&(s===n.url||"mailto:"+s===n.url)&&/^[a-z][a-z+.-]+:/i.test(n.url)&&!/[\0- <>\u007F]/.test(n.url))}h_.peek=px;function h_(n,r,s,o){const d=Zu(s),v=d==='"'?"Quote":"Apostrophe",f=s.createTracker(o);let a,c;if(u_(n,s)){const p=s.stack;s.stack=[],a=s.enter("autolink");let u=f.move("<");return u+=f.move(s.containerPhrasing(n,{before:u,after:">",...f.current()})),u+=f.move(">"),a(),s.stack=p,u}a=s.enter("link"),c=s.enter("label");let h=f.move("[");return h+=f.move(s.containerPhrasing(n,{before:h,after:"](",...f.current()})),h+=f.move("]("),c(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(c=s.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(s.safe(n.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(c=s.enter("destinationRaw"),h+=f.move(s.safe(n.url,{before:h,after:n.title?" ":")",...f.current()}))),c(),n.title&&(c=s.enter(`title${v}`),h+=f.move(" "+d),h+=f.move(s.safe(n.title,{before:h,after:d,...f.current()})),h+=f.move(d),c()),h+=f.move(")"),a(),h}function px(n,r,s){return u_(n,s)?"<":"["}f_.peek=mx;function f_(n,r,s,o){const d=n.referenceType,v=s.enter("linkReference");let f=s.enter("label");const a=s.createTracker(o);let c=a.move("[");const h=s.containerPhrasing(n,{before:c,after:"]",...a.current()});c+=a.move(h+"]["),f();const p=s.stack;s.stack=[],f=s.enter("reference");const u=s.safe(s.associationId(n),{before:c,after:"]",...a.current()});return f(),s.stack=p,v(),d==="full"||!h||h!==u?c+=a.move(u+"]"):d==="shortcut"?c=c.slice(0,-1):c+=a.move("]"),c}function mx(){return"["}function Ju(n){const r=n.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function gx(n){const r=Ju(n),s=n.options.bulletOther;if(!s)return r==="*"?"-":"*";if(s!=="*"&&s!=="+"&&s!=="-")throw new Error("Cannot serialize items with `"+s+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(s===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+s+"`) to be different");return s}function _x(n){const r=n.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function d_(n){const r=n.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function vx(n,r,s,o){const d=s.enter("list"),v=s.bulletCurrent;let f=n.ordered?_x(s):Ju(s);const a=n.ordered?f==="."?")":".":gx(s);let c=r&&s.bulletLastUsed?f===s.bulletLastUsed:!1;if(!n.ordered){const p=n.children?n.children[0]:void 0;if((f==="*"||f==="-")&&p&&(!p.children||!p.children[0])&&s.stack[s.stack.length-1]==="list"&&s.stack[s.stack.length-2]==="listItem"&&s.stack[s.stack.length-3]==="list"&&s.stack[s.stack.length-4]==="listItem"&&s.indexStack[s.indexStack.length-1]===0&&s.indexStack[s.indexStack.length-2]===0&&s.indexStack[s.indexStack.length-3]===0&&(c=!0),d_(s)===f&&p){let u=-1;for(;++u<n.children.length;){const S=n.children[u];if(S&&S.type==="listItem"&&S.children&&S.children[0]&&S.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(f=a),s.bulletCurrent=f;const h=s.containerFlow(n,o);return s.bulletLastUsed=f,s.bulletCurrent=v,d(),h}function yx(n){const r=n.options.listItemIndent||"one";if(r!=="tab"&&r!=="one"&&r!=="mixed")throw new Error("Cannot serialize items with `"+r+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return r}function Sx(n,r,s,o){const d=yx(s);let v=s.bulletCurrent||Ju(s);r&&r.type==="list"&&r.ordered&&(v=(typeof r.start=="number"&&r.start>-1?r.start:1)+(s.options.incrementListMarker===!1?0:r.children.indexOf(n))+v);let f=v.length+1;(d==="tab"||d==="mixed"&&(r&&r.type==="list"&&r.spread||n.spread))&&(f=Math.ceil(f/4)*4);const a=s.createTracker(o);a.move(v+" ".repeat(f-v.length)),a.shift(f);const c=s.enter("listItem"),h=s.indentLines(s.containerFlow(n,a.current()),p);return c(),h;function p(u,S,C){return S?(C?"":" ".repeat(f))+u:(C?v:v+" ".repeat(f-v.length))+u}}function bx(n,r,s,o){const d=s.enter("paragraph"),v=s.enter("phrasing"),f=s.containerPhrasing(n,o);return v(),d(),f}const Cx=Ba(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function wx(n,r,s,o){return(n.children.some(function(f){return Cx(f)})?s.containerPhrasing:s.containerFlow).call(s,n,o)}function xx(n){const r=n.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}p_.peek=Ex;function p_(n,r,s,o){const d=xx(s),v=s.enter("strong"),f=s.createTracker(o),a=f.move(d+d);let c=f.move(s.containerPhrasing(n,{after:d,before:a,...f.current()}));const h=c.charCodeAt(0),p=Ra(o.before.charCodeAt(o.before.length-1),h,d);p.inside&&(c=nl(h)+c.slice(1));const u=c.charCodeAt(c.length-1),S=Ra(o.after.charCodeAt(0),u,d);S.inside&&(c=c.slice(0,-1)+nl(u));const C=f.move(d+d);return v(),s.attentionEncodeSurroundingInfo={after:S.outside,before:p.outside},a+c+C}function Ex(n,r,s){return s.options.strong||"*"}function kx(n,r,s,o){return s.safe(n.value,o)}function Ax(n){const r=n.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function Tx(n,r,s){const o=(d_(s)+(s.options.ruleSpaces?" ":"")).repeat(Ax(s));return s.options.ruleSpaces?o.slice(0,-1):o}const m_={blockquote:Qw,break:Qm,code:ix,definition:sx,emphasis:s_,hardBreak:Qm,heading:cx,html:l_,image:a_,imageReference:o_,inlineCode:c_,link:h_,linkReference:f_,list:vx,listItem:Sx,paragraph:bx,root:wx,strong:p_,text:kx,thematicBreak:Tx};function Dx(){return{enter:{table:Rx,tableData:Zm,tableHeader:Zm,tableRow:Lx},exit:{codeText:Ox,table:Mx,tableData:yu,tableHeader:yu,tableRow:yu}}}function Rx(n){const r=n._align;this.enter({type:"table",align:r.map(function(s){return s==="none"?null:s}),children:[]},n),this.data.inTable=!0}function Mx(n){this.exit(n),this.data.inTable=void 0}function Lx(n){this.enter({type:"tableRow",children:[]},n)}function yu(n){this.exit(n)}function Zm(n){this.enter({type:"tableCell",children:[]},n)}function Ox(n){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,Bx));const s=this.stack[this.stack.length-1];s.type,s.value=r,this.exit(n)}function Bx(n,r){return r==="|"?r:n}function Nx(n){const r=n||{},s=r.tableCellPadding,o=r.tablePipeAlign,d=r.stringLength,v=s?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
89
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:S,table:f,tableCell:c,tableRow:a}};function f(C,A,x,b){return h(p(C,x,b),C.align)}function a(C,A,x,b){const _=u(C,x,b),g=h([_]);return g.slice(0,g.indexOf(`
|
|
90
|
+
`))}function c(C,A,x,b){const _=x.enter("tableCell"),g=x.enter("phrasing"),y=x.containerPhrasing(C,{...b,before:v,after:v});return g(),_(),y}function h(C,A){return Kw(C,{align:A,alignDelimiters:o,padding:s,stringLength:d})}function p(C,A,x){const b=C.children;let _=-1;const g=[],y=A.enter("table");for(;++_<b.length;)g[_]=u(b[_],A,x);return y(),g}function u(C,A,x){const b=C.children;let _=-1;const g=[],y=A.enter("tableRow");for(;++_<b.length;)g[_]=c(b[_],C,A,x);return y(),g}function S(C,A,x){let b=m_.inlineCode(C,A,x);return x.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function jx(){return{exit:{taskListCheckValueChecked:Jm,taskListCheckValueUnchecked:Jm,paragraph:Hx}}}function zx(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Ix}}}function Jm(n){const r=this.stack[this.stack.length-2];r.type,r.checked=n.type==="taskListCheckValueChecked"}function Hx(n){const r=this.stack[this.stack.length-2];if(r&&r.type==="listItem"&&typeof r.checked=="boolean"){const s=this.stack[this.stack.length-1];s.type;const o=s.children[0];if(o&&o.type==="text"){const d=r.children;let v=-1,f;for(;++v<d.length;){const a=d[v];if(a.type==="paragraph"){f=a;break}}f===s&&(o.value=o.value.slice(1),o.value.length===0?s.children.shift():s.position&&o.position&&typeof o.position.start.offset=="number"&&(o.position.start.column++,o.position.start.offset++,s.position.start=Object.assign({},o.position.start)))}}this.exit(n)}function Ix(n,r,s,o){const d=n.children[0],v=typeof n.checked=="boolean"&&d&&d.type==="paragraph",f="["+(n.checked?"x":" ")+"] ",a=s.createTracker(o);v&&a.move(f);let c=m_.listItem(n,r,s,{...o,...a.current()});return v&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),c;function h(p){return p+f}}function Ux(){return[vw(),Iw(),qw(),Dx(),jx()]}function Px(n){return{extensions:[yw(),Uw(n),Vw(),Nx(n),zx()]}}const Fx={tokenize:Wx,partial:!0},g_={tokenize:Kx,partial:!0},__={tokenize:Xx,partial:!0},v_={tokenize:Qx,partial:!0},qx={tokenize:Zx,partial:!0},y_={name:"wwwAutolink",tokenize:$x,previous:b_},S_={name:"protocolAutolink",tokenize:Yx,previous:C_},ii={name:"emailAutolink",tokenize:Gx,previous:w_},Nn={};function Vx(){return{text:Nn}}let Ji=48;for(;Ji<123;)Nn[Ji]=ii,Ji++,Ji===58?Ji=65:Ji===91&&(Ji=97);Nn[43]=ii;Nn[45]=ii;Nn[46]=ii;Nn[95]=ii;Nn[72]=[ii,S_];Nn[104]=[ii,S_];Nn[87]=[ii,y_];Nn[119]=[ii,y_];function Gx(n,r,s){const o=this;let d,v;return f;function f(u){return!Mu(u)||!w_.call(o,o.previous)||eh(o.events)?s(u):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),a(u))}function a(u){return Mu(u)?(n.consume(u),a):u===64?(n.consume(u),c):s(u)}function c(u){return u===46?n.check(qx,p,h)(u):u===45||u===95||qt(u)?(v=!0,n.consume(u),c):p(u)}function h(u){return n.consume(u),d=!0,c}function p(u){return v&&d&&$t(o.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),r(u)):s(u)}}function $x(n,r,s){const o=this;return d;function d(f){return f!==87&&f!==119||!b_.call(o,o.previous)||eh(o.events)?s(f):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(Fx,n.attempt(g_,n.attempt(__,v),s),s)(f))}function v(f){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),r(f)}}function Yx(n,r,s){const o=this;let d="",v=!1;return f;function f(u){return(u===72||u===104)&&C_.call(o,o.previous)&&!eh(o.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),d+=String.fromCodePoint(u),n.consume(u),a):s(u)}function a(u){if($t(u)&&d.length<5)return d+=String.fromCodePoint(u),n.consume(u),a;if(u===58){const S=d.toLowerCase();if(S==="http"||S==="https")return n.consume(u),c}return s(u)}function c(u){return u===47?(n.consume(u),v?h:(v=!0,c)):s(u)}function h(u){return u===null||Aa(u)||ut(u)||er(u)||Ma(u)?s(u):n.attempt(g_,n.attempt(__,p),s)(u)}function p(u){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),r(u)}}function Wx(n,r,s){let o=0;return d;function d(f){return(f===87||f===119)&&o<3?(o++,n.consume(f),d):f===46&&o===3?(n.consume(f),v):s(f)}function v(f){return f===null?s(f):r(f)}}function Kx(n,r,s){let o,d,v;return f;function f(h){return h===46||h===95?n.check(v_,c,a)(h):h===null||ut(h)||er(h)||h!==45&&Ma(h)?c(h):(v=!0,n.consume(h),f)}function a(h){return h===95?o=!0:(d=o,o=void 0),n.consume(h),f}function c(h){return d||o||!v?s(h):r(h)}}function Xx(n,r){let s=0,o=0;return d;function d(f){return f===40?(s++,n.consume(f),d):f===41&&o<s?v(f):f===33||f===34||f===38||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===60||f===63||f===93||f===95||f===126?n.check(v_,r,v)(f):f===null||ut(f)||er(f)?r(f):(n.consume(f),d)}function v(f){return f===41&&o++,n.consume(f),d}}function Qx(n,r,s){return o;function o(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(n.consume(a),o):a===38?(n.consume(a),v):a===93?(n.consume(a),d):a===60||a===null||ut(a)||er(a)?r(a):s(a)}function d(a){return a===null||a===40||a===91||ut(a)||er(a)?r(a):o(a)}function v(a){return $t(a)?f(a):s(a)}function f(a){return a===59?(n.consume(a),o):$t(a)?(n.consume(a),f):s(a)}}function Zx(n,r,s){return o;function o(v){return n.consume(v),d}function d(v){return qt(v)?s(v):r(v)}}function b_(n){return n===null||n===40||n===42||n===95||n===91||n===93||n===126||ut(n)}function C_(n){return!$t(n)}function w_(n){return!(n===47||Mu(n))}function Mu(n){return n===43||n===45||n===46||n===95||qt(n)}function eh(n){let r=n.length,s=!1;for(;r--;){const o=n[r][1];if((o.type==="labelLink"||o.type==="labelImage")&&!o._balanced){s=!0;break}if(o._gfmAutolinkLiteralWalkedInto){s=!1;break}}return n.length>0&&!s&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}const Jx={tokenize:a2,partial:!0};function e2(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:r2,continuation:{tokenize:s2},exit:l2}},text:{91:{name:"gfmFootnoteCall",tokenize:i2},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:t2,resolveTo:n2}}}}function t2(n,r,s){const o=this;let d=o.events.length;const v=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let f;for(;d--;){const c=o.events[d][1];if(c.type==="labelImage"){f=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return a;function a(c){if(!f||!f._balanced)return s(c);const h=Tn(o.sliceSerialize({start:f.end,end:o.now()}));return h.codePointAt(0)!==94||!v.includes(h.slice(1))?s(c):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(c),n.exit("gfmFootnoteCallLabelMarker"),r(c))}}function n2(n,r){let s=n.length;for(;s--;)if(n[s][1].type==="labelImage"&&n[s][0]==="enter"){n[s][1];break}n[s+1][1].type="data",n[s+3][1].type="gfmFootnoteCallLabelMarker";const o={type:"gfmFootnoteCall",start:Object.assign({},n[s+3][1].start),end:Object.assign({},n[n.length-1][1].end)},d={type:"gfmFootnoteCallMarker",start:Object.assign({},n[s+3][1].end),end:Object.assign({},n[s+3][1].end)};d.end.column++,d.end.offset++,d.end._bufferIndex++;const v={type:"gfmFootnoteCallString",start:Object.assign({},d.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},v.start),end:Object.assign({},v.end)},a=[n[s+1],n[s+2],["enter",o,r],n[s+3],n[s+4],["enter",d,r],["exit",d,r],["enter",v,r],["enter",f,r],["exit",f,r],["exit",v,r],n[n.length-2],n[n.length-1],["exit",o,r]];return n.splice(s,n.length-s+1,...a),n}function i2(n,r,s){const o=this,d=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let v=0,f;return a;function a(u){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),c}function c(u){return u!==94?s(u):(n.enter("gfmFootnoteCallMarker"),n.consume(u),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",h)}function h(u){if(v>999||u===93&&!f||u===null||u===91||ut(u))return s(u);if(u===93){n.exit("chunkString");const S=n.exit("gfmFootnoteCallString");return d.includes(Tn(o.sliceSerialize(S)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),r):s(u)}return ut(u)||(f=!0),v++,n.consume(u),u===92?p:h}function p(u){return u===91||u===92||u===93?(n.consume(u),v++,h):h(u)}}function r2(n,r,s){const o=this,d=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let v,f=0,a;return c;function c(A){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(A),n.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(A){return A===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(A),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",p):s(A)}function p(A){if(f>999||A===93&&!a||A===null||A===91||ut(A))return s(A);if(A===93){n.exit("chunkString");const x=n.exit("gfmFootnoteDefinitionLabelString");return v=Tn(o.sliceSerialize(x)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(A),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),S}return ut(A)||(a=!0),f++,n.consume(A),A===92?u:p}function u(A){return A===91||A===92||A===93?(n.consume(A),f++,p):p(A)}function S(A){return A===58?(n.enter("definitionMarker"),n.consume(A),n.exit("definitionMarker"),d.includes(v)||d.push(v),Xe(n,C,"gfmFootnoteDefinitionWhitespace")):s(A)}function C(A){return r(A)}}function s2(n,r,s){return n.check(rl,r,n.attempt(Jx,r,s))}function l2(n){n.exit("gfmFootnoteDefinition")}function a2(n,r,s){const o=this;return Xe(n,d,"gfmFootnoteDefinitionIndent",5);function d(v){const f=o.events[o.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(v):s(v)}}function o2(n){let s=(n||{}).singleTilde;const o={name:"strikethrough",tokenize:v,resolveAll:d};return s==null&&(s=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function d(f,a){let c=-1;for(;++c<f.length;)if(f[c][0]==="enter"&&f[c][1].type==="strikethroughSequenceTemporary"&&f[c][1]._close){let h=c;for(;h--;)if(f[h][0]==="exit"&&f[h][1].type==="strikethroughSequenceTemporary"&&f[h][1]._open&&f[c][1].end.offset-f[c][1].start.offset===f[h][1].end.offset-f[h][1].start.offset){f[c][1].type="strikethroughSequence",f[h][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},f[h][1].start),end:Object.assign({},f[c][1].end)},u={type:"strikethroughText",start:Object.assign({},f[h][1].end),end:Object.assign({},f[c][1].start)},S=[["enter",p,a],["enter",f[h][1],a],["exit",f[h][1],a],["enter",u,a]],C=a.parser.constructs.insideSpan.null;C&&fn(S,S.length,0,La(C,f.slice(h+1,c),a)),fn(S,S.length,0,[["exit",u,a],["enter",f[c][1],a],["exit",f[c][1],a],["exit",p,a]]),fn(f,h-1,c-h+3,S),c=h+S.length-2;break}}for(c=-1;++c<f.length;)f[c][1].type==="strikethroughSequenceTemporary"&&(f[c][1].type="data");return f}function v(f,a,c){const h=this.previous,p=this.events;let u=0;return S;function S(A){return h===126&&p[p.length-1][1].type!=="characterEscape"?c(A):(f.enter("strikethroughSequenceTemporary"),C(A))}function C(A){const x=Wr(h);if(A===126)return u>1?c(A):(f.consume(A),u++,C);if(u<2&&!s)return c(A);const b=f.exit("strikethroughSequenceTemporary"),_=Wr(A);return b._open=!_||_===2&&!!x,b._close=!x||x===2&&!!_,a(A)}}}class c2{constructor(){this.map=[]}add(r,s,o){u2(this,r,s,o)}consume(r){if(this.map.sort(function(v,f){return v[0]-f[0]}),this.map.length===0)return;let s=this.map.length;const o=[];for(;s>0;)s-=1,o.push(r.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),r.length=this.map[s][0];o.push(r.slice()),r.length=0;let d=o.pop();for(;d;){for(const v of d)r.push(v);d=o.pop()}this.map.length=0}}function u2(n,r,s,o){let d=0;if(!(s===0&&o.length===0)){for(;d<n.map.length;){if(n.map[d][0]===r){n.map[d][1]+=s,n.map[d][2].push(...o);return}d+=1}n.map.push([r,s,o])}}function h2(n,r){let s=!1;const o=[];for(;r<n.length;){const d=n[r];if(s){if(d[0]==="enter")d[1].type==="tableContent"&&o.push(n[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(d[1].type==="tableContent"){if(n[r-1][1].type==="tableDelimiterMarker"){const v=o.length-1;o[v]=o[v]==="left"?"center":"right"}}else if(d[1].type==="tableDelimiterRow")break}else d[0]==="enter"&&d[1].type==="tableDelimiterRow"&&(s=!0);r+=1}return o}function f2(){return{flow:{null:{name:"table",tokenize:d2,resolveAll:p2}}}}function d2(n,r,s){const o=this;let d=0,v=0,f;return a;function a(B){let H=o.events.length-1;for(;H>-1;){const $=o.events[H][1].type;if($==="lineEnding"||$==="linePrefix")H--;else break}const P=H>-1?o.events[H][1].type:null,F=P==="tableHead"||P==="tableRow"?D:c;return F===D&&o.parser.lazy[o.now().line]?s(B):F(B)}function c(B){return n.enter("tableHead"),n.enter("tableRow"),h(B)}function h(B){return B===124||(f=!0,v+=1),p(B)}function p(B){return B===null?s(B):Oe(B)?v>1?(v=0,o.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(B),n.exit("lineEnding"),C):s(B):Ge(B)?Xe(n,p,"whitespace")(B):(v+=1,f&&(f=!1,d+=1),B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),f=!0,p):(n.enter("data"),u(B)))}function u(B){return B===null||B===124||ut(B)?(n.exit("data"),p(B)):(n.consume(B),B===92?S:u)}function S(B){return B===92||B===124?(n.consume(B),u):u(B)}function C(B){return o.interrupt=!1,o.parser.lazy[o.now().line]?s(B):(n.enter("tableDelimiterRow"),f=!1,Ge(B)?Xe(n,A,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):A(B))}function A(B){return B===45||B===58?b(B):B===124?(f=!0,n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),x):M(B)}function x(B){return Ge(B)?Xe(n,b,"whitespace")(B):b(B)}function b(B){return B===58?(v+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),_):B===45?(v+=1,_(B)):B===null||Oe(B)?k(B):M(B)}function _(B){return B===45?(n.enter("tableDelimiterFiller"),g(B)):M(B)}function g(B){return B===45?(n.consume(B),g):B===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),y):(n.exit("tableDelimiterFiller"),y(B))}function y(B){return Ge(B)?Xe(n,k,"whitespace")(B):k(B)}function k(B){return B===124?A(B):B===null||Oe(B)?!f||d!==v?M(B):(n.exit("tableDelimiterRow"),n.exit("tableHead"),r(B)):M(B)}function M(B){return s(B)}function D(B){return n.enter("tableRow"),T(B)}function T(B){return B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),T):B===null||Oe(B)?(n.exit("tableRow"),r(B)):Ge(B)?Xe(n,T,"whitespace")(B):(n.enter("data"),E(B))}function E(B){return B===null||B===124||ut(B)?(n.exit("data"),T(B)):(n.consume(B),B===92?R:E)}function R(B){return B===92||B===124?(n.consume(B),E):E(B)}}function p2(n,r){let s=-1,o=!0,d=0,v=[0,0,0,0],f=[0,0,0,0],a=!1,c=0,h,p,u;const S=new c2;for(;++s<n.length;){const C=n[s],A=C[1];C[0]==="enter"?A.type==="tableHead"?(a=!1,c!==0&&(eg(S,r,c,h,p),p=void 0,c=0),h={type:"table",start:Object.assign({},A.start),end:Object.assign({},A.end)},S.add(s,0,[["enter",h,r]])):A.type==="tableRow"||A.type==="tableDelimiterRow"?(o=!0,u=void 0,v=[0,0,0,0],f=[0,s+1,0,0],a&&(a=!1,p={type:"tableBody",start:Object.assign({},A.start),end:Object.assign({},A.end)},S.add(s,0,[["enter",p,r]])),d=A.type==="tableDelimiterRow"?2:p?3:1):d&&(A.type==="data"||A.type==="tableDelimiterMarker"||A.type==="tableDelimiterFiller")?(o=!1,f[2]===0&&(v[1]!==0&&(f[0]=f[1],u=wa(S,r,v,d,void 0,u),v=[0,0,0,0]),f[2]=s)):A.type==="tableCellDivider"&&(o?o=!1:(v[1]!==0&&(f[0]=f[1],u=wa(S,r,v,d,void 0,u)),v=f,f=[v[1],s,0,0])):A.type==="tableHead"?(a=!0,c=s):A.type==="tableRow"||A.type==="tableDelimiterRow"?(c=s,v[1]!==0?(f[0]=f[1],u=wa(S,r,v,d,s,u)):f[1]!==0&&(u=wa(S,r,f,d,s,u)),d=0):d&&(A.type==="data"||A.type==="tableDelimiterMarker"||A.type==="tableDelimiterFiller")&&(f[3]=s)}for(c!==0&&eg(S,r,c,h,p),S.consume(r.events),s=-1;++s<r.events.length;){const C=r.events[s];C[0]==="enter"&&C[1].type==="table"&&(C[1]._align=h2(r.events,s))}return n}function wa(n,r,s,o,d,v){const f=o===1?"tableHeader":o===2?"tableDelimiter":"tableData",a="tableContent";s[0]!==0&&(v.end=Object.assign({},Vr(r.events,s[0])),n.add(s[0],0,[["exit",v,r]]));const c=Vr(r.events,s[1]);if(v={type:f,start:Object.assign({},c),end:Object.assign({},c)},n.add(s[1],0,[["enter",v,r]]),s[2]!==0){const h=Vr(r.events,s[2]),p=Vr(r.events,s[3]),u={type:a,start:Object.assign({},h),end:Object.assign({},p)};if(n.add(s[2],0,[["enter",u,r]]),o!==2){const S=r.events[s[2]],C=r.events[s[3]];if(S[1].end=Object.assign({},C[1].end),S[1].type="chunkText",S[1].contentType="text",s[3]>s[2]+1){const A=s[2]+1,x=s[3]-s[2]-1;n.add(A,x,[])}}n.add(s[3]+1,0,[["exit",u,r]])}return d!==void 0&&(v.end=Object.assign({},Vr(r.events,d)),n.add(d,0,[["exit",v,r]]),v=void 0),v}function eg(n,r,s,o,d){const v=[],f=Vr(r.events,s);d&&(d.end=Object.assign({},f),v.push(["exit",d,r])),o.end=Object.assign({},f),v.push(["exit",o,r]),n.add(s+1,0,v)}function Vr(n,r){const s=n[r],o=s[0]==="enter"?"start":"end";return s[1][o]}const m2={name:"tasklistCheck",tokenize:_2};function g2(){return{text:{91:m2}}}function _2(n,r,s){const o=this;return d;function d(c){return o.previous!==null||!o._gfmTasklistFirstContentOfListItem?s(c):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(c),n.exit("taskListCheckMarker"),v)}function v(c){return ut(c)?(n.enter("taskListCheckValueUnchecked"),n.consume(c),n.exit("taskListCheckValueUnchecked"),f):c===88||c===120?(n.enter("taskListCheckValueChecked"),n.consume(c),n.exit("taskListCheckValueChecked"),f):s(c)}function f(c){return c===93?(n.enter("taskListCheckMarker"),n.consume(c),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),a):s(c)}function a(c){return Oe(c)?r(c):Ge(c)?n.check({tokenize:v2},r,s)(c):s(c)}}function v2(n,r,s){return Xe(n,o,"whitespace");function o(d){return d===null?s(d):r(d)}}function y2(n){return Og([Vx(),e2(),o2(n),f2(),g2()])}const S2={};function x_(n){const r=this,s=n||S2,o=r.data(),d=o.micromarkExtensions||(o.micromarkExtensions=[]),v=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),f=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);d.push(y2(s)),v.push(Ux()),f.push(Px(s))}const b2=500,tg="zh-CN",C2="中英互译";function w2({active:n=!0,taskSlug:r,role:s,sessionId:o}){const[d,v]=ce.useState([]),[f,a]=ce.useState([]),[c,h]=ce.useState(""),[p,u]=ce.useState(!1),[S,C]=ce.useState(!1),[A,x]=ce.useState("ready"),[b,_]=ce.useState(""),[g,y]=ce.useState(Date.now()),[k,M]=ce.useState(!1),[D,T]=ce.useState(""),[E,R]=ce.useState(!1),[B,H]=ce.useState(null),[P,F]=ce.useState(""),[$,W]=ce.useState(""),[G,X]=ce.useState(""),[te,z]=ce.useState(!1),[O,j]=ce.useState(null),[V,I]=ce.useState(""),[ne,_e]=ce.useState(""),[me,Q]=ce.useState(""),[q,J]=ce.useState(!1),[Y,he]=ce.useState(0),de=ce.useRef(n),be=ce.useRef(1),Pe=ce.useRef(null);ce.useEffect(()=>{de.current=n},[n]),ce.useEffect(()=>{if(!E)return;let ve=!1,ke;const Re=async()=>{ve||(await ae(!0),ve||(ke=window.setTimeout(Re,2e3)))};return Re(),()=>{ve=!0,ke!==void 0&&window.clearTimeout(ke)}},[E,P]),ce.useEffect(()=>{v([]),a([]),T(""),x("ready"),_(""),be.current=1;let ve=!1,ke;const Re=()=>{ve||(ke=window.setTimeout(yt,de.current?200:1e3))},yt=async()=>{if(!ve)try{const Ne=await xe.pollTranslationSession(o,be.current);if(ve)return;De(Ne.events),be.current=Ne.nextCursor,x(Ne.status),de.current&&_(N2(new Date().toISOString()))}catch(Ne){ve||T(Ne instanceof Error?Ne.message:"Translation poll failed.")}finally{Re()}};return xe.startTranslationSession(r,s).then(Ne=>{ve||(x(Ne.status),be.current=Ne.nextCursor,yt())}).catch(Ne=>{ve||T(Ne instanceof Error?Ne.message:"Translation start failed.")}),()=>{ve=!0,ke!==void 0&&window.clearTimeout(ke),xe.stopTranslationSession(o).catch(()=>{})}},[o,r,s]),ce.useEffect(()=>{if(!n)return;const ve=Pe.current;if(!ve)return;const ke=window.requestAnimationFrame(()=>{ve.scrollTop=ve.scrollHeight});return()=>window.cancelAnimationFrame(ke)},[n,Y]);const Fe=T2(d);ce.useEffect(()=>{if(!Fe)return;y(Date.now());const ve=window.setInterval(()=>y(Date.now()),250);return()=>window.clearInterval(ve)},[Fe]);async function We(ve=!1){M(!0),T(""),u(!1);try{const ke=await xe.translateUserInput(r,s,{text:c,mode:ve?"auto-send":"review-before-send",useContext:!1,send:ve});ke.sent?(h(""),u(!1)):(h(ke.englishPreview),u(!0))}catch(ke){T(ke instanceof Error?ke.message:"Translation failed.")}finally{M(!1)}}function De(ve){if(ve.length===0)return;for(const Re of ve)Re.type==="status"?x(Re.status):Re.type==="error"?T(Re.message):Re.type==="failures"&&a(Re.failures);const ke=ve.filter(Re=>Re.type==="entry");ke.length>0&&(v(Re=>{const yt=ke.reduce((Yt,Bt)=>O2(Yt,Bt.entry),Re),Ne=R2(yt);return Ne.removedIds.size>0&&a(Yt=>Yt.filter(Bt=>!Ne.removedIds.has(Bt.translationId))),Ne.entries}),he(Re=>Re+1))}async function Rt(){if(c.trim()){M(!0),T("");try{await xe.sendTranslatedInput(r,s,{englishText:c}),h(""),u(!1)}catch(ve){T(ve instanceof Error?ve.message:"Failed to send English input.")}finally{M(!1)}}}function ot(ve){ve.key!=="Enter"||ve.shiftKey||ve.nativeEvent.isComposing||(ve.preventDefault(),!k&&c.trim()&&(p?Rt():We(S)))}async function Tt(){v([]),a([]),be.current=1,await xe.clearTranslationSession(o).catch(ve=>T(ve.message))}async function nt(){M(!0),T("");try{const ve=await xe.ignoreTranslationFailures(o);a(ve.failures)}catch(ve){T(ve instanceof Error?ve.message:"Failed to ignore translation failures.")}finally{M(!1)}}async function Mt(){M(!0),T("");try{const ve=await xe.retryTranslationFailures(o);a(ve.failures)}catch(ve){T(ve instanceof Error?ve.message:"Failed to retry translation failures.")}finally{M(!1)}}async function ae(ve=!1){try{const ke=await xe.getCodexTranslationState();if(H(ke),!P&&ke.fileIndex.jobs[0])tt(ke.fileIndex.jobs[0].id);else if(ve&&P){const Re=await xe.readCodexFileTranslation(P);W(Re.output),X(Re.report)}}catch(ke){T(ke instanceof Error?ke.message:"Failed to load file translations.")}}async function tt(ve){F(ve),W(""),X("");try{const ke=await xe.readCodexFileTranslation(ve);W(ke.output),X(ke.report)}catch(ke){T(ke instanceof Error?ke.message:"Failed to read translated file.")}}async function Je(){z(!0),await ue(V,ne)}async function ue(ve="",ke=""){J(!0),T("");try{const Re=await xe.browseCodexTranslationSourceFiles({path:ve,query:ke,limit:250});j(Re),I(Re.currentPath),_e(ke)}catch(Re){T(Re instanceof Error?Re.message:"Failed to browse source files.")}finally{J(!1)}}async function Se(ve=me){const ke=ve.trim();if(ke){M(!0),T("");try{const Re=await xe.createCodexFileTranslation({taskSlug:r,sourcePath:ke,targetLanguage:tg});z(!1),await ae(),await tt(Re.id)}catch(Re){T(Re instanceof Error?Re.message:"Failed to create file translation.")}finally{M(!1)}}}async function we(){M(!0),T("");try{await xe.createCodexBootstrap({taskSlug:r,targetLanguage:tg}),await ae()}catch(ve){T(ve instanceof Error?ve.message:"Failed to create translation bootstrap.")}finally{M(!1)}}async function Me(){if(!P)return;const ve=window.prompt("Promote translation to project path:");if(ve!=null&&ve.trim()){M(!0),T("");try{await xe.promoteCodexTranslation(P,ve),await tt(P)}catch(ke){T(ke instanceof Error?ke.message:"Failed to promote translation.")}finally{M(!1)}}}const je=D2(d,A,g),ht=f.length;return N.jsxs("aside",{className:"translation-panel",children:[N.jsxs("header",{className:"translation-panel-header",children:[N.jsxs("div",{className:"translation-panel-titlebar",children:[N.jsx("h2",{children:"Translation"}),N.jsxs("div",{className:"translation-panel-actions",children:[N.jsx("button",{"aria-pressed":S,className:`auto-send-toggle${S?" is-active":""}`,type:"button",onClick:()=>C(ve=>!ve),children:S?"✅ Auto-send":"× Auto-send"}),ht>0?N.jsxs(N.Fragment,{children:[N.jsxs("button",{type:"button",disabled:k,onClick:()=>void nt(),children:["Ignore ",ht]}),N.jsxs("button",{type:"button",disabled:k,onClick:()=>void Mt(),children:["Retry ",ht]})]}):null,N.jsx("button",{"aria-pressed":E,type:"button",onClick:()=>R(!0),children:"File"}),N.jsx("button",{type:"button",onClick:()=>void Tt(),children:"Clear"})]})]}),N.jsxs("div",{className:"translation-status-row",children:[N.jsxs("p",{children:["Codex · ",C2," · ",je]}),N.jsx("p",{children:b?`poll ${b}`:"poll -"})]})]}),D?N.jsx("div",{className:"error-banner",children:D}):null,N.jsxs("div",{className:"translation-entry-list",ref:Pe,children:[d.length===0?N.jsx("p",{className:"muted",children:"Translated Claude Code output will appear here."}):null,d.map(ve=>N.jsx(k2,{entry:ve},ve.id))]}),N.jsx("div",{className:"translation-composer",children:N.jsxs("div",{className:"translation-composer-row",children:[N.jsx("textarea",{value:c,onChange:ve=>{h(ve.target.value),ve.target.value.trim()||u(!1)},onKeyDown:ot,placeholder:"输入中文,先翻译成英文工程指令..."}),N.jsx("div",{className:"translation-composer-actions",children:N.jsx("button",{type:"button",disabled:k||!p||!c.trim(),onClick:()=>void Rt(),children:"Send English"})})]})}),E?N.jsx("div",{className:"modal-backdrop file-translation-backdrop",children:N.jsx(E2,{busy:k,state:B,selectedJobId:P,output:$,report:G,onBootstrap:()=>void we(),onClose:()=>{R(!1),z(!1)},onRefresh:()=>void ae(),onSelectJob:ve=>void tt(ve),onTranslate:()=>void Je(),onPromote:()=>void Me()})}):null,te?N.jsx(x2,{busy:k||q,state:O,currentPath:V,query:ne,selectedPath:me,onBrowse:(ve,ke)=>void ue(ve,ke),onClose:()=>z(!1),onQueryChange:_e,onSelectPath:Q,onTranslate:()=>void Se()}):null]})}function x2({busy:n,state:r,currentPath:s,query:o,selectedPath:d,onBrowse:v,onClose:f,onQueryChange:a,onSelectPath:c,onTranslate:h}){const p=(r==null?void 0:r.entries)??[],u=p.filter(C=>C.type==="directory"),S=p.filter(C=>C.type==="file");return N.jsx("div",{className:"modal-backdrop translation-file-browser-backdrop",children:N.jsxs("section",{className:"translation-file-browser-modal",role:"dialog","aria-modal":"true","aria-label":"Select Source File",children:[N.jsxs("header",{children:[N.jsxs("div",{children:[N.jsx("h2",{children:"Select Source File"}),N.jsx("p",{children:s||"."})]}),N.jsx("button",{type:"button",onClick:f,children:"Close"})]}),N.jsxs("div",{className:"translation-file-browser-controls",children:[N.jsxs("div",{className:"translation-file-browser-nav",children:[N.jsx("button",{type:"button",disabled:n||!s,onClick:()=>v((r==null?void 0:r.parentPath)??"",""),children:"Up"}),N.jsx("button",{type:"button",disabled:n||!s,onClick:()=>v("",""),children:"Root"})]}),N.jsxs("form",{className:"translation-file-browser-search",onSubmit:C=>{C.preventDefault(),v(s,o)},children:[N.jsx("input",{value:o,onChange:C=>a(C.target.value),placeholder:"Search files"}),N.jsx("button",{type:"submit",disabled:n,children:"Search"}),N.jsx("button",{type:"button",disabled:n||!o,onClick:()=>v(s,""),children:"Clear"})]})]}),N.jsxs("div",{className:"translation-file-browser-layout",children:[N.jsxs("div",{className:"translation-file-browser-list",children:[n&&!r?N.jsx("p",{className:"muted",children:"Loading files..."}):null,!n&&p.length===0?N.jsx("p",{className:"muted",children:"No source files found."}):null,u.length>0?N.jsxs("div",{className:"translation-file-browser-group",children:[N.jsx("h3",{children:"Folders"}),u.map(C=>N.jsx(ng,{entry:C,selected:d===C.path,onBrowse:v,onSelectPath:c},C.path))]}):null,S.length>0?N.jsxs("div",{className:"translation-file-browser-group",children:[N.jsx("h3",{children:"Files"}),S.map(C=>N.jsx(ng,{entry:C,selected:d===C.path,onBrowse:v,onSelectPath:c},C.path))]}):null,r!=null&&r.truncated?N.jsx("p",{className:"translation-entry-note",children:"Result limit reached."}):null]}),N.jsxs("aside",{className:"translation-file-browser-selection",children:[N.jsxs("label",{children:[N.jsx("span",{children:"Source path"}),N.jsx("input",{value:d,onChange:C=>c(C.target.value)})]}),N.jsx("button",{type:"button",disabled:n||!d.trim(),onClick:h,children:"Translate File"})]})]})]})})}function ng({entry:n,selected:r,onBrowse:s,onSelectPath:o}){const d=n.type==="directory";return N.jsxs("button",{className:r?"translation-file-browser-entry is-selected":"translation-file-browser-entry",type:"button",onClick:()=>d?s(n.path,""):o(n.path),onDoubleClick:()=>d?s(n.path,""):void 0,children:[N.jsx("span",{children:d?"DIR":"FILE"}),N.jsx("strong",{children:n.name}),N.jsx("small",{children:n.path})]})}function E2({busy:n,state:r,selectedJobId:s,output:o,report:d,onBootstrap:v,onClose:f,onRefresh:a,onSelectJob:c,onTranslate:h,onPromote:p}){const u=(r==null?void 0:r.fileIndex.jobs)??[],S=u.find(C=>C.id===s);return N.jsxs("section",{className:"file-translation-modal",role:"dialog","aria-modal":"true","aria-label":"File Translation",children:[N.jsxs("header",{className:"file-translation-header",children:[N.jsxs("div",{children:[N.jsx("h2",{children:"File Translation"}),N.jsx("p",{children:"Codex · 中英互译"})]}),N.jsxs("div",{className:"file-translation-toolbar",children:[N.jsx("button",{type:"button",disabled:n,onClick:h,children:"Translate"}),N.jsx("button",{type:"button",disabled:n,onClick:v,children:"Bootstrap"}),N.jsx("button",{type:"button",disabled:n,onClick:a,children:"Refresh"}),N.jsx("button",{type:"button",disabled:n||!S,onClick:p,children:"Promote"}),N.jsx("button",{type:"button",onClick:f,children:"Close"})]})]}),r!=null&&r.memoryInitialized?null:N.jsx("p",{className:"translation-entry-note",children:"Translation memory is not initialized. Run Bootstrap before important file translations."}),N.jsxs("div",{className:"file-translation-layout",children:[N.jsxs("div",{className:"file-translation-list",children:[u.length===0?N.jsx("p",{className:"muted",children:"No translated files yet."}):null,u.map(C=>N.jsxs("button",{className:C.id===s?"file-translation-item is-active":"file-translation-item",type:"button",onClick:()=>c(C.id),children:[N.jsx("strong",{children:C.sourcePath}),N.jsxs("span",{children:[C.status," · ",C.targetLanguage]})]},C.id))]}),N.jsx("div",{className:"file-translation-preview",children:S?N.jsxs(N.Fragment,{children:[N.jsxs("header",{children:[N.jsx("strong",{children:S.sourcePath}),N.jsx("span",{children:S.status})]}),N.jsx("div",{className:"translation-markdown",children:N.jsx(e_,{remarkPlugins:[x_],children:o||d||"Translation output is not available yet."})})]}):N.jsx("p",{className:"muted",children:"Select a translated file to preview it."})})]})]})}function k2({entry:n}){if(n.sourceKind==="conversation-boundary")return N.jsx(A2,{entry:n});const r=L2(n),s=n.sourceKind==="tool-output",o=n.direction==="user-input-to-english",d=["translation-entry",`is-${n.sourceKind}`,o?"is-user-input":""].filter(Boolean).join(" ");return N.jsxs("article",{className:d,children:[s?N.jsx("pre",{children:r}):N.jsx("div",{className:"translation-markdown",children:N.jsx(e_,{remarkPlugins:[x_],children:r})}),n.warning?N.jsx("p",{className:"translation-entry-note",children:n.warning}):null,n.error?N.jsx("p",{className:"translation-entry-note is-error",children:n.error}):null]})}function A2({entry:n}){const r=n.boundaryKind==="end"?"结束":"开始",s=n.conversationTurn??0,o=j2(n.occurredAt??n.createdAt);return N.jsxs("div",{className:"translation-conversation-boundary","aria-label":`${r} 第 ${s} 轮 ${o}`,children:[N.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"}),N.jsx("span",{children:r}),N.jsxs("span",{children:["第 ",s," 轮"]}),N.jsx("time",{children:o}),N.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"})]})}function T2(n){const r=n.find(th);return(r==null?void 0:r.translationStartedAt)??(r==null?void 0:r.createdAt)}function D2(n,r,s){const o=n.find(th);if(o)return`translating ${B2(Math.max(0,s-M2(o)))}`;const d=n.at(-1);return(d==null?void 0:d.status)==="failed"||r==="failed"?"error":r}function th(n){return n.status==="queued"||n.status==="translating"}function R2(n){const r=n.length-b2;if(r<=0)return{entries:n,removedIds:new Set};const s=new Set;for(const o of n){if(s.size>=r)break;th(o)||s.add(o.id)}return s.size===0?{entries:n,removedIds:s}:{entries:n.filter(o=>!s.has(o.id)),removedIds:s}}function M2(n){const r=Date.parse(n.translationStartedAt??n.createdAt);return Number.isFinite(r)?r:Date.now()}function L2(n){return n.status==="queued"||n.status==="translating"?n.sourceText:n.status==="translated"?n.translatedText:n.translatedText||n.sourceText}function O2(n,r){return n.findIndex(o=>o.id===r.id)===-1?[...n,r]:n.map(o=>o.id===r.id?r:o)}function B2(n){if(n<1e3)return`${Math.max(.1,n/1e3).toFixed(1)}s`;const r=n/1e3;if(r<60)return`${r.toFixed(1)}s`;const s=Math.floor(r/60),o=Math.floor(r%60).toString().padStart(2,"0");return`${s}:${o}`}function N2(n){const r=new Date(n);return Number.isNaN(r.getTime())?n:r.toLocaleTimeString()}function j2(n){const r=new Date(n);return Number.isNaN(r.getTime())?n:r.toLocaleTimeString()}function z2({role:n,session:r,permissionMode:s,model:o,effort:d,active:v=!0,busy:f,orchestrationMode:a,translationEnabled:c,onPermissionModeChange:h,onModelChange:p,onEffortChange:u,onOrchestrationModeChange:S,onStart:C,onResume:A,onStop:x,onRestart:b,onTerminalEvent:_}){const g=a==="auto",y=Nu(n);return N.jsxs("section",{className:"session-console",children:[N.jsxs("div",{className:"session-console-top",children:[N.jsx(K1,{role:n,session:r,permissionMode:s,model:o,effort:d,busy:f,onPermissionModeChange:h,onModelChange:p,onEffortChange:u,onStart:C,onResume:A,onStop:x,onRestart:b}),y?null:N.jsx("div",{className:"session-console-actions",children:N.jsx("button",{"aria-label":`Auto orchestration is ${g?"on":"off"}`,"aria-pressed":g,className:`translation-toggle${g?" is-active":""}`,disabled:f,type:"button",onClick:()=>S(g?"manual":"auto"),children:g?"✅ Auto orchestration":"× Auto orchestration"})})]}),(r==null?void 0:r.status)==="running"?N.jsx(H2,{active:v,onTerminalEvent:_,role:n,session:r,taskSlug:r.taskSlug,translationEnabled:!y&&c}):N.jsxs("div",{className:"terminal-empty",children:[N.jsx("strong",{children:n}),N.jsx("span",{children:y?r!=null&&r.claudeSessionId?`Resume this role to reconnect the ${n==="codex-translator"?"Codex Translator":"Codex Reviewer"} terminal.`:`Start this role to open an embedded ${n==="codex-translator"?"Codex Translator":"Codex Reviewer"} terminal.`:r!=null&&r.claudeSessionId?"Resume this role to reconnect its Claude Code conversation.":"Start this role to open an embedded Claude Code terminal."})]})]})}function H2({active:n,onTerminalEvent:r,role:s,session:o,taskSlug:d,translationEnabled:v}){return N.jsxs("div",{className:v?"session-console-body has-translation":"session-console-body",children:[N.jsx("div",{className:"terminal-pane",children:N.jsx(fg,{sessionId:o.id,active:n,onEvent:r},o.id)}),v?N.jsx("div",{className:"translation-pane",children:N.jsx(w2,{active:n,taskSlug:d,role:s,sessionId:o.id},o.id)}):null]})}function I2(n,r,s){var v;if(!n||s.mode!=="auto")return null;const o=new Map(n.map(f=>[f.id,f])),d=r.filter(f=>{var a;return f.dispatchingAt?((a=o.get(f.id))==null?void 0:a.dispatchingAt)!==f.dispatchingAt:!1});return d.length===0?null:((v=d.sort(U2)[d.length-1])==null?void 0:v.toRole)??null}function U2(n,r){const s=n.dispatchingAt??n.deliveredAt??n.acceptedAt??"",o=r.dispatchingAt??r.deliveredAt??r.acceptedAt??"";return s!==o?s.localeCompare(o):n.createdAt.localeCompare(r.createdAt)}const P2=2e3;function F2({task:n,activeRole:r,codexReviewerEnabled:s,translationEnabled:o,refreshNonce:d=0,onTaskChanged:v,onActiveRoleChange:f,onTranslationEnabledChange:a,onMessagesChanged:c,onOrchestrationChanged:h,onRoundStateChanged:p,onEventsChanged:u,onLaunchStateChanged:S}){const[C,A]=ce.useState(null),[x,b]=ce.useState({"project-manager":"default",architect:"default",coder:"default",reviewer:"default","codex-reviewer":"default","codex-translator":"default"}),[_,g]=ce.useState({"project-manager":"default",architect:"default",coder:"default",reviewer:"default","codex-reviewer":"gpt-5.5","codex-translator":"gpt-5.5"}),[y,k]=ce.useState({"project-manager":"default",architect:"default",coder:"default",reviewer:"default","codex-reviewer":"xhigh","codex-translator":"xhigh"}),[M,D]=ce.useState(!1),[T,E]=ce.useState(""),[R,B]=ce.useState([]),[H,P]=ce.useState(null),F=ce.useRef(null),$=!!(C!=null&&C.sessions.some(J=>J.role==="codex-reviewer")),W=!!(C!=null&&C.sessions.some(J=>J.role==="codex-translator")),G=s||$,X=o||W,te=[...$r,...G?[og]:[],...X?[cg]:[]],z=ce.useCallback((J,Y)=>{var be;const he=((be=F.current)==null?void 0:be.taskSlug)===n.taskSlug?F.current.messages:null,de=I2(he,J,Y);F.current={taskSlug:n.taskSlug,messages:J},P(Y),c==null||c(J),h==null||h(Y),de&&(f(de),ne(`auto switched to ${de} before VCM dispatch`))},[f,c,h,n.taskSlug]),O=ce.useCallback((J,Y,he,de)=>{A(J),z(Y,he),p==null||p(de)},[z,p]),j=ce.useCallback(async()=>{const[J,Y,he,de]=await Promise.all([xe.getTaskStatus(n.taskSlug),xe.listMessages(n.taskSlug),xe.getOrchestrationState(n.taskSlug),xe.getSessionRoundState(n.taskSlug)]);O(J,Y,he,de)},[O,n.taskSlug]);ce.useEffect(()=>{j().catch(J=>E(J.message))},[j,d]),ce.useEffect(()=>{B([]),u==null||u([])},[u,n.taskSlug]),ce.useEffect(()=>{C&&!G&&r==="codex-reviewer"&&f("project-manager"),C&&!X&&r==="codex-translator"&&f("project-manager")},[r,G,X,f,C]),ce.useEffect(()=>{b(J=>{let Y=!1;const he={...J};for(const de of(C==null?void 0:C.sessions)??[])he[de.role]!==de.permissionMode&&(he[de.role]=de.permissionMode,Y=!0);return Y?he:J})},[C==null?void 0:C.sessions]),ce.useEffect(()=>{g(J=>{let Y=!1;const he={...J};for(const de of(C==null?void 0:C.sessions)??[]){const be=de.model??"default";he[de.role]!==be&&(he[de.role]=be,Y=!0)}return Y?he:J})},[C==null?void 0:C.sessions]),ce.useEffect(()=>{k(J=>{let Y=!1;const he={...J};for(const de of(C==null?void 0:C.sessions)??[]){const be=de.effort??"default";he[de.role]!==be&&(he[de.role]=be,Y=!0)}return Y?he:J})},[C==null?void 0:C.sessions]),ce.useEffect(()=>{const J=(C==null?void 0:C.sessions)??[],Y=J.filter(be=>!Nu(be.role)),he=new Set(Y.map(be=>be.role)),de={};for(const be of $r)de[be.name]={permissionMode:x[be.name],model:_[be.name],effort:y[be.name]};S==null||S({taskSlug:n.taskSlug,roles:de,autoOrchestration:((H==null?void 0:H.mode)??"auto")==="auto",translationEnabled:o,statusLoaded:!!C,sessionCount:J.length,hasAnySession:J.length>0,allRolesHaveSession:$r.every(be=>he.has(be.name))})},[_,y,S,H==null?void 0:H.mode,x,C,n.taskSlug,o]),ce.useEffect(()=>{const J=window.setInterval(()=>{Promise.all([xe.getTaskStatus(n.taskSlug),xe.listMessages(n.taskSlug),xe.getOrchestrationState(n.taskSlug),xe.getSessionRoundState(n.taskSlug)]).then(([Y,he,de,be])=>{O(Y,he,de,be)}).catch(Y=>E(Y.message))},3e3);return()=>window.clearInterval(J)},[O,n.taskSlug]),ce.useEffect(()=>{let J=!1,Y=!1;const he=window.setInterval(()=>{Y||(Y=!0,Promise.all([xe.listMessages(n.taskSlug),xe.getOrchestrationState(n.taskSlug)]).then(([de,be])=>{J||z(de,be)}).catch(de=>{J||E(de.message)}).finally(()=>{Y=!1}))},P2);return()=>{J=!0,window.clearInterval(he)}},[z,n.taskSlug]);async function V(J){D(!0),E("");try{await J(),await j(),await v()}catch(Y){E(Y instanceof Error?Y.message:"Action failed.")}finally{D(!1)}}async function I(){const J=n.worktreePath?[`Close task "${n.taskSlug}"?`,"","This is destructive:","- stops VCM-managed running role sessions for this task",`- deletes the task worktree: ${n.worktreePath}`,`- deletes the Git branch: ${n.branch}`,"- deletes VCM task/session/message/orchestration state","","VCM will not check running sessions or uncommitted changes before closing."].join(`
|
|
91
91
|
`):[`Close task "${n.taskSlug}"?`,"","This task was created without a separate worktree/branch.","VCM will stop VCM-managed running role sessions for this task.","VCM will delete task/session/message/orchestration state only.","","VCM will not check running sessions or uncommitted changes before closing."].join(`
|
|
92
|
-
`);if(window.confirm(J)){D(!0),E("");try{await xe.cleanupTask(n.taskSlug,{force:!0,deleteBranch:!!n.worktreePath,forceDeleteBranch:!0}),ne(`closed ${n.taskSlug}`),await v()}catch(he){E(he instanceof Error?he.message:"Close task failed.")}finally{D(!1)}}}function ne(J){N(Y=>{const he=[...Y,`${new Date().toLocaleTimeString()} ${J}`];return u==null||u(he),he})}function _e(J,Y){b(he=>({...he,[J]:Y}))}function ge(J,Y){g(he=>({...he,[J]:Y}))}function Q(J,Y){k(he=>({...he,[J]:Y}))}async function q(J){D(!0),E("");try{const Y=await xe.updateOrchestrationState(n.taskSlug,{mode:J});F(Y),h==null||h(Y),ne(`auto orchestration ${J==="auto"?"enabled":"disabled"}`)}catch(Y){E(Y instanceof Error?Y.message:"Failed to update orchestration mode.")}finally{D(!1)}}return B.jsxs("div",{className:"task-workspace",children:[B.jsxs("header",{className:"workspace-header",children:[B.jsx("div",{className:"workspace-title-line",children:B.jsx("h1",{children:n.title||n.taskSlug})}),B.jsx($1,{activeRole:r,roles:ee,sessions:(w==null?void 0:w.sessions)??[],onSelect:f}),B.jsxs("div",{className:"workspace-header-actions",children:[B.jsx("button",{"aria-pressed":o,className:`translation-toggle${o?" is-active":""}`,type:"button",onClick:()=>a(!o),children:o?"✅ Translate":"× Translate"}),B.jsx("button",{className:"danger-button",type:"button",disabled:M,onClick:()=>void I(),children:"Close Task"})]})]}),T?B.jsx("div",{className:"error-banner",children:T}):null,B.jsx("div",{className:"workspace-grid",children:B.jsx("div",{className:"workspace-main",children:B.jsx("div",{className:"role-console-stack",children:ee.map(J=>{const Y=J.name,he=Y===r,de=dg((w==null?void 0:w.sessions)??[],Y);return B.jsx("div",{className:he?"role-console-panel is-active":"role-console-panel","aria-hidden":!he,children:B.jsx(j2,{role:Y,session:de,permissionMode:x[Y],model:_[Y],effort:y[Y],active:he,busy:M,orchestrationMode:(z==null?void 0:z.mode)??"auto",translationEnabled:o,onPermissionModeChange:be=>_e(Y,be),onModelChange:be=>ge(Y,be),onEffortChange:be=>Q(Y,be),onOrchestrationModeChange:be=>void q(be),onStart:()=>void V(async()=>{await xe.startRoleSession(n.taskSlug,Y,{cols:100,rows:28,permissionMode:x[Y],model:_[Y],effort:y[Y]}),ne(`started ${Y} with ${x[Y]} / ${_[Y]} / ${y[Y]}`)}),onResume:()=>void V(async()=>{await xe.resumeRoleSession(n.taskSlug,Y,{cols:100,rows:28,permissionMode:x[Y],model:_[Y],effort:y[Y]}),ne(`resumed ${Y} with ${x[Y]} / ${_[Y]} / ${y[Y]}`)}),onStop:()=>void V(async()=>{await xe.stopRoleSession(n.taskSlug,Y),ne(`stopped ${Y}`)}),onRestart:()=>void V(async()=>{await xe.restartRoleSession(n.taskSlug,Y,{cols:100,rows:28,permissionMode:x[Y],model:_[Y],effort:y[Y]}),ne(`restarted ${Y} with ${x[Y]} / ${_[Y]} / ${y[Y]}`)}),onTerminalEvent:be=>ne(`${J.label}: ${be}`)})},Y)})})})})]})}const F2=120*1e3,ng=1400,q2=3;function V2(){const[n,r]=ce.useState(null),[s,o]=ce.useState([]),[d,v]=ce.useState(null),[f,a]=ce.useState(null),[c,h]=ce.useState(null),[p,u]=ce.useState(null),[S,w]=ce.useState(null),[A,x]=ce.useState(null),[b,_]=ce.useState(!1),[g,y]=ce.useState([]),[k,M]=ce.useState(null),[D,T]=ce.useState(null),[E,R]=ce.useState(null),[N,z]=ce.useState(null),[F,P]=ce.useState(null),[$,K]=ce.useState(null),[G,X]=ce.useState("project-manager"),[ee,H]=ce.useState("system"),[O,j]=ce.useState(!0),[V,I]=ce.useState("off"),[ne,_e]=ce.useState(()=>l1()),[ge,Q]=ce.useState(null),[q,J]=ce.useState({}),[Y,he]=ce.useState(0),[de,be]=ce.useState(null),[Pe,qe]=ce.useState(!1),[Ke,Ae]=ce.useState(!1),[jt,ht]=ce.useState(""),Lt=ce.useRef({}),it=ce.useRef(null),kt=ce.useRef(""),ae=ce.useMemo(()=>o1(g,k),[g,k]),at=ae?q[ae.taskSlug]??!1:!1,Ze=(ge==null?void 0:ge.taskSlug)===(ae==null?void 0:ae.taskSlug)?ge:null,ue=!!(Ze!=null&&Ze.statusLoaded&&Ze.allRolesHaveSession),Se=!!(ae&&(Ze!=null&&Ze.statusLoaded)&&!Ze.hasAnySession),Ce=ce.useCallback(le=>{H(le.themeMode),j(le.flowPauseAlerts),I(le.permissionRequestMode),_e(le.launchTemplate)},[]),De=ce.useCallback(()=>{it.current!==null&&(window.clearInterval(it.current),it.current=null)},[]),Ne=ce.useCallback((le={})=>{De(),le.resetAudio&&X2(),Ea(),it.current=window.setInterval(()=>{Ea()},ng)},[De]),_t=ce.useCallback(()=>{De(),be(null);let le=1;Ea(),it.current=window.setInterval(()=>{le+=1,Ea(),le>=q2&&it.current!==null&&(window.clearInterval(it.current),it.current=null)},ng)},[De]),Fe=ce.useCallback((le,we=`manual-${Date.now()}`,wt={})=>{be({id:we,text:le}),Ne(wt)},[Ne]),bt=ce.useCallback(()=>{De(),be(null)},[De]),rt=ce.useCallback(()=>{De(),be(null),j(!1)},[De]),Ct=ce.useCallback(le=>{ae!=null&&ae.taskSlug&&T({taskSlug:ae.taskSlug,messages:le})},[ae==null?void 0:ae.taskSlug]),tt=ce.useCallback(le=>{ae!=null&&ae.taskSlug&&R({taskSlug:ae.taskSlug,orchestration:le})},[ae==null?void 0:ae.taskSlug]),ln=ce.useCallback(le=>{ae!=null&&ae.taskSlug&&z({taskSlug:ae.taskSlug,events:le})},[ae==null?void 0:ae.taskSlug]),Yt=ce.useCallback(le=>{if(!(ae!=null&&ae.taskSlug)||le.taskSlug!==ae.taskSlug||(P({taskSlug:le.taskSlug,roundState:le}),le.status!=="stopped"||!le.roundId))return;const we=W2(le);if(Lt.current[le.taskSlug]===we||!O)return;const zt=le.activeRole??"role";Y2(le)>=F2?Fe(`No new turn started after ${zt} stopped.`,we):_t(),Lt.current[le.taskSlug]=we},[ae==null?void 0:ae.taskSlug,O,_t,Fe]),es=ce.useCallback(le=>{Q(we=>(we==null?void 0:we.taskSlug)===le.taskSlug&&we.statusLoaded===le.statusLoaded&&we.sessionCount===le.sessionCount&&we.hasAnySession===le.hasAnySession&&we.allRolesHaveSession===le.allRolesHaveSession&&we.autoOrchestration===le.autoOrchestration&&we.translationEnabled===le.translationEnabled&&JSON.stringify(we.roles)===JSON.stringify(le.roles)?we:le)},[]);async function _n(){const le=await xe.listTasks();return y(le),M(we=>{var wt;return we&&le.some(zt=>zt.taskSlug===we)?we:((wt=le[0])==null?void 0:wt.taskSlug)??null}),le}async function Rn(){const le=await xe.getHarnessStatus();return v(le),le}async function an(){const le=await xe.getHarnessBootstrapStatus();return a(le),le}async function ve(){const le=await xe.getGatewayStatus();return u(le),le}async function Me(){const le=await xe.getRecentRepositoryPaths();return o(le),le}async function Be(le){const[we,wt]=await Promise.all([xe.listMessages(le),xe.getOrchestrationState(le)]);T({taskSlug:le,messages:we}),R({taskSlug:le,orchestration:wt})}async function vn(le){const we=await xe.getCodexReviewState(le);return K({taskSlug:le,state:we}),we}ce.useEffect(()=>{Promise.all([xe.getCurrentProject(),xe.getRecentRepositoryPaths(),xe.getAppPreferences(),xe.getGatewayStatus()]).then(async([le,we,wt,zt])=>{r(le),o(we),u(zt),Ce(wt),le&&await Promise.all([_n(),Rn(),an()])}).catch(le=>ht(le.message))},[Ce]),ce.useEffect(()=>{const le=window.matchMedia("(prefers-color-scheme: dark)"),we=()=>qe(le.matches);return we(),le.addEventListener("change",we),()=>le.removeEventListener("change",we)},[]),ce.useEffect(()=>()=>De(),[De]),ce.useEffect(()=>{const le=ee==="system"?Pe?"dark":"light":ee;document.documentElement.dataset.theme=le,document.documentElement.dataset.themeMode=ee},[Pe,ee]),ce.useEffect(()=>{!(p!=null&&p.enabled)||!O||(rt(),xe.updateAppPreferences({flowPauseAlerts:!1}).then(le=>Ce(le)).catch(le=>ht(le.message)))},[Ce,rt,O,p==null?void 0:p.enabled]),ce.useEffect(()=>{if(!(p!=null&&p.enabled)||!n||!ae)return;const le=`${n.repoRoot}:${ae.taskSlug}`;if(p.currentProjectId===n.repoRoot&&p.currentTaskSlug===ae.taskSlug){kt.current=le;return}kt.current!==le&&(kt.current=le,xe.updateGatewaySettings({currentProjectId:n.repoRoot,currentTaskSlug:ae.taskSlug}).then(we=>u(we)).catch(we=>{kt.current===le&&(kt.current=""),ht(we.message)}))},[ae==null?void 0:ae.taskSlug,p==null?void 0:p.currentProjectId,p==null?void 0:p.currentTaskSlug,p==null?void 0:p.enabled,n==null?void 0:n.repoRoot]),ce.useEffect(()=>{if(!(ae!=null&&ae.taskSlug)){K(null);return}vn(ae.taskSlug).catch(le=>ht(le.message))},[ae==null?void 0:ae.taskSlug]),ce.useEffect(()=>{if(!(ae!=null&&ae.taskSlug))return;const le=ae.taskSlug,we=window.setInterval(()=>{vn(le).catch(wt=>ht(wt.message))},3e3);return()=>window.clearInterval(we)},[ae==null?void 0:ae.taskSlug]);async function He(le){Ae(!0),ht("");try{await le()}catch(we){ht(we instanceof Error?we.message:"Action failed.")}finally{Ae(!1)}}const Fn=D&&D.taskSlug===(ae==null?void 0:ae.taskSlug)?D.messages:[],Mn=E&&E.taskSlug===(ae==null?void 0:ae.taskSlug)?E.orchestration:null,za=N&&N.taskSlug===(ae==null?void 0:ae.taskSlug)?N.events:[],al=F&&F.taskSlug===(ae==null?void 0:ae.taskSlug)?F.roundState:null,sr=$&&$.taskSlug===(ae==null?void 0:ae.taskSlug)?$.state:null,ts=!!(sr&&Object.values(sr.gates).some(le=>le.required));return B.jsxs(a1,{sidebar:B.jsx(B1,{project:n,recentRepositoryPaths:s,tasks:g,activeTaskSlug:(ae==null?void 0:ae.taskSlug)??null,messages:Fn,orchestration:Mn,events:za,roundState:al,codexReview:sr,harnessStatus:d,harnessBootstrapStatus:f,harnessApplyResult:c,gatewayStatus:p,gatewayQrLogin:S,gatewayQrCheck:A,busy:Ke,onConnect:le=>He(async()=>{const we=await xe.connectProject({repoPath:le});r(we),h(null),await Promise.all([_n(),Rn(),an(),Me()])}),onRefreshConnectedRepository:()=>He(async()=>{const le=await xe.getCurrentProject();r(le)}),onPullConnectedRepository:()=>He(async()=>{const le=await xe.pullCurrentProject();r(le)}),onRefreshHarness:()=>He(async()=>{h(null),await Promise.all([Rn(),an()])}),onApplyHarness:()=>He(async()=>{const le=await xe.applyHarness();h(le),await Promise.all([Rn(),an()])}),onStartHarnessBootstrap:()=>He(async()=>{const le=await xe.startHarnessBootstrap();a(le.status)}),onRefreshGateway:()=>He(async()=>{await ve()}),onGatewayEnabledChange:le=>{He(async()=>{const[we,wt]=await Promise.all([xe.updateGatewaySettings({enabled:le,...le&&n?{currentProjectId:n.repoRoot,currentTaskSlug:(ae==null?void 0:ae.taskSlug)??null}:{}}),le?xe.updateAppPreferences({flowPauseAlerts:!1}):Promise.resolve(null)]);wt&&Ce(wt),le&&rt(),u(we)})},onGatewayTranslationChange:le=>{He(async()=>{const we=await xe.updateGatewaySettings({translationEnabled:le});u(we)})},onStartGatewayQrLogin:()=>{He(async()=>{const le=await xe.startGatewayQrLogin();w(le),x(null),_(!0),await ve()})},onResetGatewayBinding:()=>{He(async()=>{const le=await xe.resetGatewayBinding();u(le),w(null),x(null),_(!1)})},onCodexGateEnabledChange:(le,we)=>{He(async()=>{if(!ae)throw new Error("Create or select a task before changing Codex Review Gates.");const wt=await xe.updateCodexReviewSettings(ae.taskSlug,{gates:{[le]:we}});K({taskSlug:ae.taskSlug,state:wt})})},onCreateTask:le=>He(async()=>{const we=await xe.createTask(le);await _n(),M(we.taskSlug),await vn(we.taskSlug)}),onSelectTask:M,themeMode:ee,onThemeModeChange:le=>{H(le),He(async()=>{const we=await xe.updateAppPreferences({themeMode:le});Ce(we)})},flowPauseAlerts:O,onFlowPauseAlertsChange:le=>{if(p!=null&&p.enabled){rt();return}j(le),le&&K2(),He(async()=>{const we=await xe.updateAppPreferences({flowPauseAlerts:le});Ce(we)})},permissionRequestMode:V,onPermissionRequestModeChange:le=>{I(le),He(async()=>{const we=await xe.updateAppPreferences({permissionRequestMode:le});Ce(we)})},launchTemplate:ne,canSaveLaunchTemplate:ue,canOneClickStart:Se,onSaveLaunchTemplate:()=>{He(async()=>{if(!(Ze!=null&&Ze.allRolesHaveSession))throw new Error("Start all four role sessions before saving a launch template.");const le=await xe.updateAppPreferences({launchTemplate:{version:1,roles:Ze.roles,autoOrchestration:Ze.autoOrchestration,translationEnabled:Ze.translationEnabled}});Ce(le)})},onOneClickStart:()=>{He(async()=>{if(!ae)throw new Error("Create or select a task before one-click start.");if((await xe.getTaskStatus(ae.taskSlug)).sessions.length>0)throw new Error("One-click start is only available before any role session has started.");J(zt=>({...zt,[ae.taskSlug]:ne.translationEnabled}));const we=await xe.updateOrchestrationState(ae.taskSlug,{mode:ne.autoOrchestration?"auto":"manual"});R({taskSlug:ae.taskSlug,orchestration:we});const wt=u1(ne,{codexReviewerEnabled:ts});for(const zt of wt)await xe.startRoleSession(ae.taskSlug,zt.role,{cols:100,rows:28,permissionMode:zt.permissionMode,model:zt.model,effort:zt.effort});X("project-manager"),await Be(ae.taskSlug),await _n(),he(zt=>zt+1)})},onTryFlowPauseAlert:()=>{Fe("This is a test flow pause alert.",void 0,{resetAudio:!0})},onMarkAllMessagesDone:le=>{He(async()=>{const we=await xe.markAllMessagesDone(le);T({taskSlug:le,messages:we.messages}),await Be(le)})},onDeleteMessageHistory:le=>{He(async()=>{const we=await xe.deleteMessageHistory(le);T({taskSlug:le,messages:we.messages}),await Be(le)})}}),children:[jt?B.jsx("div",{className:"error-banner",children:jt}):null,de?B.jsx("div",{className:"flow-pause-alert-backdrop",children:B.jsxs("section",{"aria-describedby":"flow-pause-alert-body flow-pause-alert-hint","aria-labelledby":"flow-pause-alert-title","aria-modal":"true",className:"flow-pause-alert",role:"alertdialog",children:[B.jsx("p",{className:"flow-pause-alert-kicker",children:"VCM needs attention"}),B.jsx("h2",{id:"flow-pause-alert-title",children:"Flow needs attention"}),B.jsx("p",{id:"flow-pause-alert-body",children:de.text}),B.jsx("p",{id:"flow-pause-alert-hint",className:"flow-pause-alert-hint",children:"The task may be complete, waiting for your decision, or blocked by a workflow issue."}),B.jsx("button",{type:"button",autoFocus:!0,onClick:bt,children:"Confirm"})]})}):null,b&&S?B.jsx(G2,{busy:Ke,qrCheck:A,qrLogin:S,onCheck:()=>{He(async()=>{const le=await xe.checkGatewayQrLogin();x(le),(le.status==="confirmed"||le.status==="binded_redirect")&&_(!1),await ve()})},onClose:()=>_(!1)}):null,n&&ae?B.jsx(P2,{task:ae,activeRole:G,codexReviewerEnabled:ts,translationEnabled:at,refreshNonce:Y,onTaskChanged:async()=>{await _n()},onActiveRoleChange:X,onTranslationEnabledChange:le=>{J(we=>({...we,[ae.taskSlug]:le}))},onMessagesChanged:Ct,onOrchestrationChanged:tt,onRoundStateChanged:Yt,onEventsChanged:ln,onLaunchStateChanged:es}):B.jsxs("section",{className:"empty-workspace",children:[B.jsx("h1",{children:n?"Create a task to open the workspace":"Connect a repository to begin"}),B.jsx("p",{children:n?"Tasks create local role commands, logs, and handoff artifacts for the selected repository.":"VibeCodingMaster will create a local task workspace, role sessions, logs, and handoff artifacts."})]})]})}function G2({busy:n,onCheck:r,onClose:s,qrCheck:o,qrLogin:d}){const[v,f]=ce.useState(""),[a,c]=ce.useState("");return ce.useEffect(()=>{let h=!1;if(c(""),f(""),d.qrcodeUrl.startsWith("data:image/")){f(d.qrcodeUrl);return}try{const p=Qr(0,"M");p.addData(d.qrcodeUrl),p.make(),h||f(p.createDataURL(8,2))}catch(p){h||c(p instanceof Error?p.message:"Failed to render QR code.")}return()=>{h=!0}},[d.qrcodeUrl]),B.jsx("div",{className:"modal-backdrop",children:B.jsxs("section",{"aria-labelledby":"gateway-qr-title","aria-modal":"true",className:"gateway-qr-modal",role:"dialog",children:[B.jsxs("header",{children:[B.jsxs("div",{children:[B.jsx("h2",{id:"gateway-qr-title",children:"Weixin Gateway Login"}),B.jsx("p",{className:"muted",children:"Scan with Weixin, confirm on the phone, then click Confirm."})]}),B.jsx("button",{type:"button",onClick:s,children:"Close"})]}),B.jsxs("div",{className:"gateway-qr-modal-body",children:[B.jsx("div",{className:"gateway-qr-code-frame",children:v?B.jsx("img",{alt:"Weixin Gateway QR login",src:v}):B.jsx("div",{className:"gateway-qr-placeholder",children:a||"Rendering QR code..."})}),B.jsxs("dl",{className:"gateway-qr-meta",children:[B.jsxs("div",{children:[B.jsx("dt",{children:"Status"}),B.jsx("dd",{children:(o==null?void 0:o.status)??d.status})]}),B.jsxs("div",{children:[B.jsx("dt",{children:"Expires"}),B.jsx("dd",{children:$2(d.expiresAt)})]}),o!=null&&o.message?B.jsxs("div",{children:[B.jsx("dt",{children:"Message"}),B.jsx("dd",{children:o.message})]}):null]})]}),B.jsx("footer",{children:B.jsx("button",{type:"button",disabled:n,onClick:r,children:"Confirm"})})]})})}function $2(n){const r=new Date(n);return Number.isNaN(r.getTime())?"-":new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(r)}let zi=null;function Y2(n){const r=Date.parse(n.startedAt??""),s=Date.parse(n.stoppedAt??n.lastTurnEndedAt??"");return!Number.isFinite(r)||!Number.isFinite(s)?0:Math.max(0,s-r)}function W2(n){const r=n.roundId??n.startedAt??n.taskSlug,s=n.stoppedAt??n.lastTurnEndedAt??"stopped";return`${r}:${s}`}async function K2(){const n=x_();return n?E_(n):!1}async function Ea(){const n=x_();if(!n||!await E_(n))return!1;try{const s=n.createGain(),o=n.currentTime+.025;return s.gain.setValueAtTime(.85,n.currentTime),s.connect(n.destination),rg(n,s,{frequency:587.33,startAt:o,duration:.18,peakGain:.045}),rg(n,s,{frequency:783.99,startAt:o+.11,duration:.28,peakGain:.055}),window.setTimeout(()=>{s.disconnect()},800),!0}catch{return!1}}function x_(){const n=window.AudioContext??window.webkitAudioContext;if(!n)return null;try{return(!zi||zi.state==="closed")&&(zi=new n),zi}catch{return null}}function X2(){Lu(zi)}function Lu(n){zi=null,n&&n.state!=="closed"&&n.close().catch(()=>{})}async function E_(n){if(ig(n))return!0;try{await n.resume();const r=ig(n);return!r&&n===zi&&Lu(n),r}catch{return n===zi&&Lu(n),!1}}function ig(n){return n.state==="running"}function rg(n,r,s){const o=n.createGain(),d=n.createOscillator(),v=n.createOscillator(),f=s.startAt+s.duration;o.gain.setValueAtTime(1e-4,s.startAt),o.gain.exponentialRampToValueAtTime(s.peakGain,s.startAt+.018),o.gain.exponentialRampToValueAtTime(1e-4,f),d.type="sine",d.frequency.setValueAtTime(s.frequency,s.startAt),v.type="triangle",v.frequency.setValueAtTime(s.frequency*2.01,s.startAt),d.connect(o),v.connect(o),o.connect(r),d.start(s.startAt),v.start(s.startAt),d.stop(f+.02),v.stop(f+.02)}const k_=document.getElementById("root");if(!k_)throw new Error("Missing #root element.");K0.createRoot(k_).render(B.jsx(ce.StrictMode,{children:B.jsx(V2,{})}));
|
|
92
|
+
`);if(window.confirm(J)){D(!0),E("");try{await xe.cleanupTask(n.taskSlug,{force:!0,deleteBranch:!!n.worktreePath,forceDeleteBranch:!0}),ne(`closed ${n.taskSlug}`),await v()}catch(he){E(he instanceof Error?he.message:"Close task failed.")}finally{D(!1)}}}function ne(J){B(Y=>{const he=[...Y,`${new Date().toLocaleTimeString()} ${J}`];return u==null||u(he),he})}function _e(J,Y){b(he=>({...he,[J]:Y}))}function me(J,Y){g(he=>({...he,[J]:Y}))}function Q(J,Y){k(he=>({...he,[J]:Y}))}async function q(J){D(!0),E("");try{const Y=await xe.updateOrchestrationState(n.taskSlug,{mode:J});P(Y),h==null||h(Y),ne(`auto orchestration ${J==="auto"?"enabled":"disabled"}`)}catch(Y){E(Y instanceof Error?Y.message:"Failed to update orchestration mode.")}finally{D(!1)}}return N.jsxs("div",{className:"task-workspace",children:[N.jsxs("header",{className:"workspace-header",children:[N.jsx("div",{className:"workspace-title-line",children:N.jsx("h1",{children:n.title||n.taskSlug})}),N.jsx(Y1,{activeRole:r,roles:te,sessions:(C==null?void 0:C.sessions)??[],onSelect:f}),N.jsxs("div",{className:"workspace-header-actions",children:[N.jsx("button",{"aria-pressed":o,className:`translation-toggle${o?" is-active":""}`,type:"button",onClick:()=>a(!o),children:o?"✅ Translate":"× Translate"}),N.jsx("button",{className:"danger-button",type:"button",disabled:M,onClick:()=>void I(),children:"Close Task"})]})]}),T?N.jsx("div",{className:"error-banner",children:T}):null,N.jsx("div",{className:"workspace-grid",children:N.jsx("div",{className:"workspace-main",children:N.jsx("div",{className:"role-console-stack",children:te.map(J=>{const Y=J.name,he=Y===r,de=pg((C==null?void 0:C.sessions)??[],Y);return N.jsx("div",{className:he?"role-console-panel is-active":"role-console-panel","aria-hidden":!he,children:N.jsx(z2,{role:Y,session:de,permissionMode:x[Y],model:_[Y],effort:y[Y],active:he,busy:M,orchestrationMode:(H==null?void 0:H.mode)??"auto",translationEnabled:o,onPermissionModeChange:be=>_e(Y,be),onModelChange:be=>me(Y,be),onEffortChange:be=>Q(Y,be),onOrchestrationModeChange:be=>void q(be),onStart:()=>void V(async()=>{await xe.startRoleSession(n.taskSlug,Y,{cols:100,rows:28,permissionMode:x[Y],model:_[Y],effort:y[Y]}),ne(`started ${Y} with ${x[Y]} / ${_[Y]} / ${y[Y]}`)}),onResume:()=>void V(async()=>{await xe.resumeRoleSession(n.taskSlug,Y,{cols:100,rows:28,permissionMode:x[Y],model:_[Y],effort:y[Y]}),ne(`resumed ${Y} with ${x[Y]} / ${_[Y]} / ${y[Y]}`)}),onStop:()=>void V(async()=>{await xe.stopRoleSession(n.taskSlug,Y),ne(`stopped ${Y}`)}),onRestart:()=>void V(async()=>{await xe.restartRoleSession(n.taskSlug,Y,{cols:100,rows:28,permissionMode:x[Y],model:_[Y],effort:y[Y]}),ne(`restarted ${Y} with ${x[Y]} / ${_[Y]} / ${y[Y]}`)}),onTerminalEvent:be=>ne(`${J.label}: ${be}`)})},Y)})})})})]})}const q2=120*1e3,ig=1400,V2=3;function G2(){const[n,r]=ce.useState(null),[s,o]=ce.useState([]),[d,v]=ce.useState(null),[f,a]=ce.useState(null),[c,h]=ce.useState(null),[p,u]=ce.useState(null),[S,C]=ce.useState(null),[A,x]=ce.useState(null),[b,_]=ce.useState(!1),[g,y]=ce.useState([]),[k,M]=ce.useState(null),[D,T]=ce.useState(null),[E,R]=ce.useState(null),[B,H]=ce.useState(null),[P,F]=ce.useState(null),[$,W]=ce.useState(null),[G,X]=ce.useState("project-manager"),[te,z]=ce.useState("system"),[O,j]=ce.useState(!0),[V,I]=ce.useState("off"),[ne,_e]=ce.useState(()=>a1()),[me,Q]=ce.useState(null),[q,J]=ce.useState({}),[Y,he]=ce.useState(0),[de,be]=ce.useState(null),[Pe,Fe]=ce.useState(!1),[We,De]=ce.useState(!1),[Rt,ot]=ce.useState(""),Tt=ce.useRef({}),nt=ce.useRef(null),Mt=ce.useRef(""),ae=ce.useMemo(()=>c1(g,k),[g,k]),tt=ae?q[ae.taskSlug]??!1:!1,Je=(me==null?void 0:me.taskSlug)===(ae==null?void 0:ae.taskSlug)?me:null,ue=!!(Je!=null&&Je.statusLoaded&&Je.allRolesHaveSession),Se=!!(ae&&(Je!=null&&Je.statusLoaded)&&!Je.hasAnySession),we=ce.useCallback(le=>{z(le.themeMode),j(le.flowPauseAlerts),I(le.permissionRequestMode),_e(le.launchTemplate)},[]),Me=ce.useCallback(()=>{nt.current!==null&&(window.clearInterval(nt.current),nt.current=null)},[]),je=ce.useCallback((le={})=>{Me(),le.resetAudio&&Q2(),xa(),nt.current=window.setInterval(()=>{xa()},ig)},[Me]),ht=ce.useCallback(()=>{Me(),be(null);let le=1;xa(),nt.current=window.setInterval(()=>{le+=1,xa(),le>=V2&&nt.current!==null&&(window.clearInterval(nt.current),nt.current=null)},ig)},[Me]),ve=ce.useCallback((le,Ce=`manual-${Date.now()}`,St={})=>{be({id:Ce,text:le}),je(St)},[je]),ke=ce.useCallback(()=>{Me(),be(null)},[Me]),Re=ce.useCallback(()=>{Me(),be(null),j(!1)},[Me]),yt=ce.useCallback(le=>{ae!=null&&ae.taskSlug&&T({taskSlug:ae.taskSlug,messages:le})},[ae==null?void 0:ae.taskSlug]),Ne=ce.useCallback(le=>{ae!=null&&ae.taskSlug&&R({taskSlug:ae.taskSlug,orchestration:le})},[ae==null?void 0:ae.taskSlug]),Yt=ce.useCallback(le=>{ae!=null&&ae.taskSlug&&H({taskSlug:ae.taskSlug,events:le})},[ae==null?void 0:ae.taskSlug]),Bt=ce.useCallback(le=>{if(!(ae!=null&&ae.taskSlug)||le.taskSlug!==ae.taskSlug||(F({taskSlug:le.taskSlug,roundState:le}),le.status!=="stopped"||!le.roundId))return;const Ce=K2(le);if(Tt.current[le.taskSlug]===Ce||!O)return;const Nt=le.activeRole??"role";W2(le)>=q2?ve(`No new turn started after ${Nt} stopped.`,Ce):ht(),Tt.current[le.taskSlug]=Ce},[ae==null?void 0:ae.taskSlug,O,ht,ve]),ja=ce.useCallback(le=>{Q(Ce=>(Ce==null?void 0:Ce.taskSlug)===le.taskSlug&&Ce.statusLoaded===le.statusLoaded&&Ce.sessionCount===le.sessionCount&&Ce.hasAnySession===le.hasAnySession&&Ce.allRolesHaveSession===le.allRolesHaveSession&&Ce.autoOrchestration===le.autoOrchestration&&Ce.translationEnabled===le.translationEnabled&&JSON.stringify(Ce.roles)===JSON.stringify(le.roles)?Ce:le)},[]);async function Dn(){const le=await xe.listTasks();return y(le),M(Ce=>{var St;return Ce&&le.some(Nt=>Nt.taskSlug===Ce)?Ce:((St=le[0])==null?void 0:St.taskSlug)??null}),le}async function jn(){const le=await xe.getHarnessStatus();return v(le),le}async function zn(){const le=await xe.getHarnessBootstrapStatus();return a(le),le}async function xn(){const le=await xe.getGatewayStatus();return u(le),le}async function nr(){const le=await xe.getRecentRepositoryPaths();return o(le),le}async function Hn(le){const[Ce,St]=await Promise.all([xe.listMessages(le),xe.getOrchestrationState(le)]);T({taskSlug:le,messages:Ce}),R({taskSlug:le,orchestration:St})}async function Zr(le){const Ce=await xe.getCodexReviewState(le);return W({taskSlug:le,state:Ce}),Ce}ce.useEffect(()=>{Promise.all([xe.getCurrentProject(),xe.getRecentRepositoryPaths(),xe.getAppPreferences(),xe.getGatewayStatus()]).then(async([le,Ce,St,Nt])=>{r(le),o(Ce),u(Nt),we(St),le&&await Promise.all([Dn(),jn(),zn()])}).catch(le=>ot(le.message))},[we]),ce.useEffect(()=>{const le=window.matchMedia("(prefers-color-scheme: dark)"),Ce=()=>Fe(le.matches);return Ce(),le.addEventListener("change",Ce),()=>le.removeEventListener("change",Ce)},[]),ce.useEffect(()=>()=>Me(),[Me]),ce.useEffect(()=>{const le=te==="system"?Pe?"dark":"light":te;document.documentElement.dataset.theme=le,document.documentElement.dataset.themeMode=te},[Pe,te]),ce.useEffect(()=>{!(p!=null&&p.enabled)||!O||(Re(),xe.updateAppPreferences({flowPauseAlerts:!1}).then(le=>we(le)).catch(le=>ot(le.message)))},[we,Re,O,p==null?void 0:p.enabled]),ce.useEffect(()=>{if(!(p!=null&&p.enabled)||!n||!ae)return;const le=`${n.repoRoot}:${ae.taskSlug}`;if(p.currentProjectId===n.repoRoot&&p.currentTaskSlug===ae.taskSlug){Mt.current=le;return}Mt.current!==le&&(Mt.current=le,xe.updateGatewaySettings({currentProjectId:n.repoRoot,currentTaskSlug:ae.taskSlug}).then(Ce=>u(Ce)).catch(Ce=>{Mt.current===le&&(Mt.current=""),ot(Ce.message)}))},[ae==null?void 0:ae.taskSlug,p==null?void 0:p.currentProjectId,p==null?void 0:p.currentTaskSlug,p==null?void 0:p.enabled,n==null?void 0:n.repoRoot]),ce.useEffect(()=>{if(!(ae!=null&&ae.taskSlug)){W(null);return}Zr(ae.taskSlug).catch(le=>ot(le.message))},[ae==null?void 0:ae.taskSlug]),ce.useEffect(()=>{if(!(ae!=null&&ae.taskSlug))return;const le=ae.taskSlug,Ce=window.setInterval(()=>{Zr(le).catch(St=>ot(St.message))},3e3);return()=>window.clearInterval(Ce)},[ae==null?void 0:ae.taskSlug]);async function mt(le){De(!0),ot("");try{await le()}catch(Ce){ot(Ce instanceof Error?Ce.message:"Action failed.")}finally{De(!1)}}const Jr=D&&D.taskSlug===(ae==null?void 0:ae.taskSlug)?D.messages:[],Ni=E&&E.taskSlug===(ae==null?void 0:ae.taskSlug)?E.orchestration:null,za=B&&B.taskSlug===(ae==null?void 0:ae.taskSlug)?B.events:[],ll=P&&P.taskSlug===(ae==null?void 0:ae.taskSlug)?P.roundState:null,ir=$&&$.taskSlug===(ae==null?void 0:ae.taskSlug)?$.state:null,es=!!(ir&&Object.values(ir.gates).some(le=>le.required));return N.jsxs(o1,{sidebar:N.jsx(N1,{project:n,recentRepositoryPaths:s,tasks:g,activeTaskSlug:(ae==null?void 0:ae.taskSlug)??null,messages:Jr,orchestration:Ni,events:za,roundState:ll,codexReview:ir,harnessStatus:d,harnessBootstrapStatus:f,harnessApplyResult:c,gatewayStatus:p,gatewayQrLogin:S,gatewayQrCheck:A,busy:We,onConnect:le=>mt(async()=>{const Ce=await xe.connectProject({repoPath:le});r(Ce),h(null),await Promise.all([Dn(),jn(),zn(),nr()])}),onRefreshConnectedRepository:()=>mt(async()=>{const le=await xe.getCurrentProject();r(le)}),onPullConnectedRepository:()=>mt(async()=>{const le=await xe.pullCurrentProject();r(le)}),onRefreshHarness:()=>mt(async()=>{h(null),await Promise.all([jn(),zn()])}),onApplyHarness:()=>mt(async()=>{const le=await xe.applyHarness();h(le),await Promise.all([jn(),zn()])}),onStartHarnessBootstrap:()=>mt(async()=>{const le=await xe.startHarnessBootstrap();a(le.status)}),onRefreshGateway:()=>mt(async()=>{await xn()}),onGatewayEnabledChange:le=>{mt(async()=>{const[Ce,St]=await Promise.all([xe.updateGatewaySettings({enabled:le,...le&&n?{currentProjectId:n.repoRoot,currentTaskSlug:(ae==null?void 0:ae.taskSlug)??null}:{}}),le?xe.updateAppPreferences({flowPauseAlerts:!1}):Promise.resolve(null)]);St&&we(St),le&&Re(),u(Ce)})},onGatewayTranslationChange:le=>{mt(async()=>{const Ce=await xe.updateGatewaySettings({translationEnabled:le});u(Ce)})},onStartGatewayQrLogin:()=>{mt(async()=>{const le=await xe.startGatewayQrLogin();C(le),x(null),_(!0),await xn()})},onResetGatewayBinding:()=>{mt(async()=>{const le=await xe.resetGatewayBinding();u(le),C(null),x(null),_(!1)})},onCodexGateEnabledChange:(le,Ce)=>{mt(async()=>{if(!ae)throw new Error("Create or select a task before changing Codex Review Gates.");const St=await xe.updateCodexReviewSettings(ae.taskSlug,{gates:{[le]:Ce}});W({taskSlug:ae.taskSlug,state:St})})},onCreateTask:le=>mt(async()=>{const Ce=await xe.createTask(le);await Dn(),M(Ce.taskSlug),await Zr(Ce.taskSlug)}),onSelectTask:M,themeMode:te,onThemeModeChange:le=>{z(le),mt(async()=>{const Ce=await xe.updateAppPreferences({themeMode:le});we(Ce)})},flowPauseAlerts:O,onFlowPauseAlertsChange:le=>{if(p!=null&&p.enabled){Re();return}j(le),le&&X2(),mt(async()=>{const Ce=await xe.updateAppPreferences({flowPauseAlerts:le});we(Ce)})},permissionRequestMode:V,onPermissionRequestModeChange:le=>{I(le),mt(async()=>{const Ce=await xe.updateAppPreferences({permissionRequestMode:le});we(Ce)})},launchTemplate:ne,canSaveLaunchTemplate:ue,canOneClickStart:Se,onSaveLaunchTemplate:()=>{mt(async()=>{if(!(Je!=null&&Je.allRolesHaveSession))throw new Error("Start all four role sessions before saving a launch template.");const le=await xe.updateAppPreferences({launchTemplate:{version:1,roles:Je.roles,autoOrchestration:Je.autoOrchestration,translationEnabled:Je.translationEnabled}});we(le)})},onOneClickStart:()=>{mt(async()=>{if(!ae)throw new Error("Create or select a task before one-click start.");if((await xe.getTaskStatus(ae.taskSlug)).sessions.length>0)throw new Error("One-click start is only available before any role session has started.");J(Nt=>({...Nt,[ae.taskSlug]:ne.translationEnabled}));const Ce=await xe.updateOrchestrationState(ae.taskSlug,{mode:ne.autoOrchestration?"auto":"manual"});R({taskSlug:ae.taskSlug,orchestration:Ce});const St=h1(ne,{codexReviewerEnabled:es});for(const Nt of St)await xe.startRoleSession(ae.taskSlug,Nt.role,{cols:100,rows:28,permissionMode:Nt.permissionMode,model:Nt.model,effort:Nt.effort});X("project-manager"),await Hn(ae.taskSlug),await Dn(),he(Nt=>Nt+1)})},onTryFlowPauseAlert:()=>{ve("This is a test flow pause alert.",void 0,{resetAudio:!0})},onMarkAllMessagesDone:le=>{mt(async()=>{const Ce=await xe.markAllMessagesDone(le);T({taskSlug:le,messages:Ce.messages}),await Hn(le)})},onDeleteMessageHistory:le=>{mt(async()=>{const Ce=await xe.deleteMessageHistory(le);T({taskSlug:le,messages:Ce.messages}),await Hn(le)})}}),children:[Rt?N.jsx("div",{className:"error-banner",children:Rt}):null,de?N.jsx("div",{className:"flow-pause-alert-backdrop",children:N.jsxs("section",{"aria-describedby":"flow-pause-alert-body flow-pause-alert-hint","aria-labelledby":"flow-pause-alert-title","aria-modal":"true",className:"flow-pause-alert",role:"alertdialog",children:[N.jsx("p",{className:"flow-pause-alert-kicker",children:"VCM needs attention"}),N.jsx("h2",{id:"flow-pause-alert-title",children:"Flow needs attention"}),N.jsx("p",{id:"flow-pause-alert-body",children:de.text}),N.jsx("p",{id:"flow-pause-alert-hint",className:"flow-pause-alert-hint",children:"The task may be complete, waiting for your decision, or blocked by a workflow issue."}),N.jsx("button",{type:"button",autoFocus:!0,onClick:ke,children:"Confirm"})]})}):null,b&&S?N.jsx($2,{busy:We,qrCheck:A,qrLogin:S,onCheck:()=>{mt(async()=>{const le=await xe.checkGatewayQrLogin();x(le),(le.status==="confirmed"||le.status==="binded_redirect")&&_(!1),await xn()})},onClose:()=>_(!1)}):null,n&&ae?N.jsx(F2,{task:ae,activeRole:G,codexReviewerEnabled:es,translationEnabled:tt,refreshNonce:Y,onTaskChanged:async()=>{await Dn()},onActiveRoleChange:X,onTranslationEnabledChange:le=>{J(Ce=>({...Ce,[ae.taskSlug]:le}))},onMessagesChanged:yt,onOrchestrationChanged:Ne,onRoundStateChanged:Bt,onEventsChanged:Yt,onLaunchStateChanged:ja}):N.jsxs("section",{className:"empty-workspace",children:[N.jsx("h1",{children:n?"Create a task to open the workspace":"Connect a repository to begin"}),N.jsx("p",{children:n?"Tasks create local role commands, logs, and handoff artifacts for the selected repository.":"VibeCodingMaster will create a local task workspace, role sessions, logs, and handoff artifacts."})]})]})}function $2({busy:n,onCheck:r,onClose:s,qrCheck:o,qrLogin:d}){const[v,f]=ce.useState(""),[a,c]=ce.useState("");return ce.useEffect(()=>{let h=!1;if(c(""),f(""),d.qrcodeUrl.startsWith("data:image/")){f(d.qrcodeUrl);return}try{const p=Kr(0,"M");p.addData(d.qrcodeUrl),p.make(),h||f(p.createDataURL(8,2))}catch(p){h||c(p instanceof Error?p.message:"Failed to render QR code.")}return()=>{h=!0}},[d.qrcodeUrl]),N.jsx("div",{className:"modal-backdrop",children:N.jsxs("section",{"aria-labelledby":"gateway-qr-title","aria-modal":"true",className:"gateway-qr-modal",role:"dialog",children:[N.jsxs("header",{children:[N.jsxs("div",{children:[N.jsx("h2",{id:"gateway-qr-title",children:"Weixin Gateway Login"}),N.jsx("p",{className:"muted",children:"Scan with Weixin, confirm on the phone, then click Confirm."})]}),N.jsx("button",{type:"button",onClick:s,children:"Close"})]}),N.jsxs("div",{className:"gateway-qr-modal-body",children:[N.jsx("div",{className:"gateway-qr-code-frame",children:v?N.jsx("img",{alt:"Weixin Gateway QR login",src:v}):N.jsx("div",{className:"gateway-qr-placeholder",children:a||"Rendering QR code..."})}),N.jsxs("dl",{className:"gateway-qr-meta",children:[N.jsxs("div",{children:[N.jsx("dt",{children:"Status"}),N.jsx("dd",{children:(o==null?void 0:o.status)??d.status})]}),N.jsxs("div",{children:[N.jsx("dt",{children:"Expires"}),N.jsx("dd",{children:Y2(d.expiresAt)})]}),o!=null&&o.message?N.jsxs("div",{children:[N.jsx("dt",{children:"Message"}),N.jsx("dd",{children:o.message})]}):null]})]}),N.jsx("footer",{children:N.jsx("button",{type:"button",disabled:n,onClick:r,children:"Confirm"})})]})})}function Y2(n){const r=new Date(n);return Number.isNaN(r.getTime())?"-":new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(r)}let Oi=null;function W2(n){const r=Date.parse(n.startedAt??""),s=Date.parse(n.stoppedAt??n.lastTurnEndedAt??"");return!Number.isFinite(r)||!Number.isFinite(s)?0:Math.max(0,s-r)}function K2(n){const r=n.roundId??n.startedAt??n.taskSlug,s=n.stoppedAt??n.lastTurnEndedAt??"stopped";return`${r}:${s}`}async function X2(){const n=E_();return n?k_(n):!1}async function xa(){const n=E_();if(!n||!await k_(n))return!1;try{const s=n.createGain(),o=n.currentTime+.025;return s.gain.setValueAtTime(.85,n.currentTime),s.connect(n.destination),sg(n,s,{frequency:587.33,startAt:o,duration:.18,peakGain:.045}),sg(n,s,{frequency:783.99,startAt:o+.11,duration:.28,peakGain:.055}),window.setTimeout(()=>{s.disconnect()},800),!0}catch{return!1}}function E_(){const n=window.AudioContext??window.webkitAudioContext;if(!n)return null;try{return(!Oi||Oi.state==="closed")&&(Oi=new n),Oi}catch{return null}}function Q2(){Lu(Oi)}function Lu(n){Oi=null,n&&n.state!=="closed"&&n.close().catch(()=>{})}async function k_(n){if(rg(n))return!0;try{await n.resume();const r=rg(n);return!r&&n===Oi&&Lu(n),r}catch{return n===Oi&&Lu(n),!1}}function rg(n){return n.state==="running"}function sg(n,r,s){const o=n.createGain(),d=n.createOscillator(),v=n.createOscillator(),f=s.startAt+s.duration;o.gain.setValueAtTime(1e-4,s.startAt),o.gain.exponentialRampToValueAtTime(s.peakGain,s.startAt+.018),o.gain.exponentialRampToValueAtTime(1e-4,f),d.type="sine",d.frequency.setValueAtTime(s.frequency,s.startAt),v.type="triangle",v.frequency.setValueAtTime(s.frequency*2.01,s.startAt),d.connect(o),v.connect(o),o.connect(r),d.start(s.startAt),v.start(s.startAt),d.stop(f+.02),v.stop(f+.02)}const A_=document.getElementById("root");if(!A_)throw new Error("Missing #root element.");X0.createRoot(A_).render(N.jsx(ce.StrictMode,{children:N.jsx(G2,{})}));
|