vibe-coding-master 0.6.11 → 0.6.13
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/dist/backend/adapters/git-adapter.js +44 -0
- package/dist/backend/gateway/gateway-service.js +6 -2
- package/dist/backend/services/session-service.js +99 -16
- package/dist/backend/services/task-service.js +72 -7
- package/dist-frontend/assets/{index-DIfaGVNJ.js → index-Cf5EOrjk.js} +46 -46
- package/dist-frontend/assets/index-sTAVWdNl.css +32 -0
- package/dist-frontend/index.html +2 -2
- package/package.json +1 -1
- package/dist-frontend/assets/index-D6vwKigt.css +0 -32
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var D0=Object.defineProperty;var M0=(n,r,s)=>r in n?D0(n,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[r]=s;var Em=(n,r,s)=>M0(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"]'))l(d);new MutationObserver(d=>{for(const p of d)if(p.type==="childList")for(const f of p.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function s(d){const p={};return d.integrity&&(p.integrity=d.integrity),d.referrerPolicy&&(p.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?p.credentials="include":d.crossOrigin==="anonymous"?p.credentials="omit":p.credentials="same-origin",p}function l(d){if(d.ep)return;d.ep=!0;const p=s(d);fetch(d.href,p)}})();function Qg(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Hu={exports:{}},Ba={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@ var R0=Object.defineProperty;var D0=(n,r,s)=>r in n?R0(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 km;function
|
|
9
|
+
*/var km;function L0(){if(km)return Ba;km=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(l,d,p){var f=null;if(p!==void 0&&(f=""+p),d.key!==void 0&&(f=""+d.key),"key"in d){p={};for(var o in d)o!=="key"&&(p[o]=d[o])}else p=d;return d=p.ref,{$$typeof:n,type:l,key:f,ref:d!==void 0?d:null,props:p}}return Ba.Fragment=r,Ba.jsx=s,Ba.jsxs=s,Ba}var Am;function O0(){return Am||(Am=1,Hu.exports=L0()),Hu.exports}var x=O0(),zu={exports:{}},Be={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react.production.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ var R0=Object.defineProperty;var D0=(n,r,s)=>r in n?R0(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 Tm;function
|
|
17
|
+
*/var Tm;function B0(){if(Tm)return Be;Tm=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),f=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),u=Symbol.for("react.activity"),y=Symbol.iterator;function w(N){return N===null||typeof N!="object"?null:(N=y&&N[y]||N["@@iterator"],typeof N=="function"?N:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,S={};function v(N,$,I){this.props=N,this.context=$,this.refs=S,this.updater=I||T}v.prototype.isReactComponent={},v.prototype.setState=function(N,$){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,$,"setState")},v.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function _(){}_.prototype=v.prototype;function b(N,$,I){this.props=N,this.context=$,this.refs=S,this.updater=I||T}var A=b.prototype=new _;A.constructor=b,E(A,v.prototype),A.isPureReactComponent=!0;var L=Array.isArray;function D(){}var R={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function M(N,$,I){var re=I.ref;return{$$typeof:n,type:N,key:$,ref:re!==void 0?re:null,props:I}}function B(N,$){return M(N.type,$,N.props)}function H(N){return typeof N=="object"&&N!==null&&N.$$typeof===n}function U(N){var $={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(I){return $[I]})}var P=/\/+/g;function K(N,$){return typeof N=="object"&&N!==null&&N.key!=null?U(""+N.key):$.toString(36)}function Y(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(D,D):(N.status="pending",N.then(function($){N.status==="pending"&&(N.status="fulfilled",N.value=$)},function($){N.status==="pending"&&(N.status="rejected",N.reason=$)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function G(N,$,I,re,ve){var me=typeof N;(me==="undefined"||me==="boolean")&&(N=null);var Q=!1;if(N===null)Q=!0;else switch(me){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(N.$$typeof){case n:case r:Q=!0;break;case g:return Q=N._init,G(Q(N._payload),$,I,re,ve)}}if(Q)return ve=ve(N),Q=re===""?"."+K(N,0):re,L(ve)?(I="",Q!=null&&(I=Q.replace(P,"$&/")+"/"),G(ve,$,I,"",function(ae){return ae})):ve!=null&&(H(ve)&&(ve=B(ve,I+(ve.key==null||N&&N.key===ve.key?"":(""+ve.key).replace(P,"$&/")+"/")+Q)),$.push(ve)),1;Q=0;var q=re===""?".":re+":";if(L(N))for(var te=0;te<N.length;te++)re=N[te],me=q+K(re,te),Q+=G(re,$,I,me,ve);else if(te=w(N),typeof te=="function")for(N=te.call(N),te=0;!(re=N.next()).done;)re=re.value,me=q+K(re,te++),Q+=G(re,$,I,me,ve);else if(me==="object"){if(typeof N.then=="function")return G(Y(N),$,I,re,ve);throw $=String(N),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return Q}function W(N,$,I){if(N==null)return N;var re=[],ve=0;return G(N,re,"","",function(me){return $.call(I,me,ve++)}),re}function Z(N){if(N._status===-1){var $=N._result;$=$(),$.then(function(I){(N._status===0||N._status===-1)&&(N._status=1,N._result=I)},function(I){(N._status===0||N._status===-1)&&(N._status=2,N._result=I)}),N._status===-1&&(N._status=0,N._result=$)}if(N._status===1)return N._result.default;throw N._result}var z=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},j={map:W,forEach:function(N,$,I){W(N,function(){$.apply(this,arguments)},I)},count:function(N){var $=0;return W(N,function(){$++}),$},toArray:function(N){return W(N,function($){return $})||[]},only:function(N){if(!H(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Be.Activity=u,Be.Children=j,Be.Component=v,Be.Fragment=s,Be.Profiler=d,Be.PureComponent=b,Be.StrictMode=l,Be.Suspense=c,Be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,Be.__COMPILER_RUNTIME={__proto__:null,c:function(N){return R.H.useMemoCache(N)}},Be.cache=function(N){return function(){return N.apply(null,arguments)}},Be.cacheSignal=function(){return null},Be.cloneElement=function(N,$,I){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var re=E({},N.props),ve=N.key;if($!=null)for(me in $.key!==void 0&&(ve=""+$.key),$)!k.call($,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&$.ref===void 0||(re[me]=$[me]);var me=arguments.length-2;if(me===1)re.children=I;else if(1<me){for(var Q=Array(me),q=0;q<me;q++)Q[q]=arguments[q+2];re.children=Q}return M(N.type,ve,re)},Be.createContext=function(N){return N={$$typeof:f,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:p,_context:N},N},Be.createElement=function(N,$,I){var re,ve={},me=null;if($!=null)for(re in $.key!==void 0&&(me=""+$.key),$)k.call($,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(ve[re]=$[re]);var Q=arguments.length-2;if(Q===1)ve.children=I;else if(1<Q){for(var q=Array(Q),te=0;te<Q;te++)q[te]=arguments[te+2];ve.children=q}if(N&&N.defaultProps)for(re in Q=N.defaultProps,Q)ve[re]===void 0&&(ve[re]=Q[re]);return M(N,me,ve)},Be.createRef=function(){return{current:null}},Be.forwardRef=function(N){return{$$typeof:o,render:N}},Be.isValidElement=H,Be.lazy=function(N){return{$$typeof:g,_payload:{_status:-1,_result:N},_init:Z}},Be.memo=function(N,$){return{$$typeof:h,type:N,compare:$===void 0?null:$}},Be.startTransition=function(N){var $=R.T,I={};R.T=I;try{var re=N(),ve=R.S;ve!==null&&ve(I,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(D,z)}catch(me){z(me)}finally{$!==null&&I.types!==null&&($.types=I.types),R.T=$}},Be.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},Be.use=function(N){return R.H.use(N)},Be.useActionState=function(N,$,I){return R.H.useActionState(N,$,I)},Be.useCallback=function(N,$){return R.H.useCallback(N,$)},Be.useContext=function(N){return R.H.useContext(N)},Be.useDebugValue=function(){},Be.useDeferredValue=function(N,$){return R.H.useDeferredValue(N,$)},Be.useEffect=function(N,$){return R.H.useEffect(N,$)},Be.useEffectEvent=function(N){return R.H.useEffectEvent(N)},Be.useId=function(){return R.H.useId()},Be.useImperativeHandle=function(N,$,I){return R.H.useImperativeHandle(N,$,I)},Be.useInsertionEffect=function(N,$){return R.H.useInsertionEffect(N,$)},Be.useLayoutEffect=function(N,$){return R.H.useLayoutEffect(N,$)},Be.useMemo=function(N,$){return R.H.useMemo(N,$)},Be.useOptimistic=function(N,$){return R.H.useOptimistic(N,$)},Be.useReducer=function(N,$,I){return R.H.useReducer(N,$,I)},Be.useRef=function(N){return R.H.useRef(N)},Be.useState=function(N){return R.H.useState(N)},Be.useSyncExternalStore=function(N,$,I){return R.H.useSyncExternalStore(N,$,I)},Be.useTransition=function(){return R.H.useTransition()},Be.version="19.2.6",Be}var Rm;function Rh(){return Rm||(Rm=1,zu.exports=B0()),zu.exports}var ee=Rh(),Iu={exports:{}},ja={},Uu={exports:{}},Pu={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ var R0=Object.defineProperty;var D0=(n,r,s)=>r in n?R0(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 Dm;function
|
|
25
|
+
*/var Dm;function j0(){return Dm||(Dm=1,(function(n){function r(G,W){var Z=G.length;G.push(W);e:for(;0<Z;){var z=Z-1>>>1,j=G[z];if(0<d(j,W))G[z]=W,G[Z]=j,Z=z;else break e}}function s(G){return G.length===0?null:G[0]}function l(G){if(G.length===0)return null;var W=G[0],Z=G.pop();if(Z!==W){G[0]=Z;e:for(var z=0,j=G.length,N=j>>>1;z<N;){var $=2*(z+1)-1,I=G[$],re=$+1,ve=G[re];if(0>d(I,Z))re<j&&0>d(ve,I)?(G[z]=ve,G[re]=Z,z=re):(G[z]=I,G[$]=Z,z=$);else if(re<j&&0>d(ve,Z))G[z]=ve,G[re]=Z,z=re;else break e}}return W}function d(G,W){var Z=G.sortIndex-W.sortIndex;return Z!==0?Z:G.id-W.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var p=performance;n.unstable_now=function(){return p.now()}}else{var f=Date,o=f.now();n.unstable_now=function(){return f.now()-o}}var c=[],h=[],g=1,u=null,y=3,w=!1,T=!1,E=!1,S=!1,v=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function A(G){for(var W=s(h);W!==null;){if(W.callback===null)l(h);else if(W.startTime<=G)l(h),W.sortIndex=W.expirationTime,r(c,W);else break;W=s(h)}}function L(G){if(E=!1,A(G),!T)if(s(c)!==null)T=!0,D||(D=!0,U());else{var W=s(h);W!==null&&Y(L,W.startTime-G)}}var D=!1,R=-1,k=5,M=-1;function B(){return S?!0:!(n.unstable_now()-M<k)}function H(){if(S=!1,D){var G=n.unstable_now();M=G;var W=!0;try{e:{T=!1,E&&(E=!1,_(R),R=-1),w=!0;var Z=y;try{t:{for(A(G),u=s(c);u!==null&&!(u.expirationTime>G&&B());){var z=u.callback;if(typeof z=="function"){u.callback=null,y=u.priorityLevel;var j=z(u.expirationTime<=G);if(G=n.unstable_now(),typeof j=="function"){u.callback=j,A(G),W=!0;break t}u===s(c)&&l(c),A(G)}else l(c);u=s(c)}if(u!==null)W=!0;else{var N=s(h);N!==null&&Y(L,N.startTime-G),W=!1}}break e}finally{u=null,y=Z,w=!1}W=void 0}}finally{W?U():D=!1}}}var U;if(typeof b=="function")U=function(){b(H)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,K=P.port2;P.port1.onmessage=H,U=function(){K.postMessage(null)}}else U=function(){v(H,0)};function Y(G,W){R=v(function(){G(n.unstable_now())},W)}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"):k=0<G?Math.floor(1e3/G):5},n.unstable_getCurrentPriorityLevel=function(){return y},n.unstable_next=function(G){switch(y){case 1:case 2:case 3:var W=3;break;default:W=y}var Z=y;y=W;try{return G()}finally{y=Z}},n.unstable_requestPaint=function(){S=!0},n.unstable_runWithPriority=function(G,W){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var Z=y;y=G;try{return W()}finally{y=Z}},n.unstable_scheduleCallback=function(G,W,Z){var z=n.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?z+Z:z):Z=z,G){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=Z+j,G={id:g++,callback:W,priorityLevel:G,startTime:Z,expirationTime:j,sortIndex:-1},Z>z?(G.sortIndex=Z,r(h,G),s(c)===null&&G===s(h)&&(E?(_(R),R=-1):E=!0,Y(L,Z-z))):(G.sortIndex=j,r(c,G),T||w||(T=!0,D||(D=!0,U()))),G},n.unstable_shouldYield=B,n.unstable_wrapCallback=function(G){var W=y;return function(){var Z=y;y=W;try{return G.apply(this,arguments)}finally{y=Z}}}})(Pu)),Pu}var Mm;function N0(){return Mm||(Mm=1,Uu.exports=j0()),Uu.exports}var Fu={exports:{}},Wt={};/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.js
|
|
28
28
|
*
|
|
@@ -30,7 +30,7 @@ var R0=Object.defineProperty;var D0=(n,r,s)=>r in n?R0(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 Lm;function
|
|
33
|
+
*/var Lm;function H0(){if(Lm)return Wt;Lm=1;var n=Rh();function r(c){var h="https://react.dev/errors/"+c;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+c+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var l={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 p(c,h,g){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:g}}var f=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(c,h){if(c==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Wt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Wt.createPortal=function(c,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(r(299));return p(c,h,null,g)},Wt.flushSync=function(c){var h=f.T,g=l.p;try{if(f.T=null,l.p=2,c)return c()}finally{f.T=h,l.p=g,l.d.f()}},Wt.preconnect=function(c,h){typeof c=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,l.d.C(c,h))},Wt.prefetchDNS=function(c){typeof c=="string"&&l.d.D(c)},Wt.preinit=function(c,h){if(typeof c=="string"&&h&&typeof h.as=="string"){var g=h.as,u=o(g,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?l.d.S(c,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:u,integrity:y,fetchPriority:w}):g==="script"&&l.d.X(c,{crossOrigin:u,integrity:y,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Wt.preinitModule=function(c,h){if(typeof c=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=o(h.as,h.crossOrigin);l.d.M(c,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&l.d.M(c)},Wt.preload=function(c,h){if(typeof c=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,u=o(g,h.crossOrigin);l.d.L(c,g,{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})}},Wt.preloadModule=function(c,h){if(typeof c=="string")if(h){var g=o(h.as,h.crossOrigin);l.d.m(c,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else l.d.m(c)},Wt.requestFormReset=function(c){l.d.r(c)},Wt.unstable_batchedUpdates=function(c,h){return c(h)},Wt.useFormState=function(c,h,g){return f.H.useFormState(c,h,g)},Wt.useFormStatus=function(){return f.H.useHostTransitionStatus()},Wt.version="19.2.6",Wt}var Om;function z0(){if(Om)return Fu.exports;Om=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(),Fu.exports=H0(),Fu.exports}/**
|
|
34
34
|
* @license React
|
|
35
35
|
* react-dom-client.production.js
|
|
36
36
|
*
|
|
@@ -38,59 +38,59 @@ var R0=Object.defineProperty;var D0=(n,r,s)=>r in n?R0(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 Bm;function
|
|
41
|
+
*/var Bm;function I0(){if(Bm)return ja;Bm=1;var n=N0(),r=Rh(),s=z0();function l(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 p(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 o(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(p(e)!==e)throw Error(l(188))}function h(e){var t=e.alternate;if(!t){if(t=p(e),t===null)throw Error(l(188));return t!==e?null:e}for(var i=e,a=t;;){var m=i.return;if(m===null)break;var C=m.alternate;if(C===null){if(a=m.return,a!==null){i=a;continue}break}if(m.child===C.child){for(C=m.child;C;){if(C===i)return c(m),e;if(C===a)return c(m),t;C=C.sibling}throw Error(l(188))}if(i.return!==a.return)i=m,a=C;else{for(var O=!1,F=m.child;F;){if(F===i){O=!0,i=m,a=C;break}if(F===a){O=!0,a=m,i=C;break}F=F.sibling}if(!O){for(F=C.child;F;){if(F===i){O=!0,i=C,a=m;break}if(F===a){O=!0,a=C,i=m;break}F=F.sibling}if(!O)throw Error(l(189))}}if(i.alternate!==a)throw Error(l(190))}if(i.tag!==3)throw Error(l(188));return i.stateNode.current===i?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var u=Object.assign,y=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),b=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function U(e){return e===null||typeof e!="object"?null:(e=H&&e[H]||e["@@iterator"],typeof e=="function"?e:null)}var P=Symbol.for("react.client.reference");function K(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===P?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case v:return"Profiler";case S:return"StrictMode";case L:return"Suspense";case D:return"SuspenseList";case M:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case b:return e.displayName||"Context";case _:return(e._context.displayName||"Context")+".Consumer";case A:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case R:return t=e.displayName||null,t!==null?t:K(e.type)||"Memo";case k:t=e._payload,e=e._init;try{return K(e(t))}catch{}}return null}var Y=Array.isArray,G=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},z=[],j=-1;function N(e){return{current:e}}function $(e){0>j||(e.current=z[j],z[j]=null,j--)}function I(e,t){j++,z[j]=e.current,e.current=t}var re=N(null),ve=N(null),me=N(null),Q=N(null);function q(e,t){switch(I(me,t),I(ve,e),I(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Kp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Kp(t),e=Yp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(re),I(re,e)}function te(){$(re),$(ve),$(me)}function ae(e){e.memoizedState!==null&&I(Q,e);var t=re.current,i=Yp(t,e.type);t!==i&&(I(ve,e),I(re,i))}function pe(e){ve.current===e&&($(re),$(ve)),Q.current===e&&($(Q),Da._currentValue=Z)}var se,we;function je(e){if(se===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);se=t&&t[1]||"",we=-1<i.stack.indexOf(`
|
|
42
42
|
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+se+e+we}var ze=!1;function Pe(e,t){if(!e||ze)return"";ze=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var _e=function(){throw Error()};if(Object.defineProperty(_e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_e,[])}catch(ue){var ce=ue}Reflect.construct(e,[],_e)}else{try{_e.call()}catch(ue){ce=ue}e.call(_e.prototype)}}else{try{throw Error()}catch(ue){ce=ue}(_e=e())&&typeof _e.catch=="function"&&_e.catch(function(){})}}catch(ue){if(ue&&ce&&typeof ue.stack=="string")return[ue.stack,ce.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var
|
|
43
|
+
`+se+e+we}var ze=!1;function Pe(e,t){if(!e||ze)return"";ze=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var _e=function(){throw Error()};if(Object.defineProperty(_e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_e,[])}catch(ue){var ce=ue}Reflect.construct(e,[],_e)}else{try{_e.call()}catch(ue){ce=ue}e.call(_e.prototype)}}else{try{throw Error()}catch(ue){ce=ue}(_e=e())&&typeof _e.catch=="function"&&_e.catch(function(){})}}catch(ue){if(ue&&ce&&typeof ue.stack=="string")return[ue.stack,ce.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var C=a.DetermineComponentFrameRoot(),O=C[0],F=C[1];if(O&&F){var X=O.split(`
|
|
44
44
|
`),oe=F.split(`
|
|
45
|
-
`);for(
|
|
46
|
-
`+X[a].replace(" at new "," at ");return e.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",e.displayName)),de}while(1<=a&&0<=
|
|
45
|
+
`);for(m=a=0;a<X.length&&!X[a].includes("DetermineComponentFrameRoot");)a++;for(;m<oe.length&&!oe[m].includes("DetermineComponentFrameRoot");)m++;if(a===X.length||m===oe.length)for(a=X.length-1,m=oe.length-1;1<=a&&0<=m&&X[a]!==oe[m];)m--;for(;1<=a&&0<=m;a--,m--)if(X[a]!==oe[m]){if(a!==1||m!==1)do if(a--,m--,0>m||X[a]!==oe[m]){var de=`
|
|
46
|
+
`+X[a].replace(" at new "," at ");return e.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",e.displayName)),de}while(1<=a&&0<=m);break}}}finally{ze=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?je(i):""}function xe(e,t){switch(e.tag){case 26:case 27:case 5:return je(e.type);case 16:return je("Lazy");case 13:return e.child!==t&&t!==null?je("Suspense Fallback"):je("Suspense");case 19:return je("SuspenseList");case 0:case 15:return Pe(e.type,!1);case 11:return Pe(e.type.render,!1);case 1:return Pe(e.type,!0);case 31:return je("Activity");default:return""}}function xt(e){try{var t="",i=null;do t+=xe(e,i),i=e,e=e.return;while(e);return t}catch(a){return`
|
|
47
47
|
Error generating stack: `+a.message+`
|
|
48
|
-
`+a.stack}}var yt=Object.prototype.hasOwnProperty,Nt=n.unstable_scheduleCallback,Gt=n.unstable_cancelCallback,Sn=n.unstable_shouldYield,St=n.unstable_requestPaint,tt=n.unstable_now,Lt=n.unstable_getCurrentPriorityLevel,he=n.unstable_ImmediatePriority,Se=n.unstable_UserBlockingPriority,Ae=n.unstable_NormalPriority,Le=n.unstable_LowPriority,Oe=n.unstable_IdlePriority,ut=n.log,Fe=n.unstable_setDisableYieldValue,gt=null,mt=null;function Ot(e){if(typeof ut=="function"&&Fe(e),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(gt,e)}catch{}}var Ze=Math.clz32?Math.clz32:bn,Qt=Math.log,Et=Math.LN2;function bn(e){return e>>>=0,e===0?32:31-(Qt(e)/Et|0)|0}var Ln=256,ri=262144,On=4194304;function Bt(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 Bn(e,t,i){var a=e.pendingLanes;if(a===0)return 0;var g=0,w=e.suspendedLanes,O=e.pingedLanes;e=e.warmLanes;var F=a&134217727;return F!==0?(a=F&~w,a!==0?g=Bt(a):(O&=F,O!==0?g=Bt(O):i||(i=F&~e,i!==0&&(g=Bt(i))))):(F=a&~w,F!==0?g=Bt(F):O!==0?g=Bt(O):i||(i=a&~e,i!==0&&(g=Bt(i)))),g===0?0:t!==0&&t!==g&&(t&w)===0&&(w=g&-g,i=t&-t,w>=i||w===32&&(i&4194048)!==0)?t:g}function Wn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function si(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 rn(){var e=On;return On<<=1,(On&62914560)===0&&(On=4194304),e}function jn(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function sn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function an(e,t,i,a,g,w){var O=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 F=e.entanglements,X=e.expirationTimes,oe=e.hiddenUpdates;for(i=O&~i;0<i;){var de=31-Ze(i),_e=1<<de;F[de]=0,X[de]=-1;var ce=oe[de];if(ce!==null)for(oe[de]=null,de=0;de<ce.length;de++){var ue=ce[de];ue!==null&&(ue.lane&=-536870913)}i&=~_e}a!==0&&Ui(e,a,0),w!==0&&g===0&&e.tag!==0&&(e.suspendedLanes|=w&~(O&~t))}function Ui(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Ze(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|i&261930}function Ne(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var a=31-Ze(i),g=1<<a;g&t|e[a]&t&&(e[a]|=t),i&=~g}}function Pi(e,t){var i=t&-t;return i=(i&42)!==0?1:qr(i),(i&(e.suspendedLanes|t))!==0?0:i}function qr(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 Us(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Kn(){var e=W.p;return e!==0?e:(e=window.event,e===void 0?32:vm(e.type))}function el(e,t){var i=W.p;try{return W.p=e,t()}finally{W.p=i}}var ai=Math.random().toString(36).slice(2),kt="__reactFiber$"+ai,It="__reactProps$"+ai,Yn="__reactContainer$"+ai,Ps="__reactEvents$"+ai,Io="__reactListeners$"+ai,tl="__reactHandles$"+ai,nl="__reactResources$"+ai,Nn="__reactMarker$"+ai;function $r(e){delete e[kt],delete e[It],delete e[Ps],delete e[Io],delete e[tl]}function ln(e){var t=e[kt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Yn]||i[kt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=nm(e);e!==null;){if(i=e[kt])return i;e=nm(e)}return t}e=i,i=e.parentNode}return null}function mi(e){if(e=e[kt]||e[Yn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function gi(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function _i(e){var t=e[nl];return t||(t=e[nl]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function bt(e){e[Nn]=!0}var Fs=new Set,Xn={};function Qn(e,t){ie(e,t),ie(e+"Capture",t)}function ie(e,t){for(Xn[e]=t,e=0;e<t.length;e++)Fs.add(t[e])}var on=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]*$"),Gr={},qs={};function Uo(e){return yt.call(qs,e)?!0:yt.call(Gr,e)?!1:on.test(e)?qs[e]=!0:(Gr[e]=!0,!1)}function Vr(e,t,i){if(Uo(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function vi(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 Hn(e,t,i,a){if(a===null)e.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+a)}}function cn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function il(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Jt(e,t,i){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var g=a.get,w=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return g.call(this)},set:function(O){i=""+O,w.call(this,O)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return i},setValue:function(O){i=""+O},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ht(e){if(!e._valueTracker){var t=il(e)?"checked":"value";e._valueTracker=Jt(e,t,""+e[t])}}function $s(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),a="";return e&&(a=il(e)?e.checked?"true":"false":e.value),e=a,e!==i?(t.setValue(e),!0):!1}function _r(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 rl=/[\n"\\]/g;function un(e){return e.replace(rl,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Gs(e,t,i,a,g,w,O,F){e.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?e.type=O:e.removeAttribute("type"),t!=null?O==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+cn(t)):e.value!==""+cn(t)&&(e.value=""+cn(t)):O!=="submit"&&O!=="reset"||e.removeAttribute("value"),t!=null?Vs(e,O,cn(t)):i!=null?Vs(e,O,cn(i)):a!=null&&e.removeAttribute("value"),g==null&&w!=null&&(e.defaultChecked=!!w),g!=null&&(e.checked=g&&typeof g!="function"&&typeof g!="symbol"),F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?e.name=""+cn(F):e.removeAttribute("name")}function sl(e,t,i,a,g,w,O,F){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)){Ht(e);return}i=i!=null?""+cn(i):"",t=t!=null?""+cn(t):i,F||t===e.value||(e.value=t),e.defaultValue=t}a=a??g,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=F?e.checked:!!a,e.defaultChecked=!!a,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(e.name=O),Ht(e)}function Vs(e,t,i){t==="number"&&_r(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Fi(e,t,i,a){if(e=e.options,t){t={};for(var g=0;g<i.length;g++)t["$"+i[g]]=!0;for(i=0;i<e.length;i++)g=t.hasOwnProperty("$"+e[i].value),e[i].selected!==g&&(e[i].selected=g),g&&a&&(e[i].defaultSelected=!0)}else{for(i=""+cn(i),t=null,g=0;g<e.length;g++){if(e[g].value===i){e[g].selected=!0,a&&(e[g].defaultSelected=!0);return}t!==null||e[g].disabled||(t=e[g])}t!==null&&(t.selected=!0)}}function al(e,t,i){if(t!=null&&(t=""+cn(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+cn(i):""}function yi(e,t,i,a){if(t==null){if(a!=null){if(i!=null)throw Error(l(92));if(Y(a)){if(1<a.length)throw Error(l(93));a=a[0]}i=a}i==null&&(i=""),t=i}i=cn(t),e.defaultValue=i,a=e.textContent,a===i&&a!==""&&a!==null&&(e.value=a),Ht(e)}function li(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var Ws=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 Si(e,t,i){var a=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,i):typeof i!="number"||i===0||Ws.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function ll(e,t,i){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,i!=null){for(var a in i)!i.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var g in t)a=t[g],t.hasOwnProperty(g)&&i[g]!==a&&Si(e,g,a)}else for(var w in t)t.hasOwnProperty(w)&&Si(e,w,t[w])}function Wr(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 Ks=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"]]),ol=/^[\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 vr(e){return ol.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Vt(){}var Kr=null;function oi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Zt=null,qi=null;function cl(e){var t=mi(e);if(t&&(e=t.stateNode)){var i=e[It]||null;e:switch(e=t.stateNode,t.type){case"input":if(Gs(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="'+un(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var a=i[t];if(a!==e&&a.form===e.form){var g=a[It]||null;if(!g)throw Error(l(90));Gs(a,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(t=0;t<i.length;t++)a=i[t],a.form===e.form&&$s(a)}break e;case"textarea":al(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Fi(e,!!i.multiple,t,!1)}}}var Ys=!1;function hn(e,t,i){if(Ys)return e(t,i);Ys=!0;try{var a=e(t);return a}finally{if(Ys=!1,(Zt!==null||qi!==null)&&(Wl(),Zt&&(t=Zt,e=qi,qi=Zt=null,cl(t),e)))for(t=0;t<e.length;t++)cl(e[t])}}function bi(e,t){var i=e.stateNode;if(i===null)return null;var a=i[It]||null;if(a===null)return null;i=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(l(231,t,typeof i));return i}var Cn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yr=!1;if(Cn)try{var Sr={};Object.defineProperty(Sr,"passive",{get:function(){yr=!0}}),window.addEventListener("test",Sr,Sr),window.removeEventListener("test",Sr,Sr)}catch{yr=!1}var ke=null,Xs=null,Yr=null;function ul(){if(Yr)return Yr;var e,t=Xs,i=t.length,a,g="value"in ke?ke.value:ke.textContent,w=g.length;for(e=0;e<i&&t[e]===g[e];e++);var O=i-e;for(a=1;a<=O&&t[i-a]===g[w-a];a++);return Yr=g.slice(e,1<a?1-a:void 0)}function Xr(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 en(){return!0}function Qr(){return!1}function Ut(e){function t(i,a,g,w,O){this._reactName=i,this._targetInst=g,this.type=a,this.nativeEvent=w,this.target=O,this.currentTarget=null;for(var F in e)e.hasOwnProperty(F)&&(i=e[F],this[F]=i?i(w):w[F]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?en:Qr,this.isPropagationStopped=Qr,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=en)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=en)},persist:function(){},isPersistent:en}),t}var Jn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Jr=Ut(Jn),V=u({},Jn,{view:0,detail:0}),fe=Ut(V),qe,fn,br,Zr=u({},V,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fo,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!==br&&(br&&e.type==="mousemove"?(qe=e.screenX-br.screenX,fn=e.screenY-br.screenY):fn=qe=0,br=e),qe)},movementY:function(e){return"movementY"in e?e.movementY:fn}}),hl=Ut(Zr),Tv=u({},Zr,{dataTransfer:0}),Rv=Ut(Tv),Dv=u({},V,{relatedTarget:0}),Po=Ut(Dv),Mv=u({},Jn,{animationName:0,elapsedTime:0,pseudoElement:0}),Lv=Ut(Mv),Ov=u({},Jn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Bv=Ut(Ov),jv=u({},Jn,{data:0}),Qh=Ut(jv),Nv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Hv={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"},zv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Iv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zv[e])?!!t[e]:!1}function Fo(){return Iv}var Uv=u({},V,{key:function(e){if(e.key){var t=Nv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Xr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Hv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fo,charCode:function(e){return e.type==="keypress"?Xr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Xr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Pv=Ut(Uv),Fv=u({},Zr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Jh=Ut(Fv),qv=u({},V,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fo}),$v=Ut(qv),Gv=u({},Jn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vv=Ut(Gv),Wv=u({},Zr,{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}),Kv=Ut(Wv),Yv=u({},Jn,{newState:0,oldState:0}),Xv=Ut(Yv),Qv=[9,13,27,32],qo=Cn&&"CompositionEvent"in window,Qs=null;Cn&&"documentMode"in document&&(Qs=document.documentMode);var Jv=Cn&&"TextEvent"in window&&!Qs,Zh=Cn&&(!qo||Qs&&8<Qs&&11>=Qs),ef=" ",tf=!1;function nf(e,t){switch(e){case"keyup":return Qv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var es=!1;function Zv(e,t){switch(e){case"compositionend":return rf(t);case"keypress":return t.which!==32?null:(tf=!0,ef);case"textInput":return e=t.data,e===ef&&tf?null:e;default:return null}}function ey(e,t){if(es)return e==="compositionend"||!qo&&nf(e,t)?(e=ul(),Yr=Xs=ke=null,es=!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 Zh&&t.locale!=="ko"?null:t.data;default:return null}}var ty={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 sf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ty[e.type]:t==="textarea"}function af(e,t,i,a){Zt?qi?qi.push(a):qi=[a]:Zt=a,t=eo(t,"onChange"),0<t.length&&(i=new Jr("onChange","change",null,i,a),e.push({event:i,listeners:t}))}var Js=null,Zs=null;function ny(e){Fp(e,0)}function fl(e){var t=gi(e);if($s(t))return e}function lf(e,t){if(e==="change")return t}var of=!1;if(Cn){var $o;if(Cn){var Go="oninput"in document;if(!Go){var cf=document.createElement("div");cf.setAttribute("oninput","return;"),Go=typeof cf.oninput=="function"}$o=Go}else $o=!1;of=$o&&(!document.documentMode||9<document.documentMode)}function uf(){Js&&(Js.detachEvent("onpropertychange",hf),Zs=Js=null)}function hf(e){if(e.propertyName==="value"&&fl(Zs)){var t=[];af(t,Zs,e,oi(e)),hn(ny,t)}}function iy(e,t,i){e==="focusin"?(uf(),Js=t,Zs=i,Js.attachEvent("onpropertychange",hf)):e==="focusout"&&uf()}function ry(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return fl(Zs)}function sy(e,t){if(e==="click")return fl(t)}function ay(e,t){if(e==="input"||e==="change")return fl(t)}function ly(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wn=typeof Object.is=="function"?Object.is:ly;function ea(e,t){if(wn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(a=0;a<i.length;a++){var g=i[a];if(!yt.call(t,g)||!wn(e[g],t[g]))return!1}return!0}function ff(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function df(e,t){var i=ff(e);e=0;for(var a;i;){if(i.nodeType===3){if(a=e+i.textContent.length,e<=t&&a>=t)return{node:i,offset:t-e};e=a}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=ff(i)}}function pf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=_r(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=_r(e.document)}return t}function Vo(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 oy=Cn&&"documentMode"in document&&11>=document.documentMode,ts=null,Wo=null,ta=null,Ko=!1;function gf(e,t,i){var a=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Ko||ts==null||ts!==_r(a)||(a=ts,"selectionStart"in a&&Vo(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),ta&&ea(ta,a)||(ta=a,a=eo(Wo,"onSelect"),0<a.length&&(t=new Jr("onSelect","select",null,t,i),e.push({event:t,listeners:a}),t.target=ts)))}function Cr(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var ns={animationend:Cr("Animation","AnimationEnd"),animationiteration:Cr("Animation","AnimationIteration"),animationstart:Cr("Animation","AnimationStart"),transitionrun:Cr("Transition","TransitionRun"),transitionstart:Cr("Transition","TransitionStart"),transitioncancel:Cr("Transition","TransitionCancel"),transitionend:Cr("Transition","TransitionEnd")},Yo={},_f={};Cn&&(_f=document.createElement("div").style,"AnimationEvent"in window||(delete ns.animationend.animation,delete ns.animationiteration.animation,delete ns.animationstart.animation),"TransitionEvent"in window||delete ns.transitionend.transition);function wr(e){if(Yo[e])return Yo[e];if(!ns[e])return e;var t=ns[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in _f)return Yo[e]=t[i];return e}var vf=wr("animationend"),yf=wr("animationiteration"),Sf=wr("animationstart"),cy=wr("transitionrun"),uy=wr("transitionstart"),hy=wr("transitioncancel"),bf=wr("transitionend"),Cf=new Map,Xo="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(" ");Xo.push("scrollEnd");function Zn(e,t){Cf.set(e,t),Qn(t,[e])}var dl=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)},zn=[],is=0,Qo=0;function pl(){for(var e=is,t=Qo=is=0;t<e;){var i=zn[t];zn[t++]=null;var a=zn[t];zn[t++]=null;var g=zn[t];zn[t++]=null;var w=zn[t];if(zn[t++]=null,a!==null&&g!==null){var O=a.pending;O===null?g.next=g:(g.next=O.next,O.next=g),a.pending=g}w!==0&&wf(i,g,w)}}function ml(e,t,i,a){zn[is++]=e,zn[is++]=t,zn[is++]=i,zn[is++]=a,Qo|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Jo(e,t,i,a){return ml(e,t,i,a),gl(e)}function xr(e,t){return ml(e,null,null,t),gl(e)}function wf(e,t,i){e.lanes|=i;var a=e.alternate;a!==null&&(a.lanes|=i);for(var g=!1,w=e.return;w!==null;)w.childLanes|=i,a=w.alternate,a!==null&&(a.childLanes|=i),w.tag===22&&(e=w.stateNode,e===null||e._visibility&1||(g=!0)),e=w,w=w.return;return e.tag===3?(w=e.stateNode,g&&t!==null&&(g=31-Ze(i),e=w.hiddenUpdates,a=e[g],a===null?e[g]=[t]:a.push(t),t.lane=i|536870912),w):null}function gl(e){if(50<wa)throw wa=0,lu=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var rs={};function fy(e,t,i,a){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=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xn(e,t,i,a){return new fy(e,t,i,a)}function Zo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ci(e,t){var i=e.alternate;return i===null?(i=xn(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 xf(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 _l(e,t,i,a,g,w){var O=0;if(a=e,typeof e=="function")Zo(e)&&(O=1);else if(typeof e=="string")O=_0(e,i,re.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case M:return e=xn(31,i,t,g),e.elementType=M,e.lanes=w,e;case E:return Er(i.children,g,w,t);case b:O=8,g|=24;break;case y:return e=xn(12,i,t,g|2),e.elementType=y,e.lanes=w,e;case L:return e=xn(13,i,t,g),e.elementType=L,e.lanes=w,e;case D:return e=xn(19,i,t,g),e.elementType=D,e.lanes=w,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case S:O=10;break e;case _:O=9;break e;case A:O=11;break e;case R:O=14;break e;case k:O=16,a=null;break e}O=29,i=Error(l(130,e===null?"null":typeof e,"")),a=null}return t=xn(O,i,t,g),t.elementType=e,t.type=a,t.lanes=w,t}function Er(e,t,i,a){return e=xn(7,e,a,t),e.lanes=i,e}function ec(e,t,i){return e=xn(6,e,null,t),e.lanes=i,e}function Ef(e){var t=xn(18,null,null,0);return t.stateNode=e,t}function tc(e,t,i){return t=xn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var kf=new WeakMap;function In(e,t){if(typeof e=="object"&&e!==null){var i=kf.get(e);return i!==void 0?i:(t={value:e,source:t,stack:xt(t)},kf.set(e,t),t)}return{value:e,source:t,stack:xt(t)}}var ss=[],as=0,vl=null,na=0,Un=[],Pn=0,$i=null,ci=1,ui="";function wi(e,t){ss[as++]=na,ss[as++]=vl,vl=e,na=t}function Af(e,t,i){Un[Pn++]=ci,Un[Pn++]=ui,Un[Pn++]=$i,$i=e;var a=ci;e=ui;var g=32-Ze(a)-1;a&=~(1<<g),i+=1;var w=32-Ze(t)+g;if(30<w){var O=g-g%5;w=(a&(1<<O)-1).toString(32),a>>=O,g-=O,ci=1<<32-Ze(t)+g|i<<g|a,ui=w+e}else ci=1<<w|i<<g|a,ui=e}function nc(e){e.return!==null&&(wi(e,1),Af(e,1,0))}function ic(e){for(;e===vl;)vl=ss[--as],ss[as]=null,na=ss[--as],ss[as]=null;for(;e===$i;)$i=Un[--Pn],Un[Pn]=null,ui=Un[--Pn],Un[Pn]=null,ci=Un[--Pn],Un[Pn]=null}function Tf(e,t){Un[Pn++]=ci,Un[Pn++]=ui,Un[Pn++]=$i,ci=t.id,ui=t.overflow,$i=e}var Pt=null,ht=null,Ye=!1,Gi=null,Fn=!1,rc=Error(l(519));function Vi(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ia(In(t,e)),rc}function Rf(e){var t=e.stateNode,i=e.type,a=e.memoizedProps;switch(t[kt]=e,t[It]=a,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<Ea.length;i++)Ge(Ea[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),sl(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Ge("invalid",t);break;case"textarea":Ge("invalid",t),yi(t,a.value,a.defaultValue,a.children)}i=a.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||a.suppressHydrationWarning===!0||Vp(t.textContent,i)?(a.popover!=null&&(Ge("beforetoggle",t),Ge("toggle",t)),a.onScroll!=null&&Ge("scroll",t),a.onScrollEnd!=null&&Ge("scrollend",t),a.onClick!=null&&(t.onclick=Vt),t=!0):t=!1,t||Vi(e,!0)}function Df(e){for(Pt=e.return;Pt;)switch(Pt.tag){case 5:case 31:case 13:Fn=!1;return;case 27:case 3:Fn=!0;return;default:Pt=Pt.return}}function ls(e){if(e!==Pt)return!1;if(!Ye)return Df(e),Ye=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Cu(e.type,e.memoizedProps)),i=!i),i&&ht&&Vi(e),Df(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));ht=tm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));ht=tm(e)}else t===27?(t=ht,ar(e.type)?(e=Au,Au=null,ht=e):ht=t):ht=Pt?$n(e.stateNode.nextSibling):null;return!0}function kr(){ht=Pt=null,Ye=!1}function sc(){var e=Gi;return e!==null&&(gn===null?gn=e:gn.push.apply(gn,e),Gi=null),e}function ia(e){Gi===null?Gi=[e]:Gi.push(e)}var ac=N(null),Ar=null,xi=null;function Wi(e,t,i){I(ac,t._currentValue),t._currentValue=i}function Ei(e){e._currentValue=ac.current,$(ac)}function lc(e,t,i){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===i)break;e=e.return}}function oc(e,t,i,a){var g=e.child;for(g!==null&&(g.return=e);g!==null;){var w=g.dependencies;if(w!==null){var O=g.child;w=w.firstContext;e:for(;w!==null;){var F=w;w=g;for(var X=0;X<t.length;X++)if(F.context===t[X]){w.lanes|=i,F=w.alternate,F!==null&&(F.lanes|=i),lc(w.return,i,e),a||(O=null);break e}w=F.next}}else if(g.tag===18){if(O=g.return,O===null)throw Error(l(341));O.lanes|=i,w=O.alternate,w!==null&&(w.lanes|=i),lc(O,i,e),O=null}else O=g.child;if(O!==null)O.return=g;else for(O=g;O!==null;){if(O===e){O=null;break}if(g=O.sibling,g!==null){g.return=O.return,O=g;break}O=O.return}g=O}}function os(e,t,i,a){e=null;for(var g=t,w=!1;g!==null;){if(!w){if((g.flags&524288)!==0)w=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var O=g.alternate;if(O===null)throw Error(l(387));if(O=O.memoizedProps,O!==null){var F=g.type;wn(g.pendingProps.value,O.value)||(e!==null?e.push(F):e=[F])}}else if(g===Q.current){if(O=g.alternate,O===null)throw Error(l(387));O.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(e!==null?e.push(Da):e=[Da])}g=g.return}e!==null&&oc(t,e,i,a),t.flags|=262144}function yl(e){for(e=e.firstContext;e!==null;){if(!wn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Tr(e){Ar=e,xi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ft(e){return Mf(Ar,e)}function Sl(e,t){return Ar===null&&Tr(e),Mf(e,t)}function Mf(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},xi===null){if(e===null)throw Error(l(308));xi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else xi=xi.next=t;return i}var dy=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},py=n.unstable_scheduleCallback,my=n.unstable_NormalPriority,At={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function cc(){return{controller:new dy,data:new Map,refCount:0}}function ra(e){e.refCount--,e.refCount===0&&py(my,function(){e.controller.abort()})}var sa=null,uc=0,cs=0,us=null;function gy(e,t){if(sa===null){var i=sa=[];uc=0,cs=du(),us={status:"pending",value:void 0,then:function(a){i.push(a)}}}return uc++,t.then(Lf,Lf),t}function Lf(){if(--uc===0&&sa!==null){us!==null&&(us.status="fulfilled");var e=sa;sa=null,cs=0,us=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function _y(e,t){var i=[],a={status:"pending",value:null,reason:null,then:function(g){i.push(g)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var g=0;g<i.length;g++)(0,i[g])(t)},function(g){for(a.status="rejected",a.reason=g,g=0;g<i.length;g++)(0,i[g])(void 0)}),a}var Of=G.S;G.S=function(e,t){gp=tt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&gy(e,t),Of!==null&&Of(e,t)};var Rr=N(null);function hc(){var e=Rr.current;return e!==null?e:lt.pooledCache}function bl(e,t){t===null?I(Rr,Rr.current):I(Rr,t.pool)}function Bf(){var e=hc();return e===null?null:{parent:At._currentValue,pool:e}}var hs=Error(l(460)),fc=Error(l(474)),Cl=Error(l(542)),wl={then:function(){}};function jf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Nf(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Vt,Vt),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,zf(e),e;default:if(typeof t.status=="string")t.then(Vt,Vt);else{if(e=lt,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var g=t;g.status="fulfilled",g.value=a}},function(a){if(t.status==="pending"){var g=t;g.status="rejected",g.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,zf(e),e}throw Mr=t,hs}}function Dr(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Mr=i,hs):i}}var Mr=null;function Hf(){if(Mr===null)throw Error(l(459));var e=Mr;return Mr=null,e}function zf(e){if(e===hs||e===Cl)throw Error(l(483))}var fs=null,aa=0;function xl(e){var t=aa;return aa+=1,fs===null&&(fs=[]),Nf(fs,e,t)}function la(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function El(e,t){throw t.$$typeof===v?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function If(e){function t(ne,J){if(e){var le=ne.deletions;le===null?(ne.deletions=[J],ne.flags|=16):le.push(J)}}function i(ne,J){if(!e)return null;for(;J!==null;)t(ne,J),J=J.sibling;return null}function a(ne){for(var J=new Map;ne!==null;)ne.key!==null?J.set(ne.key,ne):J.set(ne.index,ne),ne=ne.sibling;return J}function g(ne,J){return ne=Ci(ne,J),ne.index=0,ne.sibling=null,ne}function w(ne,J,le){return ne.index=le,e?(le=ne.alternate,le!==null?(le=le.index,le<J?(ne.flags|=67108866,J):le):(ne.flags|=67108866,J)):(ne.flags|=1048576,J)}function O(ne){return e&&ne.alternate===null&&(ne.flags|=67108866),ne}function F(ne,J,le,ge){return J===null||J.tag!==6?(J=ec(le,ne.mode,ge),J.return=ne,J):(J=g(J,le),J.return=ne,J)}function X(ne,J,le,ge){var Re=le.type;return Re===E?de(ne,J,le.props.children,ge,le.key):J!==null&&(J.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===k&&Dr(Re)===J.type)?(J=g(J,le.props),la(J,le),J.return=ne,J):(J=_l(le.type,le.key,le.props,null,ne.mode,ge),la(J,le),J.return=ne,J)}function oe(ne,J,le,ge){return J===null||J.tag!==4||J.stateNode.containerInfo!==le.containerInfo||J.stateNode.implementation!==le.implementation?(J=tc(le,ne.mode,ge),J.return=ne,J):(J=g(J,le.children||[]),J.return=ne,J)}function de(ne,J,le,ge,Re){return J===null||J.tag!==7?(J=Er(le,ne.mode,ge,Re),J.return=ne,J):(J=g(J,le),J.return=ne,J)}function _e(ne,J,le){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=ec(""+J,ne.mode,le),J.return=ne,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case C:return le=_l(J.type,J.key,J.props,null,ne.mode,le),la(le,J),le.return=ne,le;case T:return J=tc(J,ne.mode,le),J.return=ne,J;case k:return J=Dr(J),_e(ne,J,le)}if(Y(J)||U(J))return J=Er(J,ne.mode,le,null),J.return=ne,J;if(typeof J.then=="function")return _e(ne,xl(J),le);if(J.$$typeof===S)return _e(ne,Sl(ne,J),le);El(ne,J)}return null}function ce(ne,J,le,ge){var Re=J!==null?J.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Re!==null?null:F(ne,J,""+le,ge);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case C:return le.key===Re?X(ne,J,le,ge):null;case T:return le.key===Re?oe(ne,J,le,ge):null;case k:return le=Dr(le),ce(ne,J,le,ge)}if(Y(le)||U(le))return Re!==null?null:de(ne,J,le,ge,null);if(typeof le.then=="function")return ce(ne,J,xl(le),ge);if(le.$$typeof===S)return ce(ne,J,Sl(ne,le),ge);El(ne,le)}return null}function ue(ne,J,le,ge,Re){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return ne=ne.get(le)||null,F(J,ne,""+ge,Re);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case C:return ne=ne.get(ge.key===null?le:ge.key)||null,X(J,ne,ge,Re);case T:return ne=ne.get(ge.key===null?le:ge.key)||null,oe(J,ne,ge,Re);case k:return ge=Dr(ge),ue(ne,J,le,ge,Re)}if(Y(ge)||U(ge))return ne=ne.get(le)||null,de(J,ne,ge,Re,null);if(typeof ge.then=="function")return ue(ne,J,le,xl(ge),Re);if(ge.$$typeof===S)return ue(ne,J,le,Sl(J,ge),Re);El(J,ge)}return null}function Ee(ne,J,le,ge){for(var Re=null,Qe=null,Te=J,Ie=J=0,Ke=null;Te!==null&&Ie<le.length;Ie++){Te.index>Ie?(Ke=Te,Te=null):Ke=Te.sibling;var Je=ce(ne,Te,le[Ie],ge);if(Je===null){Te===null&&(Te=Ke);break}e&&Te&&Je.alternate===null&&t(ne,Te),J=w(Je,J,Ie),Qe===null?Re=Je:Qe.sibling=Je,Qe=Je,Te=Ke}if(Ie===le.length)return i(ne,Te),Ye&&wi(ne,Ie),Re;if(Te===null){for(;Ie<le.length;Ie++)Te=_e(ne,le[Ie],ge),Te!==null&&(J=w(Te,J,Ie),Qe===null?Re=Te:Qe.sibling=Te,Qe=Te);return Ye&&wi(ne,Ie),Re}for(Te=a(Te);Ie<le.length;Ie++)Ke=ue(Te,ne,Ie,le[Ie],ge),Ke!==null&&(e&&Ke.alternate!==null&&Te.delete(Ke.key===null?Ie:Ke.key),J=w(Ke,J,Ie),Qe===null?Re=Ke:Qe.sibling=Ke,Qe=Ke);return e&&Te.forEach(function(hr){return t(ne,hr)}),Ye&&wi(ne,Ie),Re}function Me(ne,J,le,ge){if(le==null)throw Error(l(151));for(var Re=null,Qe=null,Te=J,Ie=J=0,Ke=null,Je=le.next();Te!==null&&!Je.done;Ie++,Je=le.next()){Te.index>Ie?(Ke=Te,Te=null):Ke=Te.sibling;var hr=ce(ne,Te,Je.value,ge);if(hr===null){Te===null&&(Te=Ke);break}e&&Te&&hr.alternate===null&&t(ne,Te),J=w(hr,J,Ie),Qe===null?Re=hr:Qe.sibling=hr,Qe=hr,Te=Ke}if(Je.done)return i(ne,Te),Ye&&wi(ne,Ie),Re;if(Te===null){for(;!Je.done;Ie++,Je=le.next())Je=_e(ne,Je.value,ge),Je!==null&&(J=w(Je,J,Ie),Qe===null?Re=Je:Qe.sibling=Je,Qe=Je);return Ye&&wi(ne,Ie),Re}for(Te=a(Te);!Je.done;Ie++,Je=le.next())Je=ue(Te,ne,Ie,Je.value,ge),Je!==null&&(e&&Je.alternate!==null&&Te.delete(Je.key===null?Ie:Je.key),J=w(Je,J,Ie),Qe===null?Re=Je:Qe.sibling=Je,Qe=Je);return e&&Te.forEach(function(T0){return t(ne,T0)}),Ye&&wi(ne,Ie),Re}function at(ne,J,le,ge){if(typeof le=="object"&&le!==null&&le.type===E&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case C:e:{for(var Re=le.key;J!==null;){if(J.key===Re){if(Re=le.type,Re===E){if(J.tag===7){i(ne,J.sibling),ge=g(J,le.props.children),ge.return=ne,ne=ge;break e}}else if(J.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===k&&Dr(Re)===J.type){i(ne,J.sibling),ge=g(J,le.props),la(ge,le),ge.return=ne,ne=ge;break e}i(ne,J);break}else t(ne,J);J=J.sibling}le.type===E?(ge=Er(le.props.children,ne.mode,ge,le.key),ge.return=ne,ne=ge):(ge=_l(le.type,le.key,le.props,null,ne.mode,ge),la(ge,le),ge.return=ne,ne=ge)}return O(ne);case T:e:{for(Re=le.key;J!==null;){if(J.key===Re)if(J.tag===4&&J.stateNode.containerInfo===le.containerInfo&&J.stateNode.implementation===le.implementation){i(ne,J.sibling),ge=g(J,le.children||[]),ge.return=ne,ne=ge;break e}else{i(ne,J);break}else t(ne,J);J=J.sibling}ge=tc(le,ne.mode,ge),ge.return=ne,ne=ge}return O(ne);case k:return le=Dr(le),at(ne,J,le,ge)}if(Y(le))return Ee(ne,J,le,ge);if(U(le)){if(Re=U(le),typeof Re!="function")throw Error(l(150));return le=Re.call(le),Me(ne,J,le,ge)}if(typeof le.then=="function")return at(ne,J,xl(le),ge);if(le.$$typeof===S)return at(ne,J,Sl(ne,le),ge);El(ne,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,J!==null&&J.tag===6?(i(ne,J.sibling),ge=g(J,le),ge.return=ne,ne=ge):(i(ne,J),ge=ec(le,ne.mode,ge),ge.return=ne,ne=ge),O(ne)):i(ne,J)}return function(ne,J,le,ge){try{aa=0;var Re=at(ne,J,le,ge);return fs=null,Re}catch(Te){if(Te===hs||Te===Cl)throw Te;var Qe=xn(29,Te,null,ne.mode);return Qe.lanes=ge,Qe.return=ne,Qe}finally{}}}var Lr=If(!0),Uf=If(!1),Ki=!1;function dc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pc(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 Yi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Xi(e,t,i){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(et&2)!==0){var g=a.pending;return g===null?t.next=t:(t.next=g.next,g.next=t),a.pending=t,t=gl(e),wf(e,null,i),t}return ml(e,a,t,i),gl(e)}function oa(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,i|=a,t.lanes=i,Ne(e,i)}}function mc(e,t){var i=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,i===a)){var g=null,w=null;if(i=i.firstBaseUpdate,i!==null){do{var O={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};w===null?g=w=O:w=w.next=O,i=i.next}while(i!==null);w===null?g=w=t:w=w.next=t}else g=w=t;i={baseState:a.baseState,firstBaseUpdate:g,lastBaseUpdate:w,shared:a.shared,callbacks:a.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var gc=!1;function ca(){if(gc){var e=us;if(e!==null)throw e}}function ua(e,t,i,a){gc=!1;var g=e.updateQueue;Ki=!1;var w=g.firstBaseUpdate,O=g.lastBaseUpdate,F=g.shared.pending;if(F!==null){g.shared.pending=null;var X=F,oe=X.next;X.next=null,O===null?w=oe:O.next=oe,O=X;var de=e.alternate;de!==null&&(de=de.updateQueue,F=de.lastBaseUpdate,F!==O&&(F===null?de.firstBaseUpdate=oe:F.next=oe,de.lastBaseUpdate=X))}if(w!==null){var _e=g.baseState;O=0,de=oe=X=null,F=w;do{var ce=F.lane&-536870913,ue=ce!==F.lane;if(ue?(We&ce)===ce:(a&ce)===ce){ce!==0&&ce===cs&&(gc=!0),de!==null&&(de=de.next={lane:0,tag:F.tag,payload:F.payload,callback:null,next:null});e:{var Ee=e,Me=F;ce=t;var at=i;switch(Me.tag){case 1:if(Ee=Me.payload,typeof Ee=="function"){_e=Ee.call(at,_e,ce);break e}_e=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=Me.payload,ce=typeof Ee=="function"?Ee.call(at,_e,ce):Ee,ce==null)break e;_e=u({},_e,ce);break e;case 2:Ki=!0}}ce=F.callback,ce!==null&&(e.flags|=64,ue&&(e.flags|=8192),ue=g.callbacks,ue===null?g.callbacks=[ce]:ue.push(ce))}else ue={lane:ce,tag:F.tag,payload:F.payload,callback:F.callback,next:null},de===null?(oe=de=ue,X=_e):de=de.next=ue,O|=ce;if(F=F.next,F===null){if(F=g.shared.pending,F===null)break;ue=F,F=ue.next,ue.next=null,g.lastBaseUpdate=ue,g.shared.pending=null}}while(!0);de===null&&(X=_e),g.baseState=X,g.firstBaseUpdate=oe,g.lastBaseUpdate=de,w===null&&(g.shared.lanes=0),tr|=O,e.lanes=O,e.memoizedState=_e}}function Pf(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function Ff(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Pf(i[e],t)}var ds=N(null),kl=N(0);function qf(e,t){e=Bi,I(kl,e),I(ds,t),Bi=e|t.baseLanes}function _c(){I(kl,Bi),I(ds,ds.current)}function vc(){Bi=kl.current,$(ds),$(kl)}var En=N(null),qn=null;function Qi(e){var t=e.alternate;I(Ct,Ct.current&1),I(En,e),qn===null&&(t===null||ds.current!==null||t.memoizedState!==null)&&(qn=e)}function yc(e){I(Ct,Ct.current),I(En,e),qn===null&&(qn=e)}function $f(e){e.tag===22?(I(Ct,Ct.current),I(En,e),qn===null&&(qn=e)):Ji()}function Ji(){I(Ct,Ct.current),I(En,En.current)}function kn(e){$(En),qn===e&&(qn=null),$(Ct)}var Ct=N(0);function Al(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Eu(i)||ku(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 ki=0,He=null,rt=null,Tt=null,Tl=!1,ps=!1,Or=!1,Rl=0,ha=0,ms=null,vy=0;function _t(){throw Error(l(321))}function Sc(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!wn(e[i],t[i]))return!1;return!0}function bc(e,t,i,a,g,w){return ki=w,He=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,G.H=e===null||e.memoizedState===null?Ad:Nc,Or=!1,w=i(a,g),Or=!1,ps&&(w=Vf(t,i,a,g)),Gf(e),w}function Gf(e){G.H=pa;var t=rt!==null&&rt.next!==null;if(ki=0,Tt=rt=He=null,Tl=!1,ha=0,ms=null,t)throw Error(l(300));e===null||Rt||(e=e.dependencies,e!==null&&yl(e)&&(Rt=!0))}function Vf(e,t,i,a){He=e;var g=0;do{if(ps&&(ms=null),ha=0,ps=!1,25<=g)throw Error(l(301));if(g+=1,Tt=rt=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=Td,w=t(i,a)}while(ps);return w}function yy(){var e=G.H,t=e.useState()[0];return t=typeof t.then=="function"?fa(t):t,e=e.useState()[0],(rt!==null?rt.memoizedState:null)!==e&&(He.flags|=1024),t}function Cc(){var e=Rl!==0;return Rl=0,e}function wc(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function xc(e){if(Tl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Tl=!1}ki=0,Tt=rt=He=null,ps=!1,ha=Rl=0,ms=null}function tn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?He.memoizedState=Tt=e:Tt=Tt.next=e,Tt}function wt(){if(rt===null){var e=He.alternate;e=e!==null?e.memoizedState:null}else e=rt.next;var t=Tt===null?He.memoizedState:Tt.next;if(t!==null)Tt=t,rt=e;else{if(e===null)throw He.alternate===null?Error(l(467)):Error(l(310));rt=e,e={memoizedState:rt.memoizedState,baseState:rt.baseState,baseQueue:rt.baseQueue,queue:rt.queue,next:null},Tt===null?He.memoizedState=Tt=e:Tt=Tt.next=e}return Tt}function Dl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fa(e){var t=ha;return ha+=1,ms===null&&(ms=[]),e=Nf(ms,e,t),t=He,(Tt===null?t.memoizedState:Tt.next)===null&&(t=t.alternate,G.H=t===null||t.memoizedState===null?Ad:Nc),e}function Ml(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return fa(e);if(e.$$typeof===S)return Ft(e)}throw Error(l(438,String(e)))}function Ec(e){var t=null,i=He.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var a=He.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(g){return g.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=Dl(),He.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),a=0;a<e;a++)i[a]=B;return t.index++,i}function Ai(e,t){return typeof t=="function"?t(e):t}function Ll(e){var t=wt();return kc(t,rt,e)}function kc(e,t,i){var a=e.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=i;var g=e.baseQueue,w=a.pending;if(w!==null){if(g!==null){var O=g.next;g.next=w.next,w.next=O}t.baseQueue=g=w,a.pending=null}if(w=e.baseState,g===null)e.memoizedState=w;else{t=g.next;var F=O=null,X=null,oe=t,de=!1;do{var _e=oe.lane&-536870913;if(_e!==oe.lane?(We&_e)===_e:(ki&_e)===_e){var ce=oe.revertLane;if(ce===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),_e===cs&&(de=!0);else if((ki&ce)===ce){oe=oe.next,ce===cs&&(de=!0);continue}else _e={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},X===null?(F=X=_e,O=w):X=X.next=_e,He.lanes|=ce,tr|=ce;_e=oe.action,Or&&i(w,_e),w=oe.hasEagerState?oe.eagerState:i(w,_e)}else ce={lane:_e,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},X===null?(F=X=ce,O=w):X=X.next=ce,He.lanes|=_e,tr|=_e;oe=oe.next}while(oe!==null&&oe!==t);if(X===null?O=w:X.next=F,!wn(w,e.memoizedState)&&(Rt=!0,de&&(i=us,i!==null)))throw i;e.memoizedState=w,e.baseState=O,e.baseQueue=X,a.lastRenderedState=w}return g===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Ac(e){var t=wt(),i=t.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=e;var a=i.dispatch,g=i.pending,w=t.memoizedState;if(g!==null){i.pending=null;var O=g=g.next;do w=e(w,O.action),O=O.next;while(O!==g);wn(w,t.memoizedState)||(Rt=!0),t.memoizedState=w,t.baseQueue===null&&(t.baseState=w),i.lastRenderedState=w}return[w,a]}function Wf(e,t,i){var a=He,g=wt(),w=Ye;if(w){if(i===void 0)throw Error(l(407));i=i()}else i=t();var O=!wn((rt||g).memoizedState,i);if(O&&(g.memoizedState=i,Rt=!0),g=g.queue,Dc(Xf.bind(null,a,g,e),[e]),g.getSnapshot!==t||O||Tt!==null&&Tt.memoizedState.tag&1){if(a.flags|=2048,gs(9,{destroy:void 0},Yf.bind(null,a,g,i,t),null),lt===null)throw Error(l(349));w||(ki&127)!==0||Kf(a,t,i)}return i}function Kf(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=He.updateQueue,t===null?(t=Dl(),He.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Yf(e,t,i,a){t.value=i,t.getSnapshot=a,Qf(t)&&Jf(e)}function Xf(e,t,i){return i(function(){Qf(t)&&Jf(e)})}function Qf(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!wn(e,i)}catch{return!0}}function Jf(e){var t=xr(e,2);t!==null&&_n(t,e,2)}function Tc(e){var t=tn();if(typeof e=="function"){var i=e;if(e=i(),Or){Ot(!0);try{i()}finally{Ot(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:e},t}function Zf(e,t,i,a){return e.baseState=i,kc(e,rt,typeof a=="function"?a:Ai)}function Sy(e,t,i,a,g){if(jl(e))throw Error(l(485));if(e=t.action,e!==null){var w={payload:g,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){w.listeners.push(O)}};G.T!==null?i(!0):w.isTransition=!1,a(w),i=t.pending,i===null?(w.next=t.pending=w,ed(t,w)):(w.next=i.next,t.pending=i.next=w)}}function ed(e,t){var i=t.action,a=t.payload,g=e.state;if(t.isTransition){var w=G.T,O={};G.T=O;try{var F=i(g,a),X=G.S;X!==null&&X(O,F),td(e,t,F)}catch(oe){Rc(e,t,oe)}finally{w!==null&&O.types!==null&&(w.types=O.types),G.T=w}}else try{w=i(g,a),td(e,t,w)}catch(oe){Rc(e,t,oe)}}function td(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(a){nd(e,t,a)},function(a){return Rc(e,t,a)}):nd(e,t,i)}function nd(e,t,i){t.status="fulfilled",t.value=i,id(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,ed(e,i)))}function Rc(e,t,i){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=i,id(t),t=t.next;while(t!==a)}e.action=null}function id(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function rd(e,t){return t}function sd(e,t){if(Ye){var i=lt.formState;if(i!==null){e:{var a=He;if(Ye){if(ht){t:{for(var g=ht,w=Fn;g.nodeType!==8;){if(!w){g=null;break t}if(g=$n(g.nextSibling),g===null){g=null;break t}}w=g.data,g=w==="F!"||w==="F"?g:null}if(g){ht=$n(g.nextSibling),a=g.data==="F!";break e}}Vi(a)}a=!1}a&&(t=i[0])}}return i=tn(),i.memoizedState=i.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rd,lastRenderedState:t},i.queue=a,i=xd.bind(null,He,a),a.dispatch=i,a=Tc(!1),w=jc.bind(null,He,!1,a.queue),a=tn(),g={state:t,dispatch:null,action:e,pending:null},a.queue=g,i=Sy.bind(null,He,g,w,i),g.dispatch=i,a.memoizedState=e,[t,i,!1]}function ad(e){var t=wt();return ld(t,rt,e)}function ld(e,t,i){if(t=kc(e,t,rd)[0],e=Ll(Ai)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=fa(t)}catch(O){throw O===hs?Cl:O}else a=t;t=wt();var g=t.queue,w=g.dispatch;return i!==t.memoizedState&&(He.flags|=2048,gs(9,{destroy:void 0},by.bind(null,g,i),null)),[a,w,e]}function by(e,t){e.action=t}function od(e){var t=wt(),i=rt;if(i!==null)return ld(t,i,e);wt(),t=t.memoizedState,i=wt();var a=i.queue.dispatch;return i.memoizedState=e,[t,a,!1]}function gs(e,t,i,a){return e={tag:e,create:i,deps:a,inst:t,next:null},t=He.updateQueue,t===null&&(t=Dl(),He.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(a=i.next,i.next=e,e.next=a,t.lastEffect=e),e}function cd(){return wt().memoizedState}function Ol(e,t,i,a){var g=tn();He.flags|=e,g.memoizedState=gs(1|t,{destroy:void 0},i,a===void 0?null:a)}function Bl(e,t,i,a){var g=wt();a=a===void 0?null:a;var w=g.memoizedState.inst;rt!==null&&a!==null&&Sc(a,rt.memoizedState.deps)?g.memoizedState=gs(t,w,i,a):(He.flags|=e,g.memoizedState=gs(1|t,w,i,a))}function ud(e,t){Ol(8390656,8,e,t)}function Dc(e,t){Bl(2048,8,e,t)}function Cy(e){He.flags|=4;var t=He.updateQueue;if(t===null)t=Dl(),He.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function hd(e){var t=wt().memoizedState;return Cy({ref:t,nextImpl:e}),function(){if((et&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function fd(e,t){return Bl(4,2,e,t)}function dd(e,t){return Bl(4,4,e,t)}function pd(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 md(e,t,i){i=i!=null?i.concat([e]):null,Bl(4,4,pd.bind(null,t,e),i)}function Mc(){}function gd(e,t){var i=wt();t=t===void 0?null:t;var a=i.memoizedState;return t!==null&&Sc(t,a[1])?a[0]:(i.memoizedState=[e,t],e)}function _d(e,t){var i=wt();t=t===void 0?null:t;var a=i.memoizedState;if(t!==null&&Sc(t,a[1]))return a[0];if(a=e(),Or){Ot(!0);try{e()}finally{Ot(!1)}}return i.memoizedState=[a,t],a}function Lc(e,t,i){return i===void 0||(ki&1073741824)!==0&&(We&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=vp(),He.lanes|=e,tr|=e,i)}function vd(e,t,i,a){return wn(i,t)?i:ds.current!==null?(e=Lc(e,i,a),wn(e,t)||(Rt=!0),e):(ki&42)===0||(ki&1073741824)!==0&&(We&261930)===0?(Rt=!0,e.memoizedState=i):(e=vp(),He.lanes|=e,tr|=e,t)}function yd(e,t,i,a,g){var w=W.p;W.p=w!==0&&8>w?w:8;var O=G.T,F={};G.T=F,jc(e,!1,t,i);try{var X=g(),oe=G.S;if(oe!==null&&oe(F,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var de=_y(X,a);da(e,t,de,Rn(e))}else da(e,t,a,Rn(e))}catch(_e){da(e,t,{then:function(){},status:"rejected",reason:_e},Rn())}finally{W.p=w,O!==null&&F.types!==null&&(O.types=F.types),G.T=O}}function wy(){}function Oc(e,t,i,a){if(e.tag!==5)throw Error(l(476));var g=Sd(e).queue;yd(e,g,t,Z,i===null?wy:function(){return bd(e),i(a)})}function Sd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:Z},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function bd(e){var t=Sd(e);t.next===null&&(t=e.alternate.memoizedState),da(e,t.next.queue,{},Rn())}function Bc(){return Ft(Da)}function Cd(){return wt().memoizedState}function wd(){return wt().memoizedState}function xy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Rn();e=Yi(i);var a=Xi(t,e,i);a!==null&&(_n(a,t,i),oa(a,t,i)),t={cache:cc()},e.payload=t;return}t=t.return}}function Ey(e,t,i){var a=Rn();i={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},jl(e)?Ed(t,i):(i=Jo(e,t,i,a),i!==null&&(_n(i,e,a),kd(i,t,a)))}function xd(e,t,i){var a=Rn();da(e,t,i,a)}function da(e,t,i,a){var g={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(jl(e))Ed(t,g);else{var w=e.alternate;if(e.lanes===0&&(w===null||w.lanes===0)&&(w=t.lastRenderedReducer,w!==null))try{var O=t.lastRenderedState,F=w(O,i);if(g.hasEagerState=!0,g.eagerState=F,wn(F,O))return ml(e,t,g,0),lt===null&&pl(),!1}catch{}finally{}if(i=Jo(e,t,g,a),i!==null)return _n(i,e,a),kd(i,t,a),!0}return!1}function jc(e,t,i,a){if(a={lane:2,revertLane:du(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},jl(e)){if(t)throw Error(l(479))}else t=Jo(e,i,a,2),t!==null&&_n(t,e,2)}function jl(e){var t=e.alternate;return e===He||t!==null&&t===He}function Ed(e,t){ps=Tl=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function kd(e,t,i){if((i&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,i|=a,t.lanes=i,Ne(e,i)}}var pa={readContext:Ft,use:Ml,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};pa.useEffectEvent=_t;var Ad={readContext:Ft,use:Ml,useCallback:function(e,t){return tn().memoizedState=[e,t===void 0?null:t],e},useContext:Ft,useEffect:ud,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,Ol(4194308,4,pd.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Ol(4194308,4,e,t)},useInsertionEffect:function(e,t){Ol(4,2,e,t)},useMemo:function(e,t){var i=tn();t=t===void 0?null:t;var a=e();if(Or){Ot(!0);try{e()}finally{Ot(!1)}}return i.memoizedState=[a,t],a},useReducer:function(e,t,i){var a=tn();if(i!==void 0){var g=i(t);if(Or){Ot(!0);try{i(t)}finally{Ot(!1)}}}else g=t;return a.memoizedState=a.baseState=g,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:g},a.queue=e,e=e.dispatch=Ey.bind(null,He,e),[a.memoizedState,e]},useRef:function(e){var t=tn();return e={current:e},t.memoizedState=e},useState:function(e){e=Tc(e);var t=e.queue,i=xd.bind(null,He,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Mc,useDeferredValue:function(e,t){var i=tn();return Lc(i,e,t)},useTransition:function(){var e=Tc(!1);return e=yd.bind(null,He,e.queue,!0,!1),tn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var a=He,g=tn();if(Ye){if(i===void 0)throw Error(l(407));i=i()}else{if(i=t(),lt===null)throw Error(l(349));(We&127)!==0||Kf(a,t,i)}g.memoizedState=i;var w={value:i,getSnapshot:t};return g.queue=w,ud(Xf.bind(null,a,w,e),[e]),a.flags|=2048,gs(9,{destroy:void 0},Yf.bind(null,a,w,i,t),null),i},useId:function(){var e=tn(),t=lt.identifierPrefix;if(Ye){var i=ui,a=ci;i=(a&~(1<<32-Ze(a)-1)).toString(32)+i,t="_"+t+"R_"+i,i=Rl++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=vy++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Bc,useFormState:sd,useActionState:sd,useOptimistic:function(e){var t=tn();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=jc.bind(null,He,!0,i),i.dispatch=t,[e,t]},useMemoCache:Ec,useCacheRefresh:function(){return tn().memoizedState=xy.bind(null,He)},useEffectEvent:function(e){var t=tn(),i={impl:e};return t.memoizedState=i,function(){if((et&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},Nc={readContext:Ft,use:Ml,useCallback:gd,useContext:Ft,useEffect:Dc,useImperativeHandle:md,useInsertionEffect:fd,useLayoutEffect:dd,useMemo:_d,useReducer:Ll,useRef:cd,useState:function(){return Ll(Ai)},useDebugValue:Mc,useDeferredValue:function(e,t){var i=wt();return vd(i,rt.memoizedState,e,t)},useTransition:function(){var e=Ll(Ai)[0],t=wt().memoizedState;return[typeof e=="boolean"?e:fa(e),t]},useSyncExternalStore:Wf,useId:Cd,useHostTransitionStatus:Bc,useFormState:ad,useActionState:ad,useOptimistic:function(e,t){var i=wt();return Zf(i,rt,e,t)},useMemoCache:Ec,useCacheRefresh:wd};Nc.useEffectEvent=hd;var Td={readContext:Ft,use:Ml,useCallback:gd,useContext:Ft,useEffect:Dc,useImperativeHandle:md,useInsertionEffect:fd,useLayoutEffect:dd,useMemo:_d,useReducer:Ac,useRef:cd,useState:function(){return Ac(Ai)},useDebugValue:Mc,useDeferredValue:function(e,t){var i=wt();return rt===null?Lc(i,e,t):vd(i,rt.memoizedState,e,t)},useTransition:function(){var e=Ac(Ai)[0],t=wt().memoizedState;return[typeof e=="boolean"?e:fa(e),t]},useSyncExternalStore:Wf,useId:Cd,useHostTransitionStatus:Bc,useFormState:od,useActionState:od,useOptimistic:function(e,t){var i=wt();return rt!==null?Zf(i,rt,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Ec,useCacheRefresh:wd};Td.useEffectEvent=hd;function Hc(e,t,i,a){t=e.memoizedState,i=i(a,t),i=i==null?t:u({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var zc={enqueueSetState:function(e,t,i){e=e._reactInternals;var a=Rn(),g=Yi(a);g.payload=t,i!=null&&(g.callback=i),t=Xi(e,g,a),t!==null&&(_n(t,e,a),oa(t,e,a))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var a=Rn(),g=Yi(a);g.tag=1,g.payload=t,i!=null&&(g.callback=i),t=Xi(e,g,a),t!==null&&(_n(t,e,a),oa(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Rn(),a=Yi(i);a.tag=2,t!=null&&(a.callback=t),t=Xi(e,a,i),t!==null&&(_n(t,e,i),oa(t,e,i))}};function Rd(e,t,i,a,g,w,O){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,w,O):t.prototype&&t.prototype.isPureReactComponent?!ea(i,a)||!ea(g,w):!0}function Dd(e,t,i,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,a),t.state!==e&&zc.enqueueReplaceState(t,t.state,null)}function Br(e,t){var i=t;if("ref"in t){i={};for(var a in t)a!=="ref"&&(i[a]=t[a])}if(e=e.defaultProps){i===t&&(i=u({},i));for(var g in e)i[g]===void 0&&(i[g]=e[g])}return i}function Md(e){dl(e)}function Ld(e){console.error(e)}function Od(e){dl(e)}function Nl(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Bd(e,t,i){try{var a=e.onCaughtError;a(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function Ic(e,t,i){return i=Yi(i),i.tag=3,i.payload={element:null},i.callback=function(){Nl(e,t)},i}function jd(e){return e=Yi(e),e.tag=3,e}function Nd(e,t,i,a){var g=i.type.getDerivedStateFromError;if(typeof g=="function"){var w=a.value;e.payload=function(){return g(w)},e.callback=function(){Bd(t,i,a)}}var O=i.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(e.callback=function(){Bd(t,i,a),typeof g!="function"&&(nr===null?nr=new Set([this]):nr.add(this));var F=a.stack;this.componentDidCatch(a.value,{componentStack:F!==null?F:""})})}function ky(e,t,i,a,g){if(i.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=i.alternate,t!==null&&os(t,i,g,!0),i=En.current,i!==null){switch(i.tag){case 31:case 13:return qn===null?Kl():i.alternate===null&&vt===0&&(vt=3),i.flags&=-257,i.flags|=65536,i.lanes=g,a===wl?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([a]):t.add(a),uu(e,a,g)),!1;case 22:return i.flags|=65536,a===wl?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([a]):i.add(a)),uu(e,a,g)),!1}throw Error(l(435,i.tag))}return uu(e,a,g),Kl(),!1}if(Ye)return t=En.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=g,a!==rc&&(e=Error(l(422),{cause:a}),ia(In(e,i)))):(a!==rc&&(t=Error(l(423),{cause:a}),ia(In(t,i))),e=e.current.alternate,e.flags|=65536,g&=-g,e.lanes|=g,a=In(a,i),g=Ic(e.stateNode,a,g),mc(e,g),vt!==4&&(vt=2)),!1;var w=Error(l(520),{cause:a});if(w=In(w,i),Ca===null?Ca=[w]:Ca.push(w),vt!==4&&(vt=2),t===null)return!0;a=In(a,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=g&-g,i.lanes|=e,e=Ic(i.stateNode,a,e),mc(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"&&(nr===null||!nr.has(w))))return i.flags|=65536,g&=-g,i.lanes|=g,g=jd(g),Nd(g,e,i,a),mc(i,g),!1}i=i.return}while(i!==null);return!1}var Uc=Error(l(461)),Rt=!1;function qt(e,t,i,a){t.child=e===null?Uf(t,null,i,a):Lr(t,e.child,i,a)}function Hd(e,t,i,a,g){i=i.render;var w=t.ref;if("ref"in a){var O={};for(var F in a)F!=="ref"&&(O[F]=a[F])}else O=a;return Tr(t),a=bc(e,t,i,O,w,g),F=Cc(),e!==null&&!Rt?(wc(e,t,g),Ti(e,t,g)):(Ye&&F&&nc(t),t.flags|=1,qt(e,t,a,g),t.child)}function zd(e,t,i,a,g){if(e===null){var w=i.type;return typeof w=="function"&&!Zo(w)&&w.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=w,Id(e,t,w,a,g)):(e=_l(i.type,null,a,t,t.mode,g),e.ref=t.ref,e.return=t,t.child=e)}if(w=e.child,!Kc(e,g)){var O=w.memoizedProps;if(i=i.compare,i=i!==null?i:ea,i(O,a)&&e.ref===t.ref)return Ti(e,t,g)}return t.flags|=1,e=Ci(w,a),e.ref=t.ref,e.return=t,t.child=e}function Id(e,t,i,a,g){if(e!==null){var w=e.memoizedProps;if(ea(w,a)&&e.ref===t.ref)if(Rt=!1,t.pendingProps=a=w,Kc(e,g))(e.flags&131072)!==0&&(Rt=!0);else return t.lanes=e.lanes,Ti(e,t,g)}return Pc(e,t,i,a,g)}function Ud(e,t,i,a){var g=a.children,w=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(w=w!==null?w.baseLanes|i:i,e!==null){for(a=t.child=e.child,g=0;a!==null;)g=g|a.lanes|a.childLanes,a=a.sibling;a=g&~w}else a=0,t.child=null;return Pd(e,t,w,i,a)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&bl(t,w!==null?w.cachePool:null),w!==null?qf(t,w):_c(),$f(t);else return a=t.lanes=536870912,Pd(e,t,w!==null?w.baseLanes|i:i,i,a)}else w!==null?(bl(t,w.cachePool),qf(t,w),Ji(),t.memoizedState=null):(e!==null&&bl(t,null),_c(),Ji());return qt(e,t,g,i),t.child}function ma(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Pd(e,t,i,a,g){var w=hc();return w=w===null?null:{parent:At._currentValue,pool:w},t.memoizedState={baseLanes:i,cachePool:w},e!==null&&bl(t,null),_c(),$f(t),e!==null&&os(e,t,a,!0),t.childLanes=g,null}function Hl(e,t){return t=Il({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Fd(e,t,i){return Lr(t,e.child,null,i),e=Hl(t,t.pendingProps),e.flags|=2,kn(t),t.memoizedState=null,e}function Ay(e,t,i){var a=t.pendingProps,g=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ye){if(a.mode==="hidden")return e=Hl(t,a),t.lanes=536870912,ma(null,e);if(yc(t),(e=ht)?(e=em(e,Fn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:$i!==null?{id:ci,overflow:ui}:null,retryLane:536870912,hydrationErrors:null},i=Ef(e),i.return=t,t.child=i,Pt=t,ht=null)):e=null,e===null)throw Vi(t);return t.lanes=536870912,null}return Hl(t,a)}var w=e.memoizedState;if(w!==null){var O=w.dehydrated;if(yc(t),g)if(t.flags&256)t.flags&=-257,t=Fd(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(Rt||os(e,t,i,!1),g=(i&e.childLanes)!==0,Rt||g){if(a=lt,a!==null&&(O=Pi(a,i),O!==0&&O!==w.retryLane))throw w.retryLane=O,xr(e,O),_n(a,e,O),Uc;Kl(),t=Fd(e,t,i)}else e=w.treeContext,ht=$n(O.nextSibling),Pt=t,Ye=!0,Gi=null,Fn=!1,e!==null&&Tf(t,e),t=Hl(t,a),t.flags|=4096;return t}return e=Ci(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function zl(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(l(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Pc(e,t,i,a,g){return Tr(t),i=bc(e,t,i,a,void 0,g),a=Cc(),e!==null&&!Rt?(wc(e,t,g),Ti(e,t,g)):(Ye&&a&&nc(t),t.flags|=1,qt(e,t,i,g),t.child)}function qd(e,t,i,a,g,w){return Tr(t),t.updateQueue=null,i=Vf(t,a,i,g),Gf(e),a=Cc(),e!==null&&!Rt?(wc(e,t,w),Ti(e,t,w)):(Ye&&a&&nc(t),t.flags|=1,qt(e,t,i,w),t.child)}function $d(e,t,i,a,g){if(Tr(t),t.stateNode===null){var w=rs,O=i.contextType;typeof O=="object"&&O!==null&&(w=Ft(O)),w=new i(a,w),t.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=zc,t.stateNode=w,w._reactInternals=t,w=t.stateNode,w.props=a,w.state=t.memoizedState,w.refs={},dc(t),O=i.contextType,w.context=typeof O=="object"&&O!==null?Ft(O):rs,w.state=t.memoizedState,O=i.getDerivedStateFromProps,typeof O=="function"&&(Hc(t,i,O,a),w.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(O=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),O!==w.state&&zc.enqueueReplaceState(w,w.state,null),ua(t,a,w,g),ca(),w.state=t.memoizedState),typeof w.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){w=t.stateNode;var F=t.memoizedProps,X=Br(i,F);w.props=X;var oe=w.context,de=i.contextType;O=rs,typeof de=="object"&&de!==null&&(O=Ft(de));var _e=i.getDerivedStateFromProps;de=typeof _e=="function"||typeof w.getSnapshotBeforeUpdate=="function",F=t.pendingProps!==F,de||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(F||oe!==O)&&Dd(t,w,a,O),Ki=!1;var ce=t.memoizedState;w.state=ce,ua(t,a,w,g),ca(),oe=t.memoizedState,F||ce!==oe||Ki?(typeof _e=="function"&&(Hc(t,i,_e,a),oe=t.memoizedState),(X=Ki||Rd(t,i,X,a,ce,oe,O))?(de||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=a,t.memoizedState=oe),w.props=a,w.state=oe,w.context=O,a=X):(typeof w.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{w=t.stateNode,pc(e,t),O=t.memoizedProps,de=Br(i,O),w.props=de,_e=t.pendingProps,ce=w.context,oe=i.contextType,X=rs,typeof oe=="object"&&oe!==null&&(X=Ft(oe)),F=i.getDerivedStateFromProps,(oe=typeof F=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(O!==_e||ce!==X)&&Dd(t,w,a,X),Ki=!1,ce=t.memoizedState,w.state=ce,ua(t,a,w,g),ca();var ue=t.memoizedState;O!==_e||ce!==ue||Ki||e!==null&&e.dependencies!==null&&yl(e.dependencies)?(typeof F=="function"&&(Hc(t,i,F,a),ue=t.memoizedState),(de=Ki||Rd(t,i,de,a,ce,ue,X)||e!==null&&e.dependencies!==null&&yl(e.dependencies))?(oe||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(a,ue,X),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(a,ue,X)),typeof w.componentDidUpdate=="function"&&(t.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof w.componentDidUpdate!="function"||O===e.memoizedProps&&ce===e.memoizedState||(t.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&ce===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=ue),w.props=a,w.state=ue,w.context=X,a=de):(typeof w.componentDidUpdate!="function"||O===e.memoizedProps&&ce===e.memoizedState||(t.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&ce===e.memoizedState||(t.flags|=1024),a=!1)}return w=a,zl(e,t),a=(t.flags&128)!==0,w||a?(w=t.stateNode,i=a&&typeof i.getDerivedStateFromError!="function"?null:w.render(),t.flags|=1,e!==null&&a?(t.child=Lr(t,e.child,null,g),t.child=Lr(t,null,i,g)):qt(e,t,i,g),t.memoizedState=w.state,e=t.child):e=Ti(e,t,g),e}function Gd(e,t,i,a){return kr(),t.flags|=256,qt(e,t,i,a),t.child}var Fc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qc(e){return{baseLanes:e,cachePool:Bf()}}function $c(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Tn),e}function Vd(e,t,i){var a=t.pendingProps,g=!1,w=(t.flags&128)!==0,O;if((O=w)||(O=e!==null&&e.memoizedState===null?!1:(Ct.current&2)!==0),O&&(g=!0,t.flags&=-129),O=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ye){if(g?Qi(t):Ji(),(e=ht)?(e=em(e,Fn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:$i!==null?{id:ci,overflow:ui}:null,retryLane:536870912,hydrationErrors:null},i=Ef(e),i.return=t,t.child=i,Pt=t,ht=null)):e=null,e===null)throw Vi(t);return ku(e)?t.lanes=32:t.lanes=536870912,null}var F=a.children;return a=a.fallback,g?(Ji(),g=t.mode,F=Il({mode:"hidden",children:F},g),a=Er(a,g,i,null),F.return=t,a.return=t,F.sibling=a,t.child=F,a=t.child,a.memoizedState=qc(i),a.childLanes=$c(e,O,i),t.memoizedState=Fc,ma(null,a)):(Qi(t),Gc(t,F))}var X=e.memoizedState;if(X!==null&&(F=X.dehydrated,F!==null)){if(w)t.flags&256?(Qi(t),t.flags&=-257,t=Vc(e,t,i)):t.memoizedState!==null?(Ji(),t.child=e.child,t.flags|=128,t=null):(Ji(),F=a.fallback,g=t.mode,a=Il({mode:"visible",children:a.children},g),F=Er(F,g,i,null),F.flags|=2,a.return=t,F.return=t,a.sibling=F,t.child=a,Lr(t,e.child,null,i),a=t.child,a.memoizedState=qc(i),a.childLanes=$c(e,O,i),t.memoizedState=Fc,t=ma(null,a));else if(Qi(t),ku(F)){if(O=F.nextSibling&&F.nextSibling.dataset,O)var oe=O.dgst;O=oe,a=Error(l(419)),a.stack="",a.digest=O,ia({value:a,source:null,stack:null}),t=Vc(e,t,i)}else if(Rt||os(e,t,i,!1),O=(i&e.childLanes)!==0,Rt||O){if(O=lt,O!==null&&(a=Pi(O,i),a!==0&&a!==X.retryLane))throw X.retryLane=a,xr(e,a),_n(O,e,a),Uc;Eu(F)||Kl(),t=Vc(e,t,i)}else Eu(F)?(t.flags|=192,t.child=e.child,t=null):(e=X.treeContext,ht=$n(F.nextSibling),Pt=t,Ye=!0,Gi=null,Fn=!1,e!==null&&Tf(t,e),t=Gc(t,a.children),t.flags|=4096);return t}return g?(Ji(),F=a.fallback,g=t.mode,X=e.child,oe=X.sibling,a=Ci(X,{mode:"hidden",children:a.children}),a.subtreeFlags=X.subtreeFlags&65011712,oe!==null?F=Ci(oe,F):(F=Er(F,g,i,null),F.flags|=2),F.return=t,a.return=t,a.sibling=F,t.child=a,ma(null,a),a=t.child,F=e.child.memoizedState,F===null?F=qc(i):(g=F.cachePool,g!==null?(X=At._currentValue,g=g.parent!==X?{parent:X,pool:X}:g):g=Bf(),F={baseLanes:F.baseLanes|i,cachePool:g}),a.memoizedState=F,a.childLanes=$c(e,O,i),t.memoizedState=Fc,ma(e.child,a)):(Qi(t),i=e.child,e=i.sibling,i=Ci(i,{mode:"visible",children:a.children}),i.return=t,i.sibling=null,e!==null&&(O=t.deletions,O===null?(t.deletions=[e],t.flags|=16):O.push(e)),t.child=i,t.memoizedState=null,i)}function Gc(e,t){return t=Il({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Il(e,t){return e=xn(22,e,null,t),e.lanes=0,e}function Vc(e,t,i){return Lr(t,e.child,null,i),e=Gc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Wd(e,t,i){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),lc(e.return,t,i)}function Wc(e,t,i,a,g,w){var O=e.memoizedState;O===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:i,tailMode:g,treeForkCount:w}:(O.isBackwards=t,O.rendering=null,O.renderingStartTime=0,O.last=a,O.tail=i,O.tailMode=g,O.treeForkCount=w)}function Kd(e,t,i){var a=t.pendingProps,g=a.revealOrder,w=a.tail;a=a.children;var O=Ct.current,F=(O&2)!==0;if(F?(O=O&1|2,t.flags|=128):O&=1,I(Ct,O),qt(e,t,a,i),a=Ye?na:0,!F&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Wd(e,i,t);else if(e.tag===19)Wd(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(g){case"forwards":for(i=t.child,g=null;i!==null;)e=i.alternate,e!==null&&Al(e)===null&&(g=i),i=i.sibling;i=g,i===null?(g=t.child,t.child=null):(g=i.sibling,i.sibling=null),Wc(t,!1,g,i,w,a);break;case"backwards":case"unstable_legacy-backwards":for(i=null,g=t.child,t.child=null;g!==null;){if(e=g.alternate,e!==null&&Al(e)===null){t.child=g;break}e=g.sibling,g.sibling=i,i=g,g=e}Wc(t,!0,i,null,w,a);break;case"together":Wc(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Ti(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),tr|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(os(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,i=Ci(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Ci(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Kc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&yl(e)))}function Ty(e,t,i){switch(t.tag){case 3:q(t,t.stateNode.containerInfo),Wi(t,At,e.memoizedState.cache),kr();break;case 27:case 5:ae(t);break;case 4:q(t,t.stateNode.containerInfo);break;case 10:Wi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,yc(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Qi(t),t.flags|=128,null):(i&t.child.childLanes)!==0?Vd(e,t,i):(Qi(t),e=Ti(e,t,i),e!==null?e.sibling:null);Qi(t);break;case 19:var g=(e.flags&128)!==0;if(a=(i&t.childLanes)!==0,a||(os(e,t,i,!1),a=(i&t.childLanes)!==0),g){if(a)return Kd(e,t,i);t.flags|=128}if(g=t.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),I(Ct,Ct.current),a)break;return null;case 22:return t.lanes=0,Ud(e,t,i,t.pendingProps);case 24:Wi(t,At,e.memoizedState.cache)}return Ti(e,t,i)}function Yd(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Rt=!0;else{if(!Kc(e,i)&&(t.flags&128)===0)return Rt=!1,Ty(e,t,i);Rt=(e.flags&131072)!==0}else Rt=!1,Ye&&(t.flags&1048576)!==0&&Af(t,na,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Dr(t.elementType),t.type=e,typeof e=="function")Zo(e)?(a=Br(e,a),t.tag=1,t=$d(null,t,e,a,i)):(t.tag=0,t=Pc(null,t,e,a,i));else{if(e!=null){var g=e.$$typeof;if(g===A){t.tag=11,t=Hd(null,t,e,a,i);break e}else if(g===R){t.tag=14,t=zd(null,t,e,a,i);break e}}throw t=K(e)||e,Error(l(306,t,""))}}return t;case 0:return Pc(e,t,t.type,t.pendingProps,i);case 1:return a=t.type,g=Br(a,t.pendingProps),$d(e,t,a,g,i);case 3:e:{if(q(t,t.stateNode.containerInfo),e===null)throw Error(l(387));a=t.pendingProps;var w=t.memoizedState;g=w.element,pc(e,t),ua(t,a,null,i);var O=t.memoizedState;if(a=O.cache,Wi(t,At,a),a!==w.cache&&oc(t,[At],i,!0),ca(),a=O.element,w.isDehydrated)if(w={element:a,isDehydrated:!1,cache:O.cache},t.updateQueue.baseState=w,t.memoizedState=w,t.flags&256){t=Gd(e,t,a,i);break e}else if(a!==g){g=In(Error(l(424)),t),ia(g),t=Gd(e,t,a,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(ht=$n(e.firstChild),Pt=t,Ye=!0,Gi=null,Fn=!0,i=Uf(t,null,a,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(kr(),a===g){t=Ti(e,t,i);break e}qt(e,t,a,i)}t=t.child}return t;case 26:return zl(e,t),e===null?(i=am(t.type,null,t.pendingProps,null))?t.memoizedState=i:Ye||(i=t.type,e=t.pendingProps,a=to(me.current).createElement(i),a[kt]=t,a[It]=e,$t(a,i,e),bt(a),t.stateNode=a):t.memoizedState=am(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ae(t),e===null&&Ye&&(a=t.stateNode=im(t.type,t.pendingProps,me.current),Pt=t,Fn=!0,g=ht,ar(t.type)?(Au=g,ht=$n(a.firstChild)):ht=g),qt(e,t,t.pendingProps.children,i),zl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ye&&((g=a=ht)&&(a=r0(a,t.type,t.pendingProps,Fn),a!==null?(t.stateNode=a,Pt=t,ht=$n(a.firstChild),Fn=!1,g=!0):g=!1),g||Vi(t)),ae(t),g=t.type,w=t.pendingProps,O=e!==null?e.memoizedProps:null,a=w.children,Cu(g,w)?a=null:O!==null&&Cu(g,O)&&(t.flags|=32),t.memoizedState!==null&&(g=bc(e,t,yy,null,null,i),Da._currentValue=g),zl(e,t),qt(e,t,a,i),t.child;case 6:return e===null&&Ye&&((e=i=ht)&&(i=s0(i,t.pendingProps,Fn),i!==null?(t.stateNode=i,Pt=t,ht=null,e=!0):e=!1),e||Vi(t)),null;case 13:return Vd(e,t,i);case 4:return q(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Lr(t,null,a,i):qt(e,t,a,i),t.child;case 11:return Hd(e,t,t.type,t.pendingProps,i);case 7:return qt(e,t,t.pendingProps,i),t.child;case 8:return qt(e,t,t.pendingProps.children,i),t.child;case 12:return qt(e,t,t.pendingProps.children,i),t.child;case 10:return a=t.pendingProps,Wi(t,t.type,a.value),qt(e,t,a.children,i),t.child;case 9:return g=t.type._context,a=t.pendingProps.children,Tr(t),g=Ft(g),a=a(g),t.flags|=1,qt(e,t,a,i),t.child;case 14:return zd(e,t,t.type,t.pendingProps,i);case 15:return Id(e,t,t.type,t.pendingProps,i);case 19:return Kd(e,t,i);case 31:return Ay(e,t,i);case 22:return Ud(e,t,i,t.pendingProps);case 24:return Tr(t),a=Ft(At),e===null?(g=hc(),g===null&&(g=lt,w=cc(),g.pooledCache=w,w.refCount++,w!==null&&(g.pooledCacheLanes|=i),g=w),t.memoizedState={parent:a,cache:g},dc(t),Wi(t,At,g)):((e.lanes&i)!==0&&(pc(e,t),ua(t,null,null,i),ca()),g=e.memoizedState,w=t.memoizedState,g.parent!==a?(g={parent:a,cache:a},t.memoizedState=g,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=g),Wi(t,At,a)):(a=w.cache,Wi(t,At,a),a!==g.cache&&oc(t,[At],i,!0))),qt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function Ri(e){e.flags|=4}function Yc(e,t,i,a,g){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(g&335544128)===g)if(e.stateNode.complete)e.flags|=8192;else if(Cp())e.flags|=8192;else throw Mr=wl,fc}else e.flags&=-16777217}function Xd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!hm(t))if(Cp())e.flags|=8192;else throw Mr=wl,fc}function Ul(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?rn():536870912,e.lanes|=t,Ss|=t)}function ga(e,t){if(!Ye)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 a=null;i!==null;)i.alternate!==null&&(a=i),i=i.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function ft(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,a=0;if(t)for(var g=e.child;g!==null;)i|=g.lanes|g.childLanes,a|=g.subtreeFlags&65011712,a|=g.flags&65011712,g.return=e,g=g.sibling;else for(g=e.child;g!==null;)i|=g.lanes|g.childLanes,a|=g.subtreeFlags,a|=g.flags,g.return=e,g=g.sibling;return e.subtreeFlags|=a,e.childLanes=i,t}function Ry(e,t,i){var a=t.pendingProps;switch(ic(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ft(t),null;case 1:return ft(t),null;case 3:return i=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ei(At),ee(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ls(t)?Ri(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,sc())),ft(t),null;case 26:var g=t.type,w=t.memoizedState;return e===null?(Ri(t),w!==null?(ft(t),Xd(t,w)):(ft(t),Yc(t,g,null,a,i))):w?w!==e.memoizedState?(Ri(t),ft(t),Xd(t,w)):(ft(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&Ri(t),ft(t),Yc(t,g,e,a,i)),null;case 27:if(pe(t),i=me.current,g=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Ri(t);else{if(!a){if(t.stateNode===null)throw Error(l(166));return ft(t),null}e=re.current,ls(t)?Rf(t):(e=im(g,a,i),t.stateNode=e,Ri(t))}return ft(t),null;case 5:if(pe(t),g=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Ri(t);else{if(!a){if(t.stateNode===null)throw Error(l(166));return ft(t),null}if(w=re.current,ls(t))Rf(t);else{var O=to(me.current);switch(w){case 1:w=O.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:w=O.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":w=O.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":w=O.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":w=O.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof a.is=="string"?O.createElement("select",{is:a.is}):O.createElement("select"),a.multiple?w.multiple=!0:a.size&&(w.size=a.size);break;default:w=typeof a.is=="string"?O.createElement(g,{is:a.is}):O.createElement(g)}}w[kt]=t,w[It]=a;e:for(O=t.child;O!==null;){if(O.tag===5||O.tag===6)w.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===t)break e;for(;O.sibling===null;){if(O.return===null||O.return===t)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}t.stateNode=w;e:switch($t(w,g,a),g){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Ri(t)}}return ft(t),Yc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Ri(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(l(166));if(e=me.current,ls(t)){if(e=t.stateNode,i=t.memoizedProps,a=null,g=Pt,g!==null)switch(g.tag){case 27:case 5:a=g.memoizedProps}e[kt]=t,e=!!(e.nodeValue===i||a!==null&&a.suppressHydrationWarning===!0||Vp(e.nodeValue,i)),e||Vi(t,!0)}else e=to(e).createTextNode(a),e[kt]=t,t.stateNode=e}return ft(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(a=ls(t),i!==null){if(e===null){if(!a)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[kt]=t}else kr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ft(t),e=!1}else i=sc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(kn(t),t):(kn(t),null);if((t.flags&128)!==0)throw Error(l(558))}return ft(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(g=ls(t),a!==null&&a.dehydrated!==null){if(e===null){if(!g)throw Error(l(318));if(g=t.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(l(317));g[kt]=t}else kr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ft(t),g=!1}else g=sc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=g),g=!0;if(!g)return t.flags&256?(kn(t),t):(kn(t),null)}return kn(t),(t.flags&128)!==0?(t.lanes=i,t):(i=a!==null,e=e!==null&&e.memoizedState!==null,i&&(a=t.child,g=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(g=a.alternate.memoizedState.cachePool.pool),w=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(w=a.memoizedState.cachePool.pool),w!==g&&(a.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Ul(t,t.updateQueue),ft(t),null);case 4:return ee(),e===null&&_u(t.stateNode.containerInfo),ft(t),null;case 10:return Ei(t.type),ft(t),null;case 19:if($(Ct),a=t.memoizedState,a===null)return ft(t),null;if(g=(t.flags&128)!==0,w=a.rendering,w===null)if(g)ga(a,!1);else{if(vt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(w=Al(e),w!==null){for(t.flags|=128,ga(a,!1),e=w.updateQueue,t.updateQueue=e,Ul(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)xf(i,e),i=i.sibling;return I(Ct,Ct.current&1|2),Ye&&wi(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&tt()>Gl&&(t.flags|=128,g=!0,ga(a,!1),t.lanes=4194304)}else{if(!g)if(e=Al(w),e!==null){if(t.flags|=128,g=!0,e=e.updateQueue,t.updateQueue=e,Ul(t,e),ga(a,!0),a.tail===null&&a.tailMode==="hidden"&&!w.alternate&&!Ye)return ft(t),null}else 2*tt()-a.renderingStartTime>Gl&&i!==536870912&&(t.flags|=128,g=!0,ga(a,!1),t.lanes=4194304);a.isBackwards?(w.sibling=t.child,t.child=w):(e=a.last,e!==null?e.sibling=w:t.child=w,a.last=w)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=tt(),e.sibling=null,i=Ct.current,I(Ct,g?i&1|2:i&1),Ye&&wi(t,a.treeForkCount),e):(ft(t),null);case 22:case 23:return kn(t),vc(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(i&536870912)!==0&&(t.flags&128)===0&&(ft(t),t.subtreeFlags&6&&(t.flags|=8192)):ft(t),i=t.updateQueue,i!==null&&Ul(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==i&&(t.flags|=2048),e!==null&&$(Rr),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Ei(At),ft(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function Dy(e,t){switch(ic(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ei(At),ee(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return pe(t),null;case 31:if(t.memoizedState!==null){if(kn(t),t.alternate===null)throw Error(l(340));kr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(kn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));kr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $(Ct),null;case 4:return ee(),null;case 10:return Ei(t.type),null;case 22:case 23:return kn(t),vc(),e!==null&&$(Rr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ei(At),null;case 25:return null;default:return null}}function Qd(e,t){switch(ic(t),t.tag){case 3:Ei(At),ee();break;case 26:case 27:case 5:pe(t);break;case 4:ee();break;case 31:t.memoizedState!==null&&kn(t);break;case 13:kn(t);break;case 19:$(Ct);break;case 10:Ei(t.type);break;case 22:case 23:kn(t),vc(),e!==null&&$(Rr);break;case 24:Ei(At)}}function _a(e,t){try{var i=t.updateQueue,a=i!==null?i.lastEffect:null;if(a!==null){var g=a.next;i=g;do{if((i.tag&e)===e){a=void 0;var w=i.create,O=i.inst;a=w(),O.destroy=a}i=i.next}while(i!==g)}}catch(F){it(t,t.return,F)}}function Zi(e,t,i){try{var a=t.updateQueue,g=a!==null?a.lastEffect:null;if(g!==null){var w=g.next;a=w;do{if((a.tag&e)===e){var O=a.inst,F=O.destroy;if(F!==void 0){O.destroy=void 0,g=t;var X=i,oe=F;try{oe()}catch(de){it(g,X,de)}}}a=a.next}while(a!==w)}}catch(de){it(t,t.return,de)}}function Jd(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Ff(t,i)}catch(a){it(e,e.return,a)}}}function Zd(e,t,i){i.props=Br(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(a){it(e,t,a)}}function va(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof i=="function"?e.refCleanup=i(a):i.current=a}}catch(g){it(e,t,g)}}function hi(e,t){var i=e.ref,a=e.refCleanup;if(i!==null)if(typeof a=="function")try{a()}catch(g){it(e,t,g)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(g){it(e,t,g)}else i.current=null}function ep(e){var t=e.type,i=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&a.focus();break e;case"img":i.src?a.src=i.src:i.srcSet&&(a.srcset=i.srcSet)}}catch(g){it(e,e.return,g)}}function Xc(e,t,i){try{var a=e.stateNode;Jy(a,e.type,i,t),a[It]=t}catch(g){it(e,e.return,g)}}function tp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ar(e.type)||e.tag===4}function Qc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tp(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&&ar(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 Jc(e,t,i){var a=e.tag;if(a===5||a===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=Vt));else if(a!==4&&(a===27&&ar(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Jc(e,t,i),e=e.sibling;e!==null;)Jc(e,t,i),e=e.sibling}function Pl(e,t,i){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(a!==4&&(a===27&&ar(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Pl(e,t,i),e=e.sibling;e!==null;)Pl(e,t,i),e=e.sibling}function np(e){var t=e.stateNode,i=e.memoizedProps;try{for(var a=e.type,g=t.attributes;g.length;)t.removeAttributeNode(g[0]);$t(t,a,i),t[kt]=e,t[It]=i}catch(w){it(e,e.return,w)}}var Di=!1,Dt=!1,Zc=!1,ip=typeof WeakSet=="function"?WeakSet:Set,zt=null;function My(e,t){if(e=e.containerInfo,Su=oo,e=mf(e),Vo(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var a=i.getSelection&&i.getSelection();if(a&&a.rangeCount!==0){i=a.anchorNode;var g=a.anchorOffset,w=a.focusNode;a=a.focusOffset;try{i.nodeType,w.nodeType}catch{i=null;break e}var O=0,F=-1,X=-1,oe=0,de=0,_e=e,ce=null;t:for(;;){for(var ue;_e!==i||g!==0&&_e.nodeType!==3||(F=O+g),_e!==w||a!==0&&_e.nodeType!==3||(X=O+a),_e.nodeType===3&&(O+=_e.nodeValue.length),(ue=_e.firstChild)!==null;)ce=_e,_e=ue;for(;;){if(_e===e)break t;if(ce===i&&++oe===g&&(F=O),ce===w&&++de===a&&(X=O),(ue=_e.nextSibling)!==null)break;_e=ce,ce=_e.parentNode}_e=ue}i=F===-1||X===-1?null:{start:F,end:X}}else i=null}i=i||{start:0,end:0}}else i=null;for(bu={focusedElem:e,selectionRange:i},oo=!1,zt=t;zt!==null;)if(t=zt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,zt=e;else for(;zt!==null;){switch(t=zt,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++)g=e[i],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&w!==null){e=void 0,i=t,g=w.memoizedProps,w=w.memoizedState,a=i.stateNode;try{var Ee=Br(i.type,g);e=a.getSnapshotBeforeUpdate(Ee,w),a.__reactInternalSnapshotBeforeUpdate=e}catch(Me){it(i,i.return,Me)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)xu(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":xu(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(l(163))}if(e=t.sibling,e!==null){e.return=t.return,zt=e;break}zt=t.return}}function rp(e,t,i){var a=i.flags;switch(i.tag){case 0:case 11:case 15:Li(e,i),a&4&&_a(5,i);break;case 1:if(Li(e,i),a&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(O){it(i,i.return,O)}else{var g=Br(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(g,t,e.__reactInternalSnapshotBeforeUpdate)}catch(O){it(i,i.return,O)}}a&64&&Jd(i),a&512&&va(i,i.return);break;case 3:if(Li(e,i),a&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{Ff(e,t)}catch(O){it(i,i.return,O)}}break;case 27:t===null&&a&4&&np(i);case 26:case 5:Li(e,i),t===null&&a&4&&ep(i),a&512&&va(i,i.return);break;case 12:Li(e,i);break;case 31:Li(e,i),a&4&&lp(e,i);break;case 13:Li(e,i),a&4&&op(e,i),a&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=Uy.bind(null,i),a0(e,i))));break;case 22:if(a=i.memoizedState!==null||Di,!a){t=t!==null&&t.memoizedState!==null||Dt,g=Di;var w=Dt;Di=a,(Dt=t)&&!w?Oi(e,i,(i.subtreeFlags&8772)!==0):Li(e,i),Di=g,Dt=w}break;case 30:break;default:Li(e,i)}}function sp(e){var t=e.alternate;t!==null&&(e.alternate=null,sp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&$r(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 pt=null,dn=!1;function Mi(e,t,i){for(i=i.child;i!==null;)ap(e,t,i),i=i.sibling}function ap(e,t,i){if(mt&&typeof mt.onCommitFiberUnmount=="function")try{mt.onCommitFiberUnmount(gt,i)}catch{}switch(i.tag){case 26:Dt||hi(i,t),Mi(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Dt||hi(i,t);var a=pt,g=dn;ar(i.type)&&(pt=i.stateNode,dn=!1),Mi(e,t,i),Aa(i.stateNode),pt=a,dn=g;break;case 5:Dt||hi(i,t);case 6:if(a=pt,g=dn,pt=null,Mi(e,t,i),pt=a,dn=g,pt!==null)if(dn)try{(pt.nodeType===9?pt.body:pt.nodeName==="HTML"?pt.ownerDocument.body:pt).removeChild(i.stateNode)}catch(w){it(i,t,w)}else try{pt.removeChild(i.stateNode)}catch(w){it(i,t,w)}break;case 18:pt!==null&&(dn?(e=pt,Jp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Ts(e)):Jp(pt,i.stateNode));break;case 4:a=pt,g=dn,pt=i.stateNode.containerInfo,dn=!0,Mi(e,t,i),pt=a,dn=g;break;case 0:case 11:case 14:case 15:Zi(2,i,t),Dt||Zi(4,i,t),Mi(e,t,i);break;case 1:Dt||(hi(i,t),a=i.stateNode,typeof a.componentWillUnmount=="function"&&Zd(i,t,a)),Mi(e,t,i);break;case 21:Mi(e,t,i);break;case 22:Dt=(a=Dt)||i.memoizedState!==null,Mi(e,t,i),Dt=a;break;default:Mi(e,t,i)}}function lp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ts(e)}catch(i){it(t,t.return,i)}}}function op(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ts(e)}catch(i){it(t,t.return,i)}}function Ly(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ip),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ip),t;default:throw Error(l(435,e.tag))}}function Fl(e,t){var i=Ly(e);t.forEach(function(a){if(!i.has(a)){i.add(a);var g=Py.bind(null,e,a);a.then(g,g)}})}function pn(e,t){var i=t.deletions;if(i!==null)for(var a=0;a<i.length;a++){var g=i[a],w=e,O=t,F=O;e:for(;F!==null;){switch(F.tag){case 27:if(ar(F.type)){pt=F.stateNode,dn=!1;break e}break;case 5:pt=F.stateNode,dn=!1;break e;case 3:case 4:pt=F.stateNode.containerInfo,dn=!0;break e}F=F.return}if(pt===null)throw Error(l(160));ap(w,O,g),pt=null,dn=!1,w=g.alternate,w!==null&&(w.return=null),g.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)cp(t,e),t=t.sibling}var ei=null;function cp(e,t){var i=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pn(t,e),mn(e),a&4&&(Zi(3,e,e.return),_a(3,e),Zi(5,e,e.return));break;case 1:pn(t,e),mn(e),a&512&&(Dt||i===null||hi(i,i.return)),a&64&&Di&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?a:i.concat(a))));break;case 26:var g=ei;if(pn(t,e),mn(e),a&512&&(Dt||i===null||hi(i,i.return)),a&4){var w=i!==null?i.memoizedState:null;if(a=e.memoizedState,i===null)if(a===null)if(e.stateNode===null){e:{a=e.type,i=e.memoizedProps,g=g.ownerDocument||g;t:switch(a){case"title":w=g.getElementsByTagName("title")[0],(!w||w[Nn]||w[kt]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=g.createElement(a),g.head.insertBefore(w,g.querySelector("head > title"))),$t(w,a,i),w[kt]=e,bt(w),a=w;break e;case"link":var O=cm("link","href",g).get(a+(i.href||""));if(O){for(var F=0;F<O.length;F++)if(w=O[F],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)){O.splice(F,1);break t}}w=g.createElement(a),$t(w,a,i),g.head.appendChild(w);break;case"meta":if(O=cm("meta","content",g).get(a+(i.content||""))){for(F=0;F<O.length;F++)if(w=O[F],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)){O.splice(F,1);break t}}w=g.createElement(a),$t(w,a,i),g.head.appendChild(w);break;default:throw Error(l(468,a))}w[kt]=e,bt(w),a=w}e.stateNode=a}else um(g,e.type,e.stateNode);else e.stateNode=om(g,a,e.memoizedProps);else w!==a?(w===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):w.count--,a===null?um(g,e.type,e.stateNode):om(g,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Xc(e,e.memoizedProps,i.memoizedProps)}break;case 27:pn(t,e),mn(e),a&512&&(Dt||i===null||hi(i,i.return)),i!==null&&a&4&&Xc(e,e.memoizedProps,i.memoizedProps);break;case 5:if(pn(t,e),mn(e),a&512&&(Dt||i===null||hi(i,i.return)),e.flags&32){g=e.stateNode;try{li(g,"")}catch(Ee){it(e,e.return,Ee)}}a&4&&e.stateNode!=null&&(g=e.memoizedProps,Xc(e,g,i!==null?i.memoizedProps:g)),a&1024&&(Zc=!0);break;case 6:if(pn(t,e),mn(e),a&4){if(e.stateNode===null)throw Error(l(162));a=e.memoizedProps,i=e.stateNode;try{i.nodeValue=a}catch(Ee){it(e,e.return,Ee)}}break;case 3:if(ro=null,g=ei,ei=no(t.containerInfo),pn(t,e),ei=g,mn(e),a&4&&i!==null&&i.memoizedState.isDehydrated)try{Ts(t.containerInfo)}catch(Ee){it(e,e.return,Ee)}Zc&&(Zc=!1,up(e));break;case 4:a=ei,ei=no(e.stateNode.containerInfo),pn(t,e),mn(e),ei=a;break;case 12:pn(t,e),mn(e);break;case 31:pn(t,e),mn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Fl(e,a)));break;case 13:pn(t,e),mn(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&($l=tt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Fl(e,a)));break;case 22:g=e.memoizedState!==null;var X=i!==null&&i.memoizedState!==null,oe=Di,de=Dt;if(Di=oe||g,Dt=de||X,pn(t,e),Dt=de,Di=oe,mn(e),a&8192)e:for(t=e.stateNode,t._visibility=g?t._visibility&-2:t._visibility|1,g&&(i===null||X||Di||Dt||jr(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){X=i=t;try{if(w=X.stateNode,g)O=w.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{F=X.stateNode;var _e=X.memoizedProps.style,ce=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;F.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(Ee){it(X,X.return,Ee)}}}else if(t.tag===6){if(i===null){X=t;try{X.stateNode.nodeValue=g?"":X.memoizedProps}catch(Ee){it(X,X.return,Ee)}}}else if(t.tag===18){if(i===null){X=t;try{var ue=X.stateNode;g?Zp(ue,!0):Zp(X.stateNode,!1)}catch(Ee){it(X,X.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}a&4&&(a=e.updateQueue,a!==null&&(i=a.retryQueue,i!==null&&(a.retryQueue=null,Fl(e,i))));break;case 19:pn(t,e),mn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Fl(e,a)));break;case 30:break;case 21:break;default:pn(t,e),mn(e)}}function mn(e){var t=e.flags;if(t&2){try{for(var i,a=e.return;a!==null;){if(tp(a)){i=a;break}a=a.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var g=i.stateNode,w=Qc(e);Pl(e,w,g);break;case 5:var O=i.stateNode;i.flags&32&&(li(O,""),i.flags&=-33);var F=Qc(e);Pl(e,F,O);break;case 3:case 4:var X=i.stateNode.containerInfo,oe=Qc(e);Jc(e,oe,X);break;default:throw Error(l(161))}}catch(de){it(e,e.return,de)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function up(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;up(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Li(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)rp(e,t.alternate,t),t=t.sibling}function jr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Zi(4,t,t.return),jr(t);break;case 1:hi(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&Zd(t,t.return,i),jr(t);break;case 27:Aa(t.stateNode);case 26:case 5:hi(t,t.return),jr(t);break;case 22:t.memoizedState===null&&jr(t);break;case 30:jr(t);break;default:jr(t)}e=e.sibling}}function Oi(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,g=e,w=t,O=w.flags;switch(w.tag){case 0:case 11:case 15:Oi(g,w,i),_a(4,w);break;case 1:if(Oi(g,w,i),a=w,g=a.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(oe){it(a,a.return,oe)}if(a=w,g=a.updateQueue,g!==null){var F=a.stateNode;try{var X=g.shared.hiddenCallbacks;if(X!==null)for(g.shared.hiddenCallbacks=null,g=0;g<X.length;g++)Pf(X[g],F)}catch(oe){it(a,a.return,oe)}}i&&O&64&&Jd(w),va(w,w.return);break;case 27:np(w);case 26:case 5:Oi(g,w,i),i&&a===null&&O&4&&ep(w),va(w,w.return);break;case 12:Oi(g,w,i);break;case 31:Oi(g,w,i),i&&O&4&&lp(g,w);break;case 13:Oi(g,w,i),i&&O&4&&op(g,w);break;case 22:w.memoizedState===null&&Oi(g,w,i),va(w,w.return);break;case 30:break;default:Oi(g,w,i)}t=t.sibling}}function eu(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&&ra(i))}function tu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e))}function ti(e,t,i,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)hp(e,t,i,a),t=t.sibling}function hp(e,t,i,a){var g=t.flags;switch(t.tag){case 0:case 11:case 15:ti(e,t,i,a),g&2048&&_a(9,t);break;case 1:ti(e,t,i,a);break;case 3:ti(e,t,i,a),g&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e)));break;case 12:if(g&2048){ti(e,t,i,a),e=t.stateNode;try{var w=t.memoizedProps,O=w.id,F=w.onPostCommit;typeof F=="function"&&F(O,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(X){it(t,t.return,X)}}else ti(e,t,i,a);break;case 31:ti(e,t,i,a);break;case 13:ti(e,t,i,a);break;case 23:break;case 22:w=t.stateNode,O=t.alternate,t.memoizedState!==null?w._visibility&2?ti(e,t,i,a):ya(e,t):w._visibility&2?ti(e,t,i,a):(w._visibility|=2,_s(e,t,i,a,(t.subtreeFlags&10256)!==0||!1)),g&2048&&eu(O,t);break;case 24:ti(e,t,i,a),g&2048&&tu(t.alternate,t);break;default:ti(e,t,i,a)}}function _s(e,t,i,a,g){for(g=g&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var w=e,O=t,F=i,X=a,oe=O.flags;switch(O.tag){case 0:case 11:case 15:_s(w,O,F,X,g),_a(8,O);break;case 23:break;case 22:var de=O.stateNode;O.memoizedState!==null?de._visibility&2?_s(w,O,F,X,g):ya(w,O):(de._visibility|=2,_s(w,O,F,X,g)),g&&oe&2048&&eu(O.alternate,O);break;case 24:_s(w,O,F,X,g),g&&oe&2048&&tu(O.alternate,O);break;default:_s(w,O,F,X,g)}t=t.sibling}}function ya(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,a=t,g=a.flags;switch(a.tag){case 22:ya(i,a),g&2048&&eu(a.alternate,a);break;case 24:ya(i,a),g&2048&&tu(a.alternate,a);break;default:ya(i,a)}t=t.sibling}}var Sa=8192;function vs(e,t,i){if(e.subtreeFlags&Sa)for(e=e.child;e!==null;)fp(e,t,i),e=e.sibling}function fp(e,t,i){switch(e.tag){case 26:vs(e,t,i),e.flags&Sa&&e.memoizedState!==null&&v0(i,ei,e.memoizedState,e.memoizedProps);break;case 5:vs(e,t,i);break;case 3:case 4:var a=ei;ei=no(e.stateNode.containerInfo),vs(e,t,i),ei=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Sa,Sa=16777216,vs(e,t,i),Sa=a):vs(e,t,i));break;default:vs(e,t,i)}}function dp(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 ba(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var a=t[i];zt=a,mp(a,e)}dp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)pp(e),e=e.sibling}function pp(e){switch(e.tag){case 0:case 11:case 15:ba(e),e.flags&2048&&Zi(9,e,e.return);break;case 3:ba(e);break;case 12:ba(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ql(e)):ba(e);break;default:ba(e)}}function ql(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var a=t[i];zt=a,mp(a,e)}dp(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Zi(8,t,t.return),ql(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,ql(t));break;default:ql(t)}e=e.sibling}}function mp(e,t){for(;zt!==null;){var i=zt;switch(i.tag){case 0:case 11:case 15:Zi(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var a=i.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:ra(i.memoizedState.cache)}if(a=i.child,a!==null)a.return=i,zt=a;else e:for(i=e;zt!==null;){a=zt;var g=a.sibling,w=a.return;if(sp(a),a===i){zt=null;break e}if(g!==null){g.return=w,zt=g;break e}zt=w}}}var Oy={getCacheForType:function(e){var t=Ft(At),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Ft(At).controller.signal}},By=typeof WeakMap=="function"?WeakMap:Map,et=0,lt=null,$e=null,We=0,nt=0,An=null,er=!1,ys=!1,nu=!1,Bi=0,vt=0,tr=0,Nr=0,iu=0,Tn=0,Ss=0,Ca=null,gn=null,ru=!1,$l=0,gp=0,Gl=1/0,Vl=null,nr=null,jt=0,ir=null,bs=null,ji=0,su=0,au=null,_p=null,wa=0,lu=null;function Rn(){return(et&2)!==0&&We!==0?We&-We:G.T!==null?du():Kn()}function vp(){if(Tn===0)if((We&536870912)===0||Ye){var e=ri;ri<<=1,(ri&3932160)===0&&(ri=262144),Tn=e}else Tn=536870912;return e=En.current,e!==null&&(e.flags|=32),Tn}function _n(e,t,i){(e===lt&&(nt===2||nt===9)||e.cancelPendingCommit!==null)&&(Cs(e,0),rr(e,We,Tn,!1)),sn(e,i),((et&2)===0||e!==lt)&&(e===lt&&((et&2)===0&&(Nr|=i),vt===4&&rr(e,We,Tn,!1)),fi(e))}function yp(e,t,i){if((et&6)!==0)throw Error(l(327));var a=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Wn(e,t),g=a?Hy(e,t):cu(e,t,!0),w=a;do{if(g===0){ys&&!a&&rr(e,t,0,!1);break}else{if(i=e.current.alternate,w&&!jy(i)){g=cu(e,t,!1),w=!1;continue}if(g===2){if(w=t,e.errorRecoveryDisabledLanes&w)var O=0;else O=e.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){t=O;e:{var F=e;g=Ca;var X=F.current.memoizedState.isDehydrated;if(X&&(Cs(F,O).flags|=256),O=cu(F,O,!1),O!==2){if(nu&&!X){F.errorRecoveryDisabledLanes|=w,Nr|=w,g=4;break e}w=gn,gn=g,w!==null&&(gn===null?gn=w:gn.push.apply(gn,w))}g=O}if(w=!1,g!==2)continue}}if(g===1){Cs(e,0),rr(e,t,0,!0);break}e:{switch(a=e,w=g,w){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:rr(a,t,Tn,!er);break e;case 2:gn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(g=$l+300-tt(),10<g)){if(rr(a,t,Tn,!er),Bn(a,0,!0)!==0)break e;ji=t,a.timeoutHandle=Xp(Sp.bind(null,a,i,gn,Vl,ru,t,Tn,Nr,Ss,er,w,"Throttled",-0,0),g);break e}Sp(a,i,gn,Vl,ru,t,Tn,Nr,Ss,er,w,null,-0,0)}}break}while(!0);fi(e)}function Sp(e,t,i,a,g,w,O,F,X,oe,de,_e,ce,ue){if(e.timeoutHandle=-1,_e=t.subtreeFlags,_e&8192||(_e&16785408)===16785408){_e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Vt},fp(t,w,_e);var Ee=(w&62914560)===w?$l-tt():(w&4194048)===w?gp-tt():0;if(Ee=y0(_e,Ee),Ee!==null){ji=w,e.cancelPendingCommit=Ee(Tp.bind(null,e,t,w,i,a,g,O,F,X,de,_e,null,ce,ue)),rr(e,w,O,!oe);return}}Tp(e,t,w,i,a,g,O,F,X)}function jy(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 a=0;a<i.length;a++){var g=i[a],w=g.getSnapshot;g=g.value;try{if(!wn(w(),g))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 rr(e,t,i,a){t&=~iu,t&=~Nr,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var g=t;0<g;){var w=31-Ze(g),O=1<<w;a[w]=-1,g&=~O}i!==0&&Ui(e,i,t)}function Wl(){return(et&6)===0?(xa(0),!1):!0}function ou(){if($e!==null){if(nt===0)var e=$e.return;else e=$e,xi=Ar=null,xc(e),fs=null,aa=0,e=$e;for(;e!==null;)Qd(e.alternate,e),e=e.return;$e=null}}function Cs(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,t0(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),ji=0,ou(),lt=e,$e=i=Ci(e.current,null),We=t,nt=0,An=null,er=!1,ys=Wn(e,t),nu=!1,Ss=Tn=iu=Nr=tr=vt=0,gn=Ca=null,ru=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var g=31-Ze(a),w=1<<g;t|=e[g],a&=~w}return Bi=t,pl(),i}function bp(e,t){He=null,G.H=pa,t===hs||t===Cl?(t=Hf(),nt=3):t===fc?(t=Hf(),nt=4):nt=t===Uc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,An=t,$e===null&&(vt=1,Nl(e,In(t,e.current)))}function Cp(){var e=En.current;return e===null?!0:(We&4194048)===We?qn===null:(We&62914560)===We||(We&536870912)!==0?e===qn:!1}function wp(){var e=G.H;return G.H=pa,e===null?pa:e}function xp(){var e=G.A;return G.A=Oy,e}function Kl(){vt=4,er||(We&4194048)!==We&&En.current!==null||(ys=!0),(tr&134217727)===0&&(Nr&134217727)===0||lt===null||rr(lt,We,Tn,!1)}function cu(e,t,i){var a=et;et|=2;var g=wp(),w=xp();(lt!==e||We!==t)&&(Vl=null,Cs(e,t)),t=!1;var O=vt;e:do try{if(nt!==0&&$e!==null){var F=$e,X=An;switch(nt){case 8:ou(),O=6;break e;case 3:case 2:case 9:case 6:En.current===null&&(t=!0);var oe=nt;if(nt=0,An=null,ws(e,F,X,oe),i&&ys){O=0;break e}break;default:oe=nt,nt=0,An=null,ws(e,F,X,oe)}}Ny(),O=vt;break}catch(de){bp(e,de)}while(!0);return t&&e.shellSuspendCounter++,xi=Ar=null,et=a,G.H=g,G.A=w,$e===null&&(lt=null,We=0,pl()),O}function Ny(){for(;$e!==null;)Ep($e)}function Hy(e,t){var i=et;et|=2;var a=wp(),g=xp();lt!==e||We!==t?(Vl=null,Gl=tt()+500,Cs(e,t)):ys=Wn(e,t);e:do try{if(nt!==0&&$e!==null){t=$e;var w=An;t:switch(nt){case 1:nt=0,An=null,ws(e,t,w,1);break;case 2:case 9:if(jf(w)){nt=0,An=null,kp(t);break}t=function(){nt!==2&&nt!==9||lt!==e||(nt=7),fi(e)},w.then(t,t);break e;case 3:nt=7;break e;case 4:nt=5;break e;case 7:jf(w)?(nt=0,An=null,kp(t)):(nt=0,An=null,ws(e,t,w,7));break;case 5:var O=null;switch($e.tag){case 26:O=$e.memoizedState;case 5:case 27:var F=$e;if(O?hm(O):F.stateNode.complete){nt=0,An=null;var X=F.sibling;if(X!==null)$e=X;else{var oe=F.return;oe!==null?($e=oe,Yl(oe)):$e=null}break t}}nt=0,An=null,ws(e,t,w,5);break;case 6:nt=0,An=null,ws(e,t,w,6);break;case 8:ou(),vt=6;break e;default:throw Error(l(462))}}zy();break}catch(de){bp(e,de)}while(!0);return xi=Ar=null,G.H=a,G.A=g,et=i,$e!==null?0:(lt=null,We=0,pl(),vt)}function zy(){for(;$e!==null&&!Sn();)Ep($e)}function Ep(e){var t=Yd(e.alternate,e,Bi);e.memoizedProps=e.pendingProps,t===null?Yl(e):$e=t}function kp(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=qd(i,t,t.pendingProps,t.type,void 0,We);break;case 11:t=qd(i,t,t.pendingProps,t.type.render,t.ref,We);break;case 5:xc(t);default:Qd(i,t),t=$e=xf(t,Bi),t=Yd(i,t,Bi)}e.memoizedProps=e.pendingProps,t===null?Yl(e):$e=t}function ws(e,t,i,a){xi=Ar=null,xc(t),fs=null,aa=0;var g=t.return;try{if(ky(e,g,t,i,We)){vt=1,Nl(e,In(i,e.current)),$e=null;return}}catch(w){if(g!==null)throw $e=g,w;vt=1,Nl(e,In(i,e.current)),$e=null;return}t.flags&32768?(Ye||a===1?e=!0:ys||(We&536870912)!==0?e=!1:(er=e=!0,(a===2||a===9||a===3||a===6)&&(a=En.current,a!==null&&a.tag===13&&(a.flags|=16384))),Ap(t,e)):Yl(t)}function Yl(e){var t=e;do{if((t.flags&32768)!==0){Ap(t,er);return}e=t.return;var i=Ry(t.alternate,t,Bi);if(i!==null){$e=i;return}if(t=t.sibling,t!==null){$e=t;return}$e=t=e}while(t!==null);vt===0&&(vt=5)}function Ap(e,t){do{var i=Dy(e.alternate,e);if(i!==null){i.flags&=32767,$e=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){$e=e;return}$e=e=i}while(e!==null);vt=6,$e=null}function Tp(e,t,i,a,g,w,O,F,X){e.cancelPendingCommit=null;do Xl();while(jt!==0);if((et&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(w=t.lanes|t.childLanes,w|=Qo,an(e,i,w,O,F,X),e===lt&&($e=lt=null,We=0),bs=t,ir=e,ji=i,su=w,au=g,_p=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Fy(Ae,function(){return Op(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=G.T,G.T=null,g=W.p,W.p=2,O=et,et|=4;try{My(e,t,i)}finally{et=O,W.p=g,G.T=a}}jt=1,Rp(),Dp(),Mp()}}function Rp(){if(jt===1){jt=0;var e=ir,t=bs,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=G.T,G.T=null;var a=W.p;W.p=2;var g=et;et|=4;try{cp(t,e);var w=bu,O=mf(e.containerInfo),F=w.focusedElem,X=w.selectionRange;if(O!==F&&F&&F.ownerDocument&&pf(F.ownerDocument.documentElement,F)){if(X!==null&&Vo(F)){var oe=X.start,de=X.end;if(de===void 0&&(de=oe),"selectionStart"in F)F.selectionStart=oe,F.selectionEnd=Math.min(de,F.value.length);else{var _e=F.ownerDocument||document,ce=_e&&_e.defaultView||window;if(ce.getSelection){var ue=ce.getSelection(),Ee=F.textContent.length,Me=Math.min(X.start,Ee),at=X.end===void 0?Me:Math.min(X.end,Ee);!ue.extend&&Me>at&&(O=at,at=Me,Me=O);var ne=df(F,Me),J=df(F,at);if(ne&&J&&(ue.rangeCount!==1||ue.anchorNode!==ne.node||ue.anchorOffset!==ne.offset||ue.focusNode!==J.node||ue.focusOffset!==J.offset)){var le=_e.createRange();le.setStart(ne.node,ne.offset),ue.removeAllRanges(),Me>at?(ue.addRange(le),ue.extend(J.node,J.offset)):(le.setEnd(J.node,J.offset),ue.addRange(le))}}}}for(_e=[],ue=F;ue=ue.parentNode;)ue.nodeType===1&&_e.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof F.focus=="function"&&F.focus(),F=0;F<_e.length;F++){var ge=_e[F];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}oo=!!Su,bu=Su=null}finally{et=g,W.p=a,G.T=i}}e.current=t,jt=2}}function Dp(){if(jt===2){jt=0;var e=ir,t=bs,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=G.T,G.T=null;var a=W.p;W.p=2;var g=et;et|=4;try{rp(e,t.alternate,t)}finally{et=g,W.p=a,G.T=i}}jt=3}}function Mp(){if(jt===4||jt===3){jt=0,St();var e=ir,t=bs,i=ji,a=_p;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?jt=5:(jt=0,bs=ir=null,Lp(e,e.pendingLanes));var g=e.pendingLanes;if(g===0&&(nr=null),Us(i),t=t.stateNode,mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(gt,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=G.T,g=W.p,W.p=2,G.T=null;try{for(var w=e.onRecoverableError,O=0;O<a.length;O++){var F=a[O];w(F.value,{componentStack:F.stack})}}finally{G.T=t,W.p=g}}(ji&3)!==0&&Xl(),fi(e),g=e.pendingLanes,(i&261930)!==0&&(g&42)!==0?e===lu?wa++:(wa=0,lu=e):wa=0,xa(0)}}function Lp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ra(t)))}function Xl(){return Rp(),Dp(),Mp(),Op()}function Op(){if(jt!==5)return!1;var e=ir,t=su;su=0;var i=Us(ji),a=G.T,g=W.p;try{W.p=32>i?32:i,G.T=null,i=au,au=null;var w=ir,O=ji;if(jt=0,bs=ir=null,ji=0,(et&6)!==0)throw Error(l(331));var F=et;if(et|=4,pp(w.current),hp(w,w.current,O,i),et=F,xa(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(gt,w)}catch{}return!0}finally{W.p=g,G.T=a,Lp(e,t)}}function Bp(e,t,i){t=In(i,t),t=Ic(e.stateNode,t,2),e=Xi(e,t,2),e!==null&&(sn(e,2),fi(e))}function it(e,t,i){if(e.tag===3)Bp(e,e,i);else for(;t!==null;){if(t.tag===3){Bp(t,e,i);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(nr===null||!nr.has(a))){e=In(i,e),i=jd(2),a=Xi(t,i,2),a!==null&&(Nd(i,a,t,e),sn(a,2),fi(a));break}}t=t.return}}function uu(e,t,i){var a=e.pingCache;if(a===null){a=e.pingCache=new By;var g=new Set;a.set(t,g)}else g=a.get(t),g===void 0&&(g=new Set,a.set(t,g));g.has(i)||(nu=!0,g.add(i),e=Iy.bind(null,e,t,i),t.then(e,e))}function Iy(e,t,i){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,lt===e&&(We&i)===i&&(vt===4||vt===3&&(We&62914560)===We&&300>tt()-$l?(et&2)===0&&Cs(e,0):iu|=i,Ss===We&&(Ss=0)),fi(e)}function jp(e,t){t===0&&(t=rn()),e=xr(e,t),e!==null&&(sn(e,t),fi(e))}function Uy(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),jp(e,i)}function Py(e,t){var i=0;switch(e.tag){case 31:case 13:var a=e.stateNode,g=e.memoizedState;g!==null&&(i=g.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(l(314))}a!==null&&a.delete(t),jp(e,i)}function Fy(e,t){return Nt(e,t)}var Ql=null,xs=null,hu=!1,Jl=!1,fu=!1,sr=0;function fi(e){e!==xs&&e.next===null&&(xs===null?Ql=xs=e:xs=xs.next=e),Jl=!0,hu||(hu=!0,$y())}function xa(e,t){if(!fu&&Jl){fu=!0;do for(var i=!1,a=Ql;a!==null;){if(e!==0){var g=a.pendingLanes;if(g===0)var w=0;else{var O=a.suspendedLanes,F=a.pingedLanes;w=(1<<31-Ze(42|e)+1)-1,w&=g&~(O&~F),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(i=!0,Ip(a,w))}else w=We,w=Bn(a,a===lt?w:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(w&3)===0||Wn(a,w)||(i=!0,Ip(a,w));a=a.next}while(i);fu=!1}}function qy(){Np()}function Np(){Jl=hu=!1;var e=0;sr!==0&&e0()&&(e=sr);for(var t=tt(),i=null,a=Ql;a!==null;){var g=a.next,w=Hp(a,t);w===0?(a.next=null,i===null?Ql=g:i.next=g,g===null&&(xs=i)):(i=a,(e!==0||(w&3)!==0)&&(Jl=!0)),a=g}jt!==0&&jt!==5||xa(e),sr!==0&&(sr=0)}function Hp(e,t){for(var i=e.suspendedLanes,a=e.pingedLanes,g=e.expirationTimes,w=e.pendingLanes&-62914561;0<w;){var O=31-Ze(w),F=1<<O,X=g[O];X===-1?((F&i)===0||(F&a)!==0)&&(g[O]=si(F,t)):X<=t&&(e.expiredLanes|=F),w&=~F}if(t=lt,i=We,i=Bn(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,i===0||e===t&&(nt===2||nt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Gt(a),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Wn(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(a!==null&&Gt(a),Us(i)){case 2:case 8:i=Se;break;case 32:i=Ae;break;case 268435456:i=Oe;break;default:i=Ae}return a=zp.bind(null,e),i=Nt(i,a),e.callbackPriority=t,e.callbackNode=i,t}return a!==null&&a!==null&&Gt(a),e.callbackPriority=2,e.callbackNode=null,2}function zp(e,t){if(jt!==0&&jt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Xl()&&e.callbackNode!==i)return null;var a=We;return a=Bn(e,e===lt?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(yp(e,a,t),Hp(e,tt()),e.callbackNode!=null&&e.callbackNode===i?zp.bind(null,e):null)}function Ip(e,t){if(Xl())return null;yp(e,t,!0)}function $y(){n0(function(){(et&6)!==0?Nt(he,qy):Np()})}function du(){if(sr===0){var e=cs;e===0&&(e=Ln,Ln<<=1,(Ln&261888)===0&&(Ln=256)),sr=e}return sr}function Up(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:vr(""+e)}function Pp(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 Gy(e,t,i,a,g){if(t==="submit"&&i&&i.stateNode===g){var w=Up((g[It]||null).action),O=a.submitter;O&&(t=(t=O[It]||null)?Up(t.formAction):O.getAttribute("formAction"),t!==null&&(w=t,O=null));var F=new Jr("action","action",null,a,g);e.push({event:F,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(sr!==0){var X=O?Pp(g,O):new FormData(g);Oc(i,{pending:!0,data:X,method:g.method,action:w},null,X)}}else typeof w=="function"&&(F.preventDefault(),X=O?Pp(g,O):new FormData(g),Oc(i,{pending:!0,data:X,method:g.method,action:w},w,X))},currentTarget:g}]})}}for(var pu=0;pu<Xo.length;pu++){var mu=Xo[pu],Vy=mu.toLowerCase(),Wy=mu[0].toUpperCase()+mu.slice(1);Zn(Vy,"on"+Wy)}Zn(vf,"onAnimationEnd"),Zn(yf,"onAnimationIteration"),Zn(Sf,"onAnimationStart"),Zn("dblclick","onDoubleClick"),Zn("focusin","onFocus"),Zn("focusout","onBlur"),Zn(cy,"onTransitionRun"),Zn(uy,"onTransitionStart"),Zn(hy,"onTransitionCancel"),Zn(bf,"onTransitionEnd"),ie("onMouseEnter",["mouseout","mouseover"]),ie("onMouseLeave",["mouseout","mouseover"]),ie("onPointerEnter",["pointerout","pointerover"]),ie("onPointerLeave",["pointerout","pointerover"]),Qn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Qn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Qn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Qn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Qn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Qn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ea="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(" "),Ky=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ea));function Fp(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var a=e[i],g=a.event;a=a.listeners;e:{var w=void 0;if(t)for(var O=a.length-1;0<=O;O--){var F=a[O],X=F.instance,oe=F.currentTarget;if(F=F.listener,X!==w&&g.isPropagationStopped())break e;w=F,g.currentTarget=oe;try{w(g)}catch(de){dl(de)}g.currentTarget=null,w=X}else for(O=0;O<a.length;O++){if(F=a[O],X=F.instance,oe=F.currentTarget,F=F.listener,X!==w&&g.isPropagationStopped())break e;w=F,g.currentTarget=oe;try{w(g)}catch(de){dl(de)}g.currentTarget=null,w=X}}}}function Ge(e,t){var i=t[Ps];i===void 0&&(i=t[Ps]=new Set);var a=e+"__bubble";i.has(a)||(qp(t,e,2,!1),i.add(a))}function gu(e,t,i){var a=0;t&&(a|=4),qp(i,e,a,t)}var Zl="_reactListening"+Math.random().toString(36).slice(2);function _u(e){if(!e[Zl]){e[Zl]=!0,Fs.forEach(function(i){i!=="selectionchange"&&(Ky.has(i)||gu(i,!1,e),gu(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Zl]||(t[Zl]=!0,gu("selectionchange",!1,t))}}function qp(e,t,i,a){switch(vm(t)){case 2:var g=C0;break;case 8:g=w0;break;default:g=Lu}i=g.bind(null,t,i,e),g=void 0,!yr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(g=!0),a?g!==void 0?e.addEventListener(t,i,{capture:!0,passive:g}):e.addEventListener(t,i,!0):g!==void 0?e.addEventListener(t,i,{passive:g}):e.addEventListener(t,i,!1)}function vu(e,t,i,a,g){var w=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var O=a.tag;if(O===3||O===4){var F=a.stateNode.containerInfo;if(F===g)break;if(O===4)for(O=a.return;O!==null;){var X=O.tag;if((X===3||X===4)&&O.stateNode.containerInfo===g)return;O=O.return}for(;F!==null;){if(O=ln(F),O===null)return;if(X=O.tag,X===5||X===6||X===26||X===27){a=w=O;continue e}F=F.parentNode}}a=a.return}hn(function(){var oe=w,de=oi(i),_e=[];e:{var ce=Cf.get(e);if(ce!==void 0){var ue=Jr,Ee=e;switch(e){case"keypress":if(Xr(i)===0)break e;case"keydown":case"keyup":ue=Pv;break;case"focusin":Ee="focus",ue=Po;break;case"focusout":Ee="blur",ue=Po;break;case"beforeblur":case"afterblur":ue=Po;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":ue=hl;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=Rv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=$v;break;case vf:case yf:case Sf:ue=Lv;break;case bf:ue=Vv;break;case"scroll":case"scrollend":ue=fe;break;case"wheel":ue=Kv;break;case"copy":case"cut":case"paste":ue=Bv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=Jh;break;case"toggle":case"beforetoggle":ue=Xv}var Me=(t&4)!==0,at=!Me&&(e==="scroll"||e==="scrollend"),ne=Me?ce!==null?ce+"Capture":null:ce;Me=[];for(var J=oe,le;J!==null;){var ge=J;if(le=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||le===null||ne===null||(ge=bi(J,ne),ge!=null&&Me.push(ka(J,ge,le))),at)break;J=J.return}0<Me.length&&(ce=new ue(ce,Ee,null,i,de),_e.push({event:ce,listeners:Me}))}}if((t&7)===0){e:{if(ce=e==="mouseover"||e==="pointerover",ue=e==="mouseout"||e==="pointerout",ce&&i!==Kr&&(Ee=i.relatedTarget||i.fromElement)&&(ln(Ee)||Ee[Yn]))break e;if((ue||ce)&&(ce=de.window===de?de:(ce=de.ownerDocument)?ce.defaultView||ce.parentWindow:window,ue?(Ee=i.relatedTarget||i.toElement,ue=oe,Ee=Ee?ln(Ee):null,Ee!==null&&(at=m(Ee),Me=Ee.tag,Ee!==at||Me!==5&&Me!==27&&Me!==6)&&(Ee=null)):(ue=null,Ee=oe),ue!==Ee)){if(Me=hl,ge="onMouseLeave",ne="onMouseEnter",J="mouse",(e==="pointerout"||e==="pointerover")&&(Me=Jh,ge="onPointerLeave",ne="onPointerEnter",J="pointer"),at=ue==null?ce:gi(ue),le=Ee==null?ce:gi(Ee),ce=new Me(ge,J+"leave",ue,i,de),ce.target=at,ce.relatedTarget=le,ge=null,ln(de)===oe&&(Me=new Me(ne,J+"enter",Ee,i,de),Me.target=le,Me.relatedTarget=at,ge=Me),at=ge,ue&&Ee)t:{for(Me=Yy,ne=ue,J=Ee,le=0,ge=ne;ge;ge=Me(ge))le++;ge=0;for(var Re=J;Re;Re=Me(Re))ge++;for(;0<le-ge;)ne=Me(ne),le--;for(;0<ge-le;)J=Me(J),ge--;for(;le--;){if(ne===J||J!==null&&ne===J.alternate){Me=ne;break t}ne=Me(ne),J=Me(J)}Me=null}else Me=null;ue!==null&&$p(_e,ce,ue,Me,!1),Ee!==null&&at!==null&&$p(_e,at,Ee,Me,!0)}}e:{if(ce=oe?gi(oe):window,ue=ce.nodeName&&ce.nodeName.toLowerCase(),ue==="select"||ue==="input"&&ce.type==="file")var Qe=lf;else if(sf(ce))if(of)Qe=ay;else{Qe=ry;var Te=iy}else ue=ce.nodeName,!ue||ue.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?oe&&Wr(oe.elementType)&&(Qe=lf):Qe=sy;if(Qe&&(Qe=Qe(e,oe))){af(_e,Qe,i,de);break e}Te&&Te(e,ce,oe),e==="focusout"&&oe&&ce.type==="number"&&oe.memoizedProps.value!=null&&Vs(ce,"number",ce.value)}switch(Te=oe?gi(oe):window,e){case"focusin":(sf(Te)||Te.contentEditable==="true")&&(ts=Te,Wo=oe,ta=null);break;case"focusout":ta=Wo=ts=null;break;case"mousedown":Ko=!0;break;case"contextmenu":case"mouseup":case"dragend":Ko=!1,gf(_e,i,de);break;case"selectionchange":if(oy)break;case"keydown":case"keyup":gf(_e,i,de)}var Ie;if(qo)e:{switch(e){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else es?nf(e,i)&&(Ke="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ke="onCompositionStart");Ke&&(Zh&&i.locale!=="ko"&&(es||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&es&&(Ie=ul()):(ke=de,Xs="value"in ke?ke.value:ke.textContent,es=!0)),Te=eo(oe,Ke),0<Te.length&&(Ke=new Qh(Ke,e,null,i,de),_e.push({event:Ke,listeners:Te}),Ie?Ke.data=Ie:(Ie=rf(i),Ie!==null&&(Ke.data=Ie)))),(Ie=Jv?Zv(e,i):ey(e,i))&&(Ke=eo(oe,"onBeforeInput"),0<Ke.length&&(Te=new Qh("onBeforeInput","beforeinput",null,i,de),_e.push({event:Te,listeners:Ke}),Te.data=Ie)),Gy(_e,e,oe,i,de)}Fp(_e,t)})}function ka(e,t,i){return{instance:e,listener:t,currentTarget:i}}function eo(e,t){for(var i=t+"Capture",a=[];e!==null;){var g=e,w=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||w===null||(g=bi(e,i),g!=null&&a.unshift(ka(e,g,w)),g=bi(e,t),g!=null&&a.push(ka(e,g,w))),e.tag===3)return a;e=e.return}return[]}function Yy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function $p(e,t,i,a,g){for(var w=t._reactName,O=[];i!==null&&i!==a;){var F=i,X=F.alternate,oe=F.stateNode;if(F=F.tag,X!==null&&X===a)break;F!==5&&F!==26&&F!==27||oe===null||(X=oe,g?(oe=bi(i,w),oe!=null&&O.unshift(ka(i,oe,X))):g||(oe=bi(i,w),oe!=null&&O.push(ka(i,oe,X)))),i=i.return}O.length!==0&&e.push({event:t,listeners:O})}var Xy=/\r\n?/g,Qy=/\u0000|\uFFFD/g;function Gp(e){return(typeof e=="string"?e:""+e).replace(Xy,`
|
|
49
|
-
`).replace(Qy,"")}function Vp(e,t){return t=Gp(t),Gp(e)===t}function st(e,t,i,a,g,w){switch(i){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||li(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&li(e,""+a);break;case"className":vi(e,"class",a);break;case"tabIndex":vi(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":vi(e,i,a);break;case"style":ll(e,a,w);break;case"data":if(t!=="object"){vi(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(i);break}a=vr(""+a),e.setAttribute(i,a);break;case"action":case"formAction":if(typeof a=="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"&&st(e,t,"name",g.name,g,null),st(e,t,"formEncType",g.formEncType,g,null),st(e,t,"formMethod",g.formMethod,g,null),st(e,t,"formTarget",g.formTarget,g,null)):(st(e,t,"encType",g.encType,g,null),st(e,t,"method",g.method,g,null),st(e,t,"target",g.target,g,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(i);break}a=vr(""+a),e.setAttribute(i,a);break;case"onClick":a!=null&&(e.onclick=Vt);break;case"onScroll":a!=null&&Ge("scroll",e);break;case"onScrollEnd":a!=null&&Ge("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(l(61));if(i=a.__html,i!=null){if(g.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}i=vr(""+a),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":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(i,""+a):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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":a===!0?e.setAttribute(i,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(i,a):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(i,a):e.removeAttribute(i);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(i):e.setAttribute(i,a);break;case"popover":Ge("beforetoggle",e),Ge("toggle",e),Vr(e,"popover",a);break;case"xlinkActuate":Hn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Hn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Hn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Hn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Hn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Hn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Hn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Hn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Hn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Vr(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=Ks.get(i)||i,Vr(e,i,a))}}function yu(e,t,i,a,g,w){switch(i){case"style":ll(e,a,w);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(l(61));if(i=a.__html,i!=null){if(g.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"children":typeof a=="string"?li(e,a):(typeof a=="number"||typeof a=="bigint")&&li(e,""+a);break;case"onScroll":a!=null&&Ge("scroll",e);break;case"onScrollEnd":a!=null&&Ge("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Vt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Xn.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(g=i.endsWith("Capture"),t=i.slice(2,g?i.length-7:void 0),w=e[It]||null,w=w!=null?w[i]:null,typeof w=="function"&&e.removeEventListener(t,w,g),typeof a=="function")){typeof w!="function"&&w!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,a,g);break e}i in e?e[i]=a:a===!0?e.setAttribute(i,""):Vr(e,i,a)}}}function $t(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 a=!1,g=!1,w;for(w in i)if(i.hasOwnProperty(w)){var O=i[w];if(O!=null)switch(w){case"src":a=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:st(e,t,w,O,i,null)}}g&&st(e,t,"srcSet",i.srcSet,i,null),a&&st(e,t,"src",i.src,i,null);return;case"input":Ge("invalid",e);var F=w=O=g=null,X=null,oe=null;for(a in i)if(i.hasOwnProperty(a)){var de=i[a];if(de!=null)switch(a){case"name":g=de;break;case"type":O=de;break;case"checked":X=de;break;case"defaultChecked":oe=de;break;case"value":w=de;break;case"defaultValue":F=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(l(137,t));break;default:st(e,t,a,de,i,null)}}sl(e,w,F,X,oe,O,g,!1);return;case"select":Ge("invalid",e),a=O=w=null;for(g in i)if(i.hasOwnProperty(g)&&(F=i[g],F!=null))switch(g){case"value":w=F;break;case"defaultValue":O=F;break;case"multiple":a=F;default:st(e,t,g,F,i,null)}t=w,i=O,e.multiple=!!a,t!=null?Fi(e,!!a,t,!1):i!=null&&Fi(e,!!a,i,!0);return;case"textarea":Ge("invalid",e),w=g=a=null;for(O in i)if(i.hasOwnProperty(O)&&(F=i[O],F!=null))switch(O){case"value":a=F;break;case"defaultValue":g=F;break;case"children":w=F;break;case"dangerouslySetInnerHTML":if(F!=null)throw Error(l(91));break;default:st(e,t,O,F,i,null)}yi(e,a,g,w);return;case"option":for(X in i)if(i.hasOwnProperty(X)&&(a=i[X],a!=null))switch(X){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:st(e,t,X,a,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(a=0;a<Ea.length;a++)Ge(Ea[a],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(oe in i)if(i.hasOwnProperty(oe)&&(a=i[oe],a!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:st(e,t,oe,a,i,null)}return;default:if(Wr(t)){for(de in i)i.hasOwnProperty(de)&&(a=i[de],a!==void 0&&yu(e,t,de,a,i,void 0));return}}for(F in i)i.hasOwnProperty(F)&&(a=i[F],a!=null&&st(e,t,F,a,i,null))}function Jy(e,t,i,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,w=null,O=null,F=null,X=null,oe=null,de=null;for(ue in i){var _e=i[ue];if(i.hasOwnProperty(ue)&&_e!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":X=_e;default:a.hasOwnProperty(ue)||st(e,t,ue,null,a,_e)}}for(var ce in a){var ue=a[ce];if(_e=i[ce],a.hasOwnProperty(ce)&&(ue!=null||_e!=null))switch(ce){case"type":w=ue;break;case"name":g=ue;break;case"checked":oe=ue;break;case"defaultChecked":de=ue;break;case"value":O=ue;break;case"defaultValue":F=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(l(137,t));break;default:ue!==_e&&st(e,t,ce,ue,a,_e)}}Gs(e,O,F,X,oe,de,w,g);return;case"select":ue=O=F=ce=null;for(w in i)if(X=i[w],i.hasOwnProperty(w)&&X!=null)switch(w){case"value":break;case"multiple":ue=X;default:a.hasOwnProperty(w)||st(e,t,w,null,a,X)}for(g in a)if(w=a[g],X=i[g],a.hasOwnProperty(g)&&(w!=null||X!=null))switch(g){case"value":ce=w;break;case"defaultValue":F=w;break;case"multiple":O=w;default:w!==X&&st(e,t,g,w,a,X)}t=F,i=O,a=ue,ce!=null?Fi(e,!!i,ce,!1):!!a!=!!i&&(t!=null?Fi(e,!!i,t,!0):Fi(e,!!i,i?[]:"",!1));return;case"textarea":ue=ce=null;for(F in i)if(g=i[F],i.hasOwnProperty(F)&&g!=null&&!a.hasOwnProperty(F))switch(F){case"value":break;case"children":break;default:st(e,t,F,null,a,g)}for(O in a)if(g=a[O],w=i[O],a.hasOwnProperty(O)&&(g!=null||w!=null))switch(O){case"value":ce=g;break;case"defaultValue":ue=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(l(91));break;default:g!==w&&st(e,t,O,g,a,w)}al(e,ce,ue);return;case"option":for(var Ee in i)if(ce=i[Ee],i.hasOwnProperty(Ee)&&ce!=null&&!a.hasOwnProperty(Ee))switch(Ee){case"selected":e.selected=!1;break;default:st(e,t,Ee,null,a,ce)}for(X in a)if(ce=a[X],ue=i[X],a.hasOwnProperty(X)&&ce!==ue&&(ce!=null||ue!=null))switch(X){case"selected":e.selected=ce&&typeof ce!="function"&&typeof ce!="symbol";break;default:st(e,t,X,ce,a,ue)}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 Me in i)ce=i[Me],i.hasOwnProperty(Me)&&ce!=null&&!a.hasOwnProperty(Me)&&st(e,t,Me,null,a,ce);for(oe in a)if(ce=a[oe],ue=i[oe],a.hasOwnProperty(oe)&&ce!==ue&&(ce!=null||ue!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(l(137,t));break;default:st(e,t,oe,ce,a,ue)}return;default:if(Wr(t)){for(var at in i)ce=i[at],i.hasOwnProperty(at)&&ce!==void 0&&!a.hasOwnProperty(at)&&yu(e,t,at,void 0,a,ce);for(de in a)ce=a[de],ue=i[de],!a.hasOwnProperty(de)||ce===ue||ce===void 0&&ue===void 0||yu(e,t,de,ce,a,ue);return}}for(var ne in i)ce=i[ne],i.hasOwnProperty(ne)&&ce!=null&&!a.hasOwnProperty(ne)&&st(e,t,ne,null,a,ce);for(_e in a)ce=a[_e],ue=i[_e],!a.hasOwnProperty(_e)||ce===ue||ce==null&&ue==null||st(e,t,_e,ce,a,ue)}function Wp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Zy(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),a=0;a<i.length;a++){var g=i[a],w=g.transferSize,O=g.initiatorType,F=g.duration;if(w&&F&&Wp(O)){for(O=0,F=g.responseEnd,a+=1;a<i.length;a++){var X=i[a],oe=X.startTime;if(oe>F)break;var de=X.transferSize,_e=X.initiatorType;de&&Wp(_e)&&(X=X.responseEnd,O+=de*(X<F?1:(F-oe)/(X-oe)))}if(--a,t+=8*(w+O)/(g.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 Su=null,bu=null;function to(e){return e.nodeType===9?e:e.ownerDocument}function Kp(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 Yp(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 Cu(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 wu=null;function e0(){var e=window.event;return e&&e.type==="popstate"?e===wu?!1:(wu=e,!0):(wu=null,!1)}var Xp=typeof setTimeout=="function"?setTimeout:void 0,t0=typeof clearTimeout=="function"?clearTimeout:void 0,Qp=typeof Promise=="function"?Promise:void 0,n0=typeof queueMicrotask=="function"?queueMicrotask:typeof Qp<"u"?function(e){return Qp.resolve(null).then(e).catch(i0)}:Xp;function i0(e){setTimeout(function(){throw e})}function ar(e){return e==="head"}function Jp(e,t){var i=t,a=0;do{var g=i.nextSibling;if(e.removeChild(i),g&&g.nodeType===8)if(i=g.data,i==="/$"||i==="/&"){if(a===0){e.removeChild(g),Ts(t);return}a--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")a++;else if(i==="html")Aa(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Aa(i);for(var w=i.firstChild;w;){var O=w.nextSibling,F=w.nodeName;w[Nn]||F==="SCRIPT"||F==="STYLE"||F==="LINK"&&w.rel.toLowerCase()==="stylesheet"||i.removeChild(w),w=O}}else i==="body"&&Aa(e.ownerDocument.body);i=g}while(i);Ts(t)}function Zp(e,t){var i=e;e=0;do{var a=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||""),a&&a.nodeType===8)if(i=a.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=a}while(i)}function xu(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":xu(i),$r(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function r0(e,t,i,a){for(;e.nodeType===1;){var g=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[Nn])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!==g.rel||e.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||e.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||e.getAttribute("title")!==(g.title==null?null:g.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(w=e.getAttribute("src"),(w!==(g.src==null?null:g.src)||e.getAttribute("type")!==(g.type==null?null:g.type)||e.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&w&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var w=g.name==null?null:""+g.name;if(g.type==="hidden"&&e.getAttribute("name")===w)return e}else return e;if(e=$n(e.nextSibling),e===null)break}return null}function s0(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=$n(e.nextSibling),e===null))return null;return e}function em(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=$n(e.nextSibling),e===null))return null;return e}function Eu(e){return e.data==="$?"||e.data==="$~"}function ku(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function a0(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var a=function(){t(),i.removeEventListener("DOMContentLoaded",a)};i.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function $n(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 Au=null;function tm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return $n(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function nm(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 im(e,t,i){switch(t=to(i),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function Aa(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);$r(e)}var Gn=new Map,rm=new Set;function no(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ni=W.d;W.d={f:l0,r:o0,D:c0,C:u0,L:h0,m:f0,X:p0,S:d0,M:m0};function l0(){var e=Ni.f(),t=Wl();return e||t}function o0(e){var t=mi(e);t!==null&&t.tag===5&&t.type==="form"?bd(t):Ni.r(e)}var Es=typeof document>"u"?null:document;function sm(e,t,i){var a=Es;if(a&&typeof t=="string"&&t){var g=un(t);g='link[rel="'+e+'"][href="'+g+'"]',typeof i=="string"&&(g+='[crossorigin="'+i+'"]'),rm.has(g)||(rm.add(g),e={rel:e,crossOrigin:i,href:t},a.querySelector(g)===null&&(t=a.createElement("link"),$t(t,"link",e),bt(t),a.head.appendChild(t)))}}function c0(e){Ni.D(e),sm("dns-prefetch",e,null)}function u0(e,t){Ni.C(e,t),sm("preconnect",e,t)}function h0(e,t,i){Ni.L(e,t,i);var a=Es;if(a&&e&&t){var g='link[rel="preload"][as="'+un(t)+'"]';t==="image"&&i&&i.imageSrcSet?(g+='[imagesrcset="'+un(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(g+='[imagesizes="'+un(i.imageSizes)+'"]')):g+='[href="'+un(e)+'"]';var w=g;switch(t){case"style":w=ks(e);break;case"script":w=As(e)}Gn.has(w)||(e=u({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Gn.set(w,e),a.querySelector(g)!==null||t==="style"&&a.querySelector(Ta(w))||t==="script"&&a.querySelector(Ra(w))||(t=a.createElement("link"),$t(t,"link",e),bt(t),a.head.appendChild(t)))}}function f0(e,t){Ni.m(e,t);var i=Es;if(i&&e){var a=t&&typeof t.as=="string"?t.as:"script",g='link[rel="modulepreload"][as="'+un(a)+'"][href="'+un(e)+'"]',w=g;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=As(e)}if(!Gn.has(w)&&(e=u({rel:"modulepreload",href:e},t),Gn.set(w,e),i.querySelector(g)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Ra(w)))return}a=i.createElement("link"),$t(a,"link",e),bt(a),i.head.appendChild(a)}}}function d0(e,t,i){Ni.S(e,t,i);var a=Es;if(a&&e){var g=_i(a).hoistableStyles,w=ks(e);t=t||"default";var O=g.get(w);if(!O){var F={loading:0,preload:null};if(O=a.querySelector(Ta(w)))F.loading=5;else{e=u({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Gn.get(w))&&Tu(e,i);var X=O=a.createElement("link");bt(X),$t(X,"link",e),X._p=new Promise(function(oe,de){X.onload=oe,X.onerror=de}),X.addEventListener("load",function(){F.loading|=1}),X.addEventListener("error",function(){F.loading|=2}),F.loading|=4,io(O,t,a)}O={type:"stylesheet",instance:O,count:1,state:F},g.set(w,O)}}}function p0(e,t){Ni.X(e,t);var i=Es;if(i&&e){var a=_i(i).hoistableScripts,g=As(e),w=a.get(g);w||(w=i.querySelector(Ra(g)),w||(e=u({src:e,async:!0},t),(t=Gn.get(g))&&Ru(e,t),w=i.createElement("script"),bt(w),$t(w,"link",e),i.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},a.set(g,w))}}function m0(e,t){Ni.M(e,t);var i=Es;if(i&&e){var a=_i(i).hoistableScripts,g=As(e),w=a.get(g);w||(w=i.querySelector(Ra(g)),w||(e=u({src:e,async:!0,type:"module"},t),(t=Gn.get(g))&&Ru(e,t),w=i.createElement("script"),bt(w),$t(w,"link",e),i.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},a.set(g,w))}}function am(e,t,i,a){var g=(g=me.current)?no(g):null;if(!g)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=ks(i.href),i=_i(g).hoistableStyles,a=i.get(t),a||(a={type:"style",instance:null,count:0,state:null},i.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=ks(i.href);var w=_i(g).hoistableStyles,O=w.get(e);if(O||(g=g.ownerDocument||g,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(e,O),(w=g.querySelector(Ta(e)))&&!w._p&&(O.instance=w,O.state.loading=5),Gn.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},Gn.set(e,i),w||g0(g,e,i,O.state))),t&&a===null)throw Error(l(528,""));return O}if(t&&a!==null)throw Error(l(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=As(i),i=_i(g).hoistableScripts,a=i.get(t),a||(a={type:"script",instance:null,count:0,state:null},i.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function ks(e){return'href="'+un(e)+'"'}function Ta(e){return'link[rel="stylesheet"]['+e+"]"}function lm(e){return u({},e,{"data-precedence":e.precedence,precedence:null})}function g0(e,t,i,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),$t(t,"link",i),bt(t),e.head.appendChild(t))}function As(e){return'[src="'+un(e)+'"]'}function Ra(e){return"script[async]"+e}function om(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+un(i.href)+'"]');if(a)return t.instance=a,bt(a),a;var g=u({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),bt(a),$t(a,"style",g),io(a,i.precedence,e),t.instance=a;case"stylesheet":g=ks(i.href);var w=e.querySelector(Ta(g));if(w)return t.state.loading|=4,t.instance=w,bt(w),w;a=lm(i),(g=Gn.get(g))&&Tu(a,g),w=(e.ownerDocument||e).createElement("link"),bt(w);var O=w;return O._p=new Promise(function(F,X){O.onload=F,O.onerror=X}),$t(w,"link",a),t.state.loading|=4,io(w,i.precedence,e),t.instance=w;case"script":return w=As(i.src),(g=e.querySelector(Ra(w)))?(t.instance=g,bt(g),g):(a=i,(g=Gn.get(w))&&(a=u({},i),Ru(a,g)),e=e.ownerDocument||e,g=e.createElement("script"),bt(g),$t(g,"link",a),e.head.appendChild(g),t.instance=g);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,io(a,i.precedence,e));return t.instance}function io(e,t,i){for(var a=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=a.length?a[a.length-1]:null,w=g,O=0;O<a.length;O++){var F=a[O];if(F.dataset.precedence===t)w=F;else if(w!==g)break}w?w.parentNode.insertBefore(e,w.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Tu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ru(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ro=null;function cm(e,t,i){if(ro===null){var a=new Map,g=ro=new Map;g.set(i,a)}else g=ro,a=g.get(i),a||(a=new Map,g.set(i,a));if(a.has(e))return a;for(a.set(e,null),i=i.getElementsByTagName(e),g=0;g<i.length;g++){var w=i[g];if(!(w[Nn]||w[kt]||e==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var O=w.getAttribute(t)||"";O=e+O;var F=a.get(O);F?F.push(w):a.set(O,[w])}}return a}function um(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function _0(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 hm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function v0(e,t,i,a){if(i.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var g=ks(a.href),w=t.querySelector(Ta(g));if(w){t=w._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=so.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=w,bt(w);return}w=t.ownerDocument||t,a=lm(a),(g=Gn.get(g))&&Tu(a,g),w=w.createElement("link"),bt(w);var O=w;O._p=new Promise(function(F,X){O.onload=F,O.onerror=X}),$t(w,"link",a),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=so.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Du=0;function y0(e,t){return e.stylesheets&&e.count===0&&lo(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var a=setTimeout(function(){if(e.stylesheets&&lo(e,e.stylesheets),e.unsuspend){var w=e.unsuspend;e.unsuspend=null,w()}},6e4+t);0<e.imgBytes&&Du===0&&(Du=62500*Zy());var g=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&lo(e,e.stylesheets),e.unsuspend)){var w=e.unsuspend;e.unsuspend=null,w()}},(e.imgBytes>Du?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(g)}}:null}function so(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)lo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ao=null;function lo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ao=new Map,t.forEach(S0,e),ao=null,so.call(e))}function S0(e,t){if(!(t.state.loading&4)){var i=ao.get(e);if(i)var a=i.get(null);else{i=new Map,ao.set(e,i);for(var g=e.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<g.length;w++){var O=g[w];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(i.set(O.dataset.precedence,O),a=O)}a&&i.set(null,a)}g=t.instance,O=g.getAttribute("data-precedence"),w=i.get(O)||a,w===a&&i.set(null,g),i.set(O,g),this.count++,a=so.bind(this),g.addEventListener("load",a),g.addEventListener("error",a),w?w.parentNode.insertBefore(g,w.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(g,e.firstChild)),t.state.loading|=4}}var Da={$$typeof:S,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function b0(e,t,i,a,g,w,O,F,X){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=jn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jn(0),this.hiddenUpdates=jn(null),this.identifierPrefix=a,this.onUncaughtError=g,this.onCaughtError=w,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function fm(e,t,i,a,g,w,O,F,X,oe,de,_e){return e=new b0(e,t,i,O,X,oe,de,_e,F),t=1,w===!0&&(t|=24),w=xn(3,null,null,t),e.current=w,w.stateNode=e,t=cc(),t.refCount++,e.pooledCache=t,t.refCount++,w.memoizedState={element:a,isDehydrated:i,cache:t},dc(w),e}function dm(e){return e?(e=rs,e):rs}function pm(e,t,i,a,g,w){g=dm(g),a.context===null?a.context=g:a.pendingContext=g,a=Yi(t),a.payload={element:i},w=w===void 0?null:w,w!==null&&(a.callback=w),i=Xi(e,a,t),i!==null&&(_n(i,e,t),oa(i,e,t))}function mm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Mu(e,t){mm(e,t),(e=e.alternate)&&mm(e,t)}function gm(e){if(e.tag===13||e.tag===31){var t=xr(e,67108864);t!==null&&_n(t,e,67108864),Mu(e,67108864)}}function _m(e){if(e.tag===13||e.tag===31){var t=Rn();t=qr(t);var i=xr(e,t);i!==null&&_n(i,e,t),Mu(e,t)}}var oo=!0;function C0(e,t,i,a){var g=G.T;G.T=null;var w=W.p;try{W.p=2,Lu(e,t,i,a)}finally{W.p=w,G.T=g}}function w0(e,t,i,a){var g=G.T;G.T=null;var w=W.p;try{W.p=8,Lu(e,t,i,a)}finally{W.p=w,G.T=g}}function Lu(e,t,i,a){if(oo){var g=Ou(a);if(g===null)vu(e,t,a,co,i),ym(e,a);else if(E0(g,e,t,i,a))a.stopPropagation();else if(ym(e,a),t&4&&-1<x0.indexOf(e)){for(;g!==null;){var w=mi(g);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var O=Bt(w.pendingLanes);if(O!==0){var F=w;for(F.pendingLanes|=2,F.entangledLanes|=2;O;){var X=1<<31-Ze(O);F.entanglements[1]|=X,O&=~X}fi(w),(et&6)===0&&(Gl=tt()+500,xa(0))}}break;case 31:case 13:F=xr(w,2),F!==null&&_n(F,w,2),Wl(),Mu(w,2)}if(w=Ou(a),w===null&&vu(e,t,a,co,i),w===g)break;g=w}g!==null&&a.stopPropagation()}else vu(e,t,a,null,i)}}function Ou(e){return e=oi(e),Bu(e)}var co=null;function Bu(e){if(co=null,e=ln(e),e!==null){var t=m(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=o(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 co=e,null}function vm(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(Lt()){case he:return 2;case Se:return 8;case Ae:case Le:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var ju=!1,lr=null,or=null,cr=null,Ma=new Map,La=new Map,ur=[],x0="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 ym(e,t){switch(e){case"focusin":case"focusout":lr=null;break;case"dragenter":case"dragleave":or=null;break;case"mouseover":case"mouseout":cr=null;break;case"pointerover":case"pointerout":Ma.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":La.delete(t.pointerId)}}function Oa(e,t,i,a,g,w){return e===null||e.nativeEvent!==w?(e={blockedOn:t,domEventName:i,eventSystemFlags:a,nativeEvent:w,targetContainers:[g]},t!==null&&(t=mi(t),t!==null&&gm(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,g!==null&&t.indexOf(g)===-1&&t.push(g),e)}function E0(e,t,i,a,g){switch(t){case"focusin":return lr=Oa(lr,e,t,i,a,g),!0;case"dragenter":return or=Oa(or,e,t,i,a,g),!0;case"mouseover":return cr=Oa(cr,e,t,i,a,g),!0;case"pointerover":var w=g.pointerId;return Ma.set(w,Oa(Ma.get(w)||null,e,t,i,a,g)),!0;case"gotpointercapture":return w=g.pointerId,La.set(w,Oa(La.get(w)||null,e,t,i,a,g)),!0}return!1}function Sm(e){var t=ln(e.target);if(t!==null){var i=m(t);if(i!==null){if(t=i.tag,t===13){if(t=f(i),t!==null){e.blockedOn=t,el(e.priority,function(){_m(i)});return}}else if(t===31){if(t=o(i),t!==null){e.blockedOn=t,el(e.priority,function(){_m(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 uo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Ou(e.nativeEvent);if(i===null){i=e.nativeEvent;var a=new i.constructor(i.type,i);Kr=a,i.target.dispatchEvent(a),Kr=null}else return t=mi(i),t!==null&&gm(t),e.blockedOn=i,!1;t.shift()}return!0}function bm(e,t,i){uo(e)&&i.delete(t)}function k0(){ju=!1,lr!==null&&uo(lr)&&(lr=null),or!==null&&uo(or)&&(or=null),cr!==null&&uo(cr)&&(cr=null),Ma.forEach(bm),La.forEach(bm)}function ho(e,t){e.blockedOn===t&&(e.blockedOn=null,ju||(ju=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,k0)))}var fo=null;function Cm(e){fo!==e&&(fo=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){fo===e&&(fo=null);for(var t=0;t<e.length;t+=3){var i=e[t],a=e[t+1],g=e[t+2];if(typeof a!="function"){if(Bu(a||i)===null)continue;break}var w=mi(i);w!==null&&(e.splice(t,3),t-=3,Oc(w,{pending:!0,data:g,method:i.method,action:a},a,g))}}))}function Ts(e){function t(X){return ho(X,e)}lr!==null&&ho(lr,e),or!==null&&ho(or,e),cr!==null&&ho(cr,e),Ma.forEach(t),La.forEach(t);for(var i=0;i<ur.length;i++){var a=ur[i];a.blockedOn===e&&(a.blockedOn=null)}for(;0<ur.length&&(i=ur[0],i.blockedOn===null);)Sm(i),i.blockedOn===null&&ur.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(a=0;a<i.length;a+=3){var g=i[a],w=i[a+1],O=g[It]||null;if(typeof w=="function")O||Cm(i);else if(O){var F=null;if(w&&w.hasAttribute("formAction")){if(g=w,O=w[It]||null)F=O.formAction;else if(Bu(g)!==null)continue}else F=O.action;typeof F=="function"?i[a+1]=F:(i.splice(a,3),a-=3),Cm(i)}}}function wm(){function e(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(O){return g=O})},focusReset:"manual",scroll:"manual"})}function t(){g!==null&&(g(),g=null),a||setTimeout(i,20)}function i(){if(!a&&!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 a=!1,g=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),g!==null&&(g(),g=null)}}}function Nu(e){this._internalRoot=e}po.prototype.render=Nu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var i=t.current,a=Rn();pm(i,a,e,t,null,null)},po.prototype.unmount=Nu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;pm(e.current,2,null,e,null,null),Wl(),t[Yn]=null}};function po(e){this._internalRoot=e}po.prototype.unstable_scheduleHydration=function(e){if(e){var t=Kn();e={blockedOn:null,target:e,priority:t};for(var i=0;i<ur.length&&t!==0&&t<ur[i].priority;i++);ur.splice(i,0,e),i===0&&Sm(e)}};var xm=r.version;if(xm!=="19.2.6")throw Error(l(527,xm,"19.2.6"));W.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=h(t),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var A0={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mo.isDisabled&&mo.supportsFiber)try{gt=mo.inject(A0),mt=mo}catch{}}return ja.createRoot=function(e,t){if(!d(e))throw Error(l(299));var i=!1,a="",g=Md,w=Ld,O=Od;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(g=t.onUncaughtError),t.onCaughtError!==void 0&&(w=t.onCaughtError),t.onRecoverableError!==void 0&&(O=t.onRecoverableError)),t=fm(e,1,!1,null,null,i,a,null,g,w,O,wm),e[Yn]=t.current,_u(e),new Nu(t)},ja.hydrateRoot=function(e,t,i){if(!d(e))throw Error(l(299));var a=!1,g="",w=Md,O=Ld,F=Od,X=null;return i!=null&&(i.unstable_strictMode===!0&&(a=!0),i.identifierPrefix!==void 0&&(g=i.identifierPrefix),i.onUncaughtError!==void 0&&(w=i.onUncaughtError),i.onCaughtError!==void 0&&(O=i.onCaughtError),i.onRecoverableError!==void 0&&(F=i.onRecoverableError),i.formState!==void 0&&(X=i.formState)),t=fm(e,1,!0,t,i??null,a,g,X,w,O,F,wm),t.context=dm(null),i=t.current,a=Rn(),a=qr(a),g=Yi(a),g.callback=null,Xi(i,g,a),i=a,t.current.lanes=i,sn(t,i),fi(t),e[Yn]=t.current,_u(e),new po(t)},ja.version="19.2.6",ja}var jm;function I0(){if(jm)return Iu.exports;jm=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(),Iu.exports=z0(),Iu.exports}var U0=I0();const Pr=function(n,r){let d=n;const m=Pa[r];let f=null,o=0,c=null;const h=[],p={},u=function(R,k){o=d*4+17,f=(function(M){const B=new Array(M);for(let H=0;H<M;H+=1){B[H]=new Array(M);for(let U=0;U<M;U+=1)B[H][U]=null}return B})(o),v(0,0),v(o-7,0),v(0,o-7),E(),T(),y(R,k),d>=7&&b(R),c==null&&(c=A(d,m,h)),_(c,k)},v=function(R,k){for(let M=-1;M<=7;M+=1)if(!(R+M<=-1||o<=R+M))for(let B=-1;B<=7;B+=1)k+B<=-1||o<=k+B||(0<=M&&M<=6&&(B==0||B==6)||0<=B&&B<=6&&(M==0||M==6)||2<=M&&M<=4&&2<=B&&B<=4?f[R+M][k+B]=!0:f[R+M][k+B]=!1)},C=function(){let R=0,k=0;for(let M=0;M<8;M+=1){u(!0,M);const B=dr.getLostPoint(p);(M==0||R>B)&&(R=B,k=M)}return k},T=function(){for(let R=8;R<o-8;R+=1)f[R][6]==null&&(f[R][6]=R%2==0);for(let R=8;R<o-8;R+=1)f[6][R]==null&&(f[6][R]=R%2==0)},E=function(){const R=dr.getPatternPosition(d);for(let k=0;k<R.length;k+=1)for(let M=0;M<R.length;M+=1){const B=R[k],H=R[M];if(f[B][H]==null)for(let U=-2;U<=2;U+=1)for(let P=-2;P<=2;P+=1)U==-2||U==2||P==-2||P==2||U==0&&P==0?f[B+U][H+P]=!0:f[B+U][H+P]=!1}},b=function(R){const k=dr.getBCHTypeNumber(d);for(let M=0;M<18;M+=1){const B=!R&&(k>>M&1)==1;f[Math.floor(M/3)][M%3+o-8-3]=B}for(let M=0;M<18;M+=1){const B=!R&&(k>>M&1)==1;f[M%3+o-8-3][Math.floor(M/3)]=B}},y=function(R,k){const M=m<<3|k,B=dr.getBCHTypeInfo(M);for(let H=0;H<15;H+=1){const U=!R&&(B>>H&1)==1;H<6?f[H][8]=U:H<8?f[H+1][8]=U:f[o-15+H][8]=U}for(let H=0;H<15;H+=1){const U=!R&&(B>>H&1)==1;H<8?f[8][o-H-1]=U:H<9?f[8][15-H-1+1]=U:f[8][15-H-1]=U}f[o-8][8]=!R},_=function(R,k){let M=-1,B=o-1,H=7,U=0;const P=dr.getMaskFunction(k);for(let K=o-1;K>0;K-=2)for(K==6&&(K-=1);;){for(let Y=0;Y<2;Y+=1)if(f[B][K-Y]==null){let G=!1;U<R.length&&(G=(R[U]>>>H&1)==1),P(B,K-Y)&&(G=!G),f[B][K-Y]=G,H-=1,H==-1&&(U+=1,H=7)}if(B+=M,B<0||o<=B){B-=M,M=-M;break}}},S=function(R,k){let M=0,B=0,H=0;const U=new Array(k.length),P=new Array(k.length);for(let W=0;W<k.length;W+=1){const Z=k[W].dataCount,z=k[W].totalCount-Z;B=Math.max(B,Z),H=Math.max(H,z),U[W]=new Array(Z);for(let I=0;I<U[W].length;I+=1)U[W][I]=255&R.getBuffer()[I+M];M+=Z;const j=dr.getErrorCorrectPolynomial(z),$=Va(U[W],j.getLength()-1).mod(j);P[W]=new Array(j.getLength()-1);for(let I=0;I<P[W].length;I+=1){const re=I+$.getLength()-P[W].length;P[W][I]=re>=0?$.getAt(re):0}}let K=0;for(let W=0;W<k.length;W+=1)K+=k[W].totalCount;const Y=new Array(K);let G=0;for(let W=0;W<B;W+=1)for(let Z=0;Z<k.length;Z+=1)W<U[Z].length&&(Y[G]=U[Z][W],G+=1);for(let W=0;W<H;W+=1)for(let Z=0;Z<k.length;Z+=1)W<P[Z].length&&(Y[G]=P[Z][W],G+=1);return Y},A=function(R,k,M){const B=Nm.getRSBlocks(R,k),H=Hm();for(let P=0;P<M.length;P+=1){const K=M[P];H.put(K.getMode(),4),H.put(K.getLength(),dr.getLengthInBits(K.getMode(),R)),K.write(H)}let U=0;for(let P=0;P<B.length;P+=1)U+=B[P].dataCount;if(H.getLengthInBits()>U*8)throw"code length overflow. ("+H.getLengthInBits()+">"+U*8+")";for(H.getLengthInBits()+4<=U*8&&H.put(0,4);H.getLengthInBits()%8!=0;)H.putBit(!1);for(;!(H.getLengthInBits()>=U*8||(H.put(236,8),H.getLengthInBits()>=U*8));)H.put(17,8);return S(H,B)};p.addData=function(R,k){k=k||"Byte";let M=null;switch(k){case"Numeric":M=P0(R);break;case"Alphanumeric":M=F0(R);break;case"Byte":M=q0(R);break;case"Kanji":M=$0(R);break;default:throw"mode:"+k}h.push(M),c=null},p.isDark=function(R,k){if(R<0||o<=R||k<0||o<=k)throw R+","+k;return f[R][k]},p.getModuleCount=function(){return o},p.make=function(){if(d<1){let R=1;for(;R<40;R++){const k=Nm.getRSBlocks(R,m),M=Hm();for(let H=0;H<h.length;H++){const U=h[H];M.put(U.getMode(),4),M.put(U.getLength(),dr.getLengthInBits(U.getMode(),R)),U.write(M)}let B=0;for(let H=0;H<k.length;H++)B+=k[H].dataCount;if(M.getLengthInBits()<=B*8)break}d=R}u(!1,C())},p.createTableTag=function(R,k){R=R||2,k=typeof k>"u"?R*4:k;let M="";M+='<table style="',M+=" border-width: 0px; border-style: none;",M+=" border-collapse: collapse;",M+=" padding: 0px; margin: "+k+"px;",M+='">',M+="<tbody>";for(let B=0;B<p.getModuleCount();B+=1){M+="<tr>";for(let H=0;H<p.getModuleCount();H+=1)M+='<td style="',M+=" border-width: 0px; border-style: none;",M+=" border-collapse: collapse;",M+=" padding: 0px; margin: 0px;",M+=" width: "+R+"px;",M+=" height: "+R+"px;",M+=" background-color: ",M+=p.isDark(B,H)?"#000000":"#ffffff",M+=";",M+='"/>';M+="</tr>"}return M+="</tbody>",M+="</table>",M},p.createSvgTag=function(R,k,M,B){let H={};typeof arguments[0]=="object"&&(H=arguments[0],R=H.cellSize,k=H.margin,M=H.alt,B=H.title),R=R||2,k=typeof k>"u"?R*4:k,M=typeof M=="string"?{text:M}:M||{},M.text=M.text||null,M.id=M.text?M.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 U=p.getModuleCount()*R+k*2;let P,K,Y,G,W="",Z;for(Z="l"+R+",0 0,"+R+" -"+R+",0 0,-"+R+"z ",W+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',W+=H.scalable?"":' width="'+U+'px" height="'+U+'px"',W+=' viewBox="0 0 '+U+" "+U+'" ',W+=' preserveAspectRatio="xMinYMin meet"',W+=B.text||M.text?' role="img" aria-labelledby="'+L([B.id,M.id].join(" ").trim())+'"':"",W+=">",W+=B.text?'<title id="'+L(B.id)+'">'+L(B.text)+"</title>":"",W+=M.text?'<description id="'+L(M.id)+'">'+L(M.text)+"</description>":"",W+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',W+='<path d="',Y=0;Y<p.getModuleCount();Y+=1)for(G=Y*R+k,P=0;P<p.getModuleCount();P+=1)p.isDark(Y,P)&&(K=P*R+k,W+="M"+K+","+G+Z);return W+='" stroke="transparent" fill="black"/>',W+="</svg>",W},p.createDataURL=function(R,k){R=R||2,k=typeof k>"u"?R*4:k;const M=p.getModuleCount()*R+k*2,B=k,H=M-k;return K0(M,M,function(U,P){if(B<=U&&U<H&&B<=P&&P<H){const K=Math.floor((U-B)/R),Y=Math.floor((P-B)/R);return p.isDark(Y,K)?0:1}else return 1})},p.createImgTag=function(R,k,M){R=R||2,k=typeof k>"u"?R*4:k;const B=p.getModuleCount()*R+k*2;let H="";return H+="<img",H+=' src="',H+=p.createDataURL(R,k),H+='"',H+=' width="',H+=B,H+='"',H+=' height="',H+=B,H+='"',M&&(H+=' alt="',H+=L(M),H+='"'),H+="/>",H};const L=function(R){let k="";for(let M=0;M<R.length;M+=1){const B=R.charAt(M);switch(B){case"<":k+="<";break;case">":k+=">";break;case"&":k+="&";break;case'"':k+=""";break;default:k+=B;break}}return k},D=function(R){R=typeof R>"u"?2:R;const M=p.getModuleCount()*1+R*2,B=R,H=M-R;let U,P,K,Y,G;const W={"██":"█","█ ":"▀"," █":"▄"," ":" "},Z={"██":"▀","█ ":"▀"," █":" "," ":" "};let z="";for(U=0;U<M;U+=2){for(K=Math.floor((U-B)/1),Y=Math.floor((U+1-B)/1),P=0;P<M;P+=1)G="█",B<=P&&P<H&&B<=U&&U<H&&p.isDark(K,Math.floor((P-B)/1))&&(G=" "),B<=P&&P<H&&B<=U+1&&U+1<H&&p.isDark(Y,Math.floor((P-B)/1))?G+=" ":G+="█",z+=R<1&&U+1>=H?Z[G]:W[G];z+=`
|
|
50
|
-
`}return M%2&&R>0?z.substring(0,z.length-M-1)+Array(M+1).join("▀"):z.substring(0,z.length-1)};return
|
|
51
|
-
`}return Z.substring(0,Z.length-1)},p.renderTo2dContext=function(R,k){k=k||2;const M=p.getModuleCount();for(let B=0;B<M;B++)for(let H=0;H<M;H++)R.fillStyle=p.isDark(B,H)?"black":"white",R.fillRect(H*k,B*k,k,k)},p};Pr.stringToBytes=function(n){const r=[];for(let s=0;s<n.length;s+=1){const l=n.charCodeAt(s);r.push(l&255)}return r};Pr.createStringToBytes=function(n,r){const s=(function(){const d=V0(n),m=function(){const c=d.read();if(c==-1)throw"eof";return c};let f=0;const o={};for(;;){const c=d.read();if(c==-1)break;const h=m(),p=m(),u=m(),v=String.fromCharCode(c<<8|h),C=p<<8|u;o[v]=C,f+=1}if(f!=r)throw f+" != "+r;return o})(),l=63;return function(d){const m=[];for(let f=0;f<d.length;f+=1){const o=d.charCodeAt(f);if(o<128)m.push(o);else{const c=s[d.charAt(f)];typeof c=="number"?(c&255)==c?m.push(c):(m.push(c>>>8),m.push(c&255)):m.push(l)}}return m}};const Kt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Pa={L:1,M:0,Q:3,H:2},fr={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},dr=(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,l=21522,d={},m=function(f){let o=0;for(;f!=0;)o+=1,f>>>=1;return o};return d.getBCHTypeInfo=function(f){let o=f<<10;for(;m(o)-m(r)>=0;)o^=r<<m(o)-m(r);return(f<<10|o)^l},d.getBCHTypeNumber=function(f){let o=f<<12;for(;m(o)-m(s)>=0;)o^=s<<m(o)-m(s);return f<<12|o},d.getPatternPosition=function(f){return n[f-1]},d.getMaskFunction=function(f){switch(f){case fr.PATTERN000:return function(o,c){return(o+c)%2==0};case fr.PATTERN001:return function(o,c){return o%2==0};case fr.PATTERN010:return function(o,c){return c%3==0};case fr.PATTERN011:return function(o,c){return(o+c)%3==0};case fr.PATTERN100:return function(o,c){return(Math.floor(o/2)+Math.floor(c/3))%2==0};case fr.PATTERN101:return function(o,c){return o*c%2+o*c%3==0};case fr.PATTERN110:return function(o,c){return(o*c%2+o*c%3)%2==0};case fr.PATTERN111:return function(o,c){return(o*c%3+(o+c)%2)%2==0};default:throw"bad maskPattern:"+f}},d.getErrorCorrectPolynomial=function(f){let o=Va([1],0);for(let c=0;c<f;c+=1)o=o.multiply(Va([1,mr.gexp(c)],0));return o},d.getLengthInBits=function(f,o){if(1<=o&&o<10)switch(f){case Kt.MODE_NUMBER:return 10;case Kt.MODE_ALPHA_NUM:return 9;case Kt.MODE_8BIT_BYTE:return 8;case Kt.MODE_KANJI:return 8;default:throw"mode:"+f}else if(o<27)switch(f){case Kt.MODE_NUMBER:return 12;case Kt.MODE_ALPHA_NUM:return 11;case Kt.MODE_8BIT_BYTE:return 16;case Kt.MODE_KANJI:return 10;default:throw"mode:"+f}else if(o<41)switch(f){case Kt.MODE_NUMBER:return 14;case Kt.MODE_ALPHA_NUM:return 13;case Kt.MODE_8BIT_BYTE:return 16;case Kt.MODE_KANJI:return 12;default:throw"mode:"+f}else throw"type:"+o},d.getLostPoint=function(f){const o=f.getModuleCount();let c=0;for(let u=0;u<o;u+=1)for(let v=0;v<o;v+=1){let C=0;const T=f.isDark(u,v);for(let E=-1;E<=1;E+=1)if(!(u+E<0||o<=u+E))for(let b=-1;b<=1;b+=1)v+b<0||o<=v+b||E==0&&b==0||T==f.isDark(u+E,v+b)&&(C+=1);C>5&&(c+=3+C-5)}for(let u=0;u<o-1;u+=1)for(let v=0;v<o-1;v+=1){let C=0;f.isDark(u,v)&&(C+=1),f.isDark(u+1,v)&&(C+=1),f.isDark(u,v+1)&&(C+=1),f.isDark(u+1,v+1)&&(C+=1),(C==0||C==4)&&(c+=3)}for(let u=0;u<o;u+=1)for(let v=0;v<o-6;v+=1)f.isDark(u,v)&&!f.isDark(u,v+1)&&f.isDark(u,v+2)&&f.isDark(u,v+3)&&f.isDark(u,v+4)&&!f.isDark(u,v+5)&&f.isDark(u,v+6)&&(c+=40);for(let u=0;u<o;u+=1)for(let v=0;v<o-6;v+=1)f.isDark(v,u)&&!f.isDark(v+1,u)&&f.isDark(v+2,u)&&f.isDark(v+3,u)&&f.isDark(v+4,u)&&!f.isDark(v+5,u)&&f.isDark(v+6,u)&&(c+=40);let h=0;for(let u=0;u<o;u+=1)for(let v=0;v<o;v+=1)f.isDark(v,u)&&(h+=1);const p=Math.abs(100*h/o/o-50)/5;return c+=p*10,c},d})(),mr=(function(){const n=new Array(256),r=new Array(256);for(let l=0;l<8;l+=1)n[l]=1<<l;for(let l=8;l<256;l+=1)n[l]=n[l-4]^n[l-5]^n[l-6]^n[l-8];for(let l=0;l<255;l+=1)r[n[l]]=l;const s={};return s.glog=function(l){if(l<1)throw"glog("+l+")";return r[l]},s.gexp=function(l){for(;l<0;)l+=255;for(;l>=256;)l-=255;return n[l]},s})(),Va=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 m=new Array(n.length-d+r);for(let f=0;f<n.length-d;f+=1)m[f]=n[f+d];return m})(),l={};return l.getAt=function(d){return s[d]},l.getLength=function(){return s.length},l.multiply=function(d){const m=new Array(l.getLength()+d.getLength()-1);for(let f=0;f<l.getLength();f+=1)for(let o=0;o<d.getLength();o+=1)m[f+o]^=mr.gexp(mr.glog(l.getAt(f))+mr.glog(d.getAt(o)));return Va(m,0)},l.mod=function(d){if(l.getLength()-d.getLength()<0)return l;const m=mr.glog(l.getAt(0))-mr.glog(d.getAt(0)),f=new Array(l.getLength());for(let o=0;o<l.getLength();o+=1)f[o]=l.getAt(o);for(let o=0;o<d.getLength();o+=1)f[o]^=mr.gexp(mr.glog(d.getAt(o))+m);return Va(f,0).mod(d)},l},Nm=(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,m){const f={};return f.totalCount=d,f.dataCount=m,f},s={},l=function(d,m){switch(m){case Pa.L:return n[(d-1)*4+0];case Pa.M:return n[(d-1)*4+1];case Pa.Q:return n[(d-1)*4+2];case Pa.H:return n[(d-1)*4+3];default:return}};return s.getRSBlocks=function(d,m){const f=l(d,m);if(typeof f>"u")throw"bad rs block @ typeNumber:"+d+"/errorCorrectionLevel:"+m;const o=f.length/3,c=[];for(let h=0;h<o;h+=1){const p=f[h*3+0],u=f[h*3+1],v=f[h*3+2];for(let C=0;C<p;C+=1)c.push(r(u,v))}return c},s})(),Hm=function(){const n=[];let r=0;const s={};return s.getBuffer=function(){return n},s.getAt=function(l){const d=Math.floor(l/8);return(n[d]>>>7-l%8&1)==1},s.put=function(l,d){for(let m=0;m<d;m+=1)s.putBit((l>>>d-m-1&1)==1)},s.getLengthInBits=function(){return r},s.putBit=function(l){const d=Math.floor(r/8);n.length<=d&&n.push(0),l&&(n[d]|=128>>>r%8),r+=1},s},P0=function(n){const r=Kt.MODE_NUMBER,s=n,l={};l.getMode=function(){return r},l.getLength=function(f){return s.length},l.write=function(f){const o=s;let c=0;for(;c+2<o.length;)f.put(d(o.substring(c,c+3)),10),c+=3;c<o.length&&(o.length-c==1?f.put(d(o.substring(c,c+1)),4):o.length-c==2&&f.put(d(o.substring(c,c+2)),7))};const d=function(f){let o=0;for(let c=0;c<f.length;c+=1)o=o*10+m(f.charAt(c));return o},m=function(f){if("0"<=f&&f<="9")return f.charCodeAt(0)-48;throw"illegal char :"+f};return l},F0=function(n){const r=Kt.MODE_ALPHA_NUM,s=n,l={};l.getMode=function(){return r},l.getLength=function(m){return s.length},l.write=function(m){const f=s;let o=0;for(;o+1<f.length;)m.put(d(f.charAt(o))*45+d(f.charAt(o+1)),11),o+=2;o<f.length&&m.put(d(f.charAt(o)),6)};const d=function(m){if("0"<=m&&m<="9")return m.charCodeAt(0)-48;if("A"<=m&&m<="Z")return m.charCodeAt(0)-65+10;switch(m){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 :"+m}};return l},q0=function(n){const r=Kt.MODE_8BIT_BYTE,s=Pr.stringToBytes(n),l={};return l.getMode=function(){return r},l.getLength=function(d){return s.length},l.write=function(d){for(let m=0;m<s.length;m+=1)d.put(s[m],8)},l},$0=function(n){const r=Kt.MODE_KANJI,s=Pr.stringToBytes;(function(m,f){const o=s(m);if(o.length!=2||(o[0]<<8|o[1])!=f)throw"sjis not supported."})("友",38726);const l=s(n),d={};return d.getMode=function(){return r},d.getLength=function(m){return~~(l.length/2)},d.write=function(m){const f=l;let o=0;for(;o+1<f.length;){let c=(255&f[o])<<8|255&f[o+1];if(33088<=c&&c<=40956)c-=33088;else if(57408<=c&&c<=60351)c-=49472;else throw"illegal char at "+(o+1)+"/"+c;c=(c>>>8&255)*192+(c&255),m.put(c,13),o+=2}if(o<f.length)throw"illegal char at "+(o+1)},d},Qg=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,l,d){l=l||0,d=d||s.length;for(let m=0;m<d;m+=1)r.writeByte(s[m+l])},r.writeString=function(s){for(let l=0;l<s.length;l+=1)r.writeByte(s.charCodeAt(l))},r.toByteArray=function(){return n},r.toString=function(){let s="";s+="[";for(let l=0;l<n.length;l+=1)l>0&&(s+=","),s+=n[l];return s+="]",s},r},G0=function(){let n=0,r=0,s=0,l="";const d={},m=function(o){l+=String.fromCharCode(f(o&63))},f=function(o){if(o<0)throw"n:"+o;if(o<26)return 65+o;if(o<52)return 97+(o-26);if(o<62)return 48+(o-52);if(o==62)return 43;if(o==63)return 47;throw"n:"+o};return d.writeByte=function(o){for(n=n<<8|o&255,r+=8,s+=1;r>=6;)m(n>>>r-6),r-=6},d.flush=function(){if(r>0&&(m(n<<6-r),n=0,r=0),s%3!=0){const o=3-s%3;for(let c=0;c<o;c+=1)l+="="}},d.toString=function(){return l},d},V0=function(n){const r=n;let s=0,l=0,d=0;const m={};m.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;l=l<<6|f(c.charCodeAt(0)),d+=6}const o=l>>>d-8&255;return d-=8,o};const f=function(o){if(65<=o&&o<=90)return o-65;if(97<=o&&o<=122)return o-97+26;if(48<=o&&o<=57)return o-48+52;if(o==43)return 62;if(o==47)return 63;throw"c:"+o};return m},W0=function(n,r){const s=n,l=r,d=new Array(n*r),m={};m.setPixel=function(h,p,u){d[p*s+h]=u},m.write=function(h){h.writeString("GIF87a"),h.writeShort(s),h.writeShort(l),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(l),h.writeByte(0);const p=2,u=o(p);h.writeByte(p);let v=0;for(;u.length-v>255;)h.writeByte(255),h.writeBytes(u,v,255),v+=255;h.writeByte(u.length-v),h.writeBytes(u,v,u.length-v),h.writeByte(0),h.writeString(";")};const f=function(h){const p=h;let u=0,v=0;const C={};return C.write=function(T,E){if(T>>>E)throw"length over";for(;u+E>=8;)p.writeByte(255&(T<<u|v)),E-=8-u,T>>>=8-u,v=0,u=0;v=T<<u|v,u=u+E},C.flush=function(){u>0&&p.writeByte(v)},C},o=function(h){const p=1<<h,u=(1<<h)+1;let v=h+1;const C=c();for(let _=0;_<p;_+=1)C.add(String.fromCharCode(_));C.add(String.fromCharCode(p)),C.add(String.fromCharCode(u));const T=Qg(),E=f(T);E.write(p,v);let b=0,y=String.fromCharCode(d[b]);for(b+=1;b<d.length;){const _=String.fromCharCode(d[b]);b+=1,C.contains(y+_)?y=y+_:(E.write(C.indexOf(y),v),C.size()<4095&&(C.size()==1<<v&&(v+=1),C.add(y+_)),y=_)}return E.write(C.indexOf(y),v),E.write(u,v),E.flush(),T.toByteArray()},c=function(){const h={};let p=0;const u={};return u.add=function(v){if(u.contains(v))throw"dup key:"+v;h[v]=p,p+=1},u.size=function(){return p},u.indexOf=function(v){return h[v]},u.contains=function(v){return typeof h[v]<"u"},u};return m},K0=function(n,r,s){const l=W0(n,r);for(let o=0;o<r;o+=1)for(let c=0;c<n;c+=1)l.setPixel(c,o,s(c,o));const d=Qg();l.write(d);const m=G0(),f=d.toByteArray();for(let o=0;o<f.length;o+=1)m.writeByte(f[o]);return m.flush(),"data:image/gif;base64,"+m};Pr.stringToBytes;const Wa=[{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}],Jg={name:"gate-reviewer",label:"Gate Reviewer",commandAgent:"gate-reviewer",dispatchable:!1},Hs=[...Wa,Jg],Y0={name:"translator",label:"Translator",commandAgent:"translator",dispatchable:!1},X0={name:"harness-engineer",label:"Harness Engineer",commandAgent:"harness-engineer",dispatchable:!1},Zg=[Y0,X0],Dh=[...Hs,...Zg];Wa.map(n=>n.name);const e_=Hs.map(n=>n.name);Zg.map(n=>n.name);Dh.map(n=>n.name);Dh.filter(n=>n.dispatchable).map(n=>n.name);function Q0(n){return e_.includes(n)}const J0="zh-CN",Z0="pm-final-only",t_=[{value:"zh-CN",label:"Chinese"},{value:"ja",label:"Japanese"},{value:"ko",label:"Korean"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"}],e1=[{value:"round-final",label:"Round final reply"},{value:"pm-final-only",label:"PM final reply"},{value:"final-only",label:"Each role final reply"},{value:"all",label:"All replies"}];function t1(){const n={};for(const r of e_)n[r]={permissionMode:"bypassPermissions",model:"default",effort:"default"};return{version:1,roles:n,autoOrchestration:!0}}function n1({sidebar:n,children:r}){const[s,l]=te.useState(!1);return x.jsxs("div",{className:s?"app-shell is-sidebar-collapsed":"app-shell",children:[x.jsxs("aside",{className:"app-sidebar",children:[x.jsx("button",{className:"sidebar-toggle",type:"button","aria-label":s?"Expand sidebar":"Collapse sidebar",title:s?"Expand sidebar":"Collapse sidebar",onClick:()=>l(d=>!d)}),x.jsx("div",{className:"sidebar-content",children:n})]}),x.jsx("main",{className:"app-main",children:r})]})}function i1({busy:n,state:r,onApprove:s,onCancel:l,onComment:d,onReject:m}){var _;const[f,o]=te.useState(!1),[c,h]=te.useState(""),[p,u]=te.useState(null);if(!r||r.status==="idle")return null;const v=r.active,C=r1(r);if(p===C)return null;const T=r.status==="awaiting_user_approval",E=(v==null?void 0:v.title)??((_=r.pending[0])==null?void 0:_.title)??"Harness feedback",b=(v==null?void 0:v.source)==="task-retrospective"?"Task Harness Review":"Harness Feedback",y=()=>{o(!1),u(C)};return x.jsxs(x.Fragment,{children:[x.jsxs("section",{className:T?"harness-feedback-float needs-review":"harness-feedback-float",children:[x.jsxs("div",{children:[x.jsx("strong",{children:T?`${b} needed`:b}),x.jsx("span",{children:s1(r)})]}),x.jsx("p",{title:E,children:E}),x.jsxs("div",{className:"harness-feedback-float-actions",children:[x.jsx("button",{type:"button",disabled:n,onClick:y,children:"Close"}),x.jsx("button",{type:"button",disabled:n||!v,onClick:()=>o(!0),children:T?"Review":"Open"})]})]}),f&&v?x.jsx("div",{className:"modal-backdrop harness-feedback-backdrop",children:x.jsxs("section",{className:"harness-feedback-modal",role:"dialog","aria-modal":"true","aria-label":"Harness feedback review",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{children:b}),x.jsxs("p",{className:"muted",children:[r.status.replaceAll("_"," ")," · queued ",r.queuedCount]})]}),x.jsx("button",{type:"button",onClick:()=>o(!1),children:"Close"})]}),x.jsxs("div",{className:"harness-feedback-modal-body",children:[x.jsxs("section",{children:[x.jsx("h3",{children:v.source==="task-retrospective"?"Task Retrospective Request":"Feedback"}),x.jsx("pre",{children:v.feedbackContent||"No feedback content found."})]}),x.jsxs("section",{children:[x.jsx("h3",{children:"Harness Engineer Analysis"}),x.jsx("pre",{children:v.analysisContent||"Analysis is not available yet."})]})]}),T?x.jsxs("footer",{className:"harness-feedback-review-actions",children:[x.jsx("textarea",{value:c,placeholder:"Optional note for Harness Engineer...",onChange:S=>h(S.target.value)}),x.jsxs("div",{children:[x.jsx("button",{type:"button",disabled:n,onClick:()=>d(c),children:"Send Feedback"}),x.jsx("button",{type:"button",disabled:n,onClick:()=>m(c),children:"Reject"}),x.jsx("button",{type:"button",disabled:n,onClick:()=>s(c),children:"Approve"})]})]}):v?x.jsxs("footer",{className:"harness-feedback-review-actions",children:[x.jsx("textarea",{value:c,placeholder:"Optional cancellation note...",onChange:S=>h(S.target.value)}),x.jsx("div",{children:x.jsx("button",{type:"button",disabled:n,onClick:()=>l(c),children:"Cancel"})})]}):null]})}):null]})}function r1(n){if(n.active)return["active",n.status,n.active.id,n.active.path,n.active.updatedAt??"",n.active.analysisPath??"",n.active.applyReportPath??""].join(":");const r=n.pending[0];return r?["pending",n.status,r.id,r.path,n.queuedCount].join(":"):[n.status,n.queuedCount].join(":")}function s1(n){return n.status==="queued"?`${n.queuedCount} queued`:n.status==="awaiting_user_approval"?"waiting for approval":n.status==="analyzing"?"Harness Engineer analyzing":n.status==="applying"?"Harness Engineer applying":n.status}function Lo(n,r="Unknown error."){if(n instanceof Error)return n.message||r;if(typeof n=="string"&&n.trim())return n;if(n===void 0)return r;try{return JSON.stringify(n)}catch{return String(n)}}function dt(n,r,s){return`${n} failed. Reason: ${Lo(r,s)}`}function xo(n,r){return r.some(s=>n.startsWith(`${s} failed.`))?"":n}const ye={getAppPreferences(){return be("/api/settings/preferences")},updateAppPreferences(n){return be("/api/settings/preferences",{method:"PUT",body:JSON.stringify(n)})},getRuntimeDiagnostics(){return be("/api/diagnostics/runtime")},getCurrentProject(){return be("/api/projects/current")},pullCurrentProject(){return be("/api/projects/current/pull",{method:"POST"})},getRecentRepositoryPaths(){return be("/api/projects/recent")},connectProject(n){return be("/api/projects/connect",{method:"POST",body:JSON.stringify(n)})},listTasks(){return be("/api/tasks")},createTask(n){return be("/api/tasks",{method:"POST",body:JSON.stringify(n)})},cleanupTask(n,r={}){return be(`/api/tasks/${encodeURIComponent(n)}/cleanup`,{method:"POST",body:JSON.stringify(r)})},getHarnessStatus(n){const r=new URLSearchParams({taskSlug:n});return be(`/api/projects/harness?${r.toString()}`)},applyHarness(n){return be("/api/projects/harness/apply",{method:"POST",body:JSON.stringify(n)})},getHarnessFileContent(n,r){const s=new URLSearchParams({path:r,taskSlug:n});return be(`/api/projects/harness/file?${s.toString()}`)},updateHarnessFileContent(n,r,s){const l=new URLSearchParams({path:r,taskSlug:n});return be(`/api/projects/harness/file?${l.toString()}`,{method:"PUT",body:JSON.stringify(s)})},getRepositoryDiff(n,r){const s=new URLSearchParams({taskSlug:n});return r&&s.set("commit",r),be(`/api/projects/harness/repository-diff?${s.toString()}`)},getRepositoryFileDiff(n,r){const s=new URLSearchParams({taskSlug:n,path:r});return be(`/api/projects/harness/repository-diff/file?${s.toString()}`)},mergeRepositoryDiffToCurrentBranch(n){return be("/api/projects/harness/repository-diff/merge-to-current-branch",{method:"POST",body:JSON.stringify({taskSlug:n})})},getHarnessBootstrapStatus(n){const r=new URLSearchParams({taskSlug:n});return be(`/api/projects/harness/bootstrap?${r.toString()}`)},startHarnessBootstrap(n={}){return be("/api/projects/harness/bootstrap/start",{method:"POST",body:JSON.stringify(n)})},restartHarnessBootstrap(n={}){return be("/api/projects/harness/bootstrap/restart",{method:"POST",body:JSON.stringify(n)})},stopHarnessBootstrap(){return be("/api/projects/harness/bootstrap/stop",{method:"POST"})},runHarnessBootstrap(n){return be("/api/projects/harness/bootstrap/run",{method:"POST",body:JSON.stringify(n)})},getHarnessEngineerSession(){return be("/api/projects/harness/engineer/session")},ensureHarnessEngineerSession(n={}){return be("/api/projects/harness/engineer/session/ensure",{method:"POST",body:JSON.stringify(n)})},startHarnessEngineerSession(n={}){return be("/api/projects/harness/engineer/session/start",{method:"POST",body:JSON.stringify(n)})},resumeHarnessEngineerSession(n={}){return be("/api/projects/harness/engineer/session/resume",{method:"POST",body:JSON.stringify(n)})},restartHarnessEngineerSession(n={}){return be("/api/projects/harness/engineer/session/restart",{method:"POST",body:JSON.stringify(n)})},stopHarnessEngineerSession(){return be("/api/projects/harness/engineer/session/stop",{method:"POST"})},notifyHarnessEngineerHarnessUpdated(){return be("/api/projects/harness/engineer/session/notify-harness",{method:"POST"})},getHarnessFeedbackState(n){const r=new URLSearchParams;n&&r.set("taskSlug",n);const s=r.toString();return be(`/api/projects/harness/feedback${s?`?${s}`:""}`)},decideHarnessFeedback(n){return be("/api/projects/harness/feedback/decision",{method:"POST",body:JSON.stringify(n)})},startTaskHarnessRetrospective(n){return be("/api/projects/harness/task-retrospective",{method:"POST",body:JSON.stringify(n)})},getTaskStatus(n){return be(`/api/tasks/${encodeURIComponent(n)}/status`)},oneClickStart(n){return be(`/api/tasks/${encodeURIComponent(n)}/one-click-start`,{method:"POST"})},getTaskWorkspaceState(n){return be(`/api/tasks/${encodeURIComponent(n)}/workspace-state`)},getProjectRuntimeState(n){const r=new URLSearchParams;n&&r.set("taskSlug",n);const s=r.toString();return be(`/api/projects/runtime-state${s?`?${s}`:""}`)},listSessions(n){return be(`/api/tasks/${encodeURIComponent(n)}/sessions`)},startRoleSession(n,r,s={}){return be(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/start`,{method:"POST",body:JSON.stringify(s)})},stopRoleSession(n,r){return be(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/stop`,{method:"POST"})},restartRoleSession(n,r,s={}){return be(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/restart`,{method:"POST",body:JSON.stringify(s)})},resumeRoleSession(n,r,s={}){return be(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/resume`,{method:"POST",body:JSON.stringify(s)})},notifyRoleHarnessUpdated(n,r){return be(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/notify-harness`,{method:"POST"})},dispatchRoleCommand(n,r){return be(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/dispatch`,{method:"POST"})},listMessages(n){return be(`/api/tasks/${encodeURIComponent(n)}/messages`)},markAllMessagesDone(n){return be(`/api/tasks/${encodeURIComponent(n)}/messages/mark-all-done`,{method:"POST"})},deleteMessageHistory(n){return be(`/api/tasks/${encodeURIComponent(n)}/messages/history`,{method:"DELETE"})},getOrchestrationState(n){return be(`/api/tasks/${encodeURIComponent(n)}/orchestration`)},updateOrchestrationState(n,r){return be(`/api/tasks/${encodeURIComponent(n)}/orchestration`,{method:"PUT",body:JSON.stringify(r)})},getSessionRoundState(n){return be(`/api/tasks/${encodeURIComponent(n)}/round`)},getGateReviewState(n){return be(`/api/tasks/${encodeURIComponent(n)}/gate-review`)},updateGateReviewSettings(n,r){return be(`/api/tasks/${encodeURIComponent(n)}/gate-review/settings`,{method:"PUT",body:JSON.stringify(r)})},requestGateReviewGate(n,r){return be(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/request`,{method:"POST"})},retryGateReviewGate(n,r){return be(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/retry`,{method:"POST"})},skipGateReviewGate(n,r,s){return be(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/skip`,{method:"POST",body:JSON.stringify(s)})},overrideGateReviewGate(n,r,s){return be(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/override`,{method:"POST",body:JSON.stringify(s)})},getGateReviewReport(n,r){return be(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/report`)},startTranslationSession(n,r){return be(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/start`,{method:"POST"})},pollTranslationSession(n,r,s){const l=new URLSearchParams({after:String(r)});return s!==void 0&&l.set("limit",String(s)),be(`/api/translation/sessions/${encodeURIComponent(n)}/events?${l.toString()}`)},pollTranslationTaskFeed(n,r,s){const l=new URLSearchParams({after:String(r)});return s!==void 0&&l.set("limit",String(s)),be(`/api/tasks/${encodeURIComponent(n)}/translation/feed?${l.toString()}`)},translateUserInput(n,r,s){return be(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/input`,{method:"POST",body:JSON.stringify(s)})},translateManualOutput(n,r,s){return be(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/manual-output`,{method:"POST",body:JSON.stringify(s)})},translateLatestReply(n,r){return be(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/latest-reply`,{method:"POST"})},sendTranslatedInput(n,r,s){return be(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/send`,{method:"POST",body:JSON.stringify(s)})},clearTranslationSession(n){return be(`/api/translation/sessions/${encodeURIComponent(n)}/clear`,{method:"POST"})},stopTranslationSession(n){return be(`/api/translation/sessions/${encodeURIComponent(n)}/stop`,{method:"POST"})},notifyTranslatorHarnessUpdated(){return be("/api/projects/translation/session/notify-harness",{method:"POST"})},retryTranslation(n,r){return be(`/api/translation/sessions/${encodeURIComponent(n)}/retry/${encodeURIComponent(r)}`,{method:"POST"})},ignoreTranslationFailures(n){return be(`/api/translation/sessions/${encodeURIComponent(n)}/failures/ignore`,{method:"POST"})},retryTranslationFailures(n){return be(`/api/translation/sessions/${encodeURIComponent(n)}/failures/retry`,{method:"POST"})},getTranslationState(){return be("/api/translation/state")},getTranslatorSession(){return be("/api/translation/session")},ensureTranslatorSession(n={}){return be("/api/translation/session/ensure",{method:"POST",body:JSON.stringify(n)})},startTranslatorSession(n={}){return be("/api/translation/session/start",{method:"POST",body:JSON.stringify(n)})},resumeTranslatorSession(n={}){return be("/api/translation/session/resume",{method:"POST",body:JSON.stringify(n)})},restartTranslatorSession(n={}){return be("/api/translation/session/restart",{method:"POST",body:JSON.stringify(n)})},stopTranslatorSession(){return be("/api/translation/session/stop",{method:"POST"})},browseTranslationSourceFiles(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 be(`/api/translation/source-files${s}`)},createFileTranslation(n){return be("/api/translation/files",{method:"POST",body:JSON.stringify(n)})},readFileTranslation(n){return be(`/api/translation/files/${encodeURIComponent(n)}`)},createTranslationBootstrap(n){return be("/api/translation/bootstrap",{method:"POST",body:JSON.stringify(n)})},createTranslationMemoryUpdate(n){return be("/api/translation/memory-update",{method:"POST",body:JSON.stringify(n)})},promoteTranslation(n,r){return be(`/api/translation/files/${encodeURIComponent(n)}/promote`,{method:"POST",body:JSON.stringify({targetPath:r})})},getGatewayStatus(){return be("/api/gateway/status")},updateGatewaySettings(n){return be("/api/gateway/settings",{method:"PUT",body:JSON.stringify(n)})},startGatewayQrLogin(){return be("/api/gateway/qr/start",{method:"POST"})},checkGatewayQrLogin(n={}){return be("/api/gateway/qr/check",{method:"POST",body:JSON.stringify(n)})},startGatewayLarkRegistration(){return be("/api/gateway/lark-registration/start",{method:"POST"})},checkGatewayLarkRegistration(){return be("/api/gateway/lark-registration/check",{method:"POST"})},bindGatewayLarkApp(n){return be("/api/gateway/lark-registration/bind",{method:"POST",body:JSON.stringify(n)})},resetGatewayBinding(){return be("/api/gateway/binding/reset",{method:"POST"})},setGatewayConnection(n){return be("/api/gateway/connection",{method:"PUT",body:JSON.stringify({enabled:n})})}};async function be(n,r={}){var m,f,o;const s=new Headers(r.headers);r.body!==void 0&&r.body!==null&&!s.has("content-type")&&s.set("content-type","application/json");const l=(r.method??"GET").toUpperCase();let d;try{d=await fetch(n,{...r,headers:s})}catch(c){throw new Error(`${l} ${n} could not reach the VCM backend. Reason: ${Lo(c)}`)}if(!d.ok){const c=await d.text().catch(()=>""),h=a1(c),p=d.statusText?`${d.status} ${d.statusText}`:String(d.status),v=((m=h==null?void 0:h.error)!=null&&m.hint?`${h.error.message??"Backend error."} ${h.error.hint}`:(f=h==null?void 0:h.error)==null?void 0:f.message)??l1(c),C=(o=h==null?void 0:h.error)==null?void 0:o.runtime,T=C?` [backend ${C.version??"unknown"} pid=${C.pid??"unknown"} cwd=${C.cwd??"unknown"}]`:"";throw new Error(`${l} ${n} returned HTTP ${p}. ${v}${T}`)}return d.json()}function a1(n){if(!n.trim())return null;try{return JSON.parse(n)}catch{return null}}function l1(n){const r=n.trim();return r?`Non-JSON response body: ${r.slice(0,500)}`:"The response body was empty."}const uh="vcm:ui-error-report",hh="vcm:ui-error-clear-actions",fh="vcm:ui-error-clear-message";function o1(n){const r=n.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(uh,{detail:{message:r}}))}function c1(n){const r=n.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(fh,{detail:{message:r}}))}function u1(n){n.length===0||typeof window>"u"||window.dispatchEvent(new CustomEvent(hh,{detail:{actions:n}}))}function zi(n){const[r,s]=te.useState(n),l=te.useRef(n),d=te.useCallback(m=>{const f=l.current,o=typeof m=="function"?m(f):m;l.current=o,typeof o=="string"&&o.trim()?o1(o):typeof f=="string"&&f.trim()&&c1(f),s(o)},[]);return[r,d]}var qu={exports:{}},zm;function h1(){return zm||(zm=1,(function(n,r){(function(s,l){n.exports=l()})(self,(()=>(()=>{var s={};return(()=>{var l=s;Object.defineProperty(l,"__esModule",{value:!0}),l.FitAddon=void 0,l.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 m=this._terminal._core;this._terminal.rows===d.rows&&this._terminal.cols===d.cols||(m._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,m=d._renderService.dimensions;if(m.css.cell.width===0||m.css.cell.height===0)return;const f=this._terminal.options.scrollback===0?0:d.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),h=Math.max(0,parseInt(o.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),u=c-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),v=h-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-f;return{cols:Math.max(2,Math.floor(v/m.css.cell.width)),rows:Math.max(1,Math.floor(u/m.css.cell.height))}}}})(),s})()))})(qu)),qu.exports}var f1=h1(),$u={exports:{}},Im;function d1(){return Im||(Im=1,(function(n,r){(function(s,l){n.exports=l()})(self,(()=>(()=>{var s={6:(f,o)=>{function c(p){try{const u=new URL(p),v=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(v.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(p,u,v,C={}){this._terminal=p,this._regex=u,this._handler=v,this._options=C}provideLinks(p,u){const v=h.computeLink(p,this._regex,this._terminal,this._handler);u(this._addCallbacks(v))}_addCallbacks(p){return p.map((u=>(u.leave=this._options.leave,u.hover=(v,C)=>{if(this._options.hover){const{range:T}=u;this._options.hover(v,C,T)}},u)))}};class h{static computeLink(u,v,C,T){const E=new RegExp(v.source,(v.flags||"")+"g"),[b,y]=h._getWindowedLineStrings(u-1,C),_=b.join("");let S;const A=[];for(;S=E.exec(_);){const L=S[0];if(!c(L))continue;const[D,R]=h._mapStrIdx(C,y,0,S.index),[k,M]=h._mapStrIdx(C,D,R,L.length);if(D===-1||R===-1||k===-1||M===-1)continue;const B={start:{x:R+1,y:D+1},end:{x:M,y:k+1}};A.push({range:B,text:L,activate:T})}return A}static _getWindowedLineStrings(u,v){let C,T=u,E=u,b=0,y="";const _=[];if(C=v.buffer.active.getLine(u)){const S=C.translateToString(!0);if(C.isWrapped&&S[0]!==" "){for(b=0;(C=v.buffer.active.getLine(--T))&&b<2048&&(y=C.translateToString(!0),b+=y.length,_.push(y),C.isWrapped&&y.indexOf(" ")===-1););_.reverse()}for(_.push(S),b=0;(C=v.buffer.active.getLine(++E))&&C.isWrapped&&b<2048&&(y=C.translateToString(!0),b+=y.length,_.push(y),y.indexOf(" ")===-1););}return[_,T]}static _mapStrIdx(u,v,C,T){const E=u.buffer.active,b=E.getNullCell();let y=C;for(;T;){const _=E.getLine(v);if(!_)return[-1,-1];for(let S=y;S<_.length;++S){_.getCell(S,b);const A=b.getChars();if(b.getWidth()&&(T-=A.length||1,S===_.length-1&&A==="")){const L=E.getLine(v+1);L&&L.isWrapped&&(L.getCell(0,b),b.getWidth()===2&&(T+=1))}if(T<0)return[v,S]}v++,y=0}return[v,y]}}o.LinkComputer=h}},l={};function d(f){var o=l[f];if(o!==void 0)return o.exports;var c=l[f]={exports:{}};return s[f](c,c.exports,d),c.exports}var m={};return(()=>{var f=m;Object.defineProperty(f,"__esModule",{value:!0}),f.WebLinksAddon=void 0;const o=d(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function h(p,u){const v=window.open();if(v){try{v.opener=null}catch{}v.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,v=u.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,v,this._handler,u))}dispose(){var p;(p=this._linkProvider)==null||p.dispose()}}})(),m})()))})($u)),$u.exports}var p1=d1(),Gu={exports:{}},Um;function m1(){return Um||(Um=1,(function(n,r){(function(s,l){n.exports=l()})(globalThis,(()=>(()=>{var s={4567:function(f,o,c){var h=this&&this.__decorate||function(_,S,A,L){var D,R=arguments.length,k=R<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,S,A,L);else for(var M=_.length-1;M>=0;M--)(D=_[M])&&(k=(R<3?D(k):R>3?D(S,A,k):D(S,A))||k);return R>3&&k&&Object.defineProperty(S,A,k),k},p=this&&this.__param||function(_,S){return function(A,L){S(A,L,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const u=c(9042),v=c(9924),C=c(844),T=c(4725),E=c(2585),b=c(3656);let y=o.AccessibilityManager=class extends C.Disposable{constructor(_,S,A,L){super(),this._terminal=_,this._coreBrowserService=A,this._renderService=L,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 v.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,
|
|
53
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(_){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(_)||this._charsToConsume.push(_)}_refreshRows(_,S){this._liveRegionDebouncer.refresh(_,S,this._terminal.rows)}_renderRows(_,S){const A=this._terminal.buffer,L=A.lines.length.toString();for(let D=_;D<=S;D++){const R=A.lines.get(A.ydisp+D),k=[],M=(R==null?void 0:R.translateToString(!0,void 0,void 0,k))||"",B=(A.ydisp+D+1).toString(),H=this._rowElements[D];H&&(M.length===0?(H.innerText=" ",this._rowColumns.set(H,[0,1])):(H.textContent=M,this._rowColumns.set(H,k)),H.setAttribute("aria-posinset",B),H.setAttribute("aria-setsize",L))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(_,S){const A=_.target,L=this._rowElements[S===0?1:this._rowElements.length-2];if(A.getAttribute("aria-posinset")===(S===0?"1":`${this._terminal.buffer.lines.length}`)||_.relatedTarget!==L)return;let D,R;if(S===0?(D=A,R=this._rowElements.pop(),this._rowContainer.removeChild(R)):(D=this._rowElements.shift(),R=A,this._rowContainer.removeChild(D)),D.removeEventListener("focus",this._topBoundaryFocusListener),R.removeEventListener("focus",this._bottomBoundaryFocusListener),S===0){const k=this._createAccessibilityTreeNode();this._rowElements.unshift(k),this._rowContainer.insertAdjacentElement("afterbegin",k)}else{const k=this._createAccessibilityTreeNode();this._rowElements.push(k),this._rowContainer.appendChild(k)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(S===0?-1:1),this._rowElements[S===0?1:this._rowElements.length-2].focus(),_.preventDefault(),_.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const _=document.getSelection();if(!_)return;if(_.isCollapsed)return void(this._rowContainer.contains(_.anchorNode)&&this._terminal.clearSelection());if(!_.anchorNode||!_.focusNode)return void console.error("anchorNode and/or focusNode are null");let S={node:_.anchorNode,offset:_.anchorOffset},A={node:_.focusNode,offset:_.focusOffset};if((S.node.compareDocumentPosition(A.node)&Node.DOCUMENT_POSITION_PRECEDING||S.node===A.node&&S.offset>A.offset)&&([S,A]=[A,S]),S.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(S={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(S.node))return;const L=this._rowElements.slice(-1)[0];if(A.node.compareDocumentPosition(L)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(A={node:L,offset:((M=L.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(A.node))return;const D=({node:B,offset:H})=>{const U=B instanceof Text?B.parentNode:B;let P=parseInt(U==null?void 0:U.getAttribute("aria-posinset"),10)-1;if(isNaN(P))return console.warn("row is invalid. Race condition?"),null;const K=this._rowColumns.get(U);if(!K)return console.warn("columns is null. Race condition?"),null;let Y=H<K.length?K[H]:K.slice(-1)[0]+1;return Y>=this._terminal.cols&&(++P,Y=0),{row:P,column:Y}},R=D(S),k=D(A);if(R&&k){if(R.row>k.row||R.row===k.row&&R.column>=k.column)throw new Error("invalid range");this._terminal.select(R.column,R.row,(k.row-R.row)*this._terminal.cols-R.column+k.column)}}_handleResize(_){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let S=this._rowContainer.children.length;S<this._terminal.rows;S++)this._rowElements[S]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[S]);for(;this._rowElements.length>_;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const _=this._coreBrowserService.mainDocument.createElement("div");return _.setAttribute("role","listitem"),_.tabIndex=-1,this._refreshRowDimensions(_),_}_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 _=0;_<this._terminal.rows;_++)this._refreshRowDimensions(this._rowElements[_])}}_refreshRowDimensions(_){_.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=y=h([p(1,E.IInstantiationService),p(2,T.ICoreBrowserService),p(3,T.IRenderService)],y)},3614:(f,o)=>{function c(v){return v.replace(/\r?\n/g,"\r")}function h(v,C){return C?"\x1B[200~"+v+"\x1B[201~":v}function p(v,C,T,E){v=h(v=c(v),T.decPrivateModes.bracketedPasteMode&&E.rawOptions.ignoreBracketedPasteMode!==!0),T.triggerDataEvent(v,!0),C.value=""}function u(v,C,T){const E=T.getBoundingClientRect(),b=v.clientX-E.left-10,y=v.clientY-E.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${b}px`,C.style.top=`${y}px`,C.style.zIndex="1000",C.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=h,o.copyHandler=function(v,C){v.clipboardData&&v.clipboardData.setData("text/plain",C.selectionText),v.preventDefault()},o.handlePasteEvent=function(v,C,T,E){v.stopPropagation(),v.clipboardData&&p(v.clipboardData.getData("text/plain"),C,T,E)},o.paste=p,o.moveTextAreaUnderMouseCursor=u,o.rightClickHandler=function(v,C,T,E,b){u(v,C,T),b&&E.rightClickSelect(v),C.value=E.selectionText,C.select()}},7239:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const h=c(1505);o.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(p,u,v){this._css.set(p,u,v)}getCss(p,u){return this._css.get(p,u)}setColor(p,u,v){this._color.set(p,u,v)}getColor(p,u){return this._color.get(p,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,h,p,u){c.addEventListener(h,p,u);let v=!1;return{dispose:()=>{v||(v=!0,c.removeEventListener(h,p,u))}}}},3551:function(f,o,c){var h=this&&this.__decorate||function(y,_,S,A){var L,D=arguments.length,R=D<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,_,S,A);else for(var k=y.length-1;k>=0;k--)(L=y[k])&&(R=(D<3?L(R):D>3?L(_,S,R):L(_,S))||R);return D>3&&R&&Object.defineProperty(_,S,R),R},p=this&&this.__param||function(y,_){return function(S,A){_(S,A,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const u=c(3656),v=c(8460),C=c(844),T=c(2585),E=c(4725);let b=o.Linkifier=class extends C.Disposable{get currentLink(){return this._currentLink}constructor(y,_,S,A,L){super(),this._element=y,this._mouseService=_,this._renderService=S,this._bufferService=A,this._linkProviderService=L,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new v.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new v.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(y){this._lastMouseEvent=y;const _=this._positionFromMouseEvent(y,this._element,this._mouseService);if(!_)return;this._isMouseOut=!1;const S=y.composedPath();for(let A=0;A<S.length;A++){const L=S[A];if(L.classList.contains("xterm"))break;if(L.classList.contains("xterm-hover"))return}this._lastBufferCell&&_.x===this._lastBufferCell.x&&_.y===this._lastBufferCell.y||(this._handleHover(_),this._lastBufferCell=_)}_handleHover(y){if(this._activeLine!==y.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(y,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,y)||(this._clearCurrentLink(),this._askForLink(y,!0))}_askForLink(y,_){var A,L;this._activeProviderReplies&&_||((A=this._activeProviderReplies)==null||A.forEach((D=>{D==null||D.forEach((R=>{R.link.dispose&&R.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=y.y);let S=!1;for(const[D,R]of this._linkProviderService.linkProviders.entries())_?(L=this._activeProviderReplies)!=null&&L.get(D)&&(S=this._checkLinkProviderResult(D,y,S)):R.provideLinks(y.y,(k=>{var B,H;if(this._isMouseOut)return;const M=k==null?void 0:k.map((U=>({link:U})));(B=this._activeProviderReplies)==null||B.set(D,M),S=this._checkLinkProviderResult(D,y,S),((H=this._activeProviderReplies)==null?void 0:H.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(y.y,this._activeProviderReplies)}))}_removeIntersectingLinks(y,_){const S=new Set;for(let A=0;A<_.size;A++){const L=_.get(A);if(L)for(let D=0;D<L.length;D++){const R=L[D],k=R.link.range.start.y<y?0:R.link.range.start.x,M=R.link.range.end.y>y?this._bufferService.cols:R.link.range.end.x;for(let B=k;B<=M;B++){if(S.has(B)){L.splice(D--,1);break}S.add(B)}}}}_checkLinkProviderResult(y,_,S){var D;if(!this._activeProviderReplies)return S;const A=this._activeProviderReplies.get(y);let L=!1;for(let R=0;R<y;R++)this._activeProviderReplies.has(R)&&!this._activeProviderReplies.get(R)||(L=!0);if(!L&&A){const R=A.find((k=>this._linkAtPosition(k.link,_)));R&&(S=!0,this._handleNewLink(R))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!S)for(let R=0;R<this._activeProviderReplies.size;R++){const k=(D=this._activeProviderReplies.get(R))==null?void 0:D.find((M=>this._linkAtPosition(M.link,_)));if(k){S=!0,this._handleNewLink(k);break}}return S}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(y){if(!this._currentLink)return;const _=this._positionFromMouseEvent(y,this._element,this._mouseService);_&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,_)&&this._currentLink.link.activate(y,this._currentLink.link.text)}_clearCurrentLink(y,_){this._currentLink&&this._lastMouseEvent&&(!y||!_||this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=_)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,C.disposeArray)(this._linkCacheDisposables))}_handleNewLink(y){if(!this._lastMouseEvent)return;const _=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);_&&this._linkAtPosition(y.link,_)&&(this._currentLink=y,this._currentLink.state={decorations:{underline:y.link.decorations===void 0||y.link.decorations.underline,pointerCursor:y.link.decorations===void 0||y.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,y.link,this._lastMouseEvent),y.link.decorations={},Object.defineProperties(y.link.decorations,{pointerCursor:{get:()=>{var S,A;return(A=(S=this._currentLink)==null?void 0:S.state)==null?void 0:A.decorations.pointerCursor},set:S=>{var A;(A=this._currentLink)!=null&&A.state&&this._currentLink.state.decorations.pointerCursor!==S&&(this._currentLink.state.decorations.pointerCursor=S,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",S))}},underline:{get:()=>{var S,A;return(A=(S=this._currentLink)==null?void 0:S.state)==null?void 0:A.decorations.underline},set:S=>{var A,L,D;(A=this._currentLink)!=null&&A.state&&((D=(L=this._currentLink)==null?void 0:L.state)==null?void 0:D.decorations.underline)!==S&&(this._currentLink.state.decorations.underline=S,this._currentLink.state.isHovered&&this._fireUnderlineEvent(y.link,S))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((S=>{if(!this._currentLink)return;const A=S.start===0?0:S.start+1+this._bufferService.buffer.ydisp,L=this._bufferService.buffer.ydisp+1+S.end;if(this._currentLink.link.range.start.y>=A&&this._currentLink.link.range.end.y<=L&&(this._clearCurrentLink(A,L),this._lastMouseEvent)){const D=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);D&&this._askForLink(D,!1)}}))))}_linkHover(y,_,S){var A;(A=this._currentLink)!=null&&A.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(_,!0),this._currentLink.state.decorations.pointerCursor&&y.classList.add("xterm-cursor-pointer")),_.hover&&_.hover(S,_.text)}_fireUnderlineEvent(y,_){const S=y.range,A=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(S.start.x-1,S.start.y-A-1,S.end.x,S.end.y-A-1,void 0);(_?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_linkLeave(y,_,S){var A;(A=this._currentLink)!=null&&A.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(_,!1),this._currentLink.state.decorations.pointerCursor&&y.classList.remove("xterm-cursor-pointer")),_.leave&&_.leave(S,_.text)}_linkAtPosition(y,_){const S=y.range.start.y*this._bufferService.cols+y.range.start.x,A=y.range.end.y*this._bufferService.cols+y.range.end.x,L=_.y*this._bufferService.cols+_.x;return S<=L&&L<=A}_positionFromMouseEvent(y,_,S){const A=S.getCoords(y,_,this._bufferService.cols,this._bufferService.rows);if(A)return{x:A[0],y:A[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(y,_,S,A,L){return{x1:y,y1:_,x2:S,y2:A,cols:this._bufferService.cols,fg:L}}};o.Linkifier=b=h([p(1,E.IMouseService),p(2,E.IRenderService),p(3,T.IBufferService),p(4,E.ILinkProviderService)],b)},9042:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(f,o,c){var h=this&&this.__decorate||function(E,b,y,_){var S,A=arguments.length,L=A<3?b:_===null?_=Object.getOwnPropertyDescriptor(b,y):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,b,y,_);else for(var D=E.length-1;D>=0;D--)(S=E[D])&&(L=(A<3?S(L):A>3?S(b,y,L):S(b,y))||L);return A>3&&L&&Object.defineProperty(b,y,L),L},p=this&&this.__param||function(E,b){return function(y,_){b(y,_,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const u=c(511),v=c(2585);let C=o.OscLinkProvider=class{constructor(E,b,y){this._bufferService=E,this._optionsService=b,this._oscLinkService=y}provideLinks(E,b){var M;const y=this._bufferService.buffer.lines.get(E-1);if(!y)return void b(void 0);const _=[],S=this._optionsService.rawOptions.linkHandler,A=new u.CellData,L=y.getTrimmedLength();let D=-1,R=-1,k=!1;for(let B=0;B<L;B++)if(R!==-1||y.hasContent(B)){if(y.loadCell(B,A),A.hasExtendedAttrs()&&A.extended.urlId){if(R===-1){R=B,D=A.extended.urlId;continue}k=A.extended.urlId!==D}else R!==-1&&(k=!0);if(k||R!==-1&&B===L-1){const H=(M=this._oscLinkService.getLinkData(D))==null?void 0:M.uri;if(H){const U={start:{x:R+1,y:E},end:{x:B+(k||B!==L-1?0:1),y:E}};let P=!1;if(!(S!=null&&S.allowNonHttpProtocols))try{const K=new URL(H);["http:","https:"].includes(K.protocol)||(P=!0)}catch{P=!0}P||_.push({text:H,range:U,activate:(K,Y)=>S?S.activate(K,Y,U):T(0,Y),hover:(K,Y)=>{var G;return(G=S==null?void 0:S.hover)==null?void 0:G.call(S,K,Y,U)},leave:(K,Y)=>{var G;return(G=S==null?void 0:S.leave)==null?void 0:G.call(S,K,Y,U)}})}k=!1,A.hasExtendedAttrs()&&A.extended.urlId?(R=B,D=A.extended.urlId):(R=-1,D=-1)}}b(_)}};function T(E,b){if(confirm(`Do you want to navigate to ${b}?
|
|
48
|
+
`+a.stack}}var yt=Object.prototype.hasOwnProperty,Nt=n.unstable_scheduleCallback,Gt=n.unstable_cancelCallback,Sn=n.unstable_shouldYield,St=n.unstable_requestPaint,tt=n.unstable_now,Lt=n.unstable_getCurrentPriorityLevel,he=n.unstable_ImmediatePriority,Se=n.unstable_UserBlockingPriority,Ae=n.unstable_NormalPriority,Le=n.unstable_LowPriority,Oe=n.unstable_IdlePriority,ut=n.log,Fe=n.unstable_setDisableYieldValue,gt=null,mt=null;function Ot(e){if(typeof ut=="function"&&Fe(e),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(gt,e)}catch{}}var Ze=Math.clz32?Math.clz32:bn,Qt=Math.log,Et=Math.LN2;function bn(e){return e>>>=0,e===0?32:31-(Qt(e)/Et|0)|0}var Ln=256,ri=262144,On=4194304;function Bt(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 Bn(e,t,i){var a=e.pendingLanes;if(a===0)return 0;var m=0,C=e.suspendedLanes,O=e.pingedLanes;e=e.warmLanes;var F=a&134217727;return F!==0?(a=F&~C,a!==0?m=Bt(a):(O&=F,O!==0?m=Bt(O):i||(i=F&~e,i!==0&&(m=Bt(i))))):(F=a&~C,F!==0?m=Bt(F):O!==0?m=Bt(O):i||(i=a&~e,i!==0&&(m=Bt(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 Wn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function si(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 rn(){var e=On;return On<<=1,(On&62914560)===0&&(On=4194304),e}function jn(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function sn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function an(e,t,i,a,m,C){var O=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 F=e.entanglements,X=e.expirationTimes,oe=e.hiddenUpdates;for(i=O&~i;0<i;){var de=31-Ze(i),_e=1<<de;F[de]=0,X[de]=-1;var ce=oe[de];if(ce!==null)for(oe[de]=null,de=0;de<ce.length;de++){var ue=ce[de];ue!==null&&(ue.lane&=-536870913)}i&=~_e}a!==0&&Ui(e,a,0),C!==0&&m===0&&e.tag!==0&&(e.suspendedLanes|=C&~(O&~t))}function Ui(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Ze(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|i&261930}function Ne(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var a=31-Ze(i),m=1<<a;m&t|e[a]&t&&(e[a]|=t),i&=~m}}function Pi(e,t){var i=t&-t;return i=(i&42)!==0?1:qr(i),(i&(e.suspendedLanes|t))!==0?0:i}function qr(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 Us(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Kn(){var e=W.p;return e!==0?e:(e=window.event,e===void 0?32:vm(e.type))}function el(e,t){var i=W.p;try{return W.p=e,t()}finally{W.p=i}}var ai=Math.random().toString(36).slice(2),kt="__reactFiber$"+ai,It="__reactProps$"+ai,Yn="__reactContainer$"+ai,Ps="__reactEvents$"+ai,Io="__reactListeners$"+ai,tl="__reactHandles$"+ai,nl="__reactResources$"+ai,Nn="__reactMarker$"+ai;function $r(e){delete e[kt],delete e[It],delete e[Ps],delete e[Io],delete e[tl]}function ln(e){var t=e[kt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Yn]||i[kt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=nm(e);e!==null;){if(i=e[kt])return i;e=nm(e)}return t}e=i,i=e.parentNode}return null}function mi(e){if(e=e[kt]||e[Yn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function gi(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function _i(e){var t=e[nl];return t||(t=e[nl]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function bt(e){e[Nn]=!0}var Fs=new Set,Xn={};function Qn(e,t){ie(e,t),ie(e+"Capture",t)}function ie(e,t){for(Xn[e]=t,e=0;e<t.length;e++)Fs.add(t[e])}var on=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]*$"),Gr={},qs={};function Uo(e){return yt.call(qs,e)?!0:yt.call(Gr,e)?!1:on.test(e)?qs[e]=!0:(Gr[e]=!0,!1)}function Vr(e,t,i){if(Uo(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function vi(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 Hn(e,t,i,a){if(a===null)e.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+a)}}function cn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function il(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Jt(e,t,i){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var m=a.get,C=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return m.call(this)},set:function(O){i=""+O,C.call(this,O)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return i},setValue:function(O){i=""+O},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ht(e){if(!e._valueTracker){var t=il(e)?"checked":"value";e._valueTracker=Jt(e,t,""+e[t])}}function $s(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),a="";return e&&(a=il(e)?e.checked?"true":"false":e.value),e=a,e!==i?(t.setValue(e),!0):!1}function _r(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 rl=/[\n"\\]/g;function un(e){return e.replace(rl,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Gs(e,t,i,a,m,C,O,F){e.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?e.type=O:e.removeAttribute("type"),t!=null?O==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+cn(t)):e.value!==""+cn(t)&&(e.value=""+cn(t)):O!=="submit"&&O!=="reset"||e.removeAttribute("value"),t!=null?Vs(e,O,cn(t)):i!=null?Vs(e,O,cn(i)):a!=null&&e.removeAttribute("value"),m==null&&C!=null&&(e.defaultChecked=!!C),m!=null&&(e.checked=m&&typeof m!="function"&&typeof m!="symbol"),F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?e.name=""+cn(F):e.removeAttribute("name")}function sl(e,t,i,a,m,C,O,F){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)){Ht(e);return}i=i!=null?""+cn(i):"",t=t!=null?""+cn(t):i,F||t===e.value||(e.value=t),e.defaultValue=t}a=a??m,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=F?e.checked:!!a,e.defaultChecked=!!a,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(e.name=O),Ht(e)}function Vs(e,t,i){t==="number"&&_r(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Fi(e,t,i,a){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&&a&&(e[i].defaultSelected=!0)}else{for(i=""+cn(i),t=null,m=0;m<e.length;m++){if(e[m].value===i){e[m].selected=!0,a&&(e[m].defaultSelected=!0);return}t!==null||e[m].disabled||(t=e[m])}t!==null&&(t.selected=!0)}}function al(e,t,i){if(t!=null&&(t=""+cn(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+cn(i):""}function yi(e,t,i,a){if(t==null){if(a!=null){if(i!=null)throw Error(l(92));if(Y(a)){if(1<a.length)throw Error(l(93));a=a[0]}i=a}i==null&&(i=""),t=i}i=cn(t),e.defaultValue=i,a=e.textContent,a===i&&a!==""&&a!==null&&(e.value=a),Ht(e)}function li(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var Ws=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 Si(e,t,i){var a=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,i):typeof i!="number"||i===0||Ws.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function ll(e,t,i){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,i!=null){for(var a in i)!i.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var m in t)a=t[m],t.hasOwnProperty(m)&&i[m]!==a&&Si(e,m,a)}else for(var C in t)t.hasOwnProperty(C)&&Si(e,C,t[C])}function Wr(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 Ks=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"]]),ol=/^[\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 vr(e){return ol.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Vt(){}var Kr=null;function oi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Zt=null,qi=null;function cl(e){var t=mi(e);if(t&&(e=t.stateNode)){var i=e[It]||null;e:switch(e=t.stateNode,t.type){case"input":if(Gs(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="'+un(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var a=i[t];if(a!==e&&a.form===e.form){var m=a[It]||null;if(!m)throw Error(l(90));Gs(a,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(t=0;t<i.length;t++)a=i[t],a.form===e.form&&$s(a)}break e;case"textarea":al(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Fi(e,!!i.multiple,t,!1)}}}var Ys=!1;function hn(e,t,i){if(Ys)return e(t,i);Ys=!0;try{var a=e(t);return a}finally{if(Ys=!1,(Zt!==null||qi!==null)&&(Wl(),Zt&&(t=Zt,e=qi,qi=Zt=null,cl(t),e)))for(t=0;t<e.length;t++)cl(e[t])}}function bi(e,t){var i=e.stateNode;if(i===null)return null;var a=i[It]||null;if(a===null)return null;i=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(l(231,t,typeof i));return i}var Cn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yr=!1;if(Cn)try{var Sr={};Object.defineProperty(Sr,"passive",{get:function(){yr=!0}}),window.addEventListener("test",Sr,Sr),window.removeEventListener("test",Sr,Sr)}catch{yr=!1}var ke=null,Xs=null,Yr=null;function ul(){if(Yr)return Yr;var e,t=Xs,i=t.length,a,m="value"in ke?ke.value:ke.textContent,C=m.length;for(e=0;e<i&&t[e]===m[e];e++);var O=i-e;for(a=1;a<=O&&t[i-a]===m[C-a];a++);return Yr=m.slice(e,1<a?1-a:void 0)}function Xr(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 en(){return!0}function Qr(){return!1}function Ut(e){function t(i,a,m,C,O){this._reactName=i,this._targetInst=m,this.type=a,this.nativeEvent=C,this.target=O,this.currentTarget=null;for(var F in e)e.hasOwnProperty(F)&&(i=e[F],this[F]=i?i(C):C[F]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?en:Qr,this.isPropagationStopped=Qr,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=en)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=en)},persist:function(){},isPersistent:en}),t}var Jn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Jr=Ut(Jn),V=u({},Jn,{view:0,detail:0}),fe=Ut(V),qe,fn,br,Zr=u({},V,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fo,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!==br&&(br&&e.type==="mousemove"?(qe=e.screenX-br.screenX,fn=e.screenY-br.screenY):fn=qe=0,br=e),qe)},movementY:function(e){return"movementY"in e?e.movementY:fn}}),hl=Ut(Zr),Rv=u({},Zr,{dataTransfer:0}),Dv=Ut(Rv),Mv=u({},V,{relatedTarget:0}),Po=Ut(Mv),Lv=u({},Jn,{animationName:0,elapsedTime:0,pseudoElement:0}),Ov=Ut(Lv),Bv=u({},Jn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),jv=Ut(Bv),Nv=u({},Jn,{data:0}),Qh=Ut(Nv),Hv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zv={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"},Iv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Uv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Iv[e])?!!t[e]:!1}function Fo(){return Uv}var Pv=u({},V,{key:function(e){if(e.key){var t=Hv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Xr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?zv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fo,charCode:function(e){return e.type==="keypress"?Xr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Xr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Fv=Ut(Pv),qv=u({},Zr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Jh=Ut(qv),$v=u({},V,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fo}),Gv=Ut($v),Vv=u({},Jn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Wv=Ut(Vv),Kv=u({},Zr,{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}),Yv=Ut(Kv),Xv=u({},Jn,{newState:0,oldState:0}),Qv=Ut(Xv),Jv=[9,13,27,32],qo=Cn&&"CompositionEvent"in window,Qs=null;Cn&&"documentMode"in document&&(Qs=document.documentMode);var Zv=Cn&&"TextEvent"in window&&!Qs,Zh=Cn&&(!qo||Qs&&8<Qs&&11>=Qs),ef=" ",tf=!1;function nf(e,t){switch(e){case"keyup":return Jv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var es=!1;function ey(e,t){switch(e){case"compositionend":return rf(t);case"keypress":return t.which!==32?null:(tf=!0,ef);case"textInput":return e=t.data,e===ef&&tf?null:e;default:return null}}function ty(e,t){if(es)return e==="compositionend"||!qo&&nf(e,t)?(e=ul(),Yr=Xs=ke=null,es=!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 Zh&&t.locale!=="ko"?null:t.data;default:return null}}var ny={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 sf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ny[e.type]:t==="textarea"}function af(e,t,i,a){Zt?qi?qi.push(a):qi=[a]:Zt=a,t=eo(t,"onChange"),0<t.length&&(i=new Jr("onChange","change",null,i,a),e.push({event:i,listeners:t}))}var Js=null,Zs=null;function iy(e){Fp(e,0)}function fl(e){var t=gi(e);if($s(t))return e}function lf(e,t){if(e==="change")return t}var of=!1;if(Cn){var $o;if(Cn){var Go="oninput"in document;if(!Go){var cf=document.createElement("div");cf.setAttribute("oninput","return;"),Go=typeof cf.oninput=="function"}$o=Go}else $o=!1;of=$o&&(!document.documentMode||9<document.documentMode)}function uf(){Js&&(Js.detachEvent("onpropertychange",hf),Zs=Js=null)}function hf(e){if(e.propertyName==="value"&&fl(Zs)){var t=[];af(t,Zs,e,oi(e)),hn(iy,t)}}function ry(e,t,i){e==="focusin"?(uf(),Js=t,Zs=i,Js.attachEvent("onpropertychange",hf)):e==="focusout"&&uf()}function sy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return fl(Zs)}function ay(e,t){if(e==="click")return fl(t)}function ly(e,t){if(e==="input"||e==="change")return fl(t)}function oy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wn=typeof Object.is=="function"?Object.is:oy;function ea(e,t){if(wn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(a=0;a<i.length;a++){var m=i[a];if(!yt.call(t,m)||!wn(e[m],t[m]))return!1}return!0}function ff(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function df(e,t){var i=ff(e);e=0;for(var a;i;){if(i.nodeType===3){if(a=e+i.textContent.length,e<=t&&a>=t)return{node:i,offset:t-e};e=a}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=ff(i)}}function pf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=_r(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=_r(e.document)}return t}function Vo(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 cy=Cn&&"documentMode"in document&&11>=document.documentMode,ts=null,Wo=null,ta=null,Ko=!1;function gf(e,t,i){var a=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Ko||ts==null||ts!==_r(a)||(a=ts,"selectionStart"in a&&Vo(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),ta&&ea(ta,a)||(ta=a,a=eo(Wo,"onSelect"),0<a.length&&(t=new Jr("onSelect","select",null,t,i),e.push({event:t,listeners:a}),t.target=ts)))}function Cr(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var ns={animationend:Cr("Animation","AnimationEnd"),animationiteration:Cr("Animation","AnimationIteration"),animationstart:Cr("Animation","AnimationStart"),transitionrun:Cr("Transition","TransitionRun"),transitionstart:Cr("Transition","TransitionStart"),transitioncancel:Cr("Transition","TransitionCancel"),transitionend:Cr("Transition","TransitionEnd")},Yo={},_f={};Cn&&(_f=document.createElement("div").style,"AnimationEvent"in window||(delete ns.animationend.animation,delete ns.animationiteration.animation,delete ns.animationstart.animation),"TransitionEvent"in window||delete ns.transitionend.transition);function wr(e){if(Yo[e])return Yo[e];if(!ns[e])return e;var t=ns[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in _f)return Yo[e]=t[i];return e}var vf=wr("animationend"),yf=wr("animationiteration"),Sf=wr("animationstart"),uy=wr("transitionrun"),hy=wr("transitionstart"),fy=wr("transitioncancel"),bf=wr("transitionend"),Cf=new Map,Xo="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(" ");Xo.push("scrollEnd");function Zn(e,t){Cf.set(e,t),Qn(t,[e])}var dl=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)},zn=[],is=0,Qo=0;function pl(){for(var e=is,t=Qo=is=0;t<e;){var i=zn[t];zn[t++]=null;var a=zn[t];zn[t++]=null;var m=zn[t];zn[t++]=null;var C=zn[t];if(zn[t++]=null,a!==null&&m!==null){var O=a.pending;O===null?m.next=m:(m.next=O.next,O.next=m),a.pending=m}C!==0&&wf(i,m,C)}}function ml(e,t,i,a){zn[is++]=e,zn[is++]=t,zn[is++]=i,zn[is++]=a,Qo|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Jo(e,t,i,a){return ml(e,t,i,a),gl(e)}function xr(e,t){return ml(e,null,null,t),gl(e)}function wf(e,t,i){e.lanes|=i;var a=e.alternate;a!==null&&(a.lanes|=i);for(var m=!1,C=e.return;C!==null;)C.childLanes|=i,a=C.alternate,a!==null&&(a.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-Ze(i),e=C.hiddenUpdates,a=e[m],a===null?e[m]=[t]:a.push(t),t.lane=i|536870912),C):null}function gl(e){if(50<wa)throw wa=0,lu=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var rs={};function dy(e,t,i,a){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=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xn(e,t,i,a){return new dy(e,t,i,a)}function Zo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ci(e,t){var i=e.alternate;return i===null?(i=xn(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 xf(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 _l(e,t,i,a,m,C){var O=0;if(a=e,typeof e=="function")Zo(e)&&(O=1);else if(typeof e=="string")O=v0(e,i,re.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case M:return e=xn(31,i,t,m),e.elementType=M,e.lanes=C,e;case E:return Er(i.children,m,C,t);case S:O=8,m|=24;break;case v:return e=xn(12,i,t,m|2),e.elementType=v,e.lanes=C,e;case L:return e=xn(13,i,t,m),e.elementType=L,e.lanes=C,e;case D:return e=xn(19,i,t,m),e.elementType=D,e.lanes=C,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case b:O=10;break e;case _:O=9;break e;case A:O=11;break e;case R:O=14;break e;case k:O=16,a=null;break e}O=29,i=Error(l(130,e===null?"null":typeof e,"")),a=null}return t=xn(O,i,t,m),t.elementType=e,t.type=a,t.lanes=C,t}function Er(e,t,i,a){return e=xn(7,e,a,t),e.lanes=i,e}function ec(e,t,i){return e=xn(6,e,null,t),e.lanes=i,e}function Ef(e){var t=xn(18,null,null,0);return t.stateNode=e,t}function tc(e,t,i){return t=xn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var kf=new WeakMap;function In(e,t){if(typeof e=="object"&&e!==null){var i=kf.get(e);return i!==void 0?i:(t={value:e,source:t,stack:xt(t)},kf.set(e,t),t)}return{value:e,source:t,stack:xt(t)}}var ss=[],as=0,vl=null,na=0,Un=[],Pn=0,$i=null,ci=1,ui="";function wi(e,t){ss[as++]=na,ss[as++]=vl,vl=e,na=t}function Af(e,t,i){Un[Pn++]=ci,Un[Pn++]=ui,Un[Pn++]=$i,$i=e;var a=ci;e=ui;var m=32-Ze(a)-1;a&=~(1<<m),i+=1;var C=32-Ze(t)+m;if(30<C){var O=m-m%5;C=(a&(1<<O)-1).toString(32),a>>=O,m-=O,ci=1<<32-Ze(t)+m|i<<m|a,ui=C+e}else ci=1<<C|i<<m|a,ui=e}function nc(e){e.return!==null&&(wi(e,1),Af(e,1,0))}function ic(e){for(;e===vl;)vl=ss[--as],ss[as]=null,na=ss[--as],ss[as]=null;for(;e===$i;)$i=Un[--Pn],Un[Pn]=null,ui=Un[--Pn],Un[Pn]=null,ci=Un[--Pn],Un[Pn]=null}function Tf(e,t){Un[Pn++]=ci,Un[Pn++]=ui,Un[Pn++]=$i,ci=t.id,ui=t.overflow,$i=e}var Pt=null,ht=null,Ye=!1,Gi=null,Fn=!1,rc=Error(l(519));function Vi(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ia(In(t,e)),rc}function Rf(e){var t=e.stateNode,i=e.type,a=e.memoizedProps;switch(t[kt]=e,t[It]=a,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<Ea.length;i++)Ge(Ea[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),sl(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Ge("invalid",t);break;case"textarea":Ge("invalid",t),yi(t,a.value,a.defaultValue,a.children)}i=a.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||a.suppressHydrationWarning===!0||Vp(t.textContent,i)?(a.popover!=null&&(Ge("beforetoggle",t),Ge("toggle",t)),a.onScroll!=null&&Ge("scroll",t),a.onScrollEnd!=null&&Ge("scrollend",t),a.onClick!=null&&(t.onclick=Vt),t=!0):t=!1,t||Vi(e,!0)}function Df(e){for(Pt=e.return;Pt;)switch(Pt.tag){case 5:case 31:case 13:Fn=!1;return;case 27:case 3:Fn=!0;return;default:Pt=Pt.return}}function ls(e){if(e!==Pt)return!1;if(!Ye)return Df(e),Ye=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Cu(e.type,e.memoizedProps)),i=!i),i&&ht&&Vi(e),Df(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));ht=tm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));ht=tm(e)}else t===27?(t=ht,ar(e.type)?(e=Au,Au=null,ht=e):ht=t):ht=Pt?$n(e.stateNode.nextSibling):null;return!0}function kr(){ht=Pt=null,Ye=!1}function sc(){var e=Gi;return e!==null&&(gn===null?gn=e:gn.push.apply(gn,e),Gi=null),e}function ia(e){Gi===null?Gi=[e]:Gi.push(e)}var ac=N(null),Ar=null,xi=null;function Wi(e,t,i){I(ac,t._currentValue),t._currentValue=i}function Ei(e){e._currentValue=ac.current,$(ac)}function lc(e,t,i){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===i)break;e=e.return}}function oc(e,t,i,a){var m=e.child;for(m!==null&&(m.return=e);m!==null;){var C=m.dependencies;if(C!==null){var O=m.child;C=C.firstContext;e:for(;C!==null;){var F=C;C=m;for(var X=0;X<t.length;X++)if(F.context===t[X]){C.lanes|=i,F=C.alternate,F!==null&&(F.lanes|=i),lc(C.return,i,e),a||(O=null);break e}C=F.next}}else if(m.tag===18){if(O=m.return,O===null)throw Error(l(341));O.lanes|=i,C=O.alternate,C!==null&&(C.lanes|=i),lc(O,i,e),O=null}else O=m.child;if(O!==null)O.return=m;else for(O=m;O!==null;){if(O===e){O=null;break}if(m=O.sibling,m!==null){m.return=O.return,O=m;break}O=O.return}m=O}}function os(e,t,i,a){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 O=m.alternate;if(O===null)throw Error(l(387));if(O=O.memoizedProps,O!==null){var F=m.type;wn(m.pendingProps.value,O.value)||(e!==null?e.push(F):e=[F])}}else if(m===Q.current){if(O=m.alternate,O===null)throw Error(l(387));O.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(e!==null?e.push(Da):e=[Da])}m=m.return}e!==null&&oc(t,e,i,a),t.flags|=262144}function yl(e){for(e=e.firstContext;e!==null;){if(!wn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Tr(e){Ar=e,xi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ft(e){return Mf(Ar,e)}function Sl(e,t){return Ar===null&&Tr(e),Mf(e,t)}function Mf(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},xi===null){if(e===null)throw Error(l(308));xi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else xi=xi.next=t;return i}var py=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},my=n.unstable_scheduleCallback,gy=n.unstable_NormalPriority,At={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function cc(){return{controller:new py,data:new Map,refCount:0}}function ra(e){e.refCount--,e.refCount===0&&my(gy,function(){e.controller.abort()})}var sa=null,uc=0,cs=0,us=null;function _y(e,t){if(sa===null){var i=sa=[];uc=0,cs=du(),us={status:"pending",value:void 0,then:function(a){i.push(a)}}}return uc++,t.then(Lf,Lf),t}function Lf(){if(--uc===0&&sa!==null){us!==null&&(us.status="fulfilled");var e=sa;sa=null,cs=0,us=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function vy(e,t){var i=[],a={status:"pending",value:null,reason:null,then:function(m){i.push(m)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var m=0;m<i.length;m++)(0,i[m])(t)},function(m){for(a.status="rejected",a.reason=m,m=0;m<i.length;m++)(0,i[m])(void 0)}),a}var Of=G.S;G.S=function(e,t){gp=tt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&_y(e,t),Of!==null&&Of(e,t)};var Rr=N(null);function hc(){var e=Rr.current;return e!==null?e:lt.pooledCache}function bl(e,t){t===null?I(Rr,Rr.current):I(Rr,t.pool)}function Bf(){var e=hc();return e===null?null:{parent:At._currentValue,pool:e}}var hs=Error(l(460)),fc=Error(l(474)),Cl=Error(l(542)),wl={then:function(){}};function jf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Nf(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Vt,Vt),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,zf(e),e;default:if(typeof t.status=="string")t.then(Vt,Vt);else{if(e=lt,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var m=t;m.status="fulfilled",m.value=a}},function(a){if(t.status==="pending"){var m=t;m.status="rejected",m.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,zf(e),e}throw Mr=t,hs}}function Dr(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Mr=i,hs):i}}var Mr=null;function Hf(){if(Mr===null)throw Error(l(459));var e=Mr;return Mr=null,e}function zf(e){if(e===hs||e===Cl)throw Error(l(483))}var fs=null,aa=0;function xl(e){var t=aa;return aa+=1,fs===null&&(fs=[]),Nf(fs,e,t)}function la(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function El(e,t){throw t.$$typeof===y?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function If(e){function t(ne,J){if(e){var le=ne.deletions;le===null?(ne.deletions=[J],ne.flags|=16):le.push(J)}}function i(ne,J){if(!e)return null;for(;J!==null;)t(ne,J),J=J.sibling;return null}function a(ne){for(var J=new Map;ne!==null;)ne.key!==null?J.set(ne.key,ne):J.set(ne.index,ne),ne=ne.sibling;return J}function m(ne,J){return ne=Ci(ne,J),ne.index=0,ne.sibling=null,ne}function C(ne,J,le){return ne.index=le,e?(le=ne.alternate,le!==null?(le=le.index,le<J?(ne.flags|=67108866,J):le):(ne.flags|=67108866,J)):(ne.flags|=1048576,J)}function O(ne){return e&&ne.alternate===null&&(ne.flags|=67108866),ne}function F(ne,J,le,ge){return J===null||J.tag!==6?(J=ec(le,ne.mode,ge),J.return=ne,J):(J=m(J,le),J.return=ne,J)}function X(ne,J,le,ge){var Re=le.type;return Re===E?de(ne,J,le.props.children,ge,le.key):J!==null&&(J.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===k&&Dr(Re)===J.type)?(J=m(J,le.props),la(J,le),J.return=ne,J):(J=_l(le.type,le.key,le.props,null,ne.mode,ge),la(J,le),J.return=ne,J)}function oe(ne,J,le,ge){return J===null||J.tag!==4||J.stateNode.containerInfo!==le.containerInfo||J.stateNode.implementation!==le.implementation?(J=tc(le,ne.mode,ge),J.return=ne,J):(J=m(J,le.children||[]),J.return=ne,J)}function de(ne,J,le,ge,Re){return J===null||J.tag!==7?(J=Er(le,ne.mode,ge,Re),J.return=ne,J):(J=m(J,le),J.return=ne,J)}function _e(ne,J,le){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=ec(""+J,ne.mode,le),J.return=ne,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case w:return le=_l(J.type,J.key,J.props,null,ne.mode,le),la(le,J),le.return=ne,le;case T:return J=tc(J,ne.mode,le),J.return=ne,J;case k:return J=Dr(J),_e(ne,J,le)}if(Y(J)||U(J))return J=Er(J,ne.mode,le,null),J.return=ne,J;if(typeof J.then=="function")return _e(ne,xl(J),le);if(J.$$typeof===b)return _e(ne,Sl(ne,J),le);El(ne,J)}return null}function ce(ne,J,le,ge){var Re=J!==null?J.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Re!==null?null:F(ne,J,""+le,ge);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case w:return le.key===Re?X(ne,J,le,ge):null;case T:return le.key===Re?oe(ne,J,le,ge):null;case k:return le=Dr(le),ce(ne,J,le,ge)}if(Y(le)||U(le))return Re!==null?null:de(ne,J,le,ge,null);if(typeof le.then=="function")return ce(ne,J,xl(le),ge);if(le.$$typeof===b)return ce(ne,J,Sl(ne,le),ge);El(ne,le)}return null}function ue(ne,J,le,ge,Re){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return ne=ne.get(le)||null,F(J,ne,""+ge,Re);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case w:return ne=ne.get(ge.key===null?le:ge.key)||null,X(J,ne,ge,Re);case T:return ne=ne.get(ge.key===null?le:ge.key)||null,oe(J,ne,ge,Re);case k:return ge=Dr(ge),ue(ne,J,le,ge,Re)}if(Y(ge)||U(ge))return ne=ne.get(le)||null,de(J,ne,ge,Re,null);if(typeof ge.then=="function")return ue(ne,J,le,xl(ge),Re);if(ge.$$typeof===b)return ue(ne,J,le,Sl(J,ge),Re);El(J,ge)}return null}function Ee(ne,J,le,ge){for(var Re=null,Qe=null,Te=J,Ie=J=0,Ke=null;Te!==null&&Ie<le.length;Ie++){Te.index>Ie?(Ke=Te,Te=null):Ke=Te.sibling;var Je=ce(ne,Te,le[Ie],ge);if(Je===null){Te===null&&(Te=Ke);break}e&&Te&&Je.alternate===null&&t(ne,Te),J=C(Je,J,Ie),Qe===null?Re=Je:Qe.sibling=Je,Qe=Je,Te=Ke}if(Ie===le.length)return i(ne,Te),Ye&&wi(ne,Ie),Re;if(Te===null){for(;Ie<le.length;Ie++)Te=_e(ne,le[Ie],ge),Te!==null&&(J=C(Te,J,Ie),Qe===null?Re=Te:Qe.sibling=Te,Qe=Te);return Ye&&wi(ne,Ie),Re}for(Te=a(Te);Ie<le.length;Ie++)Ke=ue(Te,ne,Ie,le[Ie],ge),Ke!==null&&(e&&Ke.alternate!==null&&Te.delete(Ke.key===null?Ie:Ke.key),J=C(Ke,J,Ie),Qe===null?Re=Ke:Qe.sibling=Ke,Qe=Ke);return e&&Te.forEach(function(hr){return t(ne,hr)}),Ye&&wi(ne,Ie),Re}function Me(ne,J,le,ge){if(le==null)throw Error(l(151));for(var Re=null,Qe=null,Te=J,Ie=J=0,Ke=null,Je=le.next();Te!==null&&!Je.done;Ie++,Je=le.next()){Te.index>Ie?(Ke=Te,Te=null):Ke=Te.sibling;var hr=ce(ne,Te,Je.value,ge);if(hr===null){Te===null&&(Te=Ke);break}e&&Te&&hr.alternate===null&&t(ne,Te),J=C(hr,J,Ie),Qe===null?Re=hr:Qe.sibling=hr,Qe=hr,Te=Ke}if(Je.done)return i(ne,Te),Ye&&wi(ne,Ie),Re;if(Te===null){for(;!Je.done;Ie++,Je=le.next())Je=_e(ne,Je.value,ge),Je!==null&&(J=C(Je,J,Ie),Qe===null?Re=Je:Qe.sibling=Je,Qe=Je);return Ye&&wi(ne,Ie),Re}for(Te=a(Te);!Je.done;Ie++,Je=le.next())Je=ue(Te,ne,Ie,Je.value,ge),Je!==null&&(e&&Je.alternate!==null&&Te.delete(Je.key===null?Ie:Je.key),J=C(Je,J,Ie),Qe===null?Re=Je:Qe.sibling=Je,Qe=Je);return e&&Te.forEach(function(R0){return t(ne,R0)}),Ye&&wi(ne,Ie),Re}function at(ne,J,le,ge){if(typeof le=="object"&&le!==null&&le.type===E&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case w:e:{for(var Re=le.key;J!==null;){if(J.key===Re){if(Re=le.type,Re===E){if(J.tag===7){i(ne,J.sibling),ge=m(J,le.props.children),ge.return=ne,ne=ge;break e}}else if(J.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===k&&Dr(Re)===J.type){i(ne,J.sibling),ge=m(J,le.props),la(ge,le),ge.return=ne,ne=ge;break e}i(ne,J);break}else t(ne,J);J=J.sibling}le.type===E?(ge=Er(le.props.children,ne.mode,ge,le.key),ge.return=ne,ne=ge):(ge=_l(le.type,le.key,le.props,null,ne.mode,ge),la(ge,le),ge.return=ne,ne=ge)}return O(ne);case T:e:{for(Re=le.key;J!==null;){if(J.key===Re)if(J.tag===4&&J.stateNode.containerInfo===le.containerInfo&&J.stateNode.implementation===le.implementation){i(ne,J.sibling),ge=m(J,le.children||[]),ge.return=ne,ne=ge;break e}else{i(ne,J);break}else t(ne,J);J=J.sibling}ge=tc(le,ne.mode,ge),ge.return=ne,ne=ge}return O(ne);case k:return le=Dr(le),at(ne,J,le,ge)}if(Y(le))return Ee(ne,J,le,ge);if(U(le)){if(Re=U(le),typeof Re!="function")throw Error(l(150));return le=Re.call(le),Me(ne,J,le,ge)}if(typeof le.then=="function")return at(ne,J,xl(le),ge);if(le.$$typeof===b)return at(ne,J,Sl(ne,le),ge);El(ne,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,J!==null&&J.tag===6?(i(ne,J.sibling),ge=m(J,le),ge.return=ne,ne=ge):(i(ne,J),ge=ec(le,ne.mode,ge),ge.return=ne,ne=ge),O(ne)):i(ne,J)}return function(ne,J,le,ge){try{aa=0;var Re=at(ne,J,le,ge);return fs=null,Re}catch(Te){if(Te===hs||Te===Cl)throw Te;var Qe=xn(29,Te,null,ne.mode);return Qe.lanes=ge,Qe.return=ne,Qe}finally{}}}var Lr=If(!0),Uf=If(!1),Ki=!1;function dc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pc(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 Yi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Xi(e,t,i){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(et&2)!==0){var m=a.pending;return m===null?t.next=t:(t.next=m.next,m.next=t),a.pending=t,t=gl(e),wf(e,null,i),t}return ml(e,a,t,i),gl(e)}function oa(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,i|=a,t.lanes=i,Ne(e,i)}}function mc(e,t){var i=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,i===a)){var m=null,C=null;if(i=i.firstBaseUpdate,i!==null){do{var O={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};C===null?m=C=O:C=C.next=O,i=i.next}while(i!==null);C===null?m=C=t:C=C.next=t}else m=C=t;i={baseState:a.baseState,firstBaseUpdate:m,lastBaseUpdate:C,shared:a.shared,callbacks:a.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var gc=!1;function ca(){if(gc){var e=us;if(e!==null)throw e}}function ua(e,t,i,a){gc=!1;var m=e.updateQueue;Ki=!1;var C=m.firstBaseUpdate,O=m.lastBaseUpdate,F=m.shared.pending;if(F!==null){m.shared.pending=null;var X=F,oe=X.next;X.next=null,O===null?C=oe:O.next=oe,O=X;var de=e.alternate;de!==null&&(de=de.updateQueue,F=de.lastBaseUpdate,F!==O&&(F===null?de.firstBaseUpdate=oe:F.next=oe,de.lastBaseUpdate=X))}if(C!==null){var _e=m.baseState;O=0,de=oe=X=null,F=C;do{var ce=F.lane&-536870913,ue=ce!==F.lane;if(ue?(We&ce)===ce:(a&ce)===ce){ce!==0&&ce===cs&&(gc=!0),de!==null&&(de=de.next={lane:0,tag:F.tag,payload:F.payload,callback:null,next:null});e:{var Ee=e,Me=F;ce=t;var at=i;switch(Me.tag){case 1:if(Ee=Me.payload,typeof Ee=="function"){_e=Ee.call(at,_e,ce);break e}_e=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=Me.payload,ce=typeof Ee=="function"?Ee.call(at,_e,ce):Ee,ce==null)break e;_e=u({},_e,ce);break e;case 2:Ki=!0}}ce=F.callback,ce!==null&&(e.flags|=64,ue&&(e.flags|=8192),ue=m.callbacks,ue===null?m.callbacks=[ce]:ue.push(ce))}else ue={lane:ce,tag:F.tag,payload:F.payload,callback:F.callback,next:null},de===null?(oe=de=ue,X=_e):de=de.next=ue,O|=ce;if(F=F.next,F===null){if(F=m.shared.pending,F===null)break;ue=F,F=ue.next,ue.next=null,m.lastBaseUpdate=ue,m.shared.pending=null}}while(!0);de===null&&(X=_e),m.baseState=X,m.firstBaseUpdate=oe,m.lastBaseUpdate=de,C===null&&(m.shared.lanes=0),tr|=O,e.lanes=O,e.memoizedState=_e}}function Pf(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function Ff(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Pf(i[e],t)}var ds=N(null),kl=N(0);function qf(e,t){e=Bi,I(kl,e),I(ds,t),Bi=e|t.baseLanes}function _c(){I(kl,Bi),I(ds,ds.current)}function vc(){Bi=kl.current,$(ds),$(kl)}var En=N(null),qn=null;function Qi(e){var t=e.alternate;I(Ct,Ct.current&1),I(En,e),qn===null&&(t===null||ds.current!==null||t.memoizedState!==null)&&(qn=e)}function yc(e){I(Ct,Ct.current),I(En,e),qn===null&&(qn=e)}function $f(e){e.tag===22?(I(Ct,Ct.current),I(En,e),qn===null&&(qn=e)):Ji()}function Ji(){I(Ct,Ct.current),I(En,En.current)}function kn(e){$(En),qn===e&&(qn=null),$(Ct)}var Ct=N(0);function Al(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Eu(i)||ku(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 ki=0,He=null,rt=null,Tt=null,Tl=!1,ps=!1,Or=!1,Rl=0,ha=0,ms=null,yy=0;function _t(){throw Error(l(321))}function Sc(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!wn(e[i],t[i]))return!1;return!0}function bc(e,t,i,a,m,C){return ki=C,He=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,G.H=e===null||e.memoizedState===null?Ad:Nc,Or=!1,C=i(a,m),Or=!1,ps&&(C=Vf(t,i,a,m)),Gf(e),C}function Gf(e){G.H=pa;var t=rt!==null&&rt.next!==null;if(ki=0,Tt=rt=He=null,Tl=!1,ha=0,ms=null,t)throw Error(l(300));e===null||Rt||(e=e.dependencies,e!==null&&yl(e)&&(Rt=!0))}function Vf(e,t,i,a){He=e;var m=0;do{if(ps&&(ms=null),ha=0,ps=!1,25<=m)throw Error(l(301));if(m+=1,Tt=rt=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=Td,C=t(i,a)}while(ps);return C}function Sy(){var e=G.H,t=e.useState()[0];return t=typeof t.then=="function"?fa(t):t,e=e.useState()[0],(rt!==null?rt.memoizedState:null)!==e&&(He.flags|=1024),t}function Cc(){var e=Rl!==0;return Rl=0,e}function wc(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function xc(e){if(Tl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Tl=!1}ki=0,Tt=rt=He=null,ps=!1,ha=Rl=0,ms=null}function tn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?He.memoizedState=Tt=e:Tt=Tt.next=e,Tt}function wt(){if(rt===null){var e=He.alternate;e=e!==null?e.memoizedState:null}else e=rt.next;var t=Tt===null?He.memoizedState:Tt.next;if(t!==null)Tt=t,rt=e;else{if(e===null)throw He.alternate===null?Error(l(467)):Error(l(310));rt=e,e={memoizedState:rt.memoizedState,baseState:rt.baseState,baseQueue:rt.baseQueue,queue:rt.queue,next:null},Tt===null?He.memoizedState=Tt=e:Tt=Tt.next=e}return Tt}function Dl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fa(e){var t=ha;return ha+=1,ms===null&&(ms=[]),e=Nf(ms,e,t),t=He,(Tt===null?t.memoizedState:Tt.next)===null&&(t=t.alternate,G.H=t===null||t.memoizedState===null?Ad:Nc),e}function Ml(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return fa(e);if(e.$$typeof===b)return Ft(e)}throw Error(l(438,String(e)))}function Ec(e){var t=null,i=He.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var a=He.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(m){return m.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=Dl(),He.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),a=0;a<e;a++)i[a]=B;return t.index++,i}function Ai(e,t){return typeof t=="function"?t(e):t}function Ll(e){var t=wt();return kc(t,rt,e)}function kc(e,t,i){var a=e.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=i;var m=e.baseQueue,C=a.pending;if(C!==null){if(m!==null){var O=m.next;m.next=C.next,C.next=O}t.baseQueue=m=C,a.pending=null}if(C=e.baseState,m===null)e.memoizedState=C;else{t=m.next;var F=O=null,X=null,oe=t,de=!1;do{var _e=oe.lane&-536870913;if(_e!==oe.lane?(We&_e)===_e:(ki&_e)===_e){var ce=oe.revertLane;if(ce===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),_e===cs&&(de=!0);else if((ki&ce)===ce){oe=oe.next,ce===cs&&(de=!0);continue}else _e={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},X===null?(F=X=_e,O=C):X=X.next=_e,He.lanes|=ce,tr|=ce;_e=oe.action,Or&&i(C,_e),C=oe.hasEagerState?oe.eagerState:i(C,_e)}else ce={lane:_e,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},X===null?(F=X=ce,O=C):X=X.next=ce,He.lanes|=_e,tr|=_e;oe=oe.next}while(oe!==null&&oe!==t);if(X===null?O=C:X.next=F,!wn(C,e.memoizedState)&&(Rt=!0,de&&(i=us,i!==null)))throw i;e.memoizedState=C,e.baseState=O,e.baseQueue=X,a.lastRenderedState=C}return m===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Ac(e){var t=wt(),i=t.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=e;var a=i.dispatch,m=i.pending,C=t.memoizedState;if(m!==null){i.pending=null;var O=m=m.next;do C=e(C,O.action),O=O.next;while(O!==m);wn(C,t.memoizedState)||(Rt=!0),t.memoizedState=C,t.baseQueue===null&&(t.baseState=C),i.lastRenderedState=C}return[C,a]}function Wf(e,t,i){var a=He,m=wt(),C=Ye;if(C){if(i===void 0)throw Error(l(407));i=i()}else i=t();var O=!wn((rt||m).memoizedState,i);if(O&&(m.memoizedState=i,Rt=!0),m=m.queue,Dc(Xf.bind(null,a,m,e),[e]),m.getSnapshot!==t||O||Tt!==null&&Tt.memoizedState.tag&1){if(a.flags|=2048,gs(9,{destroy:void 0},Yf.bind(null,a,m,i,t),null),lt===null)throw Error(l(349));C||(ki&127)!==0||Kf(a,t,i)}return i}function Kf(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=He.updateQueue,t===null?(t=Dl(),He.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Yf(e,t,i,a){t.value=i,t.getSnapshot=a,Qf(t)&&Jf(e)}function Xf(e,t,i){return i(function(){Qf(t)&&Jf(e)})}function Qf(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!wn(e,i)}catch{return!0}}function Jf(e){var t=xr(e,2);t!==null&&_n(t,e,2)}function Tc(e){var t=tn();if(typeof e=="function"){var i=e;if(e=i(),Or){Ot(!0);try{i()}finally{Ot(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:e},t}function Zf(e,t,i,a){return e.baseState=i,kc(e,rt,typeof a=="function"?a:Ai)}function by(e,t,i,a,m){if(jl(e))throw Error(l(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(O){C.listeners.push(O)}};G.T!==null?i(!0):C.isTransition=!1,a(C),i=t.pending,i===null?(C.next=t.pending=C,ed(t,C)):(C.next=i.next,t.pending=i.next=C)}}function ed(e,t){var i=t.action,a=t.payload,m=e.state;if(t.isTransition){var C=G.T,O={};G.T=O;try{var F=i(m,a),X=G.S;X!==null&&X(O,F),td(e,t,F)}catch(oe){Rc(e,t,oe)}finally{C!==null&&O.types!==null&&(C.types=O.types),G.T=C}}else try{C=i(m,a),td(e,t,C)}catch(oe){Rc(e,t,oe)}}function td(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(a){nd(e,t,a)},function(a){return Rc(e,t,a)}):nd(e,t,i)}function nd(e,t,i){t.status="fulfilled",t.value=i,id(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,ed(e,i)))}function Rc(e,t,i){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=i,id(t),t=t.next;while(t!==a)}e.action=null}function id(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function rd(e,t){return t}function sd(e,t){if(Ye){var i=lt.formState;if(i!==null){e:{var a=He;if(Ye){if(ht){t:{for(var m=ht,C=Fn;m.nodeType!==8;){if(!C){m=null;break t}if(m=$n(m.nextSibling),m===null){m=null;break t}}C=m.data,m=C==="F!"||C==="F"?m:null}if(m){ht=$n(m.nextSibling),a=m.data==="F!";break e}}Vi(a)}a=!1}a&&(t=i[0])}}return i=tn(),i.memoizedState=i.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rd,lastRenderedState:t},i.queue=a,i=xd.bind(null,He,a),a.dispatch=i,a=Tc(!1),C=jc.bind(null,He,!1,a.queue),a=tn(),m={state:t,dispatch:null,action:e,pending:null},a.queue=m,i=by.bind(null,He,m,C,i),m.dispatch=i,a.memoizedState=e,[t,i,!1]}function ad(e){var t=wt();return ld(t,rt,e)}function ld(e,t,i){if(t=kc(e,t,rd)[0],e=Ll(Ai)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=fa(t)}catch(O){throw O===hs?Cl:O}else a=t;t=wt();var m=t.queue,C=m.dispatch;return i!==t.memoizedState&&(He.flags|=2048,gs(9,{destroy:void 0},Cy.bind(null,m,i),null)),[a,C,e]}function Cy(e,t){e.action=t}function od(e){var t=wt(),i=rt;if(i!==null)return ld(t,i,e);wt(),t=t.memoizedState,i=wt();var a=i.queue.dispatch;return i.memoizedState=e,[t,a,!1]}function gs(e,t,i,a){return e={tag:e,create:i,deps:a,inst:t,next:null},t=He.updateQueue,t===null&&(t=Dl(),He.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(a=i.next,i.next=e,e.next=a,t.lastEffect=e),e}function cd(){return wt().memoizedState}function Ol(e,t,i,a){var m=tn();He.flags|=e,m.memoizedState=gs(1|t,{destroy:void 0},i,a===void 0?null:a)}function Bl(e,t,i,a){var m=wt();a=a===void 0?null:a;var C=m.memoizedState.inst;rt!==null&&a!==null&&Sc(a,rt.memoizedState.deps)?m.memoizedState=gs(t,C,i,a):(He.flags|=e,m.memoizedState=gs(1|t,C,i,a))}function ud(e,t){Ol(8390656,8,e,t)}function Dc(e,t){Bl(2048,8,e,t)}function wy(e){He.flags|=4;var t=He.updateQueue;if(t===null)t=Dl(),He.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function hd(e){var t=wt().memoizedState;return wy({ref:t,nextImpl:e}),function(){if((et&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function fd(e,t){return Bl(4,2,e,t)}function dd(e,t){return Bl(4,4,e,t)}function pd(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 md(e,t,i){i=i!=null?i.concat([e]):null,Bl(4,4,pd.bind(null,t,e),i)}function Mc(){}function gd(e,t){var i=wt();t=t===void 0?null:t;var a=i.memoizedState;return t!==null&&Sc(t,a[1])?a[0]:(i.memoizedState=[e,t],e)}function _d(e,t){var i=wt();t=t===void 0?null:t;var a=i.memoizedState;if(t!==null&&Sc(t,a[1]))return a[0];if(a=e(),Or){Ot(!0);try{e()}finally{Ot(!1)}}return i.memoizedState=[a,t],a}function Lc(e,t,i){return i===void 0||(ki&1073741824)!==0&&(We&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=vp(),He.lanes|=e,tr|=e,i)}function vd(e,t,i,a){return wn(i,t)?i:ds.current!==null?(e=Lc(e,i,a),wn(e,t)||(Rt=!0),e):(ki&42)===0||(ki&1073741824)!==0&&(We&261930)===0?(Rt=!0,e.memoizedState=i):(e=vp(),He.lanes|=e,tr|=e,t)}function yd(e,t,i,a,m){var C=W.p;W.p=C!==0&&8>C?C:8;var O=G.T,F={};G.T=F,jc(e,!1,t,i);try{var X=m(),oe=G.S;if(oe!==null&&oe(F,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var de=vy(X,a);da(e,t,de,Rn(e))}else da(e,t,a,Rn(e))}catch(_e){da(e,t,{then:function(){},status:"rejected",reason:_e},Rn())}finally{W.p=C,O!==null&&F.types!==null&&(O.types=F.types),G.T=O}}function xy(){}function Oc(e,t,i,a){if(e.tag!==5)throw Error(l(476));var m=Sd(e).queue;yd(e,m,t,Z,i===null?xy:function(){return bd(e),i(a)})}function Sd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:Z},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function bd(e){var t=Sd(e);t.next===null&&(t=e.alternate.memoizedState),da(e,t.next.queue,{},Rn())}function Bc(){return Ft(Da)}function Cd(){return wt().memoizedState}function wd(){return wt().memoizedState}function Ey(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Rn();e=Yi(i);var a=Xi(t,e,i);a!==null&&(_n(a,t,i),oa(a,t,i)),t={cache:cc()},e.payload=t;return}t=t.return}}function ky(e,t,i){var a=Rn();i={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},jl(e)?Ed(t,i):(i=Jo(e,t,i,a),i!==null&&(_n(i,e,a),kd(i,t,a)))}function xd(e,t,i){var a=Rn();da(e,t,i,a)}function da(e,t,i,a){var m={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(jl(e))Ed(t,m);else{var C=e.alternate;if(e.lanes===0&&(C===null||C.lanes===0)&&(C=t.lastRenderedReducer,C!==null))try{var O=t.lastRenderedState,F=C(O,i);if(m.hasEagerState=!0,m.eagerState=F,wn(F,O))return ml(e,t,m,0),lt===null&&pl(),!1}catch{}finally{}if(i=Jo(e,t,m,a),i!==null)return _n(i,e,a),kd(i,t,a),!0}return!1}function jc(e,t,i,a){if(a={lane:2,revertLane:du(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},jl(e)){if(t)throw Error(l(479))}else t=Jo(e,i,a,2),t!==null&&_n(t,e,2)}function jl(e){var t=e.alternate;return e===He||t!==null&&t===He}function Ed(e,t){ps=Tl=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function kd(e,t,i){if((i&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,i|=a,t.lanes=i,Ne(e,i)}}var pa={readContext:Ft,use:Ml,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};pa.useEffectEvent=_t;var Ad={readContext:Ft,use:Ml,useCallback:function(e,t){return tn().memoizedState=[e,t===void 0?null:t],e},useContext:Ft,useEffect:ud,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,Ol(4194308,4,pd.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Ol(4194308,4,e,t)},useInsertionEffect:function(e,t){Ol(4,2,e,t)},useMemo:function(e,t){var i=tn();t=t===void 0?null:t;var a=e();if(Or){Ot(!0);try{e()}finally{Ot(!1)}}return i.memoizedState=[a,t],a},useReducer:function(e,t,i){var a=tn();if(i!==void 0){var m=i(t);if(Or){Ot(!0);try{i(t)}finally{Ot(!1)}}}else m=t;return a.memoizedState=a.baseState=m,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:m},a.queue=e,e=e.dispatch=ky.bind(null,He,e),[a.memoizedState,e]},useRef:function(e){var t=tn();return e={current:e},t.memoizedState=e},useState:function(e){e=Tc(e);var t=e.queue,i=xd.bind(null,He,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Mc,useDeferredValue:function(e,t){var i=tn();return Lc(i,e,t)},useTransition:function(){var e=Tc(!1);return e=yd.bind(null,He,e.queue,!0,!1),tn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var a=He,m=tn();if(Ye){if(i===void 0)throw Error(l(407));i=i()}else{if(i=t(),lt===null)throw Error(l(349));(We&127)!==0||Kf(a,t,i)}m.memoizedState=i;var C={value:i,getSnapshot:t};return m.queue=C,ud(Xf.bind(null,a,C,e),[e]),a.flags|=2048,gs(9,{destroy:void 0},Yf.bind(null,a,C,i,t),null),i},useId:function(){var e=tn(),t=lt.identifierPrefix;if(Ye){var i=ui,a=ci;i=(a&~(1<<32-Ze(a)-1)).toString(32)+i,t="_"+t+"R_"+i,i=Rl++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=yy++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Bc,useFormState:sd,useActionState:sd,useOptimistic:function(e){var t=tn();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=jc.bind(null,He,!0,i),i.dispatch=t,[e,t]},useMemoCache:Ec,useCacheRefresh:function(){return tn().memoizedState=Ey.bind(null,He)},useEffectEvent:function(e){var t=tn(),i={impl:e};return t.memoizedState=i,function(){if((et&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},Nc={readContext:Ft,use:Ml,useCallback:gd,useContext:Ft,useEffect:Dc,useImperativeHandle:md,useInsertionEffect:fd,useLayoutEffect:dd,useMemo:_d,useReducer:Ll,useRef:cd,useState:function(){return Ll(Ai)},useDebugValue:Mc,useDeferredValue:function(e,t){var i=wt();return vd(i,rt.memoizedState,e,t)},useTransition:function(){var e=Ll(Ai)[0],t=wt().memoizedState;return[typeof e=="boolean"?e:fa(e),t]},useSyncExternalStore:Wf,useId:Cd,useHostTransitionStatus:Bc,useFormState:ad,useActionState:ad,useOptimistic:function(e,t){var i=wt();return Zf(i,rt,e,t)},useMemoCache:Ec,useCacheRefresh:wd};Nc.useEffectEvent=hd;var Td={readContext:Ft,use:Ml,useCallback:gd,useContext:Ft,useEffect:Dc,useImperativeHandle:md,useInsertionEffect:fd,useLayoutEffect:dd,useMemo:_d,useReducer:Ac,useRef:cd,useState:function(){return Ac(Ai)},useDebugValue:Mc,useDeferredValue:function(e,t){var i=wt();return rt===null?Lc(i,e,t):vd(i,rt.memoizedState,e,t)},useTransition:function(){var e=Ac(Ai)[0],t=wt().memoizedState;return[typeof e=="boolean"?e:fa(e),t]},useSyncExternalStore:Wf,useId:Cd,useHostTransitionStatus:Bc,useFormState:od,useActionState:od,useOptimistic:function(e,t){var i=wt();return rt!==null?Zf(i,rt,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Ec,useCacheRefresh:wd};Td.useEffectEvent=hd;function Hc(e,t,i,a){t=e.memoizedState,i=i(a,t),i=i==null?t:u({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var zc={enqueueSetState:function(e,t,i){e=e._reactInternals;var a=Rn(),m=Yi(a);m.payload=t,i!=null&&(m.callback=i),t=Xi(e,m,a),t!==null&&(_n(t,e,a),oa(t,e,a))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var a=Rn(),m=Yi(a);m.tag=1,m.payload=t,i!=null&&(m.callback=i),t=Xi(e,m,a),t!==null&&(_n(t,e,a),oa(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Rn(),a=Yi(i);a.tag=2,t!=null&&(a.callback=t),t=Xi(e,a,i),t!==null&&(_n(t,e,i),oa(t,e,i))}};function Rd(e,t,i,a,m,C,O){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,C,O):t.prototype&&t.prototype.isPureReactComponent?!ea(i,a)||!ea(m,C):!0}function Dd(e,t,i,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,a),t.state!==e&&zc.enqueueReplaceState(t,t.state,null)}function Br(e,t){var i=t;if("ref"in t){i={};for(var a in t)a!=="ref"&&(i[a]=t[a])}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 Md(e){dl(e)}function Ld(e){console.error(e)}function Od(e){dl(e)}function Nl(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Bd(e,t,i){try{var a=e.onCaughtError;a(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Ic(e,t,i){return i=Yi(i),i.tag=3,i.payload={element:null},i.callback=function(){Nl(e,t)},i}function jd(e){return e=Yi(e),e.tag=3,e}function Nd(e,t,i,a){var m=i.type.getDerivedStateFromError;if(typeof m=="function"){var C=a.value;e.payload=function(){return m(C)},e.callback=function(){Bd(t,i,a)}}var O=i.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(e.callback=function(){Bd(t,i,a),typeof m!="function"&&(nr===null?nr=new Set([this]):nr.add(this));var F=a.stack;this.componentDidCatch(a.value,{componentStack:F!==null?F:""})})}function Ay(e,t,i,a,m){if(i.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=i.alternate,t!==null&&os(t,i,m,!0),i=En.current,i!==null){switch(i.tag){case 31:case 13:return qn===null?Kl():i.alternate===null&&vt===0&&(vt=3),i.flags&=-257,i.flags|=65536,i.lanes=m,a===wl?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([a]):t.add(a),uu(e,a,m)),!1;case 22:return i.flags|=65536,a===wl?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([a]):i.add(a)),uu(e,a,m)),!1}throw Error(l(435,i.tag))}return uu(e,a,m),Kl(),!1}if(Ye)return t=En.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=m,a!==rc&&(e=Error(l(422),{cause:a}),ia(In(e,i)))):(a!==rc&&(t=Error(l(423),{cause:a}),ia(In(t,i))),e=e.current.alternate,e.flags|=65536,m&=-m,e.lanes|=m,a=In(a,i),m=Ic(e.stateNode,a,m),mc(e,m),vt!==4&&(vt=2)),!1;var C=Error(l(520),{cause:a});if(C=In(C,i),Ca===null?Ca=[C]:Ca.push(C),vt!==4&&(vt=2),t===null)return!0;a=In(a,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=m&-m,i.lanes|=e,e=Ic(i.stateNode,a,e),mc(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"&&(nr===null||!nr.has(C))))return i.flags|=65536,m&=-m,i.lanes|=m,m=jd(m),Nd(m,e,i,a),mc(i,m),!1}i=i.return}while(i!==null);return!1}var Uc=Error(l(461)),Rt=!1;function qt(e,t,i,a){t.child=e===null?Uf(t,null,i,a):Lr(t,e.child,i,a)}function Hd(e,t,i,a,m){i=i.render;var C=t.ref;if("ref"in a){var O={};for(var F in a)F!=="ref"&&(O[F]=a[F])}else O=a;return Tr(t),a=bc(e,t,i,O,C,m),F=Cc(),e!==null&&!Rt?(wc(e,t,m),Ti(e,t,m)):(Ye&&F&&nc(t),t.flags|=1,qt(e,t,a,m),t.child)}function zd(e,t,i,a,m){if(e===null){var C=i.type;return typeof C=="function"&&!Zo(C)&&C.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=C,Id(e,t,C,a,m)):(e=_l(i.type,null,a,t,t.mode,m),e.ref=t.ref,e.return=t,t.child=e)}if(C=e.child,!Kc(e,m)){var O=C.memoizedProps;if(i=i.compare,i=i!==null?i:ea,i(O,a)&&e.ref===t.ref)return Ti(e,t,m)}return t.flags|=1,e=Ci(C,a),e.ref=t.ref,e.return=t,t.child=e}function Id(e,t,i,a,m){if(e!==null){var C=e.memoizedProps;if(ea(C,a)&&e.ref===t.ref)if(Rt=!1,t.pendingProps=a=C,Kc(e,m))(e.flags&131072)!==0&&(Rt=!0);else return t.lanes=e.lanes,Ti(e,t,m)}return Pc(e,t,i,a,m)}function Ud(e,t,i,a){var m=a.children,C=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(C=C!==null?C.baseLanes|i:i,e!==null){for(a=t.child=e.child,m=0;a!==null;)m=m|a.lanes|a.childLanes,a=a.sibling;a=m&~C}else a=0,t.child=null;return Pd(e,t,C,i,a)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&bl(t,C!==null?C.cachePool:null),C!==null?qf(t,C):_c(),$f(t);else return a=t.lanes=536870912,Pd(e,t,C!==null?C.baseLanes|i:i,i,a)}else C!==null?(bl(t,C.cachePool),qf(t,C),Ji(),t.memoizedState=null):(e!==null&&bl(t,null),_c(),Ji());return qt(e,t,m,i),t.child}function ma(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Pd(e,t,i,a,m){var C=hc();return C=C===null?null:{parent:At._currentValue,pool:C},t.memoizedState={baseLanes:i,cachePool:C},e!==null&&bl(t,null),_c(),$f(t),e!==null&&os(e,t,a,!0),t.childLanes=m,null}function Hl(e,t){return t=Il({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Fd(e,t,i){return Lr(t,e.child,null,i),e=Hl(t,t.pendingProps),e.flags|=2,kn(t),t.memoizedState=null,e}function Ty(e,t,i){var a=t.pendingProps,m=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ye){if(a.mode==="hidden")return e=Hl(t,a),t.lanes=536870912,ma(null,e);if(yc(t),(e=ht)?(e=em(e,Fn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:$i!==null?{id:ci,overflow:ui}:null,retryLane:536870912,hydrationErrors:null},i=Ef(e),i.return=t,t.child=i,Pt=t,ht=null)):e=null,e===null)throw Vi(t);return t.lanes=536870912,null}return Hl(t,a)}var C=e.memoizedState;if(C!==null){var O=C.dehydrated;if(yc(t),m)if(t.flags&256)t.flags&=-257,t=Fd(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(Rt||os(e,t,i,!1),m=(i&e.childLanes)!==0,Rt||m){if(a=lt,a!==null&&(O=Pi(a,i),O!==0&&O!==C.retryLane))throw C.retryLane=O,xr(e,O),_n(a,e,O),Uc;Kl(),t=Fd(e,t,i)}else e=C.treeContext,ht=$n(O.nextSibling),Pt=t,Ye=!0,Gi=null,Fn=!1,e!==null&&Tf(t,e),t=Hl(t,a),t.flags|=4096;return t}return e=Ci(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function zl(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(l(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Pc(e,t,i,a,m){return Tr(t),i=bc(e,t,i,a,void 0,m),a=Cc(),e!==null&&!Rt?(wc(e,t,m),Ti(e,t,m)):(Ye&&a&&nc(t),t.flags|=1,qt(e,t,i,m),t.child)}function qd(e,t,i,a,m,C){return Tr(t),t.updateQueue=null,i=Vf(t,a,i,m),Gf(e),a=Cc(),e!==null&&!Rt?(wc(e,t,C),Ti(e,t,C)):(Ye&&a&&nc(t),t.flags|=1,qt(e,t,i,C),t.child)}function $d(e,t,i,a,m){if(Tr(t),t.stateNode===null){var C=rs,O=i.contextType;typeof O=="object"&&O!==null&&(C=Ft(O)),C=new i(a,C),t.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,C.updater=zc,t.stateNode=C,C._reactInternals=t,C=t.stateNode,C.props=a,C.state=t.memoizedState,C.refs={},dc(t),O=i.contextType,C.context=typeof O=="object"&&O!==null?Ft(O):rs,C.state=t.memoizedState,O=i.getDerivedStateFromProps,typeof O=="function"&&(Hc(t,i,O,a),C.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(O=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),O!==C.state&&zc.enqueueReplaceState(C,C.state,null),ua(t,a,C,m),ca(),C.state=t.memoizedState),typeof C.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){C=t.stateNode;var F=t.memoizedProps,X=Br(i,F);C.props=X;var oe=C.context,de=i.contextType;O=rs,typeof de=="object"&&de!==null&&(O=Ft(de));var _e=i.getDerivedStateFromProps;de=typeof _e=="function"||typeof C.getSnapshotBeforeUpdate=="function",F=t.pendingProps!==F,de||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(F||oe!==O)&&Dd(t,C,a,O),Ki=!1;var ce=t.memoizedState;C.state=ce,ua(t,a,C,m),ca(),oe=t.memoizedState,F||ce!==oe||Ki?(typeof _e=="function"&&(Hc(t,i,_e,a),oe=t.memoizedState),(X=Ki||Rd(t,i,X,a,ce,oe,O))?(de||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=a,t.memoizedState=oe),C.props=a,C.state=oe,C.context=O,a=X):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{C=t.stateNode,pc(e,t),O=t.memoizedProps,de=Br(i,O),C.props=de,_e=t.pendingProps,ce=C.context,oe=i.contextType,X=rs,typeof oe=="object"&&oe!==null&&(X=Ft(oe)),F=i.getDerivedStateFromProps,(oe=typeof F=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(O!==_e||ce!==X)&&Dd(t,C,a,X),Ki=!1,ce=t.memoizedState,C.state=ce,ua(t,a,C,m),ca();var ue=t.memoizedState;O!==_e||ce!==ue||Ki||e!==null&&e.dependencies!==null&&yl(e.dependencies)?(typeof F=="function"&&(Hc(t,i,F,a),ue=t.memoizedState),(de=Ki||Rd(t,i,de,a,ce,ue,X)||e!==null&&e.dependencies!==null&&yl(e.dependencies))?(oe||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(a,ue,X),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(a,ue,X)),typeof C.componentDidUpdate=="function"&&(t.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof C.componentDidUpdate!="function"||O===e.memoizedProps&&ce===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&ce===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=ue),C.props=a,C.state=ue,C.context=X,a=de):(typeof C.componentDidUpdate!="function"||O===e.memoizedProps&&ce===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&ce===e.memoizedState||(t.flags|=1024),a=!1)}return C=a,zl(e,t),a=(t.flags&128)!==0,C||a?(C=t.stateNode,i=a&&typeof i.getDerivedStateFromError!="function"?null:C.render(),t.flags|=1,e!==null&&a?(t.child=Lr(t,e.child,null,m),t.child=Lr(t,null,i,m)):qt(e,t,i,m),t.memoizedState=C.state,e=t.child):e=Ti(e,t,m),e}function Gd(e,t,i,a){return kr(),t.flags|=256,qt(e,t,i,a),t.child}var Fc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qc(e){return{baseLanes:e,cachePool:Bf()}}function $c(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Tn),e}function Vd(e,t,i){var a=t.pendingProps,m=!1,C=(t.flags&128)!==0,O;if((O=C)||(O=e!==null&&e.memoizedState===null?!1:(Ct.current&2)!==0),O&&(m=!0,t.flags&=-129),O=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ye){if(m?Qi(t):Ji(),(e=ht)?(e=em(e,Fn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:$i!==null?{id:ci,overflow:ui}:null,retryLane:536870912,hydrationErrors:null},i=Ef(e),i.return=t,t.child=i,Pt=t,ht=null)):e=null,e===null)throw Vi(t);return ku(e)?t.lanes=32:t.lanes=536870912,null}var F=a.children;return a=a.fallback,m?(Ji(),m=t.mode,F=Il({mode:"hidden",children:F},m),a=Er(a,m,i,null),F.return=t,a.return=t,F.sibling=a,t.child=F,a=t.child,a.memoizedState=qc(i),a.childLanes=$c(e,O,i),t.memoizedState=Fc,ma(null,a)):(Qi(t),Gc(t,F))}var X=e.memoizedState;if(X!==null&&(F=X.dehydrated,F!==null)){if(C)t.flags&256?(Qi(t),t.flags&=-257,t=Vc(e,t,i)):t.memoizedState!==null?(Ji(),t.child=e.child,t.flags|=128,t=null):(Ji(),F=a.fallback,m=t.mode,a=Il({mode:"visible",children:a.children},m),F=Er(F,m,i,null),F.flags|=2,a.return=t,F.return=t,a.sibling=F,t.child=a,Lr(t,e.child,null,i),a=t.child,a.memoizedState=qc(i),a.childLanes=$c(e,O,i),t.memoizedState=Fc,t=ma(null,a));else if(Qi(t),ku(F)){if(O=F.nextSibling&&F.nextSibling.dataset,O)var oe=O.dgst;O=oe,a=Error(l(419)),a.stack="",a.digest=O,ia({value:a,source:null,stack:null}),t=Vc(e,t,i)}else if(Rt||os(e,t,i,!1),O=(i&e.childLanes)!==0,Rt||O){if(O=lt,O!==null&&(a=Pi(O,i),a!==0&&a!==X.retryLane))throw X.retryLane=a,xr(e,a),_n(O,e,a),Uc;Eu(F)||Kl(),t=Vc(e,t,i)}else Eu(F)?(t.flags|=192,t.child=e.child,t=null):(e=X.treeContext,ht=$n(F.nextSibling),Pt=t,Ye=!0,Gi=null,Fn=!1,e!==null&&Tf(t,e),t=Gc(t,a.children),t.flags|=4096);return t}return m?(Ji(),F=a.fallback,m=t.mode,X=e.child,oe=X.sibling,a=Ci(X,{mode:"hidden",children:a.children}),a.subtreeFlags=X.subtreeFlags&65011712,oe!==null?F=Ci(oe,F):(F=Er(F,m,i,null),F.flags|=2),F.return=t,a.return=t,a.sibling=F,t.child=a,ma(null,a),a=t.child,F=e.child.memoizedState,F===null?F=qc(i):(m=F.cachePool,m!==null?(X=At._currentValue,m=m.parent!==X?{parent:X,pool:X}:m):m=Bf(),F={baseLanes:F.baseLanes|i,cachePool:m}),a.memoizedState=F,a.childLanes=$c(e,O,i),t.memoizedState=Fc,ma(e.child,a)):(Qi(t),i=e.child,e=i.sibling,i=Ci(i,{mode:"visible",children:a.children}),i.return=t,i.sibling=null,e!==null&&(O=t.deletions,O===null?(t.deletions=[e],t.flags|=16):O.push(e)),t.child=i,t.memoizedState=null,i)}function Gc(e,t){return t=Il({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Il(e,t){return e=xn(22,e,null,t),e.lanes=0,e}function Vc(e,t,i){return Lr(t,e.child,null,i),e=Gc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Wd(e,t,i){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),lc(e.return,t,i)}function Wc(e,t,i,a,m,C){var O=e.memoizedState;O===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:i,tailMode:m,treeForkCount:C}:(O.isBackwards=t,O.rendering=null,O.renderingStartTime=0,O.last=a,O.tail=i,O.tailMode=m,O.treeForkCount=C)}function Kd(e,t,i){var a=t.pendingProps,m=a.revealOrder,C=a.tail;a=a.children;var O=Ct.current,F=(O&2)!==0;if(F?(O=O&1|2,t.flags|=128):O&=1,I(Ct,O),qt(e,t,a,i),a=Ye?na:0,!F&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Wd(e,i,t);else if(e.tag===19)Wd(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&&Al(e)===null&&(m=i),i=i.sibling;i=m,i===null?(m=t.child,t.child=null):(m=i.sibling,i.sibling=null),Wc(t,!1,m,i,C,a);break;case"backwards":case"unstable_legacy-backwards":for(i=null,m=t.child,t.child=null;m!==null;){if(e=m.alternate,e!==null&&Al(e)===null){t.child=m;break}e=m.sibling,m.sibling=i,i=m,m=e}Wc(t,!0,i,null,C,a);break;case"together":Wc(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Ti(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),tr|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(os(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,i=Ci(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Ci(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Kc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&yl(e)))}function Ry(e,t,i){switch(t.tag){case 3:q(t,t.stateNode.containerInfo),Wi(t,At,e.memoizedState.cache),kr();break;case 27:case 5:ae(t);break;case 4:q(t,t.stateNode.containerInfo);break;case 10:Wi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,yc(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Qi(t),t.flags|=128,null):(i&t.child.childLanes)!==0?Vd(e,t,i):(Qi(t),e=Ti(e,t,i),e!==null?e.sibling:null);Qi(t);break;case 19:var m=(e.flags&128)!==0;if(a=(i&t.childLanes)!==0,a||(os(e,t,i,!1),a=(i&t.childLanes)!==0),m){if(a)return Kd(e,t,i);t.flags|=128}if(m=t.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),I(Ct,Ct.current),a)break;return null;case 22:return t.lanes=0,Ud(e,t,i,t.pendingProps);case 24:Wi(t,At,e.memoizedState.cache)}return Ti(e,t,i)}function Yd(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Rt=!0;else{if(!Kc(e,i)&&(t.flags&128)===0)return Rt=!1,Ry(e,t,i);Rt=(e.flags&131072)!==0}else Rt=!1,Ye&&(t.flags&1048576)!==0&&Af(t,na,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Dr(t.elementType),t.type=e,typeof e=="function")Zo(e)?(a=Br(e,a),t.tag=1,t=$d(null,t,e,a,i)):(t.tag=0,t=Pc(null,t,e,a,i));else{if(e!=null){var m=e.$$typeof;if(m===A){t.tag=11,t=Hd(null,t,e,a,i);break e}else if(m===R){t.tag=14,t=zd(null,t,e,a,i);break e}}throw t=K(e)||e,Error(l(306,t,""))}}return t;case 0:return Pc(e,t,t.type,t.pendingProps,i);case 1:return a=t.type,m=Br(a,t.pendingProps),$d(e,t,a,m,i);case 3:e:{if(q(t,t.stateNode.containerInfo),e===null)throw Error(l(387));a=t.pendingProps;var C=t.memoizedState;m=C.element,pc(e,t),ua(t,a,null,i);var O=t.memoizedState;if(a=O.cache,Wi(t,At,a),a!==C.cache&&oc(t,[At],i,!0),ca(),a=O.element,C.isDehydrated)if(C={element:a,isDehydrated:!1,cache:O.cache},t.updateQueue.baseState=C,t.memoizedState=C,t.flags&256){t=Gd(e,t,a,i);break e}else if(a!==m){m=In(Error(l(424)),t),ia(m),t=Gd(e,t,a,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(ht=$n(e.firstChild),Pt=t,Ye=!0,Gi=null,Fn=!0,i=Uf(t,null,a,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(kr(),a===m){t=Ti(e,t,i);break e}qt(e,t,a,i)}t=t.child}return t;case 26:return zl(e,t),e===null?(i=am(t.type,null,t.pendingProps,null))?t.memoizedState=i:Ye||(i=t.type,e=t.pendingProps,a=to(me.current).createElement(i),a[kt]=t,a[It]=e,$t(a,i,e),bt(a),t.stateNode=a):t.memoizedState=am(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ae(t),e===null&&Ye&&(a=t.stateNode=im(t.type,t.pendingProps,me.current),Pt=t,Fn=!0,m=ht,ar(t.type)?(Au=m,ht=$n(a.firstChild)):ht=m),qt(e,t,t.pendingProps.children,i),zl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ye&&((m=a=ht)&&(a=s0(a,t.type,t.pendingProps,Fn),a!==null?(t.stateNode=a,Pt=t,ht=$n(a.firstChild),Fn=!1,m=!0):m=!1),m||Vi(t)),ae(t),m=t.type,C=t.pendingProps,O=e!==null?e.memoizedProps:null,a=C.children,Cu(m,C)?a=null:O!==null&&Cu(m,O)&&(t.flags|=32),t.memoizedState!==null&&(m=bc(e,t,Sy,null,null,i),Da._currentValue=m),zl(e,t),qt(e,t,a,i),t.child;case 6:return e===null&&Ye&&((e=i=ht)&&(i=a0(i,t.pendingProps,Fn),i!==null?(t.stateNode=i,Pt=t,ht=null,e=!0):e=!1),e||Vi(t)),null;case 13:return Vd(e,t,i);case 4:return q(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Lr(t,null,a,i):qt(e,t,a,i),t.child;case 11:return Hd(e,t,t.type,t.pendingProps,i);case 7:return qt(e,t,t.pendingProps,i),t.child;case 8:return qt(e,t,t.pendingProps.children,i),t.child;case 12:return qt(e,t,t.pendingProps.children,i),t.child;case 10:return a=t.pendingProps,Wi(t,t.type,a.value),qt(e,t,a.children,i),t.child;case 9:return m=t.type._context,a=t.pendingProps.children,Tr(t),m=Ft(m),a=a(m),t.flags|=1,qt(e,t,a,i),t.child;case 14:return zd(e,t,t.type,t.pendingProps,i);case 15:return Id(e,t,t.type,t.pendingProps,i);case 19:return Kd(e,t,i);case 31:return Ty(e,t,i);case 22:return Ud(e,t,i,t.pendingProps);case 24:return Tr(t),a=Ft(At),e===null?(m=hc(),m===null&&(m=lt,C=cc(),m.pooledCache=C,C.refCount++,C!==null&&(m.pooledCacheLanes|=i),m=C),t.memoizedState={parent:a,cache:m},dc(t),Wi(t,At,m)):((e.lanes&i)!==0&&(pc(e,t),ua(t,null,null,i),ca()),m=e.memoizedState,C=t.memoizedState,m.parent!==a?(m={parent:a,cache:a},t.memoizedState=m,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=m),Wi(t,At,a)):(a=C.cache,Wi(t,At,a),a!==m.cache&&oc(t,[At],i,!0))),qt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function Ri(e){e.flags|=4}function Yc(e,t,i,a,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(Cp())e.flags|=8192;else throw Mr=wl,fc}else e.flags&=-16777217}function Xd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!hm(t))if(Cp())e.flags|=8192;else throw Mr=wl,fc}function Ul(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?rn():536870912,e.lanes|=t,Ss|=t)}function ga(e,t){if(!Ye)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 a=null;i!==null;)i.alternate!==null&&(a=i),i=i.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function ft(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,a=0;if(t)for(var m=e.child;m!==null;)i|=m.lanes|m.childLanes,a|=m.subtreeFlags&65011712,a|=m.flags&65011712,m.return=e,m=m.sibling;else for(m=e.child;m!==null;)i|=m.lanes|m.childLanes,a|=m.subtreeFlags,a|=m.flags,m.return=e,m=m.sibling;return e.subtreeFlags|=a,e.childLanes=i,t}function Dy(e,t,i){var a=t.pendingProps;switch(ic(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ft(t),null;case 1:return ft(t),null;case 3:return i=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ei(At),te(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ls(t)?Ri(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,sc())),ft(t),null;case 26:var m=t.type,C=t.memoizedState;return e===null?(Ri(t),C!==null?(ft(t),Xd(t,C)):(ft(t),Yc(t,m,null,a,i))):C?C!==e.memoizedState?(Ri(t),ft(t),Xd(t,C)):(ft(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&Ri(t),ft(t),Yc(t,m,e,a,i)),null;case 27:if(pe(t),i=me.current,m=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Ri(t);else{if(!a){if(t.stateNode===null)throw Error(l(166));return ft(t),null}e=re.current,ls(t)?Rf(t):(e=im(m,a,i),t.stateNode=e,Ri(t))}return ft(t),null;case 5:if(pe(t),m=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Ri(t);else{if(!a){if(t.stateNode===null)throw Error(l(166));return ft(t),null}if(C=re.current,ls(t))Rf(t);else{var O=to(me.current);switch(C){case 1:C=O.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:C=O.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":C=O.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":C=O.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":C=O.createElement("div"),C.innerHTML="<script><\/script>",C=C.removeChild(C.firstChild);break;case"select":C=typeof a.is=="string"?O.createElement("select",{is:a.is}):O.createElement("select"),a.multiple?C.multiple=!0:a.size&&(C.size=a.size);break;default:C=typeof a.is=="string"?O.createElement(m,{is:a.is}):O.createElement(m)}}C[kt]=t,C[It]=a;e:for(O=t.child;O!==null;){if(O.tag===5||O.tag===6)C.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===t)break e;for(;O.sibling===null;){if(O.return===null||O.return===t)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}t.stateNode=C;e:switch($t(C,m,a),m){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Ri(t)}}return ft(t),Yc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Ri(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(l(166));if(e=me.current,ls(t)){if(e=t.stateNode,i=t.memoizedProps,a=null,m=Pt,m!==null)switch(m.tag){case 27:case 5:a=m.memoizedProps}e[kt]=t,e=!!(e.nodeValue===i||a!==null&&a.suppressHydrationWarning===!0||Vp(e.nodeValue,i)),e||Vi(t,!0)}else e=to(e).createTextNode(a),e[kt]=t,t.stateNode=e}return ft(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(a=ls(t),i!==null){if(e===null){if(!a)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[kt]=t}else kr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ft(t),e=!1}else i=sc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(kn(t),t):(kn(t),null);if((t.flags&128)!==0)throw Error(l(558))}return ft(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(m=ls(t),a!==null&&a.dehydrated!==null){if(e===null){if(!m)throw Error(l(318));if(m=t.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(l(317));m[kt]=t}else kr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ft(t),m=!1}else m=sc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=m),m=!0;if(!m)return t.flags&256?(kn(t),t):(kn(t),null)}return kn(t),(t.flags&128)!==0?(t.lanes=i,t):(i=a!==null,e=e!==null&&e.memoizedState!==null,i&&(a=t.child,m=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(m=a.alternate.memoizedState.cachePool.pool),C=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(C=a.memoizedState.cachePool.pool),C!==m&&(a.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Ul(t,t.updateQueue),ft(t),null);case 4:return te(),e===null&&_u(t.stateNode.containerInfo),ft(t),null;case 10:return Ei(t.type),ft(t),null;case 19:if($(Ct),a=t.memoizedState,a===null)return ft(t),null;if(m=(t.flags&128)!==0,C=a.rendering,C===null)if(m)ga(a,!1);else{if(vt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(C=Al(e),C!==null){for(t.flags|=128,ga(a,!1),e=C.updateQueue,t.updateQueue=e,Ul(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)xf(i,e),i=i.sibling;return I(Ct,Ct.current&1|2),Ye&&wi(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&tt()>Gl&&(t.flags|=128,m=!0,ga(a,!1),t.lanes=4194304)}else{if(!m)if(e=Al(C),e!==null){if(t.flags|=128,m=!0,e=e.updateQueue,t.updateQueue=e,Ul(t,e),ga(a,!0),a.tail===null&&a.tailMode==="hidden"&&!C.alternate&&!Ye)return ft(t),null}else 2*tt()-a.renderingStartTime>Gl&&i!==536870912&&(t.flags|=128,m=!0,ga(a,!1),t.lanes=4194304);a.isBackwards?(C.sibling=t.child,t.child=C):(e=a.last,e!==null?e.sibling=C:t.child=C,a.last=C)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=tt(),e.sibling=null,i=Ct.current,I(Ct,m?i&1|2:i&1),Ye&&wi(t,a.treeForkCount),e):(ft(t),null);case 22:case 23:return kn(t),vc(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(i&536870912)!==0&&(t.flags&128)===0&&(ft(t),t.subtreeFlags&6&&(t.flags|=8192)):ft(t),i=t.updateQueue,i!==null&&Ul(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==i&&(t.flags|=2048),e!==null&&$(Rr),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Ei(At),ft(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function My(e,t){switch(ic(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ei(At),te(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return pe(t),null;case 31:if(t.memoizedState!==null){if(kn(t),t.alternate===null)throw Error(l(340));kr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(kn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));kr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $(Ct),null;case 4:return te(),null;case 10:return Ei(t.type),null;case 22:case 23:return kn(t),vc(),e!==null&&$(Rr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ei(At),null;case 25:return null;default:return null}}function Qd(e,t){switch(ic(t),t.tag){case 3:Ei(At),te();break;case 26:case 27:case 5:pe(t);break;case 4:te();break;case 31:t.memoizedState!==null&&kn(t);break;case 13:kn(t);break;case 19:$(Ct);break;case 10:Ei(t.type);break;case 22:case 23:kn(t),vc(),e!==null&&$(Rr);break;case 24:Ei(At)}}function _a(e,t){try{var i=t.updateQueue,a=i!==null?i.lastEffect:null;if(a!==null){var m=a.next;i=m;do{if((i.tag&e)===e){a=void 0;var C=i.create,O=i.inst;a=C(),O.destroy=a}i=i.next}while(i!==m)}}catch(F){it(t,t.return,F)}}function Zi(e,t,i){try{var a=t.updateQueue,m=a!==null?a.lastEffect:null;if(m!==null){var C=m.next;a=C;do{if((a.tag&e)===e){var O=a.inst,F=O.destroy;if(F!==void 0){O.destroy=void 0,m=t;var X=i,oe=F;try{oe()}catch(de){it(m,X,de)}}}a=a.next}while(a!==C)}}catch(de){it(t,t.return,de)}}function Jd(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Ff(t,i)}catch(a){it(e,e.return,a)}}}function Zd(e,t,i){i.props=Br(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(a){it(e,t,a)}}function va(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof i=="function"?e.refCleanup=i(a):i.current=a}}catch(m){it(e,t,m)}}function hi(e,t){var i=e.ref,a=e.refCleanup;if(i!==null)if(typeof a=="function")try{a()}catch(m){it(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){it(e,t,m)}else i.current=null}function ep(e){var t=e.type,i=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&a.focus();break e;case"img":i.src?a.src=i.src:i.srcSet&&(a.srcset=i.srcSet)}}catch(m){it(e,e.return,m)}}function Xc(e,t,i){try{var a=e.stateNode;Zy(a,e.type,i,t),a[It]=t}catch(m){it(e,e.return,m)}}function tp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ar(e.type)||e.tag===4}function Qc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tp(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&&ar(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 Jc(e,t,i){var a=e.tag;if(a===5||a===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=Vt));else if(a!==4&&(a===27&&ar(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Jc(e,t,i),e=e.sibling;e!==null;)Jc(e,t,i),e=e.sibling}function Pl(e,t,i){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(a!==4&&(a===27&&ar(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Pl(e,t,i),e=e.sibling;e!==null;)Pl(e,t,i),e=e.sibling}function np(e){var t=e.stateNode,i=e.memoizedProps;try{for(var a=e.type,m=t.attributes;m.length;)t.removeAttributeNode(m[0]);$t(t,a,i),t[kt]=e,t[It]=i}catch(C){it(e,e.return,C)}}var Di=!1,Dt=!1,Zc=!1,ip=typeof WeakSet=="function"?WeakSet:Set,zt=null;function Ly(e,t){if(e=e.containerInfo,Su=oo,e=mf(e),Vo(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var a=i.getSelection&&i.getSelection();if(a&&a.rangeCount!==0){i=a.anchorNode;var m=a.anchorOffset,C=a.focusNode;a=a.focusOffset;try{i.nodeType,C.nodeType}catch{i=null;break e}var O=0,F=-1,X=-1,oe=0,de=0,_e=e,ce=null;t:for(;;){for(var ue;_e!==i||m!==0&&_e.nodeType!==3||(F=O+m),_e!==C||a!==0&&_e.nodeType!==3||(X=O+a),_e.nodeType===3&&(O+=_e.nodeValue.length),(ue=_e.firstChild)!==null;)ce=_e,_e=ue;for(;;){if(_e===e)break t;if(ce===i&&++oe===m&&(F=O),ce===C&&++de===a&&(X=O),(ue=_e.nextSibling)!==null)break;_e=ce,ce=_e.parentNode}_e=ue}i=F===-1||X===-1?null:{start:F,end:X}}else i=null}i=i||{start:0,end:0}}else i=null;for(bu={focusedElem:e,selectionRange:i},oo=!1,zt=t;zt!==null;)if(t=zt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,zt=e;else for(;zt!==null;){switch(t=zt,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,a=i.stateNode;try{var Ee=Br(i.type,m);e=a.getSnapshotBeforeUpdate(Ee,C),a.__reactInternalSnapshotBeforeUpdate=e}catch(Me){it(i,i.return,Me)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)xu(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":xu(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(l(163))}if(e=t.sibling,e!==null){e.return=t.return,zt=e;break}zt=t.return}}function rp(e,t,i){var a=i.flags;switch(i.tag){case 0:case 11:case 15:Li(e,i),a&4&&_a(5,i);break;case 1:if(Li(e,i),a&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(O){it(i,i.return,O)}else{var m=Br(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(m,t,e.__reactInternalSnapshotBeforeUpdate)}catch(O){it(i,i.return,O)}}a&64&&Jd(i),a&512&&va(i,i.return);break;case 3:if(Li(e,i),a&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{Ff(e,t)}catch(O){it(i,i.return,O)}}break;case 27:t===null&&a&4&&np(i);case 26:case 5:Li(e,i),t===null&&a&4&&ep(i),a&512&&va(i,i.return);break;case 12:Li(e,i);break;case 31:Li(e,i),a&4&&lp(e,i);break;case 13:Li(e,i),a&4&&op(e,i),a&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=Py.bind(null,i),l0(e,i))));break;case 22:if(a=i.memoizedState!==null||Di,!a){t=t!==null&&t.memoizedState!==null||Dt,m=Di;var C=Dt;Di=a,(Dt=t)&&!C?Oi(e,i,(i.subtreeFlags&8772)!==0):Li(e,i),Di=m,Dt=C}break;case 30:break;default:Li(e,i)}}function sp(e){var t=e.alternate;t!==null&&(e.alternate=null,sp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&$r(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 pt=null,dn=!1;function Mi(e,t,i){for(i=i.child;i!==null;)ap(e,t,i),i=i.sibling}function ap(e,t,i){if(mt&&typeof mt.onCommitFiberUnmount=="function")try{mt.onCommitFiberUnmount(gt,i)}catch{}switch(i.tag){case 26:Dt||hi(i,t),Mi(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Dt||hi(i,t);var a=pt,m=dn;ar(i.type)&&(pt=i.stateNode,dn=!1),Mi(e,t,i),Aa(i.stateNode),pt=a,dn=m;break;case 5:Dt||hi(i,t);case 6:if(a=pt,m=dn,pt=null,Mi(e,t,i),pt=a,dn=m,pt!==null)if(dn)try{(pt.nodeType===9?pt.body:pt.nodeName==="HTML"?pt.ownerDocument.body:pt).removeChild(i.stateNode)}catch(C){it(i,t,C)}else try{pt.removeChild(i.stateNode)}catch(C){it(i,t,C)}break;case 18:pt!==null&&(dn?(e=pt,Jp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Ts(e)):Jp(pt,i.stateNode));break;case 4:a=pt,m=dn,pt=i.stateNode.containerInfo,dn=!0,Mi(e,t,i),pt=a,dn=m;break;case 0:case 11:case 14:case 15:Zi(2,i,t),Dt||Zi(4,i,t),Mi(e,t,i);break;case 1:Dt||(hi(i,t),a=i.stateNode,typeof a.componentWillUnmount=="function"&&Zd(i,t,a)),Mi(e,t,i);break;case 21:Mi(e,t,i);break;case 22:Dt=(a=Dt)||i.memoizedState!==null,Mi(e,t,i),Dt=a;break;default:Mi(e,t,i)}}function lp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ts(e)}catch(i){it(t,t.return,i)}}}function op(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ts(e)}catch(i){it(t,t.return,i)}}function Oy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ip),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ip),t;default:throw Error(l(435,e.tag))}}function Fl(e,t){var i=Oy(e);t.forEach(function(a){if(!i.has(a)){i.add(a);var m=Fy.bind(null,e,a);a.then(m,m)}})}function pn(e,t){var i=t.deletions;if(i!==null)for(var a=0;a<i.length;a++){var m=i[a],C=e,O=t,F=O;e:for(;F!==null;){switch(F.tag){case 27:if(ar(F.type)){pt=F.stateNode,dn=!1;break e}break;case 5:pt=F.stateNode,dn=!1;break e;case 3:case 4:pt=F.stateNode.containerInfo,dn=!0;break e}F=F.return}if(pt===null)throw Error(l(160));ap(C,O,m),pt=null,dn=!1,C=m.alternate,C!==null&&(C.return=null),m.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)cp(t,e),t=t.sibling}var ei=null;function cp(e,t){var i=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pn(t,e),mn(e),a&4&&(Zi(3,e,e.return),_a(3,e),Zi(5,e,e.return));break;case 1:pn(t,e),mn(e),a&512&&(Dt||i===null||hi(i,i.return)),a&64&&Di&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?a:i.concat(a))));break;case 26:var m=ei;if(pn(t,e),mn(e),a&512&&(Dt||i===null||hi(i,i.return)),a&4){var C=i!==null?i.memoizedState:null;if(a=e.memoizedState,i===null)if(a===null)if(e.stateNode===null){e:{a=e.type,i=e.memoizedProps,m=m.ownerDocument||m;t:switch(a){case"title":C=m.getElementsByTagName("title")[0],(!C||C[Nn]||C[kt]||C.namespaceURI==="http://www.w3.org/2000/svg"||C.hasAttribute("itemprop"))&&(C=m.createElement(a),m.head.insertBefore(C,m.querySelector("head > title"))),$t(C,a,i),C[kt]=e,bt(C),a=C;break e;case"link":var O=cm("link","href",m).get(a+(i.href||""));if(O){for(var F=0;F<O.length;F++)if(C=O[F],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)){O.splice(F,1);break t}}C=m.createElement(a),$t(C,a,i),m.head.appendChild(C);break;case"meta":if(O=cm("meta","content",m).get(a+(i.content||""))){for(F=0;F<O.length;F++)if(C=O[F],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)){O.splice(F,1);break t}}C=m.createElement(a),$t(C,a,i),m.head.appendChild(C);break;default:throw Error(l(468,a))}C[kt]=e,bt(C),a=C}e.stateNode=a}else um(m,e.type,e.stateNode);else e.stateNode=om(m,a,e.memoizedProps);else C!==a?(C===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):C.count--,a===null?um(m,e.type,e.stateNode):om(m,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Xc(e,e.memoizedProps,i.memoizedProps)}break;case 27:pn(t,e),mn(e),a&512&&(Dt||i===null||hi(i,i.return)),i!==null&&a&4&&Xc(e,e.memoizedProps,i.memoizedProps);break;case 5:if(pn(t,e),mn(e),a&512&&(Dt||i===null||hi(i,i.return)),e.flags&32){m=e.stateNode;try{li(m,"")}catch(Ee){it(e,e.return,Ee)}}a&4&&e.stateNode!=null&&(m=e.memoizedProps,Xc(e,m,i!==null?i.memoizedProps:m)),a&1024&&(Zc=!0);break;case 6:if(pn(t,e),mn(e),a&4){if(e.stateNode===null)throw Error(l(162));a=e.memoizedProps,i=e.stateNode;try{i.nodeValue=a}catch(Ee){it(e,e.return,Ee)}}break;case 3:if(ro=null,m=ei,ei=no(t.containerInfo),pn(t,e),ei=m,mn(e),a&4&&i!==null&&i.memoizedState.isDehydrated)try{Ts(t.containerInfo)}catch(Ee){it(e,e.return,Ee)}Zc&&(Zc=!1,up(e));break;case 4:a=ei,ei=no(e.stateNode.containerInfo),pn(t,e),mn(e),ei=a;break;case 12:pn(t,e),mn(e);break;case 31:pn(t,e),mn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Fl(e,a)));break;case 13:pn(t,e),mn(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&($l=tt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Fl(e,a)));break;case 22:m=e.memoizedState!==null;var X=i!==null&&i.memoizedState!==null,oe=Di,de=Dt;if(Di=oe||m,Dt=de||X,pn(t,e),Dt=de,Di=oe,mn(e),a&8192)e:for(t=e.stateNode,t._visibility=m?t._visibility&-2:t._visibility|1,m&&(i===null||X||Di||Dt||jr(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){X=i=t;try{if(C=X.stateNode,m)O=C.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{F=X.stateNode;var _e=X.memoizedProps.style,ce=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;F.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(Ee){it(X,X.return,Ee)}}}else if(t.tag===6){if(i===null){X=t;try{X.stateNode.nodeValue=m?"":X.memoizedProps}catch(Ee){it(X,X.return,Ee)}}}else if(t.tag===18){if(i===null){X=t;try{var ue=X.stateNode;m?Zp(ue,!0):Zp(X.stateNode,!1)}catch(Ee){it(X,X.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}a&4&&(a=e.updateQueue,a!==null&&(i=a.retryQueue,i!==null&&(a.retryQueue=null,Fl(e,i))));break;case 19:pn(t,e),mn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Fl(e,a)));break;case 30:break;case 21:break;default:pn(t,e),mn(e)}}function mn(e){var t=e.flags;if(t&2){try{for(var i,a=e.return;a!==null;){if(tp(a)){i=a;break}a=a.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var m=i.stateNode,C=Qc(e);Pl(e,C,m);break;case 5:var O=i.stateNode;i.flags&32&&(li(O,""),i.flags&=-33);var F=Qc(e);Pl(e,F,O);break;case 3:case 4:var X=i.stateNode.containerInfo,oe=Qc(e);Jc(e,oe,X);break;default:throw Error(l(161))}}catch(de){it(e,e.return,de)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function up(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;up(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Li(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)rp(e,t.alternate,t),t=t.sibling}function jr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Zi(4,t,t.return),jr(t);break;case 1:hi(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&Zd(t,t.return,i),jr(t);break;case 27:Aa(t.stateNode);case 26:case 5:hi(t,t.return),jr(t);break;case 22:t.memoizedState===null&&jr(t);break;case 30:jr(t);break;default:jr(t)}e=e.sibling}}function Oi(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,m=e,C=t,O=C.flags;switch(C.tag){case 0:case 11:case 15:Oi(m,C,i),_a(4,C);break;case 1:if(Oi(m,C,i),a=C,m=a.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(oe){it(a,a.return,oe)}if(a=C,m=a.updateQueue,m!==null){var F=a.stateNode;try{var X=m.shared.hiddenCallbacks;if(X!==null)for(m.shared.hiddenCallbacks=null,m=0;m<X.length;m++)Pf(X[m],F)}catch(oe){it(a,a.return,oe)}}i&&O&64&&Jd(C),va(C,C.return);break;case 27:np(C);case 26:case 5:Oi(m,C,i),i&&a===null&&O&4&&ep(C),va(C,C.return);break;case 12:Oi(m,C,i);break;case 31:Oi(m,C,i),i&&O&4&&lp(m,C);break;case 13:Oi(m,C,i),i&&O&4&&op(m,C);break;case 22:C.memoizedState===null&&Oi(m,C,i),va(C,C.return);break;case 30:break;default:Oi(m,C,i)}t=t.sibling}}function eu(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&&ra(i))}function tu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e))}function ti(e,t,i,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)hp(e,t,i,a),t=t.sibling}function hp(e,t,i,a){var m=t.flags;switch(t.tag){case 0:case 11:case 15:ti(e,t,i,a),m&2048&&_a(9,t);break;case 1:ti(e,t,i,a);break;case 3:ti(e,t,i,a),m&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e)));break;case 12:if(m&2048){ti(e,t,i,a),e=t.stateNode;try{var C=t.memoizedProps,O=C.id,F=C.onPostCommit;typeof F=="function"&&F(O,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(X){it(t,t.return,X)}}else ti(e,t,i,a);break;case 31:ti(e,t,i,a);break;case 13:ti(e,t,i,a);break;case 23:break;case 22:C=t.stateNode,O=t.alternate,t.memoizedState!==null?C._visibility&2?ti(e,t,i,a):ya(e,t):C._visibility&2?ti(e,t,i,a):(C._visibility|=2,_s(e,t,i,a,(t.subtreeFlags&10256)!==0||!1)),m&2048&&eu(O,t);break;case 24:ti(e,t,i,a),m&2048&&tu(t.alternate,t);break;default:ti(e,t,i,a)}}function _s(e,t,i,a,m){for(m=m&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var C=e,O=t,F=i,X=a,oe=O.flags;switch(O.tag){case 0:case 11:case 15:_s(C,O,F,X,m),_a(8,O);break;case 23:break;case 22:var de=O.stateNode;O.memoizedState!==null?de._visibility&2?_s(C,O,F,X,m):ya(C,O):(de._visibility|=2,_s(C,O,F,X,m)),m&&oe&2048&&eu(O.alternate,O);break;case 24:_s(C,O,F,X,m),m&&oe&2048&&tu(O.alternate,O);break;default:_s(C,O,F,X,m)}t=t.sibling}}function ya(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,a=t,m=a.flags;switch(a.tag){case 22:ya(i,a),m&2048&&eu(a.alternate,a);break;case 24:ya(i,a),m&2048&&tu(a.alternate,a);break;default:ya(i,a)}t=t.sibling}}var Sa=8192;function vs(e,t,i){if(e.subtreeFlags&Sa)for(e=e.child;e!==null;)fp(e,t,i),e=e.sibling}function fp(e,t,i){switch(e.tag){case 26:vs(e,t,i),e.flags&Sa&&e.memoizedState!==null&&y0(i,ei,e.memoizedState,e.memoizedProps);break;case 5:vs(e,t,i);break;case 3:case 4:var a=ei;ei=no(e.stateNode.containerInfo),vs(e,t,i),ei=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Sa,Sa=16777216,vs(e,t,i),Sa=a):vs(e,t,i));break;default:vs(e,t,i)}}function dp(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 ba(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var a=t[i];zt=a,mp(a,e)}dp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)pp(e),e=e.sibling}function pp(e){switch(e.tag){case 0:case 11:case 15:ba(e),e.flags&2048&&Zi(9,e,e.return);break;case 3:ba(e);break;case 12:ba(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ql(e)):ba(e);break;default:ba(e)}}function ql(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var a=t[i];zt=a,mp(a,e)}dp(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Zi(8,t,t.return),ql(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,ql(t));break;default:ql(t)}e=e.sibling}}function mp(e,t){for(;zt!==null;){var i=zt;switch(i.tag){case 0:case 11:case 15:Zi(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var a=i.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:ra(i.memoizedState.cache)}if(a=i.child,a!==null)a.return=i,zt=a;else e:for(i=e;zt!==null;){a=zt;var m=a.sibling,C=a.return;if(sp(a),a===i){zt=null;break e}if(m!==null){m.return=C,zt=m;break e}zt=C}}}var By={getCacheForType:function(e){var t=Ft(At),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Ft(At).controller.signal}},jy=typeof WeakMap=="function"?WeakMap:Map,et=0,lt=null,$e=null,We=0,nt=0,An=null,er=!1,ys=!1,nu=!1,Bi=0,vt=0,tr=0,Nr=0,iu=0,Tn=0,Ss=0,Ca=null,gn=null,ru=!1,$l=0,gp=0,Gl=1/0,Vl=null,nr=null,jt=0,ir=null,bs=null,ji=0,su=0,au=null,_p=null,wa=0,lu=null;function Rn(){return(et&2)!==0&&We!==0?We&-We:G.T!==null?du():Kn()}function vp(){if(Tn===0)if((We&536870912)===0||Ye){var e=ri;ri<<=1,(ri&3932160)===0&&(ri=262144),Tn=e}else Tn=536870912;return e=En.current,e!==null&&(e.flags|=32),Tn}function _n(e,t,i){(e===lt&&(nt===2||nt===9)||e.cancelPendingCommit!==null)&&(Cs(e,0),rr(e,We,Tn,!1)),sn(e,i),((et&2)===0||e!==lt)&&(e===lt&&((et&2)===0&&(Nr|=i),vt===4&&rr(e,We,Tn,!1)),fi(e))}function yp(e,t,i){if((et&6)!==0)throw Error(l(327));var a=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Wn(e,t),m=a?zy(e,t):cu(e,t,!0),C=a;do{if(m===0){ys&&!a&&rr(e,t,0,!1);break}else{if(i=e.current.alternate,C&&!Ny(i)){m=cu(e,t,!1),C=!1;continue}if(m===2){if(C=t,e.errorRecoveryDisabledLanes&C)var O=0;else O=e.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){t=O;e:{var F=e;m=Ca;var X=F.current.memoizedState.isDehydrated;if(X&&(Cs(F,O).flags|=256),O=cu(F,O,!1),O!==2){if(nu&&!X){F.errorRecoveryDisabledLanes|=C,Nr|=C,m=4;break e}C=gn,gn=m,C!==null&&(gn===null?gn=C:gn.push.apply(gn,C))}m=O}if(C=!1,m!==2)continue}}if(m===1){Cs(e,0),rr(e,t,0,!0);break}e:{switch(a=e,C=m,C){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:rr(a,t,Tn,!er);break e;case 2:gn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(m=$l+300-tt(),10<m)){if(rr(a,t,Tn,!er),Bn(a,0,!0)!==0)break e;ji=t,a.timeoutHandle=Xp(Sp.bind(null,a,i,gn,Vl,ru,t,Tn,Nr,Ss,er,C,"Throttled",-0,0),m);break e}Sp(a,i,gn,Vl,ru,t,Tn,Nr,Ss,er,C,null,-0,0)}}break}while(!0);fi(e)}function Sp(e,t,i,a,m,C,O,F,X,oe,de,_e,ce,ue){if(e.timeoutHandle=-1,_e=t.subtreeFlags,_e&8192||(_e&16785408)===16785408){_e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Vt},fp(t,C,_e);var Ee=(C&62914560)===C?$l-tt():(C&4194048)===C?gp-tt():0;if(Ee=S0(_e,Ee),Ee!==null){ji=C,e.cancelPendingCommit=Ee(Tp.bind(null,e,t,C,i,a,m,O,F,X,de,_e,null,ce,ue)),rr(e,C,O,!oe);return}}Tp(e,t,C,i,a,m,O,F,X)}function Ny(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 a=0;a<i.length;a++){var m=i[a],C=m.getSnapshot;m=m.value;try{if(!wn(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 rr(e,t,i,a){t&=~iu,t&=~Nr,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var m=t;0<m;){var C=31-Ze(m),O=1<<C;a[C]=-1,m&=~O}i!==0&&Ui(e,i,t)}function Wl(){return(et&6)===0?(xa(0),!1):!0}function ou(){if($e!==null){if(nt===0)var e=$e.return;else e=$e,xi=Ar=null,xc(e),fs=null,aa=0,e=$e;for(;e!==null;)Qd(e.alternate,e),e=e.return;$e=null}}function Cs(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,n0(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),ji=0,ou(),lt=e,$e=i=Ci(e.current,null),We=t,nt=0,An=null,er=!1,ys=Wn(e,t),nu=!1,Ss=Tn=iu=Nr=tr=vt=0,gn=Ca=null,ru=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var m=31-Ze(a),C=1<<m;t|=e[m],a&=~C}return Bi=t,pl(),i}function bp(e,t){He=null,G.H=pa,t===hs||t===Cl?(t=Hf(),nt=3):t===fc?(t=Hf(),nt=4):nt=t===Uc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,An=t,$e===null&&(vt=1,Nl(e,In(t,e.current)))}function Cp(){var e=En.current;return e===null?!0:(We&4194048)===We?qn===null:(We&62914560)===We||(We&536870912)!==0?e===qn:!1}function wp(){var e=G.H;return G.H=pa,e===null?pa:e}function xp(){var e=G.A;return G.A=By,e}function Kl(){vt=4,er||(We&4194048)!==We&&En.current!==null||(ys=!0),(tr&134217727)===0&&(Nr&134217727)===0||lt===null||rr(lt,We,Tn,!1)}function cu(e,t,i){var a=et;et|=2;var m=wp(),C=xp();(lt!==e||We!==t)&&(Vl=null,Cs(e,t)),t=!1;var O=vt;e:do try{if(nt!==0&&$e!==null){var F=$e,X=An;switch(nt){case 8:ou(),O=6;break e;case 3:case 2:case 9:case 6:En.current===null&&(t=!0);var oe=nt;if(nt=0,An=null,ws(e,F,X,oe),i&&ys){O=0;break e}break;default:oe=nt,nt=0,An=null,ws(e,F,X,oe)}}Hy(),O=vt;break}catch(de){bp(e,de)}while(!0);return t&&e.shellSuspendCounter++,xi=Ar=null,et=a,G.H=m,G.A=C,$e===null&&(lt=null,We=0,pl()),O}function Hy(){for(;$e!==null;)Ep($e)}function zy(e,t){var i=et;et|=2;var a=wp(),m=xp();lt!==e||We!==t?(Vl=null,Gl=tt()+500,Cs(e,t)):ys=Wn(e,t);e:do try{if(nt!==0&&$e!==null){t=$e;var C=An;t:switch(nt){case 1:nt=0,An=null,ws(e,t,C,1);break;case 2:case 9:if(jf(C)){nt=0,An=null,kp(t);break}t=function(){nt!==2&&nt!==9||lt!==e||(nt=7),fi(e)},C.then(t,t);break e;case 3:nt=7;break e;case 4:nt=5;break e;case 7:jf(C)?(nt=0,An=null,kp(t)):(nt=0,An=null,ws(e,t,C,7));break;case 5:var O=null;switch($e.tag){case 26:O=$e.memoizedState;case 5:case 27:var F=$e;if(O?hm(O):F.stateNode.complete){nt=0,An=null;var X=F.sibling;if(X!==null)$e=X;else{var oe=F.return;oe!==null?($e=oe,Yl(oe)):$e=null}break t}}nt=0,An=null,ws(e,t,C,5);break;case 6:nt=0,An=null,ws(e,t,C,6);break;case 8:ou(),vt=6;break e;default:throw Error(l(462))}}Iy();break}catch(de){bp(e,de)}while(!0);return xi=Ar=null,G.H=a,G.A=m,et=i,$e!==null?0:(lt=null,We=0,pl(),vt)}function Iy(){for(;$e!==null&&!Sn();)Ep($e)}function Ep(e){var t=Yd(e.alternate,e,Bi);e.memoizedProps=e.pendingProps,t===null?Yl(e):$e=t}function kp(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=qd(i,t,t.pendingProps,t.type,void 0,We);break;case 11:t=qd(i,t,t.pendingProps,t.type.render,t.ref,We);break;case 5:xc(t);default:Qd(i,t),t=$e=xf(t,Bi),t=Yd(i,t,Bi)}e.memoizedProps=e.pendingProps,t===null?Yl(e):$e=t}function ws(e,t,i,a){xi=Ar=null,xc(t),fs=null,aa=0;var m=t.return;try{if(Ay(e,m,t,i,We)){vt=1,Nl(e,In(i,e.current)),$e=null;return}}catch(C){if(m!==null)throw $e=m,C;vt=1,Nl(e,In(i,e.current)),$e=null;return}t.flags&32768?(Ye||a===1?e=!0:ys||(We&536870912)!==0?e=!1:(er=e=!0,(a===2||a===9||a===3||a===6)&&(a=En.current,a!==null&&a.tag===13&&(a.flags|=16384))),Ap(t,e)):Yl(t)}function Yl(e){var t=e;do{if((t.flags&32768)!==0){Ap(t,er);return}e=t.return;var i=Dy(t.alternate,t,Bi);if(i!==null){$e=i;return}if(t=t.sibling,t!==null){$e=t;return}$e=t=e}while(t!==null);vt===0&&(vt=5)}function Ap(e,t){do{var i=My(e.alternate,e);if(i!==null){i.flags&=32767,$e=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){$e=e;return}$e=e=i}while(e!==null);vt=6,$e=null}function Tp(e,t,i,a,m,C,O,F,X){e.cancelPendingCommit=null;do Xl();while(jt!==0);if((et&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(C=t.lanes|t.childLanes,C|=Qo,an(e,i,C,O,F,X),e===lt&&($e=lt=null,We=0),bs=t,ir=e,ji=i,su=C,au=m,_p=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,qy(Ae,function(){return Op(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=G.T,G.T=null,m=W.p,W.p=2,O=et,et|=4;try{Ly(e,t,i)}finally{et=O,W.p=m,G.T=a}}jt=1,Rp(),Dp(),Mp()}}function Rp(){if(jt===1){jt=0;var e=ir,t=bs,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=G.T,G.T=null;var a=W.p;W.p=2;var m=et;et|=4;try{cp(t,e);var C=bu,O=mf(e.containerInfo),F=C.focusedElem,X=C.selectionRange;if(O!==F&&F&&F.ownerDocument&&pf(F.ownerDocument.documentElement,F)){if(X!==null&&Vo(F)){var oe=X.start,de=X.end;if(de===void 0&&(de=oe),"selectionStart"in F)F.selectionStart=oe,F.selectionEnd=Math.min(de,F.value.length);else{var _e=F.ownerDocument||document,ce=_e&&_e.defaultView||window;if(ce.getSelection){var ue=ce.getSelection(),Ee=F.textContent.length,Me=Math.min(X.start,Ee),at=X.end===void 0?Me:Math.min(X.end,Ee);!ue.extend&&Me>at&&(O=at,at=Me,Me=O);var ne=df(F,Me),J=df(F,at);if(ne&&J&&(ue.rangeCount!==1||ue.anchorNode!==ne.node||ue.anchorOffset!==ne.offset||ue.focusNode!==J.node||ue.focusOffset!==J.offset)){var le=_e.createRange();le.setStart(ne.node,ne.offset),ue.removeAllRanges(),Me>at?(ue.addRange(le),ue.extend(J.node,J.offset)):(le.setEnd(J.node,J.offset),ue.addRange(le))}}}}for(_e=[],ue=F;ue=ue.parentNode;)ue.nodeType===1&&_e.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof F.focus=="function"&&F.focus(),F=0;F<_e.length;F++){var ge=_e[F];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}oo=!!Su,bu=Su=null}finally{et=m,W.p=a,G.T=i}}e.current=t,jt=2}}function Dp(){if(jt===2){jt=0;var e=ir,t=bs,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=G.T,G.T=null;var a=W.p;W.p=2;var m=et;et|=4;try{rp(e,t.alternate,t)}finally{et=m,W.p=a,G.T=i}}jt=3}}function Mp(){if(jt===4||jt===3){jt=0,St();var e=ir,t=bs,i=ji,a=_p;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?jt=5:(jt=0,bs=ir=null,Lp(e,e.pendingLanes));var m=e.pendingLanes;if(m===0&&(nr=null),Us(i),t=t.stateNode,mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(gt,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=G.T,m=W.p,W.p=2,G.T=null;try{for(var C=e.onRecoverableError,O=0;O<a.length;O++){var F=a[O];C(F.value,{componentStack:F.stack})}}finally{G.T=t,W.p=m}}(ji&3)!==0&&Xl(),fi(e),m=e.pendingLanes,(i&261930)!==0&&(m&42)!==0?e===lu?wa++:(wa=0,lu=e):wa=0,xa(0)}}function Lp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ra(t)))}function Xl(){return Rp(),Dp(),Mp(),Op()}function Op(){if(jt!==5)return!1;var e=ir,t=su;su=0;var i=Us(ji),a=G.T,m=W.p;try{W.p=32>i?32:i,G.T=null,i=au,au=null;var C=ir,O=ji;if(jt=0,bs=ir=null,ji=0,(et&6)!==0)throw Error(l(331));var F=et;if(et|=4,pp(C.current),hp(C,C.current,O,i),et=F,xa(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(gt,C)}catch{}return!0}finally{W.p=m,G.T=a,Lp(e,t)}}function Bp(e,t,i){t=In(i,t),t=Ic(e.stateNode,t,2),e=Xi(e,t,2),e!==null&&(sn(e,2),fi(e))}function it(e,t,i){if(e.tag===3)Bp(e,e,i);else for(;t!==null;){if(t.tag===3){Bp(t,e,i);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(nr===null||!nr.has(a))){e=In(i,e),i=jd(2),a=Xi(t,i,2),a!==null&&(Nd(i,a,t,e),sn(a,2),fi(a));break}}t=t.return}}function uu(e,t,i){var a=e.pingCache;if(a===null){a=e.pingCache=new jy;var m=new Set;a.set(t,m)}else m=a.get(t),m===void 0&&(m=new Set,a.set(t,m));m.has(i)||(nu=!0,m.add(i),e=Uy.bind(null,e,t,i),t.then(e,e))}function Uy(e,t,i){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,lt===e&&(We&i)===i&&(vt===4||vt===3&&(We&62914560)===We&&300>tt()-$l?(et&2)===0&&Cs(e,0):iu|=i,Ss===We&&(Ss=0)),fi(e)}function jp(e,t){t===0&&(t=rn()),e=xr(e,t),e!==null&&(sn(e,t),fi(e))}function Py(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),jp(e,i)}function Fy(e,t){var i=0;switch(e.tag){case 31:case 13:var a=e.stateNode,m=e.memoizedState;m!==null&&(i=m.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(l(314))}a!==null&&a.delete(t),jp(e,i)}function qy(e,t){return Nt(e,t)}var Ql=null,xs=null,hu=!1,Jl=!1,fu=!1,sr=0;function fi(e){e!==xs&&e.next===null&&(xs===null?Ql=xs=e:xs=xs.next=e),Jl=!0,hu||(hu=!0,Gy())}function xa(e,t){if(!fu&&Jl){fu=!0;do for(var i=!1,a=Ql;a!==null;){if(e!==0){var m=a.pendingLanes;if(m===0)var C=0;else{var O=a.suspendedLanes,F=a.pingedLanes;C=(1<<31-Ze(42|e)+1)-1,C&=m&~(O&~F),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(i=!0,Ip(a,C))}else C=We,C=Bn(a,a===lt?C:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(C&3)===0||Wn(a,C)||(i=!0,Ip(a,C));a=a.next}while(i);fu=!1}}function $y(){Np()}function Np(){Jl=hu=!1;var e=0;sr!==0&&t0()&&(e=sr);for(var t=tt(),i=null,a=Ql;a!==null;){var m=a.next,C=Hp(a,t);C===0?(a.next=null,i===null?Ql=m:i.next=m,m===null&&(xs=i)):(i=a,(e!==0||(C&3)!==0)&&(Jl=!0)),a=m}jt!==0&&jt!==5||xa(e),sr!==0&&(sr=0)}function Hp(e,t){for(var i=e.suspendedLanes,a=e.pingedLanes,m=e.expirationTimes,C=e.pendingLanes&-62914561;0<C;){var O=31-Ze(C),F=1<<O,X=m[O];X===-1?((F&i)===0||(F&a)!==0)&&(m[O]=si(F,t)):X<=t&&(e.expiredLanes|=F),C&=~F}if(t=lt,i=We,i=Bn(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,i===0||e===t&&(nt===2||nt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Gt(a),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Wn(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(a!==null&&Gt(a),Us(i)){case 2:case 8:i=Se;break;case 32:i=Ae;break;case 268435456:i=Oe;break;default:i=Ae}return a=zp.bind(null,e),i=Nt(i,a),e.callbackPriority=t,e.callbackNode=i,t}return a!==null&&a!==null&&Gt(a),e.callbackPriority=2,e.callbackNode=null,2}function zp(e,t){if(jt!==0&&jt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Xl()&&e.callbackNode!==i)return null;var a=We;return a=Bn(e,e===lt?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(yp(e,a,t),Hp(e,tt()),e.callbackNode!=null&&e.callbackNode===i?zp.bind(null,e):null)}function Ip(e,t){if(Xl())return null;yp(e,t,!0)}function Gy(){i0(function(){(et&6)!==0?Nt(he,$y):Np()})}function du(){if(sr===0){var e=cs;e===0&&(e=Ln,Ln<<=1,(Ln&261888)===0&&(Ln=256)),sr=e}return sr}function Up(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:vr(""+e)}function Pp(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 Vy(e,t,i,a,m){if(t==="submit"&&i&&i.stateNode===m){var C=Up((m[It]||null).action),O=a.submitter;O&&(t=(t=O[It]||null)?Up(t.formAction):O.getAttribute("formAction"),t!==null&&(C=t,O=null));var F=new Jr("action","action",null,a,m);e.push({event:F,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(sr!==0){var X=O?Pp(m,O):new FormData(m);Oc(i,{pending:!0,data:X,method:m.method,action:C},null,X)}}else typeof C=="function"&&(F.preventDefault(),X=O?Pp(m,O):new FormData(m),Oc(i,{pending:!0,data:X,method:m.method,action:C},C,X))},currentTarget:m}]})}}for(var pu=0;pu<Xo.length;pu++){var mu=Xo[pu],Wy=mu.toLowerCase(),Ky=mu[0].toUpperCase()+mu.slice(1);Zn(Wy,"on"+Ky)}Zn(vf,"onAnimationEnd"),Zn(yf,"onAnimationIteration"),Zn(Sf,"onAnimationStart"),Zn("dblclick","onDoubleClick"),Zn("focusin","onFocus"),Zn("focusout","onBlur"),Zn(uy,"onTransitionRun"),Zn(hy,"onTransitionStart"),Zn(fy,"onTransitionCancel"),Zn(bf,"onTransitionEnd"),ie("onMouseEnter",["mouseout","mouseover"]),ie("onMouseLeave",["mouseout","mouseover"]),ie("onPointerEnter",["pointerout","pointerover"]),ie("onPointerLeave",["pointerout","pointerover"]),Qn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Qn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Qn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Qn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Qn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Qn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ea="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(" "),Yy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ea));function Fp(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var a=e[i],m=a.event;a=a.listeners;e:{var C=void 0;if(t)for(var O=a.length-1;0<=O;O--){var F=a[O],X=F.instance,oe=F.currentTarget;if(F=F.listener,X!==C&&m.isPropagationStopped())break e;C=F,m.currentTarget=oe;try{C(m)}catch(de){dl(de)}m.currentTarget=null,C=X}else for(O=0;O<a.length;O++){if(F=a[O],X=F.instance,oe=F.currentTarget,F=F.listener,X!==C&&m.isPropagationStopped())break e;C=F,m.currentTarget=oe;try{C(m)}catch(de){dl(de)}m.currentTarget=null,C=X}}}}function Ge(e,t){var i=t[Ps];i===void 0&&(i=t[Ps]=new Set);var a=e+"__bubble";i.has(a)||(qp(t,e,2,!1),i.add(a))}function gu(e,t,i){var a=0;t&&(a|=4),qp(i,e,a,t)}var Zl="_reactListening"+Math.random().toString(36).slice(2);function _u(e){if(!e[Zl]){e[Zl]=!0,Fs.forEach(function(i){i!=="selectionchange"&&(Yy.has(i)||gu(i,!1,e),gu(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Zl]||(t[Zl]=!0,gu("selectionchange",!1,t))}}function qp(e,t,i,a){switch(vm(t)){case 2:var m=w0;break;case 8:m=x0;break;default:m=Lu}i=m.bind(null,t,i,e),m=void 0,!yr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(m=!0),a?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 vu(e,t,i,a,m){var C=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var O=a.tag;if(O===3||O===4){var F=a.stateNode.containerInfo;if(F===m)break;if(O===4)for(O=a.return;O!==null;){var X=O.tag;if((X===3||X===4)&&O.stateNode.containerInfo===m)return;O=O.return}for(;F!==null;){if(O=ln(F),O===null)return;if(X=O.tag,X===5||X===6||X===26||X===27){a=C=O;continue e}F=F.parentNode}}a=a.return}hn(function(){var oe=C,de=oi(i),_e=[];e:{var ce=Cf.get(e);if(ce!==void 0){var ue=Jr,Ee=e;switch(e){case"keypress":if(Xr(i)===0)break e;case"keydown":case"keyup":ue=Fv;break;case"focusin":Ee="focus",ue=Po;break;case"focusout":Ee="blur",ue=Po;break;case"beforeblur":case"afterblur":ue=Po;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":ue=hl;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=Dv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=Gv;break;case vf:case yf:case Sf:ue=Ov;break;case bf:ue=Wv;break;case"scroll":case"scrollend":ue=fe;break;case"wheel":ue=Yv;break;case"copy":case"cut":case"paste":ue=jv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=Jh;break;case"toggle":case"beforetoggle":ue=Qv}var Me=(t&4)!==0,at=!Me&&(e==="scroll"||e==="scrollend"),ne=Me?ce!==null?ce+"Capture":null:ce;Me=[];for(var J=oe,le;J!==null;){var ge=J;if(le=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||le===null||ne===null||(ge=bi(J,ne),ge!=null&&Me.push(ka(J,ge,le))),at)break;J=J.return}0<Me.length&&(ce=new ue(ce,Ee,null,i,de),_e.push({event:ce,listeners:Me}))}}if((t&7)===0){e:{if(ce=e==="mouseover"||e==="pointerover",ue=e==="mouseout"||e==="pointerout",ce&&i!==Kr&&(Ee=i.relatedTarget||i.fromElement)&&(ln(Ee)||Ee[Yn]))break e;if((ue||ce)&&(ce=de.window===de?de:(ce=de.ownerDocument)?ce.defaultView||ce.parentWindow:window,ue?(Ee=i.relatedTarget||i.toElement,ue=oe,Ee=Ee?ln(Ee):null,Ee!==null&&(at=p(Ee),Me=Ee.tag,Ee!==at||Me!==5&&Me!==27&&Me!==6)&&(Ee=null)):(ue=null,Ee=oe),ue!==Ee)){if(Me=hl,ge="onMouseLeave",ne="onMouseEnter",J="mouse",(e==="pointerout"||e==="pointerover")&&(Me=Jh,ge="onPointerLeave",ne="onPointerEnter",J="pointer"),at=ue==null?ce:gi(ue),le=Ee==null?ce:gi(Ee),ce=new Me(ge,J+"leave",ue,i,de),ce.target=at,ce.relatedTarget=le,ge=null,ln(de)===oe&&(Me=new Me(ne,J+"enter",Ee,i,de),Me.target=le,Me.relatedTarget=at,ge=Me),at=ge,ue&&Ee)t:{for(Me=Xy,ne=ue,J=Ee,le=0,ge=ne;ge;ge=Me(ge))le++;ge=0;for(var Re=J;Re;Re=Me(Re))ge++;for(;0<le-ge;)ne=Me(ne),le--;for(;0<ge-le;)J=Me(J),ge--;for(;le--;){if(ne===J||J!==null&&ne===J.alternate){Me=ne;break t}ne=Me(ne),J=Me(J)}Me=null}else Me=null;ue!==null&&$p(_e,ce,ue,Me,!1),Ee!==null&&at!==null&&$p(_e,at,Ee,Me,!0)}}e:{if(ce=oe?gi(oe):window,ue=ce.nodeName&&ce.nodeName.toLowerCase(),ue==="select"||ue==="input"&&ce.type==="file")var Qe=lf;else if(sf(ce))if(of)Qe=ly;else{Qe=sy;var Te=ry}else ue=ce.nodeName,!ue||ue.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?oe&&Wr(oe.elementType)&&(Qe=lf):Qe=ay;if(Qe&&(Qe=Qe(e,oe))){af(_e,Qe,i,de);break e}Te&&Te(e,ce,oe),e==="focusout"&&oe&&ce.type==="number"&&oe.memoizedProps.value!=null&&Vs(ce,"number",ce.value)}switch(Te=oe?gi(oe):window,e){case"focusin":(sf(Te)||Te.contentEditable==="true")&&(ts=Te,Wo=oe,ta=null);break;case"focusout":ta=Wo=ts=null;break;case"mousedown":Ko=!0;break;case"contextmenu":case"mouseup":case"dragend":Ko=!1,gf(_e,i,de);break;case"selectionchange":if(cy)break;case"keydown":case"keyup":gf(_e,i,de)}var Ie;if(qo)e:{switch(e){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else es?nf(e,i)&&(Ke="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ke="onCompositionStart");Ke&&(Zh&&i.locale!=="ko"&&(es||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&es&&(Ie=ul()):(ke=de,Xs="value"in ke?ke.value:ke.textContent,es=!0)),Te=eo(oe,Ke),0<Te.length&&(Ke=new Qh(Ke,e,null,i,de),_e.push({event:Ke,listeners:Te}),Ie?Ke.data=Ie:(Ie=rf(i),Ie!==null&&(Ke.data=Ie)))),(Ie=Zv?ey(e,i):ty(e,i))&&(Ke=eo(oe,"onBeforeInput"),0<Ke.length&&(Te=new Qh("onBeforeInput","beforeinput",null,i,de),_e.push({event:Te,listeners:Ke}),Te.data=Ie)),Vy(_e,e,oe,i,de)}Fp(_e,t)})}function ka(e,t,i){return{instance:e,listener:t,currentTarget:i}}function eo(e,t){for(var i=t+"Capture",a=[];e!==null;){var m=e,C=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||C===null||(m=bi(e,i),m!=null&&a.unshift(ka(e,m,C)),m=bi(e,t),m!=null&&a.push(ka(e,m,C))),e.tag===3)return a;e=e.return}return[]}function Xy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function $p(e,t,i,a,m){for(var C=t._reactName,O=[];i!==null&&i!==a;){var F=i,X=F.alternate,oe=F.stateNode;if(F=F.tag,X!==null&&X===a)break;F!==5&&F!==26&&F!==27||oe===null||(X=oe,m?(oe=bi(i,C),oe!=null&&O.unshift(ka(i,oe,X))):m||(oe=bi(i,C),oe!=null&&O.push(ka(i,oe,X)))),i=i.return}O.length!==0&&e.push({event:t,listeners:O})}var Qy=/\r\n?/g,Jy=/\u0000|\uFFFD/g;function Gp(e){return(typeof e=="string"?e:""+e).replace(Qy,`
|
|
49
|
+
`).replace(Jy,"")}function Vp(e,t){return t=Gp(t),Gp(e)===t}function st(e,t,i,a,m,C){switch(i){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||li(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&li(e,""+a);break;case"className":vi(e,"class",a);break;case"tabIndex":vi(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":vi(e,i,a);break;case"style":ll(e,a,C);break;case"data":if(t!=="object"){vi(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(i);break}a=vr(""+a),e.setAttribute(i,a);break;case"action":case"formAction":if(typeof a=="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"&&st(e,t,"name",m.name,m,null),st(e,t,"formEncType",m.formEncType,m,null),st(e,t,"formMethod",m.formMethod,m,null),st(e,t,"formTarget",m.formTarget,m,null)):(st(e,t,"encType",m.encType,m,null),st(e,t,"method",m.method,m,null),st(e,t,"target",m.target,m,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(i);break}a=vr(""+a),e.setAttribute(i,a);break;case"onClick":a!=null&&(e.onclick=Vt);break;case"onScroll":a!=null&&Ge("scroll",e);break;case"onScrollEnd":a!=null&&Ge("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(l(61));if(i=a.__html,i!=null){if(m.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}i=vr(""+a),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":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(i,""+a):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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":a===!0?e.setAttribute(i,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(i,a):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(i,a):e.removeAttribute(i);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(i):e.setAttribute(i,a);break;case"popover":Ge("beforetoggle",e),Ge("toggle",e),Vr(e,"popover",a);break;case"xlinkActuate":Hn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Hn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Hn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Hn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Hn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Hn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Hn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Hn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Hn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Vr(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=Ks.get(i)||i,Vr(e,i,a))}}function yu(e,t,i,a,m,C){switch(i){case"style":ll(e,a,C);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(l(61));if(i=a.__html,i!=null){if(m.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"children":typeof a=="string"?li(e,a):(typeof a=="number"||typeof a=="bigint")&&li(e,""+a);break;case"onScroll":a!=null&&Ge("scroll",e);break;case"onScrollEnd":a!=null&&Ge("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Vt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Xn.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[It]||null,C=C!=null?C[i]:null,typeof C=="function"&&e.removeEventListener(t,C,m),typeof a=="function")){typeof C!="function"&&C!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,a,m);break e}i in e?e[i]=a:a===!0?e.setAttribute(i,""):Vr(e,i,a)}}}function $t(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 a=!1,m=!1,C;for(C in i)if(i.hasOwnProperty(C)){var O=i[C];if(O!=null)switch(C){case"src":a=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:st(e,t,C,O,i,null)}}m&&st(e,t,"srcSet",i.srcSet,i,null),a&&st(e,t,"src",i.src,i,null);return;case"input":Ge("invalid",e);var F=C=O=m=null,X=null,oe=null;for(a in i)if(i.hasOwnProperty(a)){var de=i[a];if(de!=null)switch(a){case"name":m=de;break;case"type":O=de;break;case"checked":X=de;break;case"defaultChecked":oe=de;break;case"value":C=de;break;case"defaultValue":F=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(l(137,t));break;default:st(e,t,a,de,i,null)}}sl(e,C,F,X,oe,O,m,!1);return;case"select":Ge("invalid",e),a=O=C=null;for(m in i)if(i.hasOwnProperty(m)&&(F=i[m],F!=null))switch(m){case"value":C=F;break;case"defaultValue":O=F;break;case"multiple":a=F;default:st(e,t,m,F,i,null)}t=C,i=O,e.multiple=!!a,t!=null?Fi(e,!!a,t,!1):i!=null&&Fi(e,!!a,i,!0);return;case"textarea":Ge("invalid",e),C=m=a=null;for(O in i)if(i.hasOwnProperty(O)&&(F=i[O],F!=null))switch(O){case"value":a=F;break;case"defaultValue":m=F;break;case"children":C=F;break;case"dangerouslySetInnerHTML":if(F!=null)throw Error(l(91));break;default:st(e,t,O,F,i,null)}yi(e,a,m,C);return;case"option":for(X in i)if(i.hasOwnProperty(X)&&(a=i[X],a!=null))switch(X){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:st(e,t,X,a,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(a=0;a<Ea.length;a++)Ge(Ea[a],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(oe in i)if(i.hasOwnProperty(oe)&&(a=i[oe],a!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:st(e,t,oe,a,i,null)}return;default:if(Wr(t)){for(de in i)i.hasOwnProperty(de)&&(a=i[de],a!==void 0&&yu(e,t,de,a,i,void 0));return}}for(F in i)i.hasOwnProperty(F)&&(a=i[F],a!=null&&st(e,t,F,a,i,null))}function Zy(e,t,i,a){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,O=null,F=null,X=null,oe=null,de=null;for(ue in i){var _e=i[ue];if(i.hasOwnProperty(ue)&&_e!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":X=_e;default:a.hasOwnProperty(ue)||st(e,t,ue,null,a,_e)}}for(var ce in a){var ue=a[ce];if(_e=i[ce],a.hasOwnProperty(ce)&&(ue!=null||_e!=null))switch(ce){case"type":C=ue;break;case"name":m=ue;break;case"checked":oe=ue;break;case"defaultChecked":de=ue;break;case"value":O=ue;break;case"defaultValue":F=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(l(137,t));break;default:ue!==_e&&st(e,t,ce,ue,a,_e)}}Gs(e,O,F,X,oe,de,C,m);return;case"select":ue=O=F=ce=null;for(C in i)if(X=i[C],i.hasOwnProperty(C)&&X!=null)switch(C){case"value":break;case"multiple":ue=X;default:a.hasOwnProperty(C)||st(e,t,C,null,a,X)}for(m in a)if(C=a[m],X=i[m],a.hasOwnProperty(m)&&(C!=null||X!=null))switch(m){case"value":ce=C;break;case"defaultValue":F=C;break;case"multiple":O=C;default:C!==X&&st(e,t,m,C,a,X)}t=F,i=O,a=ue,ce!=null?Fi(e,!!i,ce,!1):!!a!=!!i&&(t!=null?Fi(e,!!i,t,!0):Fi(e,!!i,i?[]:"",!1));return;case"textarea":ue=ce=null;for(F in i)if(m=i[F],i.hasOwnProperty(F)&&m!=null&&!a.hasOwnProperty(F))switch(F){case"value":break;case"children":break;default:st(e,t,F,null,a,m)}for(O in a)if(m=a[O],C=i[O],a.hasOwnProperty(O)&&(m!=null||C!=null))switch(O){case"value":ce=m;break;case"defaultValue":ue=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(l(91));break;default:m!==C&&st(e,t,O,m,a,C)}al(e,ce,ue);return;case"option":for(var Ee in i)if(ce=i[Ee],i.hasOwnProperty(Ee)&&ce!=null&&!a.hasOwnProperty(Ee))switch(Ee){case"selected":e.selected=!1;break;default:st(e,t,Ee,null,a,ce)}for(X in a)if(ce=a[X],ue=i[X],a.hasOwnProperty(X)&&ce!==ue&&(ce!=null||ue!=null))switch(X){case"selected":e.selected=ce&&typeof ce!="function"&&typeof ce!="symbol";break;default:st(e,t,X,ce,a,ue)}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 Me in i)ce=i[Me],i.hasOwnProperty(Me)&&ce!=null&&!a.hasOwnProperty(Me)&&st(e,t,Me,null,a,ce);for(oe in a)if(ce=a[oe],ue=i[oe],a.hasOwnProperty(oe)&&ce!==ue&&(ce!=null||ue!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(l(137,t));break;default:st(e,t,oe,ce,a,ue)}return;default:if(Wr(t)){for(var at in i)ce=i[at],i.hasOwnProperty(at)&&ce!==void 0&&!a.hasOwnProperty(at)&&yu(e,t,at,void 0,a,ce);for(de in a)ce=a[de],ue=i[de],!a.hasOwnProperty(de)||ce===ue||ce===void 0&&ue===void 0||yu(e,t,de,ce,a,ue);return}}for(var ne in i)ce=i[ne],i.hasOwnProperty(ne)&&ce!=null&&!a.hasOwnProperty(ne)&&st(e,t,ne,null,a,ce);for(_e in a)ce=a[_e],ue=i[_e],!a.hasOwnProperty(_e)||ce===ue||ce==null&&ue==null||st(e,t,_e,ce,a,ue)}function Wp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function e0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),a=0;a<i.length;a++){var m=i[a],C=m.transferSize,O=m.initiatorType,F=m.duration;if(C&&F&&Wp(O)){for(O=0,F=m.responseEnd,a+=1;a<i.length;a++){var X=i[a],oe=X.startTime;if(oe>F)break;var de=X.transferSize,_e=X.initiatorType;de&&Wp(_e)&&(X=X.responseEnd,O+=de*(X<F?1:(F-oe)/(X-oe)))}if(--a,t+=8*(C+O)/(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 Su=null,bu=null;function to(e){return e.nodeType===9?e:e.ownerDocument}function Kp(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 Yp(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 Cu(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 wu=null;function t0(){var e=window.event;return e&&e.type==="popstate"?e===wu?!1:(wu=e,!0):(wu=null,!1)}var Xp=typeof setTimeout=="function"?setTimeout:void 0,n0=typeof clearTimeout=="function"?clearTimeout:void 0,Qp=typeof Promise=="function"?Promise:void 0,i0=typeof queueMicrotask=="function"?queueMicrotask:typeof Qp<"u"?function(e){return Qp.resolve(null).then(e).catch(r0)}:Xp;function r0(e){setTimeout(function(){throw e})}function ar(e){return e==="head"}function Jp(e,t){var i=t,a=0;do{var m=i.nextSibling;if(e.removeChild(i),m&&m.nodeType===8)if(i=m.data,i==="/$"||i==="/&"){if(a===0){e.removeChild(m),Ts(t);return}a--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")a++;else if(i==="html")Aa(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Aa(i);for(var C=i.firstChild;C;){var O=C.nextSibling,F=C.nodeName;C[Nn]||F==="SCRIPT"||F==="STYLE"||F==="LINK"&&C.rel.toLowerCase()==="stylesheet"||i.removeChild(C),C=O}}else i==="body"&&Aa(e.ownerDocument.body);i=m}while(i);Ts(t)}function Zp(e,t){var i=e;e=0;do{var a=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||""),a&&a.nodeType===8)if(i=a.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=a}while(i)}function xu(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":xu(i),$r(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function s0(e,t,i,a){for(;e.nodeType===1;){var m=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[Nn])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=$n(e.nextSibling),e===null)break}return null}function a0(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=$n(e.nextSibling),e===null))return null;return e}function em(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=$n(e.nextSibling),e===null))return null;return e}function Eu(e){return e.data==="$?"||e.data==="$~"}function ku(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function l0(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var a=function(){t(),i.removeEventListener("DOMContentLoaded",a)};i.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function $n(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 Au=null;function tm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return $n(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function nm(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 im(e,t,i){switch(t=to(i),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function Aa(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);$r(e)}var Gn=new Map,rm=new Set;function no(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ni=W.d;W.d={f:o0,r:c0,D:u0,C:h0,L:f0,m:d0,X:m0,S:p0,M:g0};function o0(){var e=Ni.f(),t=Wl();return e||t}function c0(e){var t=mi(e);t!==null&&t.tag===5&&t.type==="form"?bd(t):Ni.r(e)}var Es=typeof document>"u"?null:document;function sm(e,t,i){var a=Es;if(a&&typeof t=="string"&&t){var m=un(t);m='link[rel="'+e+'"][href="'+m+'"]',typeof i=="string"&&(m+='[crossorigin="'+i+'"]'),rm.has(m)||(rm.add(m),e={rel:e,crossOrigin:i,href:t},a.querySelector(m)===null&&(t=a.createElement("link"),$t(t,"link",e),bt(t),a.head.appendChild(t)))}}function u0(e){Ni.D(e),sm("dns-prefetch",e,null)}function h0(e,t){Ni.C(e,t),sm("preconnect",e,t)}function f0(e,t,i){Ni.L(e,t,i);var a=Es;if(a&&e&&t){var m='link[rel="preload"][as="'+un(t)+'"]';t==="image"&&i&&i.imageSrcSet?(m+='[imagesrcset="'+un(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(m+='[imagesizes="'+un(i.imageSizes)+'"]')):m+='[href="'+un(e)+'"]';var C=m;switch(t){case"style":C=ks(e);break;case"script":C=As(e)}Gn.has(C)||(e=u({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Gn.set(C,e),a.querySelector(m)!==null||t==="style"&&a.querySelector(Ta(C))||t==="script"&&a.querySelector(Ra(C))||(t=a.createElement("link"),$t(t,"link",e),bt(t),a.head.appendChild(t)))}}function d0(e,t){Ni.m(e,t);var i=Es;if(i&&e){var a=t&&typeof t.as=="string"?t.as:"script",m='link[rel="modulepreload"][as="'+un(a)+'"][href="'+un(e)+'"]',C=m;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":C=As(e)}if(!Gn.has(C)&&(e=u({rel:"modulepreload",href:e},t),Gn.set(C,e),i.querySelector(m)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Ra(C)))return}a=i.createElement("link"),$t(a,"link",e),bt(a),i.head.appendChild(a)}}}function p0(e,t,i){Ni.S(e,t,i);var a=Es;if(a&&e){var m=_i(a).hoistableStyles,C=ks(e);t=t||"default";var O=m.get(C);if(!O){var F={loading:0,preload:null};if(O=a.querySelector(Ta(C)))F.loading=5;else{e=u({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Gn.get(C))&&Tu(e,i);var X=O=a.createElement("link");bt(X),$t(X,"link",e),X._p=new Promise(function(oe,de){X.onload=oe,X.onerror=de}),X.addEventListener("load",function(){F.loading|=1}),X.addEventListener("error",function(){F.loading|=2}),F.loading|=4,io(O,t,a)}O={type:"stylesheet",instance:O,count:1,state:F},m.set(C,O)}}}function m0(e,t){Ni.X(e,t);var i=Es;if(i&&e){var a=_i(i).hoistableScripts,m=As(e),C=a.get(m);C||(C=i.querySelector(Ra(m)),C||(e=u({src:e,async:!0},t),(t=Gn.get(m))&&Ru(e,t),C=i.createElement("script"),bt(C),$t(C,"link",e),i.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},a.set(m,C))}}function g0(e,t){Ni.M(e,t);var i=Es;if(i&&e){var a=_i(i).hoistableScripts,m=As(e),C=a.get(m);C||(C=i.querySelector(Ra(m)),C||(e=u({src:e,async:!0,type:"module"},t),(t=Gn.get(m))&&Ru(e,t),C=i.createElement("script"),bt(C),$t(C,"link",e),i.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},a.set(m,C))}}function am(e,t,i,a){var m=(m=me.current)?no(m):null;if(!m)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=ks(i.href),i=_i(m).hoistableStyles,a=i.get(t),a||(a={type:"style",instance:null,count:0,state:null},i.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=ks(i.href);var C=_i(m).hoistableStyles,O=C.get(e);if(O||(m=m.ownerDocument||m,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},C.set(e,O),(C=m.querySelector(Ta(e)))&&!C._p&&(O.instance=C,O.state.loading=5),Gn.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},Gn.set(e,i),C||_0(m,e,i,O.state))),t&&a===null)throw Error(l(528,""));return O}if(t&&a!==null)throw Error(l(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=As(i),i=_i(m).hoistableScripts,a=i.get(t),a||(a={type:"script",instance:null,count:0,state:null},i.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function ks(e){return'href="'+un(e)+'"'}function Ta(e){return'link[rel="stylesheet"]['+e+"]"}function lm(e){return u({},e,{"data-precedence":e.precedence,precedence:null})}function _0(e,t,i,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),$t(t,"link",i),bt(t),e.head.appendChild(t))}function As(e){return'[src="'+un(e)+'"]'}function Ra(e){return"script[async]"+e}function om(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+un(i.href)+'"]');if(a)return t.instance=a,bt(a),a;var m=u({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),bt(a),$t(a,"style",m),io(a,i.precedence,e),t.instance=a;case"stylesheet":m=ks(i.href);var C=e.querySelector(Ta(m));if(C)return t.state.loading|=4,t.instance=C,bt(C),C;a=lm(i),(m=Gn.get(m))&&Tu(a,m),C=(e.ownerDocument||e).createElement("link"),bt(C);var O=C;return O._p=new Promise(function(F,X){O.onload=F,O.onerror=X}),$t(C,"link",a),t.state.loading|=4,io(C,i.precedence,e),t.instance=C;case"script":return C=As(i.src),(m=e.querySelector(Ra(C)))?(t.instance=m,bt(m),m):(a=i,(m=Gn.get(C))&&(a=u({},i),Ru(a,m)),e=e.ownerDocument||e,m=e.createElement("script"),bt(m),$t(m,"link",a),e.head.appendChild(m),t.instance=m);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,io(a,i.precedence,e));return t.instance}function io(e,t,i){for(var a=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=a.length?a[a.length-1]:null,C=m,O=0;O<a.length;O++){var F=a[O];if(F.dataset.precedence===t)C=F;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 Tu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ru(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ro=null;function cm(e,t,i){if(ro===null){var a=new Map,m=ro=new Map;m.set(i,a)}else m=ro,a=m.get(i),a||(a=new Map,m.set(i,a));if(a.has(e))return a;for(a.set(e,null),i=i.getElementsByTagName(e),m=0;m<i.length;m++){var C=i[m];if(!(C[Nn]||C[kt]||e==="link"&&C.getAttribute("rel")==="stylesheet")&&C.namespaceURI!=="http://www.w3.org/2000/svg"){var O=C.getAttribute(t)||"";O=e+O;var F=a.get(O);F?F.push(C):a.set(O,[C])}}return a}function um(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function v0(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 hm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function y0(e,t,i,a){if(i.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var m=ks(a.href),C=t.querySelector(Ta(m));if(C){t=C._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=so.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=C,bt(C);return}C=t.ownerDocument||t,a=lm(a),(m=Gn.get(m))&&Tu(a,m),C=C.createElement("link"),bt(C);var O=C;O._p=new Promise(function(F,X){O.onload=F,O.onerror=X}),$t(C,"link",a),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=so.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Du=0;function S0(e,t){return e.stylesheets&&e.count===0&&lo(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var a=setTimeout(function(){if(e.stylesheets&&lo(e,e.stylesheets),e.unsuspend){var C=e.unsuspend;e.unsuspend=null,C()}},6e4+t);0<e.imgBytes&&Du===0&&(Du=62500*e0());var m=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&lo(e,e.stylesheets),e.unsuspend)){var C=e.unsuspend;e.unsuspend=null,C()}},(e.imgBytes>Du?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(m)}}:null}function so(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)lo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ao=null;function lo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ao=new Map,t.forEach(b0,e),ao=null,so.call(e))}function b0(e,t){if(!(t.state.loading&4)){var i=ao.get(e);if(i)var a=i.get(null);else{i=new Map,ao.set(e,i);for(var m=e.querySelectorAll("link[data-precedence],style[data-precedence]"),C=0;C<m.length;C++){var O=m[C];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(i.set(O.dataset.precedence,O),a=O)}a&&i.set(null,a)}m=t.instance,O=m.getAttribute("data-precedence"),C=i.get(O)||a,C===a&&i.set(null,m),i.set(O,m),this.count++,a=so.bind(this),m.addEventListener("load",a),m.addEventListener("error",a),C?C.parentNode.insertBefore(m,C.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(m,e.firstChild)),t.state.loading|=4}}var Da={$$typeof:b,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function C0(e,t,i,a,m,C,O,F,X){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=jn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jn(0),this.hiddenUpdates=jn(null),this.identifierPrefix=a,this.onUncaughtError=m,this.onCaughtError=C,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function fm(e,t,i,a,m,C,O,F,X,oe,de,_e){return e=new C0(e,t,i,O,X,oe,de,_e,F),t=1,C===!0&&(t|=24),C=xn(3,null,null,t),e.current=C,C.stateNode=e,t=cc(),t.refCount++,e.pooledCache=t,t.refCount++,C.memoizedState={element:a,isDehydrated:i,cache:t},dc(C),e}function dm(e){return e?(e=rs,e):rs}function pm(e,t,i,a,m,C){m=dm(m),a.context===null?a.context=m:a.pendingContext=m,a=Yi(t),a.payload={element:i},C=C===void 0?null:C,C!==null&&(a.callback=C),i=Xi(e,a,t),i!==null&&(_n(i,e,t),oa(i,e,t))}function mm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Mu(e,t){mm(e,t),(e=e.alternate)&&mm(e,t)}function gm(e){if(e.tag===13||e.tag===31){var t=xr(e,67108864);t!==null&&_n(t,e,67108864),Mu(e,67108864)}}function _m(e){if(e.tag===13||e.tag===31){var t=Rn();t=qr(t);var i=xr(e,t);i!==null&&_n(i,e,t),Mu(e,t)}}var oo=!0;function w0(e,t,i,a){var m=G.T;G.T=null;var C=W.p;try{W.p=2,Lu(e,t,i,a)}finally{W.p=C,G.T=m}}function x0(e,t,i,a){var m=G.T;G.T=null;var C=W.p;try{W.p=8,Lu(e,t,i,a)}finally{W.p=C,G.T=m}}function Lu(e,t,i,a){if(oo){var m=Ou(a);if(m===null)vu(e,t,a,co,i),ym(e,a);else if(k0(m,e,t,i,a))a.stopPropagation();else if(ym(e,a),t&4&&-1<E0.indexOf(e)){for(;m!==null;){var C=mi(m);if(C!==null)switch(C.tag){case 3:if(C=C.stateNode,C.current.memoizedState.isDehydrated){var O=Bt(C.pendingLanes);if(O!==0){var F=C;for(F.pendingLanes|=2,F.entangledLanes|=2;O;){var X=1<<31-Ze(O);F.entanglements[1]|=X,O&=~X}fi(C),(et&6)===0&&(Gl=tt()+500,xa(0))}}break;case 31:case 13:F=xr(C,2),F!==null&&_n(F,C,2),Wl(),Mu(C,2)}if(C=Ou(a),C===null&&vu(e,t,a,co,i),C===m)break;m=C}m!==null&&a.stopPropagation()}else vu(e,t,a,null,i)}}function Ou(e){return e=oi(e),Bu(e)}var co=null;function Bu(e){if(co=null,e=ln(e),e!==null){var t=p(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=o(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 co=e,null}function vm(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(Lt()){case he:return 2;case Se:return 8;case Ae:case Le:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var ju=!1,lr=null,or=null,cr=null,Ma=new Map,La=new Map,ur=[],E0="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 ym(e,t){switch(e){case"focusin":case"focusout":lr=null;break;case"dragenter":case"dragleave":or=null;break;case"mouseover":case"mouseout":cr=null;break;case"pointerover":case"pointerout":Ma.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":La.delete(t.pointerId)}}function Oa(e,t,i,a,m,C){return e===null||e.nativeEvent!==C?(e={blockedOn:t,domEventName:i,eventSystemFlags:a,nativeEvent:C,targetContainers:[m]},t!==null&&(t=mi(t),t!==null&&gm(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,m!==null&&t.indexOf(m)===-1&&t.push(m),e)}function k0(e,t,i,a,m){switch(t){case"focusin":return lr=Oa(lr,e,t,i,a,m),!0;case"dragenter":return or=Oa(or,e,t,i,a,m),!0;case"mouseover":return cr=Oa(cr,e,t,i,a,m),!0;case"pointerover":var C=m.pointerId;return Ma.set(C,Oa(Ma.get(C)||null,e,t,i,a,m)),!0;case"gotpointercapture":return C=m.pointerId,La.set(C,Oa(La.get(C)||null,e,t,i,a,m)),!0}return!1}function Sm(e){var t=ln(e.target);if(t!==null){var i=p(t);if(i!==null){if(t=i.tag,t===13){if(t=f(i),t!==null){e.blockedOn=t,el(e.priority,function(){_m(i)});return}}else if(t===31){if(t=o(i),t!==null){e.blockedOn=t,el(e.priority,function(){_m(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 uo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Ou(e.nativeEvent);if(i===null){i=e.nativeEvent;var a=new i.constructor(i.type,i);Kr=a,i.target.dispatchEvent(a),Kr=null}else return t=mi(i),t!==null&&gm(t),e.blockedOn=i,!1;t.shift()}return!0}function bm(e,t,i){uo(e)&&i.delete(t)}function A0(){ju=!1,lr!==null&&uo(lr)&&(lr=null),or!==null&&uo(or)&&(or=null),cr!==null&&uo(cr)&&(cr=null),Ma.forEach(bm),La.forEach(bm)}function ho(e,t){e.blockedOn===t&&(e.blockedOn=null,ju||(ju=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,A0)))}var fo=null;function Cm(e){fo!==e&&(fo=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){fo===e&&(fo=null);for(var t=0;t<e.length;t+=3){var i=e[t],a=e[t+1],m=e[t+2];if(typeof a!="function"){if(Bu(a||i)===null)continue;break}var C=mi(i);C!==null&&(e.splice(t,3),t-=3,Oc(C,{pending:!0,data:m,method:i.method,action:a},a,m))}}))}function Ts(e){function t(X){return ho(X,e)}lr!==null&&ho(lr,e),or!==null&&ho(or,e),cr!==null&&ho(cr,e),Ma.forEach(t),La.forEach(t);for(var i=0;i<ur.length;i++){var a=ur[i];a.blockedOn===e&&(a.blockedOn=null)}for(;0<ur.length&&(i=ur[0],i.blockedOn===null);)Sm(i),i.blockedOn===null&&ur.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(a=0;a<i.length;a+=3){var m=i[a],C=i[a+1],O=m[It]||null;if(typeof C=="function")O||Cm(i);else if(O){var F=null;if(C&&C.hasAttribute("formAction")){if(m=C,O=C[It]||null)F=O.formAction;else if(Bu(m)!==null)continue}else F=O.action;typeof F=="function"?i[a+1]=F:(i.splice(a,3),a-=3),Cm(i)}}}function wm(){function e(C){C.canIntercept&&C.info==="react-transition"&&C.intercept({handler:function(){return new Promise(function(O){return m=O})},focusReset:"manual",scroll:"manual"})}function t(){m!==null&&(m(),m=null),a||setTimeout(i,20)}function i(){if(!a&&!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 a=!1,m=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),m!==null&&(m(),m=null)}}}function Nu(e){this._internalRoot=e}po.prototype.render=Nu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var i=t.current,a=Rn();pm(i,a,e,t,null,null)},po.prototype.unmount=Nu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;pm(e.current,2,null,e,null,null),Wl(),t[Yn]=null}};function po(e){this._internalRoot=e}po.prototype.unstable_scheduleHydration=function(e){if(e){var t=Kn();e={blockedOn:null,target:e,priority:t};for(var i=0;i<ur.length&&t!==0&&t<ur[i].priority;i++);ur.splice(i,0,e),i===0&&Sm(e)}};var xm=r.version;if(xm!=="19.2.6")throw Error(l(527,xm,"19.2.6"));W.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=h(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var T0={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mo.isDisabled&&mo.supportsFiber)try{gt=mo.inject(T0),mt=mo}catch{}}return ja.createRoot=function(e,t){if(!d(e))throw Error(l(299));var i=!1,a="",m=Md,C=Ld,O=Od;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(m=t.onUncaughtError),t.onCaughtError!==void 0&&(C=t.onCaughtError),t.onRecoverableError!==void 0&&(O=t.onRecoverableError)),t=fm(e,1,!1,null,null,i,a,null,m,C,O,wm),e[Yn]=t.current,_u(e),new Nu(t)},ja.hydrateRoot=function(e,t,i){if(!d(e))throw Error(l(299));var a=!1,m="",C=Md,O=Ld,F=Od,X=null;return i!=null&&(i.unstable_strictMode===!0&&(a=!0),i.identifierPrefix!==void 0&&(m=i.identifierPrefix),i.onUncaughtError!==void 0&&(C=i.onUncaughtError),i.onCaughtError!==void 0&&(O=i.onCaughtError),i.onRecoverableError!==void 0&&(F=i.onRecoverableError),i.formState!==void 0&&(X=i.formState)),t=fm(e,1,!0,t,i??null,a,m,X,C,O,F,wm),t.context=dm(null),i=t.current,a=Rn(),a=qr(a),m=Yi(a),m.callback=null,Xi(i,m,a),i=a,t.current.lanes=i,sn(t,i),fi(t),e[Yn]=t.current,_u(e),new po(t)},ja.version="19.2.6",ja}var jm;function U0(){if(jm)return Iu.exports;jm=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(),Iu.exports=I0(),Iu.exports}var P0=U0();const Pr=function(n,r){let d=n;const p=Pa[r];let f=null,o=0,c=null;const h=[],g={},u=function(R,k){o=d*4+17,f=(function(M){const B=new Array(M);for(let H=0;H<M;H+=1){B[H]=new Array(M);for(let U=0;U<M;U+=1)B[H][U]=null}return B})(o),y(0,0),y(o-7,0),y(0,o-7),E(),T(),v(R,k),d>=7&&S(R),c==null&&(c=A(d,p,h)),_(c,k)},y=function(R,k){for(let M=-1;M<=7;M+=1)if(!(R+M<=-1||o<=R+M))for(let B=-1;B<=7;B+=1)k+B<=-1||o<=k+B||(0<=M&&M<=6&&(B==0||B==6)||0<=B&&B<=6&&(M==0||M==6)||2<=M&&M<=4&&2<=B&&B<=4?f[R+M][k+B]=!0:f[R+M][k+B]=!1)},w=function(){let R=0,k=0;for(let M=0;M<8;M+=1){u(!0,M);const B=dr.getLostPoint(g);(M==0||R>B)&&(R=B,k=M)}return k},T=function(){for(let R=8;R<o-8;R+=1)f[R][6]==null&&(f[R][6]=R%2==0);for(let R=8;R<o-8;R+=1)f[6][R]==null&&(f[6][R]=R%2==0)},E=function(){const R=dr.getPatternPosition(d);for(let k=0;k<R.length;k+=1)for(let M=0;M<R.length;M+=1){const B=R[k],H=R[M];if(f[B][H]==null)for(let U=-2;U<=2;U+=1)for(let P=-2;P<=2;P+=1)U==-2||U==2||P==-2||P==2||U==0&&P==0?f[B+U][H+P]=!0:f[B+U][H+P]=!1}},S=function(R){const k=dr.getBCHTypeNumber(d);for(let M=0;M<18;M+=1){const B=!R&&(k>>M&1)==1;f[Math.floor(M/3)][M%3+o-8-3]=B}for(let M=0;M<18;M+=1){const B=!R&&(k>>M&1)==1;f[M%3+o-8-3][Math.floor(M/3)]=B}},v=function(R,k){const M=p<<3|k,B=dr.getBCHTypeInfo(M);for(let H=0;H<15;H+=1){const U=!R&&(B>>H&1)==1;H<6?f[H][8]=U:H<8?f[H+1][8]=U:f[o-15+H][8]=U}for(let H=0;H<15;H+=1){const U=!R&&(B>>H&1)==1;H<8?f[8][o-H-1]=U:H<9?f[8][15-H-1+1]=U:f[8][15-H-1]=U}f[o-8][8]=!R},_=function(R,k){let M=-1,B=o-1,H=7,U=0;const P=dr.getMaskFunction(k);for(let K=o-1;K>0;K-=2)for(K==6&&(K-=1);;){for(let Y=0;Y<2;Y+=1)if(f[B][K-Y]==null){let G=!1;U<R.length&&(G=(R[U]>>>H&1)==1),P(B,K-Y)&&(G=!G),f[B][K-Y]=G,H-=1,H==-1&&(U+=1,H=7)}if(B+=M,B<0||o<=B){B-=M,M=-M;break}}},b=function(R,k){let M=0,B=0,H=0;const U=new Array(k.length),P=new Array(k.length);for(let W=0;W<k.length;W+=1){const Z=k[W].dataCount,z=k[W].totalCount-Z;B=Math.max(B,Z),H=Math.max(H,z),U[W]=new Array(Z);for(let I=0;I<U[W].length;I+=1)U[W][I]=255&R.getBuffer()[I+M];M+=Z;const j=dr.getErrorCorrectPolynomial(z),$=Va(U[W],j.getLength()-1).mod(j);P[W]=new Array(j.getLength()-1);for(let I=0;I<P[W].length;I+=1){const re=I+$.getLength()-P[W].length;P[W][I]=re>=0?$.getAt(re):0}}let K=0;for(let W=0;W<k.length;W+=1)K+=k[W].totalCount;const Y=new Array(K);let G=0;for(let W=0;W<B;W+=1)for(let Z=0;Z<k.length;Z+=1)W<U[Z].length&&(Y[G]=U[Z][W],G+=1);for(let W=0;W<H;W+=1)for(let Z=0;Z<k.length;Z+=1)W<P[Z].length&&(Y[G]=P[Z][W],G+=1);return Y},A=function(R,k,M){const B=Nm.getRSBlocks(R,k),H=Hm();for(let P=0;P<M.length;P+=1){const K=M[P];H.put(K.getMode(),4),H.put(K.getLength(),dr.getLengthInBits(K.getMode(),R)),K.write(H)}let U=0;for(let P=0;P<B.length;P+=1)U+=B[P].dataCount;if(H.getLengthInBits()>U*8)throw"code length overflow. ("+H.getLengthInBits()+">"+U*8+")";for(H.getLengthInBits()+4<=U*8&&H.put(0,4);H.getLengthInBits()%8!=0;)H.putBit(!1);for(;!(H.getLengthInBits()>=U*8||(H.put(236,8),H.getLengthInBits()>=U*8));)H.put(17,8);return b(H,B)};g.addData=function(R,k){k=k||"Byte";let M=null;switch(k){case"Numeric":M=F0(R);break;case"Alphanumeric":M=q0(R);break;case"Byte":M=$0(R);break;case"Kanji":M=G0(R);break;default:throw"mode:"+k}h.push(M),c=null},g.isDark=function(R,k){if(R<0||o<=R||k<0||o<=k)throw R+","+k;return f[R][k]},g.getModuleCount=function(){return o},g.make=function(){if(d<1){let R=1;for(;R<40;R++){const k=Nm.getRSBlocks(R,p),M=Hm();for(let H=0;H<h.length;H++){const U=h[H];M.put(U.getMode(),4),M.put(U.getLength(),dr.getLengthInBits(U.getMode(),R)),U.write(M)}let B=0;for(let H=0;H<k.length;H++)B+=k[H].dataCount;if(M.getLengthInBits()<=B*8)break}d=R}u(!1,w())},g.createTableTag=function(R,k){R=R||2,k=typeof k>"u"?R*4:k;let M="";M+='<table style="',M+=" border-width: 0px; border-style: none;",M+=" border-collapse: collapse;",M+=" padding: 0px; margin: "+k+"px;",M+='">',M+="<tbody>";for(let B=0;B<g.getModuleCount();B+=1){M+="<tr>";for(let H=0;H<g.getModuleCount();H+=1)M+='<td style="',M+=" border-width: 0px; border-style: none;",M+=" border-collapse: collapse;",M+=" padding: 0px; margin: 0px;",M+=" width: "+R+"px;",M+=" height: "+R+"px;",M+=" background-color: ",M+=g.isDark(B,H)?"#000000":"#ffffff",M+=";",M+='"/>';M+="</tr>"}return M+="</tbody>",M+="</table>",M},g.createSvgTag=function(R,k,M,B){let H={};typeof arguments[0]=="object"&&(H=arguments[0],R=H.cellSize,k=H.margin,M=H.alt,B=H.title),R=R||2,k=typeof k>"u"?R*4:k,M=typeof M=="string"?{text:M}:M||{},M.text=M.text||null,M.id=M.text?M.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 U=g.getModuleCount()*R+k*2;let P,K,Y,G,W="",Z;for(Z="l"+R+",0 0,"+R+" -"+R+",0 0,-"+R+"z ",W+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',W+=H.scalable?"":' width="'+U+'px" height="'+U+'px"',W+=' viewBox="0 0 '+U+" "+U+'" ',W+=' preserveAspectRatio="xMinYMin meet"',W+=B.text||M.text?' role="img" aria-labelledby="'+L([B.id,M.id].join(" ").trim())+'"':"",W+=">",W+=B.text?'<title id="'+L(B.id)+'">'+L(B.text)+"</title>":"",W+=M.text?'<description id="'+L(M.id)+'">'+L(M.text)+"</description>":"",W+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',W+='<path d="',Y=0;Y<g.getModuleCount();Y+=1)for(G=Y*R+k,P=0;P<g.getModuleCount();P+=1)g.isDark(Y,P)&&(K=P*R+k,W+="M"+K+","+G+Z);return W+='" stroke="transparent" fill="black"/>',W+="</svg>",W},g.createDataURL=function(R,k){R=R||2,k=typeof k>"u"?R*4:k;const M=g.getModuleCount()*R+k*2,B=k,H=M-k;return Y0(M,M,function(U,P){if(B<=U&&U<H&&B<=P&&P<H){const K=Math.floor((U-B)/R),Y=Math.floor((P-B)/R);return g.isDark(Y,K)?0:1}else return 1})},g.createImgTag=function(R,k,M){R=R||2,k=typeof k>"u"?R*4:k;const B=g.getModuleCount()*R+k*2;let H="";return H+="<img",H+=' src="',H+=g.createDataURL(R,k),H+='"',H+=' width="',H+=B,H+='"',H+=' height="',H+=B,H+='"',M&&(H+=' alt="',H+=L(M),H+='"'),H+="/>",H};const L=function(R){let k="";for(let M=0;M<R.length;M+=1){const B=R.charAt(M);switch(B){case"<":k+="<";break;case">":k+=">";break;case"&":k+="&";break;case'"':k+=""";break;default:k+=B;break}}return k},D=function(R){R=typeof R>"u"?2:R;const M=g.getModuleCount()*1+R*2,B=R,H=M-R;let U,P,K,Y,G;const W={"██":"█","█ ":"▀"," █":"▄"," ":" "},Z={"██":"▀","█ ":"▀"," █":" "," ":" "};let z="";for(U=0;U<M;U+=2){for(K=Math.floor((U-B)/1),Y=Math.floor((U+1-B)/1),P=0;P<M;P+=1)G="█",B<=P&&P<H&&B<=U&&U<H&&g.isDark(K,Math.floor((P-B)/1))&&(G=" "),B<=P&&P<H&&B<=U+1&&U+1<H&&g.isDark(Y,Math.floor((P-B)/1))?G+=" ":G+="█",z+=R<1&&U+1>=H?Z[G]:W[G];z+=`
|
|
50
|
+
`}return M%2&&R>0?z.substring(0,z.length-M-1)+Array(M+1).join("▀"):z.substring(0,z.length-1)};return g.createASCII=function(R,k){if(R=R||1,R<2)return D(k);R-=1,k=typeof k>"u"?R*2:k;const M=g.getModuleCount()*R+k*2,B=k,H=M-k;let U,P,K,Y;const G=Array(R+1).join("██"),W=Array(R+1).join(" ");let Z="",z="";for(U=0;U<M;U+=1){for(K=Math.floor((U-B)/R),z="",P=0;P<M;P+=1)Y=1,B<=P&&P<H&&B<=U&&U<H&&g.isDark(K,Math.floor((P-B)/R))&&(Y=0),z+=Y?G:W;for(K=0;K<R;K+=1)Z+=z+`
|
|
51
|
+
`}return Z.substring(0,Z.length-1)},g.renderTo2dContext=function(R,k){k=k||2;const M=g.getModuleCount();for(let B=0;B<M;B++)for(let H=0;H<M;H++)R.fillStyle=g.isDark(B,H)?"black":"white",R.fillRect(H*k,B*k,k,k)},g};Pr.stringToBytes=function(n){const r=[];for(let s=0;s<n.length;s+=1){const l=n.charCodeAt(s);r.push(l&255)}return r};Pr.createStringToBytes=function(n,r){const s=(function(){const d=W0(n),p=function(){const c=d.read();if(c==-1)throw"eof";return c};let f=0;const o={};for(;;){const c=d.read();if(c==-1)break;const h=p(),g=p(),u=p(),y=String.fromCharCode(c<<8|h),w=g<<8|u;o[y]=w,f+=1}if(f!=r)throw f+" != "+r;return o})(),l=63;return function(d){const p=[];for(let f=0;f<d.length;f+=1){const o=d.charCodeAt(f);if(o<128)p.push(o);else{const c=s[d.charAt(f)];typeof c=="number"?(c&255)==c?p.push(c):(p.push(c>>>8),p.push(c&255)):p.push(l)}}return p}};const Kt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Pa={L:1,M:0,Q:3,H:2},fr={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},dr=(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,l=21522,d={},p=function(f){let o=0;for(;f!=0;)o+=1,f>>>=1;return o};return d.getBCHTypeInfo=function(f){let o=f<<10;for(;p(o)-p(r)>=0;)o^=r<<p(o)-p(r);return(f<<10|o)^l},d.getBCHTypeNumber=function(f){let o=f<<12;for(;p(o)-p(s)>=0;)o^=s<<p(o)-p(s);return f<<12|o},d.getPatternPosition=function(f){return n[f-1]},d.getMaskFunction=function(f){switch(f){case fr.PATTERN000:return function(o,c){return(o+c)%2==0};case fr.PATTERN001:return function(o,c){return o%2==0};case fr.PATTERN010:return function(o,c){return c%3==0};case fr.PATTERN011:return function(o,c){return(o+c)%3==0};case fr.PATTERN100:return function(o,c){return(Math.floor(o/2)+Math.floor(c/3))%2==0};case fr.PATTERN101:return function(o,c){return o*c%2+o*c%3==0};case fr.PATTERN110:return function(o,c){return(o*c%2+o*c%3)%2==0};case fr.PATTERN111:return function(o,c){return(o*c%3+(o+c)%2)%2==0};default:throw"bad maskPattern:"+f}},d.getErrorCorrectPolynomial=function(f){let o=Va([1],0);for(let c=0;c<f;c+=1)o=o.multiply(Va([1,mr.gexp(c)],0));return o},d.getLengthInBits=function(f,o){if(1<=o&&o<10)switch(f){case Kt.MODE_NUMBER:return 10;case Kt.MODE_ALPHA_NUM:return 9;case Kt.MODE_8BIT_BYTE:return 8;case Kt.MODE_KANJI:return 8;default:throw"mode:"+f}else if(o<27)switch(f){case Kt.MODE_NUMBER:return 12;case Kt.MODE_ALPHA_NUM:return 11;case Kt.MODE_8BIT_BYTE:return 16;case Kt.MODE_KANJI:return 10;default:throw"mode:"+f}else if(o<41)switch(f){case Kt.MODE_NUMBER:return 14;case Kt.MODE_ALPHA_NUM:return 13;case Kt.MODE_8BIT_BYTE:return 16;case Kt.MODE_KANJI:return 12;default:throw"mode:"+f}else throw"type:"+o},d.getLostPoint=function(f){const o=f.getModuleCount();let c=0;for(let u=0;u<o;u+=1)for(let y=0;y<o;y+=1){let w=0;const T=f.isDark(u,y);for(let E=-1;E<=1;E+=1)if(!(u+E<0||o<=u+E))for(let S=-1;S<=1;S+=1)y+S<0||o<=y+S||E==0&&S==0||T==f.isDark(u+E,y+S)&&(w+=1);w>5&&(c+=3+w-5)}for(let u=0;u<o-1;u+=1)for(let y=0;y<o-1;y+=1){let w=0;f.isDark(u,y)&&(w+=1),f.isDark(u+1,y)&&(w+=1),f.isDark(u,y+1)&&(w+=1),f.isDark(u+1,y+1)&&(w+=1),(w==0||w==4)&&(c+=3)}for(let u=0;u<o;u+=1)for(let y=0;y<o-6;y+=1)f.isDark(u,y)&&!f.isDark(u,y+1)&&f.isDark(u,y+2)&&f.isDark(u,y+3)&&f.isDark(u,y+4)&&!f.isDark(u,y+5)&&f.isDark(u,y+6)&&(c+=40);for(let u=0;u<o;u+=1)for(let y=0;y<o-6;y+=1)f.isDark(y,u)&&!f.isDark(y+1,u)&&f.isDark(y+2,u)&&f.isDark(y+3,u)&&f.isDark(y+4,u)&&!f.isDark(y+5,u)&&f.isDark(y+6,u)&&(c+=40);let h=0;for(let u=0;u<o;u+=1)for(let y=0;y<o;y+=1)f.isDark(y,u)&&(h+=1);const g=Math.abs(100*h/o/o-50)/5;return c+=g*10,c},d})(),mr=(function(){const n=new Array(256),r=new Array(256);for(let l=0;l<8;l+=1)n[l]=1<<l;for(let l=8;l<256;l+=1)n[l]=n[l-4]^n[l-5]^n[l-6]^n[l-8];for(let l=0;l<255;l+=1)r[n[l]]=l;const s={};return s.glog=function(l){if(l<1)throw"glog("+l+")";return r[l]},s.gexp=function(l){for(;l<0;)l+=255;for(;l>=256;)l-=255;return n[l]},s})(),Va=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 p=new Array(n.length-d+r);for(let f=0;f<n.length-d;f+=1)p[f]=n[f+d];return p})(),l={};return l.getAt=function(d){return s[d]},l.getLength=function(){return s.length},l.multiply=function(d){const p=new Array(l.getLength()+d.getLength()-1);for(let f=0;f<l.getLength();f+=1)for(let o=0;o<d.getLength();o+=1)p[f+o]^=mr.gexp(mr.glog(l.getAt(f))+mr.glog(d.getAt(o)));return Va(p,0)},l.mod=function(d){if(l.getLength()-d.getLength()<0)return l;const p=mr.glog(l.getAt(0))-mr.glog(d.getAt(0)),f=new Array(l.getLength());for(let o=0;o<l.getLength();o+=1)f[o]=l.getAt(o);for(let o=0;o<d.getLength();o+=1)f[o]^=mr.gexp(mr.glog(d.getAt(o))+p);return Va(f,0).mod(d)},l},Nm=(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,p){const f={};return f.totalCount=d,f.dataCount=p,f},s={},l=function(d,p){switch(p){case Pa.L:return n[(d-1)*4+0];case Pa.M:return n[(d-1)*4+1];case Pa.Q:return n[(d-1)*4+2];case Pa.H:return n[(d-1)*4+3];default:return}};return s.getRSBlocks=function(d,p){const f=l(d,p);if(typeof f>"u")throw"bad rs block @ typeNumber:"+d+"/errorCorrectionLevel:"+p;const o=f.length/3,c=[];for(let h=0;h<o;h+=1){const g=f[h*3+0],u=f[h*3+1],y=f[h*3+2];for(let w=0;w<g;w+=1)c.push(r(u,y))}return c},s})(),Hm=function(){const n=[];let r=0;const s={};return s.getBuffer=function(){return n},s.getAt=function(l){const d=Math.floor(l/8);return(n[d]>>>7-l%8&1)==1},s.put=function(l,d){for(let p=0;p<d;p+=1)s.putBit((l>>>d-p-1&1)==1)},s.getLengthInBits=function(){return r},s.putBit=function(l){const d=Math.floor(r/8);n.length<=d&&n.push(0),l&&(n[d]|=128>>>r%8),r+=1},s},F0=function(n){const r=Kt.MODE_NUMBER,s=n,l={};l.getMode=function(){return r},l.getLength=function(f){return s.length},l.write=function(f){const o=s;let c=0;for(;c+2<o.length;)f.put(d(o.substring(c,c+3)),10),c+=3;c<o.length&&(o.length-c==1?f.put(d(o.substring(c,c+1)),4):o.length-c==2&&f.put(d(o.substring(c,c+2)),7))};const d=function(f){let o=0;for(let c=0;c<f.length;c+=1)o=o*10+p(f.charAt(c));return o},p=function(f){if("0"<=f&&f<="9")return f.charCodeAt(0)-48;throw"illegal char :"+f};return l},q0=function(n){const r=Kt.MODE_ALPHA_NUM,s=n,l={};l.getMode=function(){return r},l.getLength=function(p){return s.length},l.write=function(p){const f=s;let o=0;for(;o+1<f.length;)p.put(d(f.charAt(o))*45+d(f.charAt(o+1)),11),o+=2;o<f.length&&p.put(d(f.charAt(o)),6)};const d=function(p){if("0"<=p&&p<="9")return p.charCodeAt(0)-48;if("A"<=p&&p<="Z")return p.charCodeAt(0)-65+10;switch(p){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 :"+p}};return l},$0=function(n){const r=Kt.MODE_8BIT_BYTE,s=Pr.stringToBytes(n),l={};return l.getMode=function(){return r},l.getLength=function(d){return s.length},l.write=function(d){for(let p=0;p<s.length;p+=1)d.put(s[p],8)},l},G0=function(n){const r=Kt.MODE_KANJI,s=Pr.stringToBytes;(function(p,f){const o=s(p);if(o.length!=2||(o[0]<<8|o[1])!=f)throw"sjis not supported."})("友",38726);const l=s(n),d={};return d.getMode=function(){return r},d.getLength=function(p){return~~(l.length/2)},d.write=function(p){const f=l;let o=0;for(;o+1<f.length;){let c=(255&f[o])<<8|255&f[o+1];if(33088<=c&&c<=40956)c-=33088;else if(57408<=c&&c<=60351)c-=49472;else throw"illegal char at "+(o+1)+"/"+c;c=(c>>>8&255)*192+(c&255),p.put(c,13),o+=2}if(o<f.length)throw"illegal char at "+(o+1)},d},Jg=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,l,d){l=l||0,d=d||s.length;for(let p=0;p<d;p+=1)r.writeByte(s[p+l])},r.writeString=function(s){for(let l=0;l<s.length;l+=1)r.writeByte(s.charCodeAt(l))},r.toByteArray=function(){return n},r.toString=function(){let s="";s+="[";for(let l=0;l<n.length;l+=1)l>0&&(s+=","),s+=n[l];return s+="]",s},r},V0=function(){let n=0,r=0,s=0,l="";const d={},p=function(o){l+=String.fromCharCode(f(o&63))},f=function(o){if(o<0)throw"n:"+o;if(o<26)return 65+o;if(o<52)return 97+(o-26);if(o<62)return 48+(o-52);if(o==62)return 43;if(o==63)return 47;throw"n:"+o};return d.writeByte=function(o){for(n=n<<8|o&255,r+=8,s+=1;r>=6;)p(n>>>r-6),r-=6},d.flush=function(){if(r>0&&(p(n<<6-r),n=0,r=0),s%3!=0){const o=3-s%3;for(let c=0;c<o;c+=1)l+="="}},d.toString=function(){return l},d},W0=function(n){const r=n;let s=0,l=0,d=0;const p={};p.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;l=l<<6|f(c.charCodeAt(0)),d+=6}const o=l>>>d-8&255;return d-=8,o};const f=function(o){if(65<=o&&o<=90)return o-65;if(97<=o&&o<=122)return o-97+26;if(48<=o&&o<=57)return o-48+52;if(o==43)return 62;if(o==47)return 63;throw"c:"+o};return p},K0=function(n,r){const s=n,l=r,d=new Array(n*r),p={};p.setPixel=function(h,g,u){d[g*s+h]=u},p.write=function(h){h.writeString("GIF87a"),h.writeShort(s),h.writeShort(l),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(l),h.writeByte(0);const g=2,u=o(g);h.writeByte(g);let y=0;for(;u.length-y>255;)h.writeByte(255),h.writeBytes(u,y,255),y+=255;h.writeByte(u.length-y),h.writeBytes(u,y,u.length-y),h.writeByte(0),h.writeString(";")};const f=function(h){const g=h;let u=0,y=0;const w={};return w.write=function(T,E){if(T>>>E)throw"length over";for(;u+E>=8;)g.writeByte(255&(T<<u|y)),E-=8-u,T>>>=8-u,y=0,u=0;y=T<<u|y,u=u+E},w.flush=function(){u>0&&g.writeByte(y)},w},o=function(h){const g=1<<h,u=(1<<h)+1;let y=h+1;const w=c();for(let _=0;_<g;_+=1)w.add(String.fromCharCode(_));w.add(String.fromCharCode(g)),w.add(String.fromCharCode(u));const T=Jg(),E=f(T);E.write(g,y);let S=0,v=String.fromCharCode(d[S]);for(S+=1;S<d.length;){const _=String.fromCharCode(d[S]);S+=1,w.contains(v+_)?v=v+_:(E.write(w.indexOf(v),y),w.size()<4095&&(w.size()==1<<y&&(y+=1),w.add(v+_)),v=_)}return E.write(w.indexOf(v),y),E.write(u,y),E.flush(),T.toByteArray()},c=function(){const h={};let g=0;const u={};return u.add=function(y){if(u.contains(y))throw"dup key:"+y;h[y]=g,g+=1},u.size=function(){return g},u.indexOf=function(y){return h[y]},u.contains=function(y){return typeof h[y]<"u"},u};return p},Y0=function(n,r,s){const l=K0(n,r);for(let o=0;o<r;o+=1)for(let c=0;c<n;c+=1)l.setPixel(c,o,s(c,o));const d=Jg();l.write(d);const p=V0(),f=d.toByteArray();for(let o=0;o<f.length;o+=1)p.writeByte(f[o]);return p.flush(),"data:image/gif;base64,"+p};Pr.stringToBytes;const Wa=[{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}],Zg={name:"gate-reviewer",label:"Gate Reviewer",commandAgent:"gate-reviewer",dispatchable:!1},Hs=[...Wa,Zg],X0={name:"translator",label:"Translator",commandAgent:"translator",dispatchable:!1},Q0={name:"harness-engineer",label:"Harness Engineer",commandAgent:"harness-engineer",dispatchable:!1},e_=[X0,Q0],Dh=[...Hs,...e_];Wa.map(n=>n.name);const t_=Hs.map(n=>n.name);e_.map(n=>n.name);Dh.map(n=>n.name);Dh.filter(n=>n.dispatchable).map(n=>n.name);function J0(n){return t_.includes(n)}const Z0="zh-CN",e1="pm-final-only",n_=[{value:"zh-CN",label:"Chinese"},{value:"ja",label:"Japanese"},{value:"ko",label:"Korean"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"}],t1=[{value:"round-final",label:"Round final reply"},{value:"pm-final-only",label:"PM final reply"},{value:"final-only",label:"Each role final reply"},{value:"all",label:"All replies"}];function n1(){const n={};for(const r of t_)n[r]={permissionMode:"bypassPermissions",model:"default",effort:"default"};return{version:1,roles:n,autoOrchestration:!0}}function i1({sidebar:n,children:r}){const[s,l]=ee.useState(!1);return x.jsxs("div",{className:s?"app-shell is-sidebar-collapsed":"app-shell",children:[x.jsxs("aside",{className:"app-sidebar",children:[x.jsx("button",{className:"sidebar-toggle",type:"button","aria-label":s?"Expand sidebar":"Collapse sidebar",title:s?"Expand sidebar":"Collapse sidebar",onClick:()=>l(d=>!d)}),x.jsx("div",{className:"sidebar-content",children:n})]}),x.jsx("main",{className:"app-main",children:r})]})}function r1({busy:n,state:r,onApprove:s,onCancel:l,onComment:d,onReject:p}){var _;const[f,o]=ee.useState(!1),[c,h]=ee.useState(""),[g,u]=ee.useState(null);if(!r||r.status==="idle")return null;const y=r.active,w=s1(r);if(g===w)return null;const T=r.status==="awaiting_user_approval",E=(y==null?void 0:y.title)??((_=r.pending[0])==null?void 0:_.title)??"Harness feedback",S=(y==null?void 0:y.source)==="task-retrospective"?"Task Harness Review":"Harness Feedback",v=()=>{o(!1),u(w)};return x.jsxs(x.Fragment,{children:[x.jsxs("section",{className:T?"harness-feedback-float needs-review":"harness-feedback-float",children:[x.jsxs("div",{children:[x.jsx("strong",{children:T?`${S} needed`:S}),x.jsx("span",{children:a1(r)})]}),x.jsx("p",{title:E,children:E}),x.jsxs("div",{className:"harness-feedback-float-actions",children:[x.jsx("button",{type:"button",disabled:n,onClick:v,children:"Close"}),x.jsx("button",{type:"button",disabled:n||!y,onClick:()=>o(!0),children:T?"Review":"Open"})]})]}),f&&y?x.jsx("div",{className:"modal-backdrop harness-feedback-backdrop",children:x.jsxs("section",{className:"harness-feedback-modal",role:"dialog","aria-modal":"true","aria-label":"Harness feedback review",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{children:S}),x.jsxs("p",{className:"muted",children:[r.status.replaceAll("_"," ")," · queued ",r.queuedCount]})]}),x.jsx("button",{type:"button",onClick:()=>o(!1),children:"Close"})]}),x.jsxs("div",{className:"harness-feedback-modal-body",children:[x.jsxs("section",{children:[x.jsx("h3",{children:y.source==="task-retrospective"?"Task Retrospective Request":"Feedback"}),x.jsx("pre",{children:y.feedbackContent||"No feedback content found."})]}),x.jsxs("section",{children:[x.jsx("h3",{children:"Harness Engineer Analysis"}),x.jsx("pre",{children:y.analysisContent||"Analysis is not available yet."})]})]}),T?x.jsxs("footer",{className:"harness-feedback-review-actions",children:[x.jsx("textarea",{value:c,placeholder:"Optional note for Harness Engineer...",onChange:b=>h(b.target.value)}),x.jsxs("div",{children:[x.jsx("button",{type:"button",disabled:n,onClick:()=>d(c),children:"Send Feedback"}),x.jsx("button",{type:"button",disabled:n,onClick:()=>p(c),children:"Reject"}),x.jsx("button",{type:"button",disabled:n,onClick:()=>s(c),children:"Approve"})]})]}):y?x.jsxs("footer",{className:"harness-feedback-review-actions",children:[x.jsx("textarea",{value:c,placeholder:"Optional cancellation note...",onChange:b=>h(b.target.value)}),x.jsx("div",{children:x.jsx("button",{type:"button",disabled:n,onClick:()=>l(c),children:"Cancel"})})]}):null]})}):null]})}function s1(n){if(n.active)return["active",n.status,n.active.id,n.active.path,n.active.updatedAt??"",n.active.analysisPath??"",n.active.applyReportPath??""].join(":");const r=n.pending[0];return r?["pending",n.status,r.id,r.path,n.queuedCount].join(":"):[n.status,n.queuedCount].join(":")}function a1(n){return n.status==="queued"?`${n.queuedCount} queued`:n.status==="awaiting_user_approval"?"waiting for approval":n.status==="analyzing"?"Harness Engineer analyzing":n.status==="applying"?"Harness Engineer applying":n.status}function Lo(n,r="Unknown error."){if(n instanceof Error)return n.message||r;if(typeof n=="string"&&n.trim())return n;if(n===void 0)return r;try{return JSON.stringify(n)}catch{return String(n)}}function dt(n,r,s){return`${n} failed. Reason: ${Lo(r,s)}`}function xo(n,r){return r.some(s=>n.startsWith(`${s} failed.`))?"":n}const ye={getAppPreferences(){return be("/api/settings/preferences")},updateAppPreferences(n){return be("/api/settings/preferences",{method:"PUT",body:JSON.stringify(n)})},getRuntimeDiagnostics(){return be("/api/diagnostics/runtime")},getCurrentProject(){return be("/api/projects/current")},pullCurrentProject(){return be("/api/projects/current/pull",{method:"POST"})},getRecentRepositoryPaths(){return be("/api/projects/recent")},connectProject(n){return be("/api/projects/connect",{method:"POST",body:JSON.stringify(n)})},listTasks(){return be("/api/tasks")},createTask(n){return be("/api/tasks",{method:"POST",body:JSON.stringify(n)})},cleanupTask(n,r={}){return be(`/api/tasks/${encodeURIComponent(n)}/cleanup`,{method:"POST",body:JSON.stringify(r)})},getHarnessStatus(n){const r=new URLSearchParams({taskSlug:n});return be(`/api/projects/harness?${r.toString()}`)},applyHarness(n){return be("/api/projects/harness/apply",{method:"POST",body:JSON.stringify(n)})},getHarnessFileContent(n,r){const s=new URLSearchParams({path:r,taskSlug:n});return be(`/api/projects/harness/file?${s.toString()}`)},updateHarnessFileContent(n,r,s){const l=new URLSearchParams({path:r,taskSlug:n});return be(`/api/projects/harness/file?${l.toString()}`,{method:"PUT",body:JSON.stringify(s)})},getRepositoryDiff(n,r){const s=new URLSearchParams({taskSlug:n});return r&&s.set("commit",r),be(`/api/projects/harness/repository-diff?${s.toString()}`)},getRepositoryFileDiff(n,r){const s=new URLSearchParams({taskSlug:n,path:r});return be(`/api/projects/harness/repository-diff/file?${s.toString()}`)},mergeRepositoryDiffToCurrentBranch(n){return be("/api/projects/harness/repository-diff/merge-to-current-branch",{method:"POST",body:JSON.stringify({taskSlug:n})})},getHarnessBootstrapStatus(n){const r=new URLSearchParams({taskSlug:n});return be(`/api/projects/harness/bootstrap?${r.toString()}`)},startHarnessBootstrap(n={}){return be("/api/projects/harness/bootstrap/start",{method:"POST",body:JSON.stringify(n)})},restartHarnessBootstrap(n={}){return be("/api/projects/harness/bootstrap/restart",{method:"POST",body:JSON.stringify(n)})},stopHarnessBootstrap(){return be("/api/projects/harness/bootstrap/stop",{method:"POST"})},runHarnessBootstrap(n){return be("/api/projects/harness/bootstrap/run",{method:"POST",body:JSON.stringify(n)})},getHarnessEngineerSession(){return be("/api/projects/harness/engineer/session")},ensureHarnessEngineerSession(n={}){return be("/api/projects/harness/engineer/session/ensure",{method:"POST",body:JSON.stringify(n)})},startHarnessEngineerSession(n={}){return be("/api/projects/harness/engineer/session/start",{method:"POST",body:JSON.stringify(n)})},resumeHarnessEngineerSession(n={}){return be("/api/projects/harness/engineer/session/resume",{method:"POST",body:JSON.stringify(n)})},restartHarnessEngineerSession(n={}){return be("/api/projects/harness/engineer/session/restart",{method:"POST",body:JSON.stringify(n)})},stopHarnessEngineerSession(){return be("/api/projects/harness/engineer/session/stop",{method:"POST"})},notifyHarnessEngineerHarnessUpdated(){return be("/api/projects/harness/engineer/session/notify-harness",{method:"POST"})},getHarnessFeedbackState(n){const r=new URLSearchParams;n&&r.set("taskSlug",n);const s=r.toString();return be(`/api/projects/harness/feedback${s?`?${s}`:""}`)},decideHarnessFeedback(n){return be("/api/projects/harness/feedback/decision",{method:"POST",body:JSON.stringify(n)})},startTaskHarnessRetrospective(n){return be("/api/projects/harness/task-retrospective",{method:"POST",body:JSON.stringify(n)})},getTaskStatus(n){return be(`/api/tasks/${encodeURIComponent(n)}/status`)},oneClickStart(n){return be(`/api/tasks/${encodeURIComponent(n)}/one-click-start`,{method:"POST"})},getTaskWorkspaceState(n){return be(`/api/tasks/${encodeURIComponent(n)}/workspace-state`)},getProjectRuntimeState(n){const r=new URLSearchParams;n&&r.set("taskSlug",n);const s=r.toString();return be(`/api/projects/runtime-state${s?`?${s}`:""}`)},listSessions(n){return be(`/api/tasks/${encodeURIComponent(n)}/sessions`)},startRoleSession(n,r,s={}){return be(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/start`,{method:"POST",body:JSON.stringify(s)})},stopRoleSession(n,r){return be(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/stop`,{method:"POST"})},restartRoleSession(n,r,s={}){return be(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/restart`,{method:"POST",body:JSON.stringify(s)})},resumeRoleSession(n,r,s={}){return be(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/resume`,{method:"POST",body:JSON.stringify(s)})},notifyRoleHarnessUpdated(n,r){return be(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/notify-harness`,{method:"POST"})},dispatchRoleCommand(n,r){return be(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/dispatch`,{method:"POST"})},listMessages(n){return be(`/api/tasks/${encodeURIComponent(n)}/messages`)},markAllMessagesDone(n){return be(`/api/tasks/${encodeURIComponent(n)}/messages/mark-all-done`,{method:"POST"})},deleteMessageHistory(n){return be(`/api/tasks/${encodeURIComponent(n)}/messages/history`,{method:"DELETE"})},getOrchestrationState(n){return be(`/api/tasks/${encodeURIComponent(n)}/orchestration`)},updateOrchestrationState(n,r){return be(`/api/tasks/${encodeURIComponent(n)}/orchestration`,{method:"PUT",body:JSON.stringify(r)})},getSessionRoundState(n){return be(`/api/tasks/${encodeURIComponent(n)}/round`)},getGateReviewState(n){return be(`/api/tasks/${encodeURIComponent(n)}/gate-review`)},updateGateReviewSettings(n,r){return be(`/api/tasks/${encodeURIComponent(n)}/gate-review/settings`,{method:"PUT",body:JSON.stringify(r)})},requestGateReviewGate(n,r){return be(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/request`,{method:"POST"})},retryGateReviewGate(n,r){return be(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/retry`,{method:"POST"})},skipGateReviewGate(n,r,s){return be(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/skip`,{method:"POST",body:JSON.stringify(s)})},overrideGateReviewGate(n,r,s){return be(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/override`,{method:"POST",body:JSON.stringify(s)})},getGateReviewReport(n,r){return be(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/report`)},startTranslationSession(n,r){return be(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/start`,{method:"POST"})},pollTranslationSession(n,r,s){const l=new URLSearchParams({after:String(r)});return s!==void 0&&l.set("limit",String(s)),be(`/api/translation/sessions/${encodeURIComponent(n)}/events?${l.toString()}`)},pollTranslationTaskFeed(n,r,s){const l=new URLSearchParams({after:String(r)});return s!==void 0&&l.set("limit",String(s)),be(`/api/tasks/${encodeURIComponent(n)}/translation/feed?${l.toString()}`)},translateUserInput(n,r,s){return be(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/input`,{method:"POST",body:JSON.stringify(s)})},translateManualOutput(n,r,s){return be(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/manual-output`,{method:"POST",body:JSON.stringify(s)})},translateLatestReply(n,r){return be(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/latest-reply`,{method:"POST"})},sendTranslatedInput(n,r,s){return be(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/send`,{method:"POST",body:JSON.stringify(s)})},clearTranslationSession(n){return be(`/api/translation/sessions/${encodeURIComponent(n)}/clear`,{method:"POST"})},stopTranslationSession(n){return be(`/api/translation/sessions/${encodeURIComponent(n)}/stop`,{method:"POST"})},notifyTranslatorHarnessUpdated(){return be("/api/projects/translation/session/notify-harness",{method:"POST"})},retryTranslation(n,r){return be(`/api/translation/sessions/${encodeURIComponent(n)}/retry/${encodeURIComponent(r)}`,{method:"POST"})},ignoreTranslationFailures(n){return be(`/api/translation/sessions/${encodeURIComponent(n)}/failures/ignore`,{method:"POST"})},retryTranslationFailures(n){return be(`/api/translation/sessions/${encodeURIComponent(n)}/failures/retry`,{method:"POST"})},getTranslationState(){return be("/api/translation/state")},getTranslatorSession(){return be("/api/translation/session")},ensureTranslatorSession(n={}){return be("/api/translation/session/ensure",{method:"POST",body:JSON.stringify(n)})},startTranslatorSession(n={}){return be("/api/translation/session/start",{method:"POST",body:JSON.stringify(n)})},resumeTranslatorSession(n={}){return be("/api/translation/session/resume",{method:"POST",body:JSON.stringify(n)})},restartTranslatorSession(n={}){return be("/api/translation/session/restart",{method:"POST",body:JSON.stringify(n)})},stopTranslatorSession(){return be("/api/translation/session/stop",{method:"POST"})},browseTranslationSourceFiles(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 be(`/api/translation/source-files${s}`)},createFileTranslation(n){return be("/api/translation/files",{method:"POST",body:JSON.stringify(n)})},readFileTranslation(n){return be(`/api/translation/files/${encodeURIComponent(n)}`)},createTranslationBootstrap(n){return be("/api/translation/bootstrap",{method:"POST",body:JSON.stringify(n)})},createTranslationMemoryUpdate(n){return be("/api/translation/memory-update",{method:"POST",body:JSON.stringify(n)})},promoteTranslation(n,r){return be(`/api/translation/files/${encodeURIComponent(n)}/promote`,{method:"POST",body:JSON.stringify({targetPath:r})})},getGatewayStatus(){return be("/api/gateway/status")},updateGatewaySettings(n){return be("/api/gateway/settings",{method:"PUT",body:JSON.stringify(n)})},startGatewayQrLogin(){return be("/api/gateway/qr/start",{method:"POST"})},checkGatewayQrLogin(n={}){return be("/api/gateway/qr/check",{method:"POST",body:JSON.stringify(n)})},startGatewayLarkRegistration(){return be("/api/gateway/lark-registration/start",{method:"POST"})},checkGatewayLarkRegistration(){return be("/api/gateway/lark-registration/check",{method:"POST"})},bindGatewayLarkApp(n){return be("/api/gateway/lark-registration/bind",{method:"POST",body:JSON.stringify(n)})},resetGatewayBinding(){return be("/api/gateway/binding/reset",{method:"POST"})},setGatewayConnection(n){return be("/api/gateway/connection",{method:"PUT",body:JSON.stringify({enabled:n})})}};async function be(n,r={}){var p,f,o;const s=new Headers(r.headers);r.body!==void 0&&r.body!==null&&!s.has("content-type")&&s.set("content-type","application/json");const l=(r.method??"GET").toUpperCase();let d;try{d=await fetch(n,{...r,headers:s})}catch(c){throw new Error(`${l} ${n} could not reach the VCM backend. Reason: ${Lo(c)}`)}if(!d.ok){const c=await d.text().catch(()=>""),h=l1(c),g=d.statusText?`${d.status} ${d.statusText}`:String(d.status),y=((p=h==null?void 0:h.error)!=null&&p.hint?`${h.error.message??"Backend error."} ${h.error.hint}`:(f=h==null?void 0:h.error)==null?void 0:f.message)??o1(c),w=(o=h==null?void 0:h.error)==null?void 0:o.runtime,T=w?` [backend ${w.version??"unknown"} pid=${w.pid??"unknown"} cwd=${w.cwd??"unknown"}]`:"";throw new Error(`${l} ${n} returned HTTP ${g}. ${y}${T}`)}return d.json()}function l1(n){if(!n.trim())return null;try{return JSON.parse(n)}catch{return null}}function o1(n){const r=n.trim();return r?`Non-JSON response body: ${r.slice(0,500)}`:"The response body was empty."}const uh="vcm:ui-error-report",hh="vcm:ui-error-clear-actions",fh="vcm:ui-error-clear-message";function c1(n){const r=n.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(uh,{detail:{message:r}}))}function u1(n){const r=n.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(fh,{detail:{message:r}}))}function h1(n){n.length===0||typeof window>"u"||window.dispatchEvent(new CustomEvent(hh,{detail:{actions:n}}))}function zi(n){const[r,s]=ee.useState(n),l=ee.useRef(n),d=ee.useCallback(p=>{const f=l.current,o=typeof p=="function"?p(f):p;l.current=o,typeof o=="string"&&o.trim()?c1(o):typeof f=="string"&&f.trim()&&u1(f),s(o)},[]);return[r,d]}var qu={exports:{}},zm;function f1(){return zm||(zm=1,(function(n,r){(function(s,l){n.exports=l()})(self,(()=>(()=>{var s={};return(()=>{var l=s;Object.defineProperty(l,"__esModule",{value:!0}),l.FitAddon=void 0,l.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 p=this._terminal._core;this._terminal.rows===d.rows&&this._terminal.cols===d.cols||(p._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,p=d._renderService.dimensions;if(p.css.cell.width===0||p.css.cell.height===0)return;const f=this._terminal.options.scrollback===0?0:d.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),h=Math.max(0,parseInt(o.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),u=c-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),y=h-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-f;return{cols:Math.max(2,Math.floor(y/p.css.cell.width)),rows:Math.max(1,Math.floor(u/p.css.cell.height))}}}})(),s})()))})(qu)),qu.exports}var d1=f1(),$u={exports:{}},Im;function p1(){return Im||(Im=1,(function(n,r){(function(s,l){n.exports=l()})(self,(()=>(()=>{var s={6:(f,o)=>{function c(g){try{const u=new URL(g),y=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 g.toLocaleLowerCase().startsWith(y.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(g,u,y,w={}){this._terminal=g,this._regex=u,this._handler=y,this._options=w}provideLinks(g,u){const y=h.computeLink(g,this._regex,this._terminal,this._handler);u(this._addCallbacks(y))}_addCallbacks(g){return g.map((u=>(u.leave=this._options.leave,u.hover=(y,w)=>{if(this._options.hover){const{range:T}=u;this._options.hover(y,w,T)}},u)))}};class h{static computeLink(u,y,w,T){const E=new RegExp(y.source,(y.flags||"")+"g"),[S,v]=h._getWindowedLineStrings(u-1,w),_=S.join("");let b;const A=[];for(;b=E.exec(_);){const L=b[0];if(!c(L))continue;const[D,R]=h._mapStrIdx(w,v,0,b.index),[k,M]=h._mapStrIdx(w,D,R,L.length);if(D===-1||R===-1||k===-1||M===-1)continue;const B={start:{x:R+1,y:D+1},end:{x:M,y:k+1}};A.push({range:B,text:L,activate:T})}return A}static _getWindowedLineStrings(u,y){let w,T=u,E=u,S=0,v="";const _=[];if(w=y.buffer.active.getLine(u)){const b=w.translateToString(!0);if(w.isWrapped&&b[0]!==" "){for(S=0;(w=y.buffer.active.getLine(--T))&&S<2048&&(v=w.translateToString(!0),S+=v.length,_.push(v),w.isWrapped&&v.indexOf(" ")===-1););_.reverse()}for(_.push(b),S=0;(w=y.buffer.active.getLine(++E))&&w.isWrapped&&S<2048&&(v=w.translateToString(!0),S+=v.length,_.push(v),v.indexOf(" ")===-1););}return[_,T]}static _mapStrIdx(u,y,w,T){const E=u.buffer.active,S=E.getNullCell();let v=w;for(;T;){const _=E.getLine(y);if(!_)return[-1,-1];for(let b=v;b<_.length;++b){_.getCell(b,S);const A=S.getChars();if(S.getWidth()&&(T-=A.length||1,b===_.length-1&&A==="")){const L=E.getLine(y+1);L&&L.isWrapped&&(L.getCell(0,S),S.getWidth()===2&&(T+=1))}if(T<0)return[y,b]}y++,v=0}return[y,v]}}o.LinkComputer=h}},l={};function d(f){var o=l[f];if(o!==void 0)return o.exports;var c=l[f]={exports:{}};return s[f](c,c.exports,d),c.exports}var p={};return(()=>{var f=p;Object.defineProperty(f,"__esModule",{value:!0}),f.WebLinksAddon=void 0;const o=d(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function h(g,u){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}f.WebLinksAddon=class{constructor(g=h,u={}){this._handler=g,this._options=u}activate(g){this._terminal=g;const u=this._options,y=u.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,y,this._handler,u))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),p})()))})($u)),$u.exports}var m1=p1(),Gu={exports:{}},Um;function g1(){return Um||(Um=1,(function(n,r){(function(s,l){n.exports=l()})(globalThis,(()=>(()=>{var s={4567:function(f,o,c){var h=this&&this.__decorate||function(_,b,A,L){var D,R=arguments.length,k=R<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,b,A,L);else for(var M=_.length-1;M>=0;M--)(D=_[M])&&(k=(R<3?D(k):R>3?D(b,A,k):D(b,A))||k);return R>3&&k&&Object.defineProperty(b,A,k),k},g=this&&this.__param||function(_,b){return function(A,L){b(A,L,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const u=c(9042),y=c(9924),w=c(844),T=c(4725),E=c(2585),S=c(3656);let v=o.AccessibilityManager=class extends w.Disposable{constructor(_,b,A,L){super(),this._terminal=_,this._coreBrowserService=A,this._renderService=L,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 y.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,S.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,w.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(_){for(let b=0;b<_;b++)this._handleChar(" ")}_handleChar(_){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==_&&(this._charsToAnnounce+=_):this._charsToAnnounce+=_,_===`
|
|
53
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(_){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(_)||this._charsToConsume.push(_)}_refreshRows(_,b){this._liveRegionDebouncer.refresh(_,b,this._terminal.rows)}_renderRows(_,b){const A=this._terminal.buffer,L=A.lines.length.toString();for(let D=_;D<=b;D++){const R=A.lines.get(A.ydisp+D),k=[],M=(R==null?void 0:R.translateToString(!0,void 0,void 0,k))||"",B=(A.ydisp+D+1).toString(),H=this._rowElements[D];H&&(M.length===0?(H.innerText=" ",this._rowColumns.set(H,[0,1])):(H.textContent=M,this._rowColumns.set(H,k)),H.setAttribute("aria-posinset",B),H.setAttribute("aria-setsize",L))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(_,b){const A=_.target,L=this._rowElements[b===0?1:this._rowElements.length-2];if(A.getAttribute("aria-posinset")===(b===0?"1":`${this._terminal.buffer.lines.length}`)||_.relatedTarget!==L)return;let D,R;if(b===0?(D=A,R=this._rowElements.pop(),this._rowContainer.removeChild(R)):(D=this._rowElements.shift(),R=A,this._rowContainer.removeChild(D)),D.removeEventListener("focus",this._topBoundaryFocusListener),R.removeEventListener("focus",this._bottomBoundaryFocusListener),b===0){const k=this._createAccessibilityTreeNode();this._rowElements.unshift(k),this._rowContainer.insertAdjacentElement("afterbegin",k)}else{const k=this._createAccessibilityTreeNode();this._rowElements.push(k),this._rowContainer.appendChild(k)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(b===0?-1:1),this._rowElements[b===0?1:this._rowElements.length-2].focus(),_.preventDefault(),_.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const _=document.getSelection();if(!_)return;if(_.isCollapsed)return void(this._rowContainer.contains(_.anchorNode)&&this._terminal.clearSelection());if(!_.anchorNode||!_.focusNode)return void console.error("anchorNode and/or focusNode are null");let b={node:_.anchorNode,offset:_.anchorOffset},A={node:_.focusNode,offset:_.focusOffset};if((b.node.compareDocumentPosition(A.node)&Node.DOCUMENT_POSITION_PRECEDING||b.node===A.node&&b.offset>A.offset)&&([b,A]=[A,b]),b.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(b={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(b.node))return;const L=this._rowElements.slice(-1)[0];if(A.node.compareDocumentPosition(L)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(A={node:L,offset:((M=L.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(A.node))return;const D=({node:B,offset:H})=>{const U=B instanceof Text?B.parentNode:B;let P=parseInt(U==null?void 0:U.getAttribute("aria-posinset"),10)-1;if(isNaN(P))return console.warn("row is invalid. Race condition?"),null;const K=this._rowColumns.get(U);if(!K)return console.warn("columns is null. Race condition?"),null;let Y=H<K.length?K[H]:K.slice(-1)[0]+1;return Y>=this._terminal.cols&&(++P,Y=0),{row:P,column:Y}},R=D(b),k=D(A);if(R&&k){if(R.row>k.row||R.row===k.row&&R.column>=k.column)throw new Error("invalid range");this._terminal.select(R.column,R.row,(k.row-R.row)*this._terminal.cols-R.column+k.column)}}_handleResize(_){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let b=this._rowContainer.children.length;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);for(;this._rowElements.length>_;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const _=this._coreBrowserService.mainDocument.createElement("div");return _.setAttribute("role","listitem"),_.tabIndex=-1,this._refreshRowDimensions(_),_}_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 _=0;_<this._terminal.rows;_++)this._refreshRowDimensions(this._rowElements[_])}}_refreshRowDimensions(_){_.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=v=h([g(1,E.IInstantiationService),g(2,T.ICoreBrowserService),g(3,T.IRenderService)],v)},3614:(f,o)=>{function c(y){return y.replace(/\r?\n/g,"\r")}function h(y,w){return w?"\x1B[200~"+y+"\x1B[201~":y}function g(y,w,T,E){y=h(y=c(y),T.decPrivateModes.bracketedPasteMode&&E.rawOptions.ignoreBracketedPasteMode!==!0),T.triggerDataEvent(y,!0),w.value=""}function u(y,w,T){const E=T.getBoundingClientRect(),S=y.clientX-E.left-10,v=y.clientY-E.top-10;w.style.width="20px",w.style.height="20px",w.style.left=`${S}px`,w.style.top=`${v}px`,w.style.zIndex="1000",w.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=h,o.copyHandler=function(y,w){y.clipboardData&&y.clipboardData.setData("text/plain",w.selectionText),y.preventDefault()},o.handlePasteEvent=function(y,w,T,E){y.stopPropagation(),y.clipboardData&&g(y.clipboardData.getData("text/plain"),w,T,E)},o.paste=g,o.moveTextAreaUnderMouseCursor=u,o.rightClickHandler=function(y,w,T,E,S){u(y,w,T),S&&E.rightClickSelect(y),w.value=E.selectionText,w.select()}},7239:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const h=c(1505);o.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(g,u,y){this._css.set(g,u,y)}getCss(g,u){return this._css.get(g,u)}setColor(g,u,y){this._color.set(g,u,y)}getColor(g,u){return this._color.get(g,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,h,g,u){c.addEventListener(h,g,u);let y=!1;return{dispose:()=>{y||(y=!0,c.removeEventListener(h,g,u))}}}},3551:function(f,o,c){var h=this&&this.__decorate||function(v,_,b,A){var L,D=arguments.length,R=D<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,b):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(v,_,b,A);else for(var k=v.length-1;k>=0;k--)(L=v[k])&&(R=(D<3?L(R):D>3?L(_,b,R):L(_,b))||R);return D>3&&R&&Object.defineProperty(_,b,R),R},g=this&&this.__param||function(v,_){return function(b,A){_(b,A,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const u=c(3656),y=c(8460),w=c(844),T=c(2585),E=c(4725);let S=o.Linkifier=class extends w.Disposable{get currentLink(){return this._currentLink}constructor(v,_,b,A,L){super(),this._element=v,this._mouseService=_,this._renderService=b,this._bufferService=A,this._linkProviderService=L,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new y.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new y.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(v){this._lastMouseEvent=v;const _=this._positionFromMouseEvent(v,this._element,this._mouseService);if(!_)return;this._isMouseOut=!1;const b=v.composedPath();for(let A=0;A<b.length;A++){const L=b[A];if(L.classList.contains("xterm"))break;if(L.classList.contains("xterm-hover"))return}this._lastBufferCell&&_.x===this._lastBufferCell.x&&_.y===this._lastBufferCell.y||(this._handleHover(_),this._lastBufferCell=_)}_handleHover(v){if(this._activeLine!==v.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(v,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,v)||(this._clearCurrentLink(),this._askForLink(v,!0))}_askForLink(v,_){var A,L;this._activeProviderReplies&&_||((A=this._activeProviderReplies)==null||A.forEach((D=>{D==null||D.forEach((R=>{R.link.dispose&&R.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=v.y);let b=!1;for(const[D,R]of this._linkProviderService.linkProviders.entries())_?(L=this._activeProviderReplies)!=null&&L.get(D)&&(b=this._checkLinkProviderResult(D,v,b)):R.provideLinks(v.y,(k=>{var B,H;if(this._isMouseOut)return;const M=k==null?void 0:k.map((U=>({link:U})));(B=this._activeProviderReplies)==null||B.set(D,M),b=this._checkLinkProviderResult(D,v,b),((H=this._activeProviderReplies)==null?void 0:H.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(v.y,this._activeProviderReplies)}))}_removeIntersectingLinks(v,_){const b=new Set;for(let A=0;A<_.size;A++){const L=_.get(A);if(L)for(let D=0;D<L.length;D++){const R=L[D],k=R.link.range.start.y<v?0:R.link.range.start.x,M=R.link.range.end.y>v?this._bufferService.cols:R.link.range.end.x;for(let B=k;B<=M;B++){if(b.has(B)){L.splice(D--,1);break}b.add(B)}}}}_checkLinkProviderResult(v,_,b){var D;if(!this._activeProviderReplies)return b;const A=this._activeProviderReplies.get(v);let L=!1;for(let R=0;R<v;R++)this._activeProviderReplies.has(R)&&!this._activeProviderReplies.get(R)||(L=!0);if(!L&&A){const R=A.find((k=>this._linkAtPosition(k.link,_)));R&&(b=!0,this._handleNewLink(R))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!b)for(let R=0;R<this._activeProviderReplies.size;R++){const k=(D=this._activeProviderReplies.get(R))==null?void 0:D.find((M=>this._linkAtPosition(M.link,_)));if(k){b=!0,this._handleNewLink(k);break}}return b}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(v){if(!this._currentLink)return;const _=this._positionFromMouseEvent(v,this._element,this._mouseService);_&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,_)&&this._currentLink.link.activate(v,this._currentLink.link.text)}_clearCurrentLink(v,_){this._currentLink&&this._lastMouseEvent&&(!v||!_||this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=_)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,w.disposeArray)(this._linkCacheDisposables))}_handleNewLink(v){if(!this._lastMouseEvent)return;const _=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);_&&this._linkAtPosition(v.link,_)&&(this._currentLink=v,this._currentLink.state={decorations:{underline:v.link.decorations===void 0||v.link.decorations.underline,pointerCursor:v.link.decorations===void 0||v.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,v.link,this._lastMouseEvent),v.link.decorations={},Object.defineProperties(v.link.decorations,{pointerCursor:{get:()=>{var b,A;return(A=(b=this._currentLink)==null?void 0:b.state)==null?void 0:A.decorations.pointerCursor},set:b=>{var A;(A=this._currentLink)!=null&&A.state&&this._currentLink.state.decorations.pointerCursor!==b&&(this._currentLink.state.decorations.pointerCursor=b,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",b))}},underline:{get:()=>{var b,A;return(A=(b=this._currentLink)==null?void 0:b.state)==null?void 0:A.decorations.underline},set:b=>{var A,L,D;(A=this._currentLink)!=null&&A.state&&((D=(L=this._currentLink)==null?void 0:L.state)==null?void 0:D.decorations.underline)!==b&&(this._currentLink.state.decorations.underline=b,this._currentLink.state.isHovered&&this._fireUnderlineEvent(v.link,b))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((b=>{if(!this._currentLink)return;const A=b.start===0?0:b.start+1+this._bufferService.buffer.ydisp,L=this._bufferService.buffer.ydisp+1+b.end;if(this._currentLink.link.range.start.y>=A&&this._currentLink.link.range.end.y<=L&&(this._clearCurrentLink(A,L),this._lastMouseEvent)){const D=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);D&&this._askForLink(D,!1)}}))))}_linkHover(v,_,b){var A;(A=this._currentLink)!=null&&A.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(_,!0),this._currentLink.state.decorations.pointerCursor&&v.classList.add("xterm-cursor-pointer")),_.hover&&_.hover(b,_.text)}_fireUnderlineEvent(v,_){const b=v.range,A=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(b.start.x-1,b.start.y-A-1,b.end.x,b.end.y-A-1,void 0);(_?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_linkLeave(v,_,b){var A;(A=this._currentLink)!=null&&A.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(_,!1),this._currentLink.state.decorations.pointerCursor&&v.classList.remove("xterm-cursor-pointer")),_.leave&&_.leave(b,_.text)}_linkAtPosition(v,_){const b=v.range.start.y*this._bufferService.cols+v.range.start.x,A=v.range.end.y*this._bufferService.cols+v.range.end.x,L=_.y*this._bufferService.cols+_.x;return b<=L&&L<=A}_positionFromMouseEvent(v,_,b){const A=b.getCoords(v,_,this._bufferService.cols,this._bufferService.rows);if(A)return{x:A[0],y:A[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(v,_,b,A,L){return{x1:v,y1:_,x2:b,y2:A,cols:this._bufferService.cols,fg:L}}};o.Linkifier=S=h([g(1,E.IMouseService),g(2,E.IRenderService),g(3,T.IBufferService),g(4,E.ILinkProviderService)],S)},9042:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(f,o,c){var h=this&&this.__decorate||function(E,S,v,_){var b,A=arguments.length,L=A<3?S:_===null?_=Object.getOwnPropertyDescriptor(S,v):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,S,v,_);else for(var D=E.length-1;D>=0;D--)(b=E[D])&&(L=(A<3?b(L):A>3?b(S,v,L):b(S,v))||L);return A>3&&L&&Object.defineProperty(S,v,L),L},g=this&&this.__param||function(E,S){return function(v,_){S(v,_,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const u=c(511),y=c(2585);let w=o.OscLinkProvider=class{constructor(E,S,v){this._bufferService=E,this._optionsService=S,this._oscLinkService=v}provideLinks(E,S){var M;const v=this._bufferService.buffer.lines.get(E-1);if(!v)return void S(void 0);const _=[],b=this._optionsService.rawOptions.linkHandler,A=new u.CellData,L=v.getTrimmedLength();let D=-1,R=-1,k=!1;for(let B=0;B<L;B++)if(R!==-1||v.hasContent(B)){if(v.loadCell(B,A),A.hasExtendedAttrs()&&A.extended.urlId){if(R===-1){R=B,D=A.extended.urlId;continue}k=A.extended.urlId!==D}else R!==-1&&(k=!0);if(k||R!==-1&&B===L-1){const H=(M=this._oscLinkService.getLinkData(D))==null?void 0:M.uri;if(H){const U={start:{x:R+1,y:E},end:{x:B+(k||B!==L-1?0:1),y:E}};let P=!1;if(!(b!=null&&b.allowNonHttpProtocols))try{const K=new URL(H);["http:","https:"].includes(K.protocol)||(P=!0)}catch{P=!0}P||_.push({text:H,range:U,activate:(K,Y)=>b?b.activate(K,Y,U):T(0,Y),hover:(K,Y)=>{var G;return(G=b==null?void 0:b.hover)==null?void 0:G.call(b,K,Y,U)},leave:(K,Y)=>{var G;return(G=b==null?void 0:b.leave)==null?void 0:G.call(b,K,Y,U)}})}k=!1,A.hasExtendedAttrs()&&A.extended.urlId?(R=B,D=A.extended.urlId):(R=-1,D=-1)}}S(_)}};function T(E,S){if(confirm(`Do you want to navigate to ${S}?
|
|
54
54
|
|
|
55
|
-
WARNING: This link could potentially be dangerous`)){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=b}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=C=h([p(0,v.IBufferService),p(1,v.IOptionsService),p(2,v.IOscLinkService)],C)},6193:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.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,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const h=c(3614),p=c(3656),u=c(3551),v=c(9042),C=c(3730),T=c(1680),E=c(3107),b=c(5744),y=c(2950),_=c(1296),S=c(428),A=c(4269),L=c(5114),D=c(8934),R=c(3230),k=c(9312),M=c(4725),B=c(6731),H=c(8055),U=c(8969),P=c(8460),K=c(844),Y=c(6114),G=c(8437),W=c(2584),Z=c(7399),z=c(5941),j=c(9074),N=c(2585),$=c(5435),I=c(4567),re=c(779);class ve extends U.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=Y,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new K.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(j.DecorationService),this._instantiationService.setService(N.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(re.LinkProviderService),this._instantiationService.setService(M.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,ee)=>this.refresh(q,ee)))),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,K.toDisposable)((()=>{var q,ee;this._customKeyEventHandler=void 0,(ee=(q=this.element)==null?void 0:q.parentNode)==null||ee.removeChild(this.element)})))}_handleColorEvent(Q){if(this._themeService)for(const q of Q){let ee,ae="";switch(q.index){case 256:ee="foreground",ae="10";break;case 257:ee="background",ae="11";break;case 258:ee="cursor",ae="12";break;default:ee="ansi",ae="4;"+q.index}switch(q.type){case 0:const pe=H.color.toColorRGB(ee==="ansi"?this._themeService.colors.ansi[q.index]:this._themeService.colors[ee]);this.coreService.triggerDataEvent(`${W.C0.ESC}]${ae};${(0,z.toRgbString)(pe)}${W.C1_ESCAPED.ST}`);break;case 1:if(ee==="ansi")this._themeService.modifyColors((se=>se.ansi[q.index]=H.channels.toColor(...q.color)));else{const se=ee;this._themeService.modifyColors((we=>we[se]=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(W.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(W.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 ee=Math.min(this.buffer.x,this.cols-1),ae=this._renderService.dimensions.css.cell.height,pe=q.getWidth(ee),se=this._renderService.dimensions.css.cell.width*pe,we=this.buffer.y*this._renderService.dimensions.css.cell.height,je=ee*this._renderService.dimensions.css.cell.width;this.textarea.style.left=je+"px",this.textarea.style.top=we+"px",this.textarea.style.width=se+"px",this.textarea.style.height=ae+"px",this.textarea.style.lineHeight=ae+"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)),Y.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)}))),Y.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 ee;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"),((ee=this.element)==null?void 0:ee.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",(ae=>this.updateCursorStyle(ae)))),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",v.promptLabel),Y.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(L.CoreBrowserService,this.textarea,Q.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(M.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",(ae=>this._handleTextAreaFocus(ae)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(S.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(M.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(B.ThemeService),this._instantiationService.setService(M.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(A.CharacterJoinerService),this._instantiationService.setService(M.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(R.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(M.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ae=>this._onRender.fire(ae)))),this.onResize((ae=>this._renderService.resize(ae.cols,ae.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(y.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(D.MouseService),this._instantiationService.setService(M.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(T.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ae=>this.scrollLines(ae.amount,ae.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(k.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(M.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ae=>this.scrollLines(ae.amount,ae.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ae=>this._renderService.handleSelectionChanged(ae.start,ae.end,ae.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ae=>{this.textarea.value=ae,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ae=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(E.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(ae=>this._selectionService.handleMouseDown(ae)))),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",(ae=>this._handleScreenReaderModeOptionChange(ae)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ae=>{!this._overviewRulerRenderer&&ae&&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(_.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Q=this,q=this.element;function ee(se){const we=Q._mouseService.getMouseReportCoords(se,Q.screenElement);if(!we)return!1;let je,ze;switch(se.overrideType||se.type){case"mousemove":ze=32,se.buttons===void 0?(je=3,se.button!==void 0&&(je=se.button<3?se.button:3)):je=1&se.buttons?0:4&se.buttons?1:2&se.buttons?2:3;break;case"mouseup":ze=0,je=se.button<3?se.button:3;break;case"mousedown":ze=1,je=se.button<3?se.button:3;break;case"wheel":if(Q._customWheelEventHandler&&Q._customWheelEventHandler(se)===!1||Q.viewport.getLinesScrolled(se)===0)return!1;ze=se.deltaY<0?0:1,je=4;break;default:return!1}return!(ze===void 0||je===void 0||je>4)&&Q.coreMouseService.triggerMouseEvent({col:we.col,row:we.row,x:we.x,y:we.y,button:je,action:ze,ctrl:se.ctrlKey,alt:se.altKey,shift:se.shiftKey})}const ae={mouseup:null,wheel:null,mousedrag:null,mousemove:null},pe={mouseup:se=>(ee(se),se.buttons||(this._document.removeEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.removeEventListener("mousemove",ae.mousedrag)),this.cancel(se)),wheel:se=>(ee(se),this.cancel(se,!0)),mousedrag:se=>{se.buttons&&ee(se)},mousemove:se=>{se.buttons||ee(se)}};this.register(this.coreMouseService.onProtocolChange((se=>{se?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(se)),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&se?ae.mousemove||(q.addEventListener("mousemove",pe.mousemove),ae.mousemove=pe.mousemove):(q.removeEventListener("mousemove",ae.mousemove),ae.mousemove=null),16&se?ae.wheel||(q.addEventListener("wheel",pe.wheel,{passive:!1}),ae.wheel=pe.wheel):(q.removeEventListener("wheel",ae.wheel),ae.wheel=null),2&se?ae.mouseup||(ae.mouseup=pe.mouseup):(this._document.removeEventListener("mouseup",ae.mouseup),ae.mouseup=null),4&se?ae.mousedrag||(ae.mousedrag=pe.mousedrag):(this._document.removeEventListener("mousemove",ae.mousedrag),ae.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(q,"mousedown",(se=>{if(se.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(se))return ee(se),ae.mouseup&&this._document.addEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.addEventListener("mousemove",ae.mousedrag),this.cancel(se)}))),this.register((0,p.addDisposableDomListener)(q,"wheel",(se=>{if(!ae.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(se)===!1)return!1;if(!this.buffer.hasScrollback){const we=this.viewport.getLinesScrolled(se);if(we===0)return;const je=W.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(se.deltaY<0?"A":"B");let ze="";for(let Pe=0;Pe<Math.abs(we);Pe++)ze+=je;return this.coreService.triggerDataEvent(ze,!0),this.cancel(se,!0)}return this.viewport.handleWheel(se)?this.cancel(se):void 0}}),{passive:!1})),this.register((0,p.addDisposableDomListener)(q,"touchstart",(se=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(se),this.cancel(se)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(q,"touchmove",(se=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(se)?void 0:this.cancel(se)}),{passive:!1}))}refresh(Q,q){var ee;(ee=this._renderService)==null||ee.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,ee=0){var ae;ee===1?(super.scrollLines(Q,q,ee),this.refresh(0,this.rows-1)):(ae=this.viewport)==null||ae.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,ee){this._selectionService.setSelection(Q,q,ee)}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 ee;(ee=this._selectionService)==null||ee.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 ee=(0,Z.evaluateKeyboardEvent)(Q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Q),ee.type===3||ee.type===2){const ae=this.rows-1;return this.scrollLines(ee.type===2?-ae:ae),this.cancel(Q,!0)}return ee.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Q)||(ee.cancel&&this.cancel(Q,!0),!ee.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):(ee.key!==W.C0.ETX&&ee.key!==W.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ee.key,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(ee.key,!0),!this.optionsService.rawOptions.screenReaderMode||Q.altKey||Q.ctrlKey?this.cancel(Q,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Q,q){const ee=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"?ee:ee&&(!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 ee,ae;(ee=this._charSizeService)==null||ee.measure(),(ae=this.viewport)==null||ae.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,ee;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(),(ee=this.viewport)==null||ee.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(W.C0.ESC+"[I"):this.coreService.triggerDataEvent(W.C0.ESC+"[O")}_reportWindowsOptions(Q){if(this._renderService)switch(Q){case $.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const q=this._renderService.dimensions.css.canvas.width.toFixed(0),ee=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${W.C0.ESC}[4;${ee};${q}t`);break;case $.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ae=this._renderService.dimensions.css.cell.width.toFixed(0),pe=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${W.C0.ESC}[6;${pe};${ae}t`)}}cancel(Q,q){if(this.options.cancelEvents||q)return Q.preventDefault(),Q.stopPropagation(),!1}}o.Terminal=ve},9924:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.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 v=u-this._lastRefreshMs,C=this._debounceThresholdMS-v;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,o,c){var h=this&&this.__decorate||function(y,_,S,A){var L,D=arguments.length,R=D<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,_,S,A);else for(var k=y.length-1;k>=0;k--)(L=y[k])&&(R=(D<3?L(R):D>3?L(_,S,R):L(_,S))||R);return D>3&&R&&Object.defineProperty(_,S,R),R},p=this&&this.__param||function(y,_){return function(S,A){_(S,A,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const u=c(3656),v=c(4725),C=c(8460),T=c(844),E=c(2585);let b=o.Viewport=class extends T.Disposable{constructor(y,_,S,A,L,D,R,k){super(),this._viewportElement=y,this._scrollArea=_,this._bufferService=S,this._optionsService=A,this._charSizeService=L,this._renderService=D,this._coreBrowserService=R,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((M=>this._activeBuffer=M.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((M=>this._renderDimensions=M))),this._handleThemeChange(k.colors),this.register(k.onChangeColors((M=>this._handleThemeChange(M)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(y){this._viewportElement.style.backgroundColor=y.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(y){if(y)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 _=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==_&&(this._lastRecordedBufferHeight=_,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const y=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==y&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=y),this._refreshAnimationFrame=null}syncScrollArea(y=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(y);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(y)}_handleScroll(y){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 _=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:_,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const y=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(y*(this._smoothScrollState.target-this._smoothScrollState.origin)),y<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(y,_){const S=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(_<0&&this._viewportElement.scrollTop!==0||_>0&&S<this._lastRecordedBufferHeight)||(y.cancelable&&y.preventDefault(),!1)}handleWheel(y){const _=this._getPixelsScrolled(y);return _!==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+_:this._smoothScrollState.target+=_,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=_,this._bubbleScroll(y,_))}scrollLines(y){if(y!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const _=y*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+_,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:y,suppressScrollEvent:!1})}_getPixelsScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let _=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_LINE?_*=this._currentRowHeight:y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._currentRowHeight*this._bufferService.rows),_}getBufferElements(y,_){var k;let S,A="";const L=[],D=_??this._bufferService.buffer.lines.length,R=this._bufferService.buffer.lines;for(let M=y;M<D;M++){const B=R.get(M);if(!B)continue;const H=(k=R.get(M+1))==null?void 0:k.isWrapped;if(A+=B.translateToString(!H),!H||M===R.length-1){const U=document.createElement("div");U.textContent=A,L.push(U),A.length>0&&(S=U),A=""}}return{bufferElements:L,cursorElement:S}}getLinesScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let _=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(_/=this._currentRowHeight+0,this._wheelPartialScroll+=_,_=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._bufferService.rows),_}_applyScrollModifier(y,_){const S=this._optionsService.rawOptions.fastScrollModifier;return S==="alt"&&_.altKey||S==="ctrl"&&_.ctrlKey||S==="shift"&&_.shiftKey?y*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:y*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(y){this._lastTouchY=y.touches[0].pageY}handleTouchMove(y){const _=this._lastTouchY-y.touches[0].pageY;return this._lastTouchY=y.touches[0].pageY,_!==0&&(this._viewportElement.scrollTop+=_,this._bubbleScroll(y,_))}};o.Viewport=b=h([p(2,E.IBufferService),p(3,E.IOptionsService),p(4,v.ICharSizeService),p(5,v.IRenderService),p(6,v.ICoreBrowserService),p(7,v.IThemeService)],b)},3107:function(f,o,c){var h=this&&this.__decorate||function(E,b,y,_){var S,A=arguments.length,L=A<3?b:_===null?_=Object.getOwnPropertyDescriptor(b,y):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,b,y,_);else for(var D=E.length-1;D>=0;D--)(S=E[D])&&(L=(A<3?S(L):A>3?S(b,y,L):S(b,y))||L);return A>3&&L&&Object.defineProperty(b,y,L),L},p=this&&this.__param||function(E,b){return function(y,_){b(y,_,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const u=c(4725),v=c(844),C=c(2585);let T=o.BufferDecorationRenderer=class extends v.Disposable{constructor(E,b,y,_,S){super(),this._screenElement=E,this._bufferService=b,this._coreBrowserService=y,this._decorationService=_,this._renderService=S,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((A=>this._removeDecoration(A)))),this.register((0,v.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 E of this._decorationService.decorations)this._renderDecoration(E);this._dimensionsChanged=!1}_renderDecoration(E){this._refreshStyle(E),this._dimensionsChanged&&this._refreshXPosition(E)}_createElement(E){var _;const b=this._coreBrowserService.mainDocument.createElement("div");b.classList.add("xterm-decoration"),b.classList.toggle("xterm-decoration-top-layer",((_=E==null?void 0:E.options)==null?void 0:_.layer)==="top"),b.style.width=`${Math.round((E.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,b.style.height=(E.options.height||1)*this._renderService.dimensions.css.cell.height+"px",b.style.top=(E.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 y=E.options.x??0;return y&&y>this._bufferService.cols&&(b.style.display="none"),this._refreshXPosition(E,b),b}_refreshStyle(E){const b=E.marker.line-this._bufferService.buffers.active.ydisp;if(b<0||b>=this._bufferService.rows)E.element&&(E.element.style.display="none",E.onRenderEmitter.fire(E.element));else{let y=this._decorationElements.get(E);y||(y=this._createElement(E),E.element=y,this._decorationElements.set(E,y),this._container.appendChild(y),E.onDispose((()=>{this._decorationElements.delete(E),y.remove()}))),y.style.top=b*this._renderService.dimensions.css.cell.height+"px",y.style.display=this._altBufferIsActive?"none":"block",E.onRenderEmitter.fire(y)}}_refreshXPosition(E,b=E.element){if(!b)return;const y=E.options.x??0;(E.options.anchor||"left")==="right"?b.style.right=y?y*this._renderService.dimensions.css.cell.width+"px":"":b.style.left=y?y*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(E){var b;(b=this._decorationElements.get(E))==null||b.remove(),this._decorationElements.delete(E),E.dispose()}};o.BufferDecorationRenderer=T=h([p(1,C.IBufferService),p(2,u.ICoreBrowserService),p(3,C.IDecorationService),p(4,u.IRenderService)],T)},5871:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.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,o,c){var h=this&&this.__decorate||function(S,A,L,D){var R,k=arguments.length,M=k<3?A:D===null?D=Object.getOwnPropertyDescriptor(A,L):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(S,A,L,D);else for(var B=S.length-1;B>=0;B--)(R=S[B])&&(M=(k<3?R(M):k>3?R(A,L,M):R(A,L))||M);return k>3&&M&&Object.defineProperty(A,L,M),M},p=this&&this.__param||function(S,A){return function(L,D){A(L,D,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const u=c(5871),v=c(4725),C=c(844),T=c(2585),E={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0};let _=o.OverviewRulerRenderer=class extends C.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(S,A,L,D,R,k,M){var H;super(),this._viewportElement=S,this._screenElement=A,this._bufferService=L,this._decorationService=D,this._renderService=R,this._optionsService=k,this._coreBrowserService=M,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 U;(U=this._canvas)==null||U.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 S=Math.floor(this._canvas.width/3),A=Math.ceil(this._canvas.width/3);b.full=this._canvas.width,b.left=S,b.center=A,b.right=S,this._refreshDrawHeightConstants(),y.full=0,y.left=0,y.center=b.left,y.right=b.left+b.center}_refreshDrawHeightConstants(){E.full=Math.round(2*this._coreBrowserService.dpr);const S=this._canvas.height/this._bufferService.buffer.lines.length,A=Math.round(Math.max(Math.min(S,12),6)*this._coreBrowserService.dpr);E.left=A,E.center=A,E.right=A}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.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 A of this._decorationService.decorations)this._colorZoneStore.addDecoration(A);this._ctx.lineWidth=1;const S=this._colorZoneStore.zones;for(const A of S)A.position!=="full"&&this._renderColorZone(A);for(const A of S)A.position==="full"&&this._renderColorZone(A);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(S){this._ctx.fillStyle=S.color,this._ctx.fillRect(y[S.position||"full"],Math.round((this._canvas.height-1)*(S.startBufferLine/this._bufferService.buffers.active.lines.length)-E[S.position||"full"]/2),b[S.position||"full"],Math.round((this._canvas.height-1)*((S.endBufferLine-S.startBufferLine)/this._bufferService.buffers.active.lines.length)+E[S.position||"full"]))}_queueRefresh(S,A){this._shouldUpdateDimensions=S||this._shouldUpdateDimensions,this._shouldUpdateAnchor=A||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=_=h([p(2,T.IBufferService),p(3,T.IDecorationService),p(4,v.IRenderService),p(5,T.IOptionsService),p(6,v.ICoreBrowserService)],_)},2950:function(f,o,c){var h=this&&this.__decorate||function(E,b,y,_){var S,A=arguments.length,L=A<3?b:_===null?_=Object.getOwnPropertyDescriptor(b,y):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,b,y,_);else for(var D=E.length-1;D>=0;D--)(S=E[D])&&(L=(A<3?S(L):A>3?S(b,y,L):S(b,y))||L);return A>3&&L&&Object.defineProperty(b,y,L),L},p=this&&this.__param||function(E,b){return function(y,_){b(y,_,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const u=c(4725),v=c(2585),C=c(2584);let T=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(E,b,y,_,S,A){this._textarea=E,this._compositionView=b,this._bufferService=y,this._optionsService=_,this._coreService=S,this._renderService=A,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(E){this._compositionView.textContent=E.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(E){if(this._isComposing||this._isSendingComposition){if(E.keyCode===229||E.keyCode===16||E.keyCode===17||E.keyCode===18)return!1;this._finalizeComposition(!1)}return E.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(E){if(this._compositionView.classList.remove("active"),this._isComposing=!1,E){const b={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let y;this._isSendingComposition=!1,b.start+=this._dataAlreadySent.length,y=this._isComposing?this._textarea.value.substring(b.start,b.end):this._textarea.value.substring(b.start),y.length>0&&this._coreService.triggerDataEvent(y,!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 E=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const b=this._textarea.value,y=b.replace(E,"");this._dataAlreadySent=y,b.length>E.length?this._coreService.triggerDataEvent(y,!0):b.length<E.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):b.length===E.length&&b!==E&&this._coreService.triggerDataEvent(b,!0)}}),0)}updateCompositionElements(E){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const b=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),y=this._renderService.dimensions.css.cell.height,_=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,S=b*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=S+"px",this._compositionView.style.top=_+"px",this._compositionView.style.height=y+"px",this._compositionView.style.lineHeight=y+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const A=this._compositionView.getBoundingClientRect();this._textarea.style.left=S+"px",this._textarea.style.top=_+"px",this._textarea.style.width=Math.max(A.width,1)+"px",this._textarea.style.height=Math.max(A.height,1)+"px",this._textarea.style.lineHeight=A.height+"px"}E||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};o.CompositionHelper=T=h([p(2,v.IBufferService),p(3,v.IOptionsService),p(4,v.ICoreService),p(5,u.IRenderService)],T)},9806:(f,o)=>{function c(h,p,u){const v=u.getBoundingClientRect(),C=h.getComputedStyle(u),T=parseInt(C.getPropertyValue("padding-left")),E=parseInt(C.getPropertyValue("padding-top"));return[p.clientX-v.left-T,p.clientY-v.top-E]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(h,p,u,v,C,T,E,b,y){if(!T)return;const _=c(h,p,u);return _?(_[0]=Math.ceil((_[0]+(y?E/2:0))/E),_[1]=Math.ceil(_[1]/b),_[0]=Math.min(Math.max(_[0],1),v+(y?1:0)),_[1]=Math.min(Math.max(_[1],1),C),_):void 0}},9504:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const h=c(2584);function p(b,y,_,S){const A=b-u(b,_),L=y-u(y,_),D=Math.abs(A-L)-(function(R,k,M){let B=0;const H=R-u(R,M),U=k-u(k,M);for(let P=0;P<Math.abs(H-U);P++){const K=v(R,k)==="A"?-1:1,Y=M.buffer.lines.get(H+K*P);Y!=null&&Y.isWrapped&&B++}return B})(b,y,_);return E(D,T(v(b,y),S))}function u(b,y){let _=0,S=y.buffer.lines.get(b),A=S==null?void 0:S.isWrapped;for(;A&&b>=0&&b<y.rows;)_++,S=y.buffer.lines.get(--b),A=S==null?void 0:S.isWrapped;return _}function v(b,y){return b>y?"A":"B"}function C(b,y,_,S,A,L){let D=b,R=y,k="";for(;D!==_||R!==S;)D+=A?1:-1,A&&D>L.cols-1?(k+=L.buffer.translateBufferLineToString(R,!1,b,D),D=0,b=0,R++):!A&&D<0&&(k+=L.buffer.translateBufferLineToString(R,!1,0,b+1),D=L.cols-1,b=D,R--);return k+L.buffer.translateBufferLineToString(R,!1,b,D)}function T(b,y){const _=y?"O":"[";return h.C0.ESC+_+b}function E(b,y){b=Math.floor(b);let _="";for(let S=0;S<b;S++)_+=y;return _}o.moveToCellSequence=function(b,y,_,S){const A=_.buffer.x,L=_.buffer.y;if(!_.buffer.hasScrollback)return(function(k,M,B,H,U,P){return p(M,H,U,P).length===0?"":E(C(k,M,k,M-u(M,U),!1,U).length,T("D",P))})(A,L,0,y,_,S)+p(L,y,_,S)+(function(k,M,B,H,U,P){let K;K=p(M,H,U,P).length>0?H-u(H,U):M;const Y=H,G=(function(W,Z,z,j,N,$){let I;return I=p(z,j,N,$).length>0?j-u(j,N):Z,W<z&&I<=j||W>=z&&I<j?"C":"D"})(k,M,B,H,U,P);return E(C(k,K,B,Y,G==="C",U).length,T(G,P))})(A,L,b,y,_,S);let D;if(L===y)return D=A>b?"D":"C",E(Math.abs(A-b),T(D,S));D=L>y?"D":"C";const R=Math.abs(L-y);return E((function(k,M){return M.cols-k})(L>y?b:A,_)+(R-1)*_.cols+1+((L>y?A:b)-1),T(D,S))}},1296:function(f,o,c){var h=this&&this.__decorate||function(P,K,Y,G){var W,Z=arguments.length,z=Z<3?K:G===null?G=Object.getOwnPropertyDescriptor(K,Y):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(P,K,Y,G);else for(var j=P.length-1;j>=0;j--)(W=P[j])&&(z=(Z<3?W(z):Z>3?W(K,Y,z):W(K,Y))||z);return Z>3&&z&&Object.defineProperty(K,Y,z),z},p=this&&this.__param||function(P,K){return function(Y,G){K(Y,G,P)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const u=c(3787),v=c(2550),C=c(2223),T=c(6171),E=c(6052),b=c(4725),y=c(8055),_=c(8460),S=c(844),A=c(2585),L="xterm-dom-renderer-owner-",D="xterm-rows",R="xterm-fg-",k="xterm-bg-",M="xterm-focus",B="xterm-selection";let H=1,U=o.DomRenderer=class extends S.Disposable{constructor(P,K,Y,G,W,Z,z,j,N,$,I,re,ve){super(),this._terminal=P,this._document=K,this._element=Y,this._screenElement=G,this._viewportElement=W,this._helperContainer=Z,this._linkifier2=z,this._charSizeService=N,this._optionsService=$,this._bufferService=I,this._coreBrowserService=re,this._themeService=ve,this._terminalClass=H++,this._rowElements=[],this._selectionRenderModel=(0,E.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new _.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,T.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=j.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(L+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,S.toDisposable)((()=>{this._element.classList.remove(L+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new v.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 Y of this._rowElements)Y.style.width=`${this.dimensions.css.canvas.width}px`,Y.style.height=`${this.dimensions.css.cell.height}px`,Y.style.lineHeight=`${this.dimensions.css.cell.height}px`,Y.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const K=`${this._terminalSelector} .${D} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=K,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 K=`${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}`;K+=`${this._terminalSelector} .${D} .xterm-dim { color: ${y.color.multiplyOpacity(P.foreground,.5).css};}`,K+=`${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 Y=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,W=`blink_block_${this._terminalClass}`;K+=`@keyframes ${Y} { 50% { border-bottom-style: hidden; }}`,K+=`@keyframes ${G} { 50% { box-shadow: none; }}`,K+=`@keyframes ${W} { 0% { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css}; } 50% { background-color: inherit; color: ${P.cursor.css}; }}`,K+=`${this._terminalSelector} .${D}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${D}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${D}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${W} 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);}`,K+=`${this._terminalSelector} .${B} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${B} div { position: absolute; background-color: ${P.selectionBackgroundOpaque.css};}${this._terminalSelector} .${B} div { position: absolute; background-color: ${P.selectionInactiveBackgroundOpaque.css};}`;for(const[Z,z]of P.ansi.entries())K+=`${this._terminalSelector} .${R}${Z} { color: ${z.css}; }${this._terminalSelector} .${R}${Z}.xterm-dim { color: ${y.color.multiplyOpacity(z,.5).css}; }${this._terminalSelector} .${k}${Z} { background-color: ${z.css}; }`;K+=`${this._terminalSelector} .${R}${C.INVERTED_DEFAULT_COLOR} { color: ${y.color.opaque(P.background).css}; }${this._terminalSelector} .${R}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${y.color.multiplyOpacity(y.color.opaque(P.background),.5).css}; }${this._terminalSelector} .${k}${C.INVERTED_DEFAULT_COLOR} { background-color: ${P.foreground.css}; }`,this._themeStyleElement.textContent=K}_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,K){for(let Y=this._rowElements.length;Y<=K;Y++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>K;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(P,K){this._refreshRowElements(P,K),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(M),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(M),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(P,K,Y){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(P,K,Y),this.renderRows(0,this._bufferService.rows-1),!P||!K)return;this._selectionRenderModel.update(this._terminal,P,K,Y);const G=this._selectionRenderModel.viewportStartRow,W=this._selectionRenderModel.viewportEndRow,Z=this._selectionRenderModel.viewportCappedStartRow,z=this._selectionRenderModel.viewportCappedEndRow;if(Z>=this._bufferService.rows||z<0)return;const j=this._document.createDocumentFragment();if(Y){const N=P[0]>K[0];j.appendChild(this._createSelectionElement(Z,N?K[0]:P[0],N?P[0]:K[0],z-Z+1))}else{const N=G===Z?P[0]:0,$=Z===W?K[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(Z,N,$));const I=z-Z-1;if(j.appendChild(this._createSelectionElement(Z+1,0,this._bufferService.cols,I)),Z!==z){const re=W===z?K[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(z,0,re))}}this._selectionContainer.appendChild(j)}_createSelectionElement(P,K,Y,G=1){const W=this._document.createElement("div"),Z=K*this.dimensions.css.cell.width;let z=this.dimensions.css.cell.width*(Y-K);return Z+z>this.dimensions.css.canvas.width&&(z=this.dimensions.css.canvas.width-Z),W.style.height=G*this.dimensions.css.cell.height+"px",W.style.top=P*this.dimensions.css.cell.height+"px",W.style.left=`${Z}px`,W.style.width=`${z}px`,W}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,K){const Y=this._bufferService.buffer,G=Y.ybase+Y.y,W=Math.min(Y.x,this._bufferService.cols-1),Z=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,j=this._optionsService.rawOptions.cursorInactiveStyle;for(let N=P;N<=K;N++){const $=N+Y.ydisp,I=this._rowElements[N],re=Y.lines.get($);if(!I||!re)break;I.replaceChildren(...this._rowFactory.createRow(re,$,$===G,z,j,W,Z,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${L}${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,Y,G,W,Z){Y<0&&(P=0),G<0&&(K=0);const z=this._bufferService.rows-1;Y=Math.max(Math.min(Y,z),0),G=Math.max(Math.min(G,z),0),W=Math.min(W,this._bufferService.cols);const j=this._bufferService.buffer,N=j.ybase+j.y,$=Math.min(j.x,W-1),I=this._optionsService.rawOptions.cursorBlink,re=this._optionsService.rawOptions.cursorStyle,ve=this._optionsService.rawOptions.cursorInactiveStyle;for(let me=Y;me<=G;++me){const Q=me+j.ydisp,q=this._rowElements[me],ee=j.lines.get(Q);if(!q||!ee)break;q.replaceChildren(...this._rowFactory.createRow(ee,Q,Q===N,re,ve,$,I,this.dimensions.css.cell.width,this._widthCache,Z?me===Y?P:0:-1,Z?(me===G?K:W)-1:-1))}}};o.DomRenderer=U=h([p(7,A.IInstantiationService),p(8,b.ICharSizeService),p(9,A.IOptionsService),p(10,A.IBufferService),p(11,b.ICoreBrowserService),p(12,b.IThemeService)],U)},3787:function(f,o,c){var h=this&&this.__decorate||function(D,R,k,M){var B,H=arguments.length,U=H<3?R:M===null?M=Object.getOwnPropertyDescriptor(R,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(D,R,k,M);else for(var P=D.length-1;P>=0;P--)(B=D[P])&&(U=(H<3?B(U):H>3?B(R,k,U):B(R,k))||U);return H>3&&U&&Object.defineProperty(R,k,U),U},p=this&&this.__param||function(D,R){return function(k,M){R(k,M,D)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const u=c(2223),v=c(643),C=c(511),T=c(2585),E=c(8055),b=c(4725),y=c(4269),_=c(6171),S=c(3734);let A=o.DomRendererRowFactory=class{constructor(D,R,k,M,B,H,U){this._document=D,this._characterJoinerService=R,this._optionsService=k,this._coreBrowserService=M,this._coreService=B,this._decorationService=H,this._themeService=U,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(D,R,k){this._selectionStart=D,this._selectionEnd=R,this._columnSelectMode=k}createRow(D,R,k,M,B,H,U,P,K,Y,G){const W=[],Z=this._characterJoinerService.getJoinedCharacters(R),z=this._themeService.colors;let j,N=D.getNoBgTrimmedLength();k&&N<H+1&&(N=H+1);let $=0,I="",re=0,ve=0,me=0,Q=!1,q=0,ee=!1,ae=0;const pe=[],se=Y!==-1&&G!==-1;for(let we=0;we<N;we++){D.loadCell(we,this._workCell);let je=this._workCell.getWidth();if(je===0)continue;let ze=!1,Pe=we,xe=this._workCell;if(Z.length>0&&we===Z[0][0]){ze=!0;const Fe=Z.shift();xe=new y.JoinedCellData(this._workCell,D.translateToString(!0,Fe[0],Fe[1]),Fe[1]-Fe[0]),Pe=Fe[1]-1,je=xe.getWidth()}const xt=this._isCellInSelection(we,R),yt=k&&we===H,Nt=se&&we>=Y&&we<=G;let Gt=!1;this._decorationService.forEachDecorationAtCell(we,R,void 0,(Fe=>{Gt=!0}));let Sn=xe.getChars()||v.WHITESPACE_CELL_CHAR;if(Sn===" "&&(xe.isUnderline()||xe.isOverline())&&(Sn=" "),ae=je*P-K.get(Sn,xe.isBold(),xe.isItalic()),j){if($&&(xt&&ee||!xt&&!ee&&xe.bg===re)&&(xt&&ee&&z.selectionForeground||xe.fg===ve)&&xe.extended.ext===me&&Nt===Q&&ae===q&&!yt&&!ze&&!Gt){xe.isInvisible()?I+=v.WHITESPACE_CELL_CHAR:I+=Sn,$++;continue}$&&(j.textContent=I),j=this._document.createElement("span"),$=0,I=""}else j=this._document.createElement("span");if(re=xe.bg,ve=xe.fg,me=xe.extended.ext,Q=Nt,q=ae,ee=xt,ze&&H>=we&&H<=Pe&&(H=we),!this._coreService.isCursorHidden&&yt&&this._coreService.isCursorInitialized){if(pe.push("xterm-cursor"),this._coreBrowserService.isFocused)U&&pe.push("xterm-cursor-blink"),pe.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(B)switch(B){case"outline":pe.push("xterm-cursor-outline");break;case"block":pe.push("xterm-cursor-block");break;case"bar":pe.push("xterm-cursor-bar");break;case"underline":pe.push("xterm-cursor-underline")}}if(xe.isBold()&&pe.push("xterm-bold"),xe.isItalic()&&pe.push("xterm-italic"),xe.isDim()&&pe.push("xterm-dim"),I=xe.isInvisible()?v.WHITESPACE_CELL_CHAR:xe.getChars()||v.WHITESPACE_CELL_CHAR,xe.isUnderline()&&(pe.push(`xterm-underline-${xe.extended.underlineStyle}`),I===" "&&(I=" "),!xe.isUnderlineColorDefault()))if(xe.isUnderlineColorRGB())j.style.textDecorationColor=`rgb(${S.AttributeData.toColorRGB(xe.getUnderlineColor()).join(",")})`;else{let Fe=xe.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&xe.isBold()&&Fe<8&&(Fe+=8),j.style.textDecorationColor=z.ansi[Fe].css}xe.isOverline()&&(pe.push("xterm-overline"),I===" "&&(I=" ")),xe.isStrikethrough()&&pe.push("xterm-strikethrough"),Nt&&(j.style.textDecoration="underline");let St=xe.getFgColor(),tt=xe.getFgColorMode(),Lt=xe.getBgColor(),he=xe.getBgColorMode();const Se=!!xe.isInverse();if(Se){const Fe=St;St=Lt,Lt=Fe;const gt=tt;tt=he,he=gt}let Ae,Le,Oe,ut=!1;switch(this._decorationService.forEachDecorationAtCell(we,R,void 0,(Fe=>{Fe.options.layer!=="top"&&ut||(Fe.backgroundColorRGB&&(he=50331648,Lt=Fe.backgroundColorRGB.rgba>>8&16777215,Ae=Fe.backgroundColorRGB),Fe.foregroundColorRGB&&(tt=50331648,St=Fe.foregroundColorRGB.rgba>>8&16777215,Le=Fe.foregroundColorRGB),ut=Fe.options.layer==="top")})),!ut&&xt&&(Ae=this._coreBrowserService.isFocused?z.selectionBackgroundOpaque:z.selectionInactiveBackgroundOpaque,Lt=Ae.rgba>>8&16777215,he=50331648,ut=!0,z.selectionForeground&&(tt=50331648,St=z.selectionForeground.rgba>>8&16777215,Le=z.selectionForeground)),ut&&pe.push("xterm-decoration-top"),he){case 16777216:case 33554432:Oe=z.ansi[Lt],pe.push(`xterm-bg-${Lt}`);break;case 50331648:Oe=E.channels.toColor(Lt>>16,Lt>>8&255,255&Lt),this._addStyle(j,`background-color:#${L((Lt>>>0).toString(16),"0",6)}`);break;default:Se?(Oe=z.foreground,pe.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):Oe=z.background}switch(Ae||xe.isDim()&&(Ae=E.color.multiplyOpacity(Oe,.5)),tt){case 16777216:case 33554432:xe.isBold()&&St<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(St+=8),this._applyMinimumContrast(j,Oe,z.ansi[St],xe,Ae,void 0)||pe.push(`xterm-fg-${St}`);break;case 50331648:const Fe=E.channels.toColor(St>>16&255,St>>8&255,255&St);this._applyMinimumContrast(j,Oe,Fe,xe,Ae,Le)||this._addStyle(j,`color:#${L(St.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(j,Oe,z.foreground,xe,Ae,Le)||Se&&pe.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}pe.length&&(j.className=pe.join(" "),pe.length=0),yt||ze||Gt?j.textContent=I:$++,ae!==this.defaultSpacing&&(j.style.letterSpacing=`${ae}px`),W.push(j),we=Pe}return j&&$&&(j.textContent=I),W}_applyMinimumContrast(D,R,k,M,B,H){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,_.treatGlyphAsBackgroundColor)(M.getCode()))return!1;const U=this._getContrastCache(M);let P;if(B||H||(P=U.getColor(R.rgba,k.rgba)),P===void 0){const K=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);P=E.color.ensureContrastRatio(B||R,H||k,K),U.setColor((B||R).rgba,(H||k).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,R){D.setAttribute("style",`${D.getAttribute("style")||""}${R};`)}_isCellInSelection(D,R){const k=this._selectionStart,M=this._selectionEnd;return!(!k||!M)&&(this._columnSelectMode?k[0]<=M[0]?D>=k[0]&&R>=k[1]&&D<M[0]&&R<=M[1]:D<k[0]&&R>=k[1]&&D>=M[0]&&R<=M[1]:R>k[1]&&R<M[1]||k[1]===M[1]&&R===k[1]&&D>=k[0]&&D<M[0]||k[1]<M[1]&&R===M[1]&&D<M[0]||k[1]<M[1]&&R===k[1]&&D>=k[0])}};function L(D,R,k){for(;D.length<k;)D=R+D;return D}o.DomRendererRowFactory=A=h([p(1,b.ICharacterJoinerService),p(2,T.IOptionsService),p(3,b.ICoreBrowserService),p(4,T.ICoreService),p(5,T.IDecorationService),p(6,b.IThemeService)],A)},2550:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.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 v=c.createElement("span");v.classList.add("xterm-char-measure-element"),v.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,v,C],this._container.appendChild(p),this._container.appendChild(u),this._container.appendChild(v),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 T=this._measure(c,0);return T>0&&(this._flat[u]=T),T}let v=c;h&&(v+="B"),p&&(v+="I");let C=this._holey.get(v);if(C===void 0){let T=0;h&&(T|=1),p&&(T|=2),C=this._measure(c,T),C>0&&this._holey.set(v,C)}return C}_measure(c,h){const p=this._measureElements[h];return p.textContent=c.repeat(32),p.offsetWidth/32}}},2223:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const h=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(f,o)=>{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(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},o.isEmoji=h,o.allowRescaling=function(p,u,v,C){return u===1&&v>Math.ceil(1.5*C)&&p!==void 0&&p>255&&!h(p)&&!c(p)&&!(function(T){return 57344<=T&&T<=63743})(p)},o.treatGlyphAsBackgroundColor=function(p){return c(p)||(function(u){return 9472<=u&&u<=9631})(p)},o.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}}}},o.computeNextVariantOffset=function(p,u,v=0){return(p-(2*Math.round(u)-v))%(2*Math.round(u))}},6052:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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,v,C=!1){if(this.selectionStart=u,this.selectionEnd=v,!u||!v||u[0]===v[0]&&u[1]===v[1])return void this.clear();const T=p.buffers.active.ydisp,E=u[1]-T,b=v[1]-T,y=Math.max(E,0),_=Math.min(b,p.rows-1);y>=p.rows||_<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=C,this.viewportStartRow=E,this.viewportEndRow=b,this.viewportCappedStartRow=y,this.viewportCappedEndRow=_,this.startCol=u[0],this.endCol=v[0])}isCellSelected(p,u,v){return!!this.hasSelection&&(v-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&v>=this.viewportCappedStartRow&&u<this.endCol&&v<=this.viewportCappedEndRow:u<this.startCol&&v>=this.viewportCappedStartRow&&u>=this.endCol&&v<=this.viewportCappedEndRow:v>this.viewportStartRow&&v<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&v===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportStartRow&&u>=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.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,o,c){var h=this&&this.__decorate||function(_,S,A,L){var D,R=arguments.length,k=R<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,S,A,L);else for(var M=_.length-1;M>=0;M--)(D=_[M])&&(k=(R<3?D(k):R>3?D(S,A,k):D(S,A))||k);return R>3&&k&&Object.defineProperty(S,A,k),k},p=this&&this.__param||function(_,S){return function(A,L){S(A,L,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const u=c(2585),v=c(8460),C=c(844);let T=o.CharSizeService=class extends C.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(_,S,A){super(),this._optionsService=A,this.width=0,this.height=0,this._onCharSizeChange=this.register(new v.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new y(this._optionsService))}catch{this._measureStrategy=this.register(new b(_,S,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const _=this._measureStrategy.measure();_.width===this.width&&_.height===this.height||(this.width=_.width,this.height=_.height,this._onCharSizeChange.fire())}};o.CharSizeService=T=h([p(2,u.IOptionsService)],T);class E extends C.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(S,A){S!==void 0&&S>0&&A!==void 0&&A>0&&(this._result.width=S,this._result.height=A)}}class b extends E{constructor(S,A,L){super(),this._document=S,this._parentElement=A,this._optionsService=L,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 y extends E{constructor(S){super(),this._optionsService=S,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const A=this._ctx.measureText("W");if(!("width"in A&&"fontBoundingBoxAscent"in A&&"fontBoundingBoxDescent"in A))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const S=this._ctx.measureText("W");return this._validateAndSet(S.width,S.fontBoundingBoxAscent+S.fontBoundingBoxDescent),this._result}}},4269:function(f,o,c){var h=this&&this.__decorate||function(y,_,S,A){var L,D=arguments.length,R=D<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,_,S,A);else for(var k=y.length-1;k>=0;k--)(L=y[k])&&(R=(D<3?L(R):D>3?L(_,S,R):L(_,S))||R);return D>3&&R&&Object.defineProperty(_,S,R),R},p=this&&this.__param||function(y,_){return function(S,A){_(S,A,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const u=c(3734),v=c(643),C=c(511),T=c(2585);class E extends u.AttributeData{constructor(_,S,A){super(),this.content=0,this.combinedData="",this.fg=_.fg,this.bg=_.bg,this.combinedData=S,this._width=A}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(_){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=E;let b=o.CharacterJoinerService=class n_{constructor(_){this._bufferService=_,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new C.CellData}register(_){const S={id:this._nextCharacterJoinerId++,handler:_};return this._characterJoiners.push(S),S.id}deregister(_){for(let S=0;S<this._characterJoiners.length;S++)if(this._characterJoiners[S].id===_)return this._characterJoiners.splice(S,1),!0;return!1}getJoinedCharacters(_){if(this._characterJoiners.length===0)return[];const S=this._bufferService.buffer.lines.get(_);if(!S||S.length===0)return[];const A=[],L=S.translateToString(!0);let D=0,R=0,k=0,M=S.getFg(0),B=S.getBg(0);for(let H=0;H<S.getTrimmedLength();H++)if(S.loadCell(H,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==M||this._workCell.bg!==B){if(H-D>1){const U=this._getJoinedRanges(L,k,R,S,D);for(let P=0;P<U.length;P++)A.push(U[P])}D=H,k=R,M=this._workCell.fg,B=this._workCell.bg}R+=this._workCell.getChars().length||v.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-D>1){const H=this._getJoinedRanges(L,k,R,S,D);for(let U=0;U<H.length;U++)A.push(H[U])}return A}_getJoinedRanges(_,S,A,L,D){const R=_.substring(S,A);let k=[];try{k=this._characterJoiners[0].handler(R)}catch(M){console.error(M)}for(let M=1;M<this._characterJoiners.length;M++)try{const B=this._characterJoiners[M].handler(R);for(let H=0;H<B.length;H++)n_._mergeRanges(k,B[H])}catch(B){console.error(B)}return this._stringRangesToCellRanges(k,L,D),k}_stringRangesToCellRanges(_,S,A){let L=0,D=!1,R=0,k=_[L];if(k){for(let M=A;M<this._bufferService.cols;M++){const B=S.getWidth(M),H=S.getString(M).length||v.WHITESPACE_CELL_CHAR.length;if(B!==0){if(!D&&k[0]<=R&&(k[0]=M,D=!0),k[1]<=R){if(k[1]=M,k=_[++L],!k)break;k[0]<=R?(k[0]=M,D=!0):D=!1}R+=H}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(_,S){let A=!1;for(let L=0;L<_.length;L++){const D=_[L];if(A){if(S[1]<=D[0])return _[L-1][1]=S[1],_;if(S[1]<=D[1])return _[L-1][1]=Math.max(S[1],D[1]),_.splice(L,1),_;_.splice(L,1),L--}else{if(S[1]<=D[0])return _.splice(L,0,S),_;if(S[1]<=D[1])return D[0]=Math.min(S[0],D[0]),_;S[0]<D[1]&&(D[0]=Math.min(S[0],D[0]),A=!0)}}return A?_[_.length-1][1]=S[1]:_.push(S),_}};o.CharacterJoinerService=b=h([p(0,T.IBufferService)],b)},5114:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const h=c(844),p=c(8460),u=c(3656);class v extends h.Disposable{constructor(E,b,y){super(),this._textarea=E,this._window=b,this.mainDocument=y,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((_=>this._screenDprMonitor.setWindow(_)))),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(E){this._window!==E&&(this._window=E,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=v;class C extends h.Disposable{constructor(E){super(),this._parentWindow=E,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(E){this._parentWindow=E,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 E;this._outerListener&&((E=this._resolutionMediaMatchList)==null||E.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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(v){return this.linkProviders.push(v),{dispose:()=>{const C=this.linkProviders.indexOf(v);C!==-1&&this.linkProviders.splice(C,1)}}}}o.LinkProviderService=p},8934:function(f,o,c){var h=this&&this.__decorate||function(T,E,b,y){var _,S=arguments.length,A=S<3?E:y===null?y=Object.getOwnPropertyDescriptor(E,b):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(T,E,b,y);else for(var L=T.length-1;L>=0;L--)(_=T[L])&&(A=(S<3?_(A):S>3?_(E,b,A):_(E,b))||A);return S>3&&A&&Object.defineProperty(E,b,A),A},p=this&&this.__param||function(T,E){return function(b,y){E(b,y,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const u=c(4725),v=c(9806);let C=o.MouseService=class{constructor(T,E){this._renderService=T,this._charSizeService=E}getCoords(T,E,b,y,_){return(0,v.getCoords)(window,T,E,b,y,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,_)}getMouseReportCoords(T,E){const b=(0,v.getCoordsRelativeToElement)(window,T,E);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])}}};o.MouseService=C=h([p(0,u.IRenderService),p(1,u.ICharSizeService)],C)},3230:function(f,o,c){var h=this&&this.__decorate||function(_,S,A,L){var D,R=arguments.length,k=R<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,S,A,L);else for(var M=_.length-1;M>=0;M--)(D=_[M])&&(k=(R<3?D(k):R>3?D(S,A,k):D(S,A))||k);return R>3&&k&&Object.defineProperty(S,A,k),k},p=this&&this.__param||function(_,S){return function(A,L){S(A,L,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const u=c(6193),v=c(4725),C=c(8460),T=c(844),E=c(7226),b=c(2585);let y=o.RenderService=class extends T.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(_,S,A,L,D,R,k,M){super(),this._rowCount=_,this._charSizeService=L,this._renderer=this.register(new T.MutableDisposable),this._pausedResizeTask=new E.DebouncedIdleTask,this._observerDisposable=this.register(new T.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)),k),this.register(this._renderDebouncer),this.register(k.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(R.onResize((()=>this._fullRefresh()))),this.register(R.buffers.onBufferActivate((()=>{var B;return(B=this._renderer.value)==null?void 0:B.clear()}))),this.register(A.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(D.onDecorationRegistered((()=>this._fullRefresh()))),this.register(D.onDecorationRemoved((()=>this._fullRefresh()))),this.register(A.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(R.cols,R.rows),this._fullRefresh()}))),this.register(A.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(R.buffer.y,R.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(k.window,S),this.register(k.onWindowChange((B=>this._registerIntersectionObserver(B,S))))}_registerIntersectionObserver(_,S){if("IntersectionObserver"in _){const A=new _.IntersectionObserver((L=>this._handleIntersectionChange(L[L.length-1])),{threshold:0});A.observe(S),this._observerDisposable.value=(0,T.toDisposable)((()=>A.disconnect()))}}_handleIntersectionChange(_){this._isPaused=_.isIntersecting===void 0?_.intersectionRatio===0:!_.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(_,S,A=!1){this._isPaused?this._needsFullRefresh=!0:(A||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(_,S,this._rowCount))}_renderRows(_,S){this._renderer.value&&(_=Math.min(_,this._rowCount-1),S=Math.min(S,this._rowCount-1),this._renderer.value.renderRows(_,S),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:_,end:S}),this._onRender.fire({start:_,end:S}),this._isNextRenderRedrawOnly=!0)}resize(_,S){this._rowCount=S,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(_){this._renderer.value=_,this._renderer.value&&(this._renderer.value.onRequestRedraw((S=>this.refreshRows(S.start,S.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(_){return this._renderDebouncer.addRefreshCallback(_)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var _,S;this._renderer.value&&((S=(_=this._renderer.value).clearTextureAtlas)==null||S.call(_),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(_,S){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var A;return(A=this._renderer.value)==null?void 0:A.handleResize(_,S)})):this._renderer.value.handleResize(_,S),this._fullRefresh())}handleCharSizeChanged(){var _;(_=this._renderer.value)==null||_.handleCharSizeChanged()}handleBlur(){var _;(_=this._renderer.value)==null||_.handleBlur()}handleFocus(){var _;(_=this._renderer.value)==null||_.handleFocus()}handleSelectionChanged(_,S,A){var L;this._selectionState.start=_,this._selectionState.end=S,this._selectionState.columnSelectMode=A,(L=this._renderer.value)==null||L.handleSelectionChanged(_,S,A)}handleCursorMove(){var _;(_=this._renderer.value)==null||_.handleCursorMove()}clear(){var _;(_=this._renderer.value)==null||_.clear()}};o.RenderService=y=h([p(2,b.IOptionsService),p(3,v.ICharSizeService),p(4,b.IDecorationService),p(5,b.IBufferService),p(6,v.ICoreBrowserService),p(7,v.IThemeService)],y)},9312:function(f,o,c){var h=this&&this.__decorate||function(k,M,B,H){var U,P=arguments.length,K=P<3?M:H===null?H=Object.getOwnPropertyDescriptor(M,B):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(k,M,B,H);else for(var Y=k.length-1;Y>=0;Y--)(U=k[Y])&&(K=(P<3?U(K):P>3?U(M,B,K):U(M,B))||K);return P>3&&K&&Object.defineProperty(M,B,K),K},p=this&&this.__param||function(k,M){return function(B,H){M(B,H,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const u=c(9806),v=c(9504),C=c(456),T=c(4725),E=c(8460),b=c(844),y=c(6114),_=c(4841),S=c(511),A=c(2585),L=" ",D=new RegExp(L,"g");let R=o.SelectionService=class extends b.Disposable{constructor(k,M,B,H,U,P,K,Y,G){super(),this._element=k,this._screenElement=M,this._linkifier=B,this._bufferService=H,this._coreService=U,this._mouseService=P,this._optionsService=K,this._renderService=Y,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new S.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new E.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new E.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new E.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new E.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=W=>this._handleMouseMove(W),this._mouseUpListener=W=>this._handleMouseUp(W),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((W=>this._handleTrim(W))),this.register(this._bufferService.buffers.onBufferActivate((W=>this._handleBufferActivate(W)))),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 k=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!k||!M||k[0]===M[0]&&k[1]===M[1])}get selectionText(){const k=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!k||!M)return"";const B=this._bufferService.buffer,H=[];if(this._activeSelectionMode===3){if(k[0]===M[0])return"";const U=k[0]<M[0]?k[0]:M[0],P=k[0]<M[0]?M[0]:k[0];for(let K=k[1];K<=M[1];K++){const Y=B.translateBufferLineToString(K,!0,U,P);H.push(Y)}}else{const U=k[1]===M[1]?M[0]:void 0;H.push(B.translateBufferLineToString(k[1],!0,k[0],U));for(let P=k[1]+1;P<=M[1]-1;P++){const K=B.lines.get(P),Y=B.translateBufferLineToString(P,!0);K!=null&&K.isWrapped?H[H.length-1]+=Y:H.push(Y)}if(k[1]!==M[1]){const P=B.lines.get(M[1]),K=B.translateBufferLineToString(M[1],!0,0,M[0]);P&&P.isWrapped?H[H.length-1]+=K:H.push(K)}}return H.map((U=>U.replace(D," "))).join(y.isWindows?`\r
|
|
55
|
+
WARNING: This link could potentially be dangerous`)){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=S}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=w=h([g(0,y.IBufferService),g(1,y.IOptionsService),g(2,y.IOscLinkService)],w)},6193:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.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,g){this._rowCount=g,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,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const h=c(3614),g=c(3656),u=c(3551),y=c(9042),w=c(3730),T=c(1680),E=c(3107),S=c(5744),v=c(2950),_=c(1296),b=c(428),A=c(4269),L=c(5114),D=c(8934),R=c(3230),k=c(9312),M=c(4725),B=c(6731),H=c(8055),U=c(8969),P=c(8460),K=c(844),Y=c(6114),G=c(8437),W=c(2584),Z=c(7399),z=c(5941),j=c(9074),N=c(2585),$=c(5435),I=c(4567),re=c(779);class ve extends U.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=Y,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new K.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(j.DecorationService),this._instantiationService.setService(N.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(re.LinkProviderService),this._instantiationService.setService(M.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,te)=>this.refresh(q,te)))),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,K.toDisposable)((()=>{var q,te;this._customKeyEventHandler=void 0,(te=(q=this.element)==null?void 0:q.parentNode)==null||te.removeChild(this.element)})))}_handleColorEvent(Q){if(this._themeService)for(const q of Q){let te,ae="";switch(q.index){case 256:te="foreground",ae="10";break;case 257:te="background",ae="11";break;case 258:te="cursor",ae="12";break;default:te="ansi",ae="4;"+q.index}switch(q.type){case 0:const pe=H.color.toColorRGB(te==="ansi"?this._themeService.colors.ansi[q.index]:this._themeService.colors[te]);this.coreService.triggerDataEvent(`${W.C0.ESC}]${ae};${(0,z.toRgbString)(pe)}${W.C1_ESCAPED.ST}`);break;case 1:if(te==="ansi")this._themeService.modifyColors((se=>se.ansi[q.index]=H.channels.toColor(...q.color)));else{const se=te;this._themeService.modifyColors((we=>we[se]=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(W.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(W.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 te=Math.min(this.buffer.x,this.cols-1),ae=this._renderService.dimensions.css.cell.height,pe=q.getWidth(te),se=this._renderService.dimensions.css.cell.width*pe,we=this.buffer.y*this._renderService.dimensions.css.cell.height,je=te*this._renderService.dimensions.css.cell.width;this.textarea.style.left=je+"px",this.textarea.style.top=we+"px",this.textarea.style.width=se+"px",this.textarea.style.height=ae+"px",this.textarea.style.lineHeight=ae+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.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,g.addDisposableDomListener)(this.textarea,"paste",Q)),this.register((0,g.addDisposableDomListener)(this.element,"paste",Q)),Y.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(q=>{q.button===2&&(0,h.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",(q=>{(0,h.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Y.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",(q=>{q.button===1&&(0,h.moveTextAreaUnderMouseCursor)(q,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",(Q=>this._keyUp(Q)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",(Q=>this._keyDown(Q)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",(Q=>this._keyPress(Q)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",(Q=>this._compositionHelper.compositionupdate(Q)))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,g.addDisposableDomListener)(this.textarea,"input",(Q=>this._inputEvent(Q)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Q){var te;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"),((te=this.element)==null?void 0:te.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,g.addDisposableDomListener)(this.screenElement,"mousemove",(ae=>this.updateCursorStyle(ae)))),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",y.promptLabel),Y.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(L.CoreBrowserService,this.textarea,Q.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(M.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",(ae=>this._handleTextAreaFocus(ae)))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(b.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(M.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(B.ThemeService),this._instantiationService.setService(M.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(A.CharacterJoinerService),this._instantiationService.setService(M.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(R.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(M.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ae=>this._onRender.fire(ae)))),this.onResize((ae=>this._renderService.resize(ae.cols,ae.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(v.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(D.MouseService),this._instantiationService.setService(M.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(T.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ae=>this.scrollLines(ae.amount,ae.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(k.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(M.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ae=>this.scrollLines(ae.amount,ae.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ae=>this._renderService.handleSelectionChanged(ae.start,ae.end,ae.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ae=>{this.textarea.value=ae,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ae=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(E.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(ae=>this._selectionService.handleMouseDown(ae)))),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",(ae=>this._handleScreenReaderModeOptionChange(ae)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(S.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ae=>{!this._overviewRulerRenderer&&ae&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(S.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(_.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Q=this,q=this.element;function te(se){const we=Q._mouseService.getMouseReportCoords(se,Q.screenElement);if(!we)return!1;let je,ze;switch(se.overrideType||se.type){case"mousemove":ze=32,se.buttons===void 0?(je=3,se.button!==void 0&&(je=se.button<3?se.button:3)):je=1&se.buttons?0:4&se.buttons?1:2&se.buttons?2:3;break;case"mouseup":ze=0,je=se.button<3?se.button:3;break;case"mousedown":ze=1,je=se.button<3?se.button:3;break;case"wheel":if(Q._customWheelEventHandler&&Q._customWheelEventHandler(se)===!1||Q.viewport.getLinesScrolled(se)===0)return!1;ze=se.deltaY<0?0:1,je=4;break;default:return!1}return!(ze===void 0||je===void 0||je>4)&&Q.coreMouseService.triggerMouseEvent({col:we.col,row:we.row,x:we.x,y:we.y,button:je,action:ze,ctrl:se.ctrlKey,alt:se.altKey,shift:se.shiftKey})}const ae={mouseup:null,wheel:null,mousedrag:null,mousemove:null},pe={mouseup:se=>(te(se),se.buttons||(this._document.removeEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.removeEventListener("mousemove",ae.mousedrag)),this.cancel(se)),wheel:se=>(te(se),this.cancel(se,!0)),mousedrag:se=>{se.buttons&&te(se)},mousemove:se=>{se.buttons||te(se)}};this.register(this.coreMouseService.onProtocolChange((se=>{se?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(se)),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&se?ae.mousemove||(q.addEventListener("mousemove",pe.mousemove),ae.mousemove=pe.mousemove):(q.removeEventListener("mousemove",ae.mousemove),ae.mousemove=null),16&se?ae.wheel||(q.addEventListener("wheel",pe.wheel,{passive:!1}),ae.wheel=pe.wheel):(q.removeEventListener("wheel",ae.wheel),ae.wheel=null),2&se?ae.mouseup||(ae.mouseup=pe.mouseup):(this._document.removeEventListener("mouseup",ae.mouseup),ae.mouseup=null),4&se?ae.mousedrag||(ae.mousedrag=pe.mousedrag):(this._document.removeEventListener("mousemove",ae.mousedrag),ae.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(q,"mousedown",(se=>{if(se.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(se))return te(se),ae.mouseup&&this._document.addEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.addEventListener("mousemove",ae.mousedrag),this.cancel(se)}))),this.register((0,g.addDisposableDomListener)(q,"wheel",(se=>{if(!ae.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(se)===!1)return!1;if(!this.buffer.hasScrollback){const we=this.viewport.getLinesScrolled(se);if(we===0)return;const je=W.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(se.deltaY<0?"A":"B");let ze="";for(let Pe=0;Pe<Math.abs(we);Pe++)ze+=je;return this.coreService.triggerDataEvent(ze,!0),this.cancel(se,!0)}return this.viewport.handleWheel(se)?this.cancel(se):void 0}}),{passive:!1})),this.register((0,g.addDisposableDomListener)(q,"touchstart",(se=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(se),this.cancel(se)}),{passive:!0})),this.register((0,g.addDisposableDomListener)(q,"touchmove",(se=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(se)?void 0:this.cancel(se)}),{passive:!1}))}refresh(Q,q){var te;(te=this._renderService)==null||te.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,te=0){var ae;te===1?(super.scrollLines(Q,q,te),this.refresh(0,this.rows-1)):(ae=this.viewport)==null||ae.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,te){this._selectionService.setSelection(Q,q,te)}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 te;(te=this._selectionService)==null||te.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 te=(0,Z.evaluateKeyboardEvent)(Q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Q),te.type===3||te.type===2){const ae=this.rows-1;return this.scrollLines(te.type===2?-ae:ae),this.cancel(Q,!0)}return te.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Q)||(te.cancel&&this.cancel(Q,!0),!te.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):(te.key!==W.C0.ETX&&te.key!==W.C0.CR||(this.textarea.value=""),this._onKey.fire({key:te.key,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(te.key,!0),!this.optionsService.rawOptions.screenReaderMode||Q.altKey||Q.ctrlKey?this.cancel(Q,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Q,q){const te=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"?te:te&&(!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 te,ae;(te=this._charSizeService)==null||te.measure(),(ae=this.viewport)==null||ae.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,te;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(),(te=this.viewport)==null||te.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(W.C0.ESC+"[I"):this.coreService.triggerDataEvent(W.C0.ESC+"[O")}_reportWindowsOptions(Q){if(this._renderService)switch(Q){case $.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const q=this._renderService.dimensions.css.canvas.width.toFixed(0),te=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${W.C0.ESC}[4;${te};${q}t`);break;case $.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ae=this._renderService.dimensions.css.cell.width.toFixed(0),pe=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${W.C0.ESC}[6;${pe};${ae}t`)}}cancel(Q,q){if(this.options.cancelEvents||q)return Q.preventDefault(),Q.stopPropagation(),!1}}o.Terminal=ve},9924:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.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,g){this._rowCount=g,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 y=u-this._lastRefreshMs,w=this._debounceThresholdMS-y;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,o,c){var h=this&&this.__decorate||function(v,_,b,A){var L,D=arguments.length,R=D<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,b):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(v,_,b,A);else for(var k=v.length-1;k>=0;k--)(L=v[k])&&(R=(D<3?L(R):D>3?L(_,b,R):L(_,b))||R);return D>3&&R&&Object.defineProperty(_,b,R),R},g=this&&this.__param||function(v,_){return function(b,A){_(b,A,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const u=c(3656),y=c(4725),w=c(8460),T=c(844),E=c(2585);let S=o.Viewport=class extends T.Disposable{constructor(v,_,b,A,L,D,R,k){super(),this._viewportElement=v,this._scrollArea=_,this._bufferService=b,this._optionsService=A,this._charSizeService=L,this._renderService=D,this._coreBrowserService=R,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((M=>this._activeBuffer=M.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((M=>this._renderDimensions=M))),this._handleThemeChange(k.colors),this.register(k.onChangeColors((M=>this._handleThemeChange(M)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(v){this._viewportElement.style.backgroundColor=v.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(v){if(v)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 _=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==_&&(this._lastRecordedBufferHeight=_,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const v=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==v&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=v),this._refreshAnimationFrame=null}syncScrollArea(v=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(v);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(v)}_handleScroll(v){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 _=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:_,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const v=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(v*(this._smoothScrollState.target-this._smoothScrollState.origin)),v<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(v,_){const b=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(_<0&&this._viewportElement.scrollTop!==0||_>0&&b<this._lastRecordedBufferHeight)||(v.cancelable&&v.preventDefault(),!1)}handleWheel(v){const _=this._getPixelsScrolled(v);return _!==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+_:this._smoothScrollState.target+=_,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=_,this._bubbleScroll(v,_))}scrollLines(v){if(v!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const _=v*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+_,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:v,suppressScrollEvent:!1})}_getPixelsScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let _=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_LINE?_*=this._currentRowHeight:v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._currentRowHeight*this._bufferService.rows),_}getBufferElements(v,_){var k;let b,A="";const L=[],D=_??this._bufferService.buffer.lines.length,R=this._bufferService.buffer.lines;for(let M=v;M<D;M++){const B=R.get(M);if(!B)continue;const H=(k=R.get(M+1))==null?void 0:k.isWrapped;if(A+=B.translateToString(!H),!H||M===R.length-1){const U=document.createElement("div");U.textContent=A,L.push(U),A.length>0&&(b=U),A=""}}return{bufferElements:L,cursorElement:b}}getLinesScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let _=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(_/=this._currentRowHeight+0,this._wheelPartialScroll+=_,_=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._bufferService.rows),_}_applyScrollModifier(v,_){const b=this._optionsService.rawOptions.fastScrollModifier;return b==="alt"&&_.altKey||b==="ctrl"&&_.ctrlKey||b==="shift"&&_.shiftKey?v*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:v*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(v){this._lastTouchY=v.touches[0].pageY}handleTouchMove(v){const _=this._lastTouchY-v.touches[0].pageY;return this._lastTouchY=v.touches[0].pageY,_!==0&&(this._viewportElement.scrollTop+=_,this._bubbleScroll(v,_))}};o.Viewport=S=h([g(2,E.IBufferService),g(3,E.IOptionsService),g(4,y.ICharSizeService),g(5,y.IRenderService),g(6,y.ICoreBrowserService),g(7,y.IThemeService)],S)},3107:function(f,o,c){var h=this&&this.__decorate||function(E,S,v,_){var b,A=arguments.length,L=A<3?S:_===null?_=Object.getOwnPropertyDescriptor(S,v):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,S,v,_);else for(var D=E.length-1;D>=0;D--)(b=E[D])&&(L=(A<3?b(L):A>3?b(S,v,L):b(S,v))||L);return A>3&&L&&Object.defineProperty(S,v,L),L},g=this&&this.__param||function(E,S){return function(v,_){S(v,_,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const u=c(4725),y=c(844),w=c(2585);let T=o.BufferDecorationRenderer=class extends y.Disposable{constructor(E,S,v,_,b){super(),this._screenElement=E,this._bufferService=S,this._coreBrowserService=v,this._decorationService=_,this._renderService=b,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((A=>this._removeDecoration(A)))),this.register((0,y.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 E of this._decorationService.decorations)this._renderDecoration(E);this._dimensionsChanged=!1}_renderDecoration(E){this._refreshStyle(E),this._dimensionsChanged&&this._refreshXPosition(E)}_createElement(E){var _;const S=this._coreBrowserService.mainDocument.createElement("div");S.classList.add("xterm-decoration"),S.classList.toggle("xterm-decoration-top-layer",((_=E==null?void 0:E.options)==null?void 0:_.layer)==="top"),S.style.width=`${Math.round((E.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,S.style.height=(E.options.height||1)*this._renderService.dimensions.css.cell.height+"px",S.style.top=(E.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",S.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const v=E.options.x??0;return v&&v>this._bufferService.cols&&(S.style.display="none"),this._refreshXPosition(E,S),S}_refreshStyle(E){const S=E.marker.line-this._bufferService.buffers.active.ydisp;if(S<0||S>=this._bufferService.rows)E.element&&(E.element.style.display="none",E.onRenderEmitter.fire(E.element));else{let v=this._decorationElements.get(E);v||(v=this._createElement(E),E.element=v,this._decorationElements.set(E,v),this._container.appendChild(v),E.onDispose((()=>{this._decorationElements.delete(E),v.remove()}))),v.style.top=S*this._renderService.dimensions.css.cell.height+"px",v.style.display=this._altBufferIsActive?"none":"block",E.onRenderEmitter.fire(v)}}_refreshXPosition(E,S=E.element){if(!S)return;const v=E.options.x??0;(E.options.anchor||"left")==="right"?S.style.right=v?v*this._renderService.dimensions.css.cell.width+"px":"":S.style.left=v?v*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(E){var S;(S=this._decorationElements.get(E))==null||S.remove(),this._decorationElements.delete(E),E.dispose()}};o.BufferDecorationRenderer=T=h([g(1,w.IBufferService),g(2,u.ICoreBrowserService),g(3,w.IDecorationService),g(4,u.IRenderService)],T)},5871:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.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,g){return h>=c.startBufferLine-this._linePadding[g||"full"]&&h<=c.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(c,h){c.startBufferLine=Math.min(c.startBufferLine,h),c.endBufferLine=Math.max(c.endBufferLine,h)}}},5744:function(f,o,c){var h=this&&this.__decorate||function(b,A,L,D){var R,k=arguments.length,M=k<3?A:D===null?D=Object.getOwnPropertyDescriptor(A,L):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(b,A,L,D);else for(var B=b.length-1;B>=0;B--)(R=b[B])&&(M=(k<3?R(M):k>3?R(A,L,M):R(A,L))||M);return k>3&&M&&Object.defineProperty(A,L,M),M},g=this&&this.__param||function(b,A){return function(L,D){A(L,D,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const u=c(5871),y=c(4725),w=c(844),T=c(2585),E={full:0,left:0,center:0,right:0},S={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0};let _=o.OverviewRulerRenderer=class extends w.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(b,A,L,D,R,k,M){var H;super(),this._viewportElement=b,this._screenElement=A,this._bufferService=L,this._decorationService=D,this._renderService=R,this._optionsService=k,this._coreBrowserService=M,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,w.toDisposable)((()=>{var U;(U=this._canvas)==null||U.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 b=Math.floor(this._canvas.width/3),A=Math.ceil(this._canvas.width/3);S.full=this._canvas.width,S.left=b,S.center=A,S.right=b,this._refreshDrawHeightConstants(),v.full=0,v.left=0,v.center=S.left,v.right=S.left+S.center}_refreshDrawHeightConstants(){E.full=Math.round(2*this._coreBrowserService.dpr);const b=this._canvas.height/this._bufferService.buffer.lines.length,A=Math.round(Math.max(Math.min(b,12),6)*this._coreBrowserService.dpr);E.left=A,E.center=A,E.right=A}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.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 A of this._decorationService.decorations)this._colorZoneStore.addDecoration(A);this._ctx.lineWidth=1;const b=this._colorZoneStore.zones;for(const A of b)A.position!=="full"&&this._renderColorZone(A);for(const A of b)A.position==="full"&&this._renderColorZone(A);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(b){this._ctx.fillStyle=b.color,this._ctx.fillRect(v[b.position||"full"],Math.round((this._canvas.height-1)*(b.startBufferLine/this._bufferService.buffers.active.lines.length)-E[b.position||"full"]/2),S[b.position||"full"],Math.round((this._canvas.height-1)*((b.endBufferLine-b.startBufferLine)/this._bufferService.buffers.active.lines.length)+E[b.position||"full"]))}_queueRefresh(b,A){this._shouldUpdateDimensions=b||this._shouldUpdateDimensions,this._shouldUpdateAnchor=A||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=_=h([g(2,T.IBufferService),g(3,T.IDecorationService),g(4,y.IRenderService),g(5,T.IOptionsService),g(6,y.ICoreBrowserService)],_)},2950:function(f,o,c){var h=this&&this.__decorate||function(E,S,v,_){var b,A=arguments.length,L=A<3?S:_===null?_=Object.getOwnPropertyDescriptor(S,v):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,S,v,_);else for(var D=E.length-1;D>=0;D--)(b=E[D])&&(L=(A<3?b(L):A>3?b(S,v,L):b(S,v))||L);return A>3&&L&&Object.defineProperty(S,v,L),L},g=this&&this.__param||function(E,S){return function(v,_){S(v,_,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const u=c(4725),y=c(2585),w=c(2584);let T=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(E,S,v,_,b,A){this._textarea=E,this._compositionView=S,this._bufferService=v,this._optionsService=_,this._coreService=b,this._renderService=A,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(E){this._compositionView.textContent=E.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(E){if(this._isComposing||this._isSendingComposition){if(E.keyCode===229||E.keyCode===16||E.keyCode===17||E.keyCode===18)return!1;this._finalizeComposition(!1)}return E.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(E){if(this._compositionView.classList.remove("active"),this._isComposing=!1,E){const S={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let v;this._isSendingComposition=!1,S.start+=this._dataAlreadySent.length,v=this._isComposing?this._textarea.value.substring(S.start,S.end):this._textarea.value.substring(S.start),v.length>0&&this._coreService.triggerDataEvent(v,!0)}}),0)}else{this._isSendingComposition=!1;const S=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(S,!0)}}_handleAnyTextareaChanges(){const E=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const S=this._textarea.value,v=S.replace(E,"");this._dataAlreadySent=v,S.length>E.length?this._coreService.triggerDataEvent(v,!0):S.length<E.length?this._coreService.triggerDataEvent(`${w.C0.DEL}`,!0):S.length===E.length&&S!==E&&this._coreService.triggerDataEvent(S,!0)}}),0)}updateCompositionElements(E){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const S=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),v=this._renderService.dimensions.css.cell.height,_=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,b=S*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=b+"px",this._compositionView.style.top=_+"px",this._compositionView.style.height=v+"px",this._compositionView.style.lineHeight=v+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const A=this._compositionView.getBoundingClientRect();this._textarea.style.left=b+"px",this._textarea.style.top=_+"px",this._textarea.style.width=Math.max(A.width,1)+"px",this._textarea.style.height=Math.max(A.height,1)+"px",this._textarea.style.lineHeight=A.height+"px"}E||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};o.CompositionHelper=T=h([g(2,y.IBufferService),g(3,y.IOptionsService),g(4,y.ICoreService),g(5,u.IRenderService)],T)},9806:(f,o)=>{function c(h,g,u){const y=u.getBoundingClientRect(),w=h.getComputedStyle(u),T=parseInt(w.getPropertyValue("padding-left")),E=parseInt(w.getPropertyValue("padding-top"));return[g.clientX-y.left-T,g.clientY-y.top-E]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(h,g,u,y,w,T,E,S,v){if(!T)return;const _=c(h,g,u);return _?(_[0]=Math.ceil((_[0]+(v?E/2:0))/E),_[1]=Math.ceil(_[1]/S),_[0]=Math.min(Math.max(_[0],1),y+(v?1:0)),_[1]=Math.min(Math.max(_[1],1),w),_):void 0}},9504:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const h=c(2584);function g(S,v,_,b){const A=S-u(S,_),L=v-u(v,_),D=Math.abs(A-L)-(function(R,k,M){let B=0;const H=R-u(R,M),U=k-u(k,M);for(let P=0;P<Math.abs(H-U);P++){const K=y(R,k)==="A"?-1:1,Y=M.buffer.lines.get(H+K*P);Y!=null&&Y.isWrapped&&B++}return B})(S,v,_);return E(D,T(y(S,v),b))}function u(S,v){let _=0,b=v.buffer.lines.get(S),A=b==null?void 0:b.isWrapped;for(;A&&S>=0&&S<v.rows;)_++,b=v.buffer.lines.get(--S),A=b==null?void 0:b.isWrapped;return _}function y(S,v){return S>v?"A":"B"}function w(S,v,_,b,A,L){let D=S,R=v,k="";for(;D!==_||R!==b;)D+=A?1:-1,A&&D>L.cols-1?(k+=L.buffer.translateBufferLineToString(R,!1,S,D),D=0,S=0,R++):!A&&D<0&&(k+=L.buffer.translateBufferLineToString(R,!1,0,S+1),D=L.cols-1,S=D,R--);return k+L.buffer.translateBufferLineToString(R,!1,S,D)}function T(S,v){const _=v?"O":"[";return h.C0.ESC+_+S}function E(S,v){S=Math.floor(S);let _="";for(let b=0;b<S;b++)_+=v;return _}o.moveToCellSequence=function(S,v,_,b){const A=_.buffer.x,L=_.buffer.y;if(!_.buffer.hasScrollback)return(function(k,M,B,H,U,P){return g(M,H,U,P).length===0?"":E(w(k,M,k,M-u(M,U),!1,U).length,T("D",P))})(A,L,0,v,_,b)+g(L,v,_,b)+(function(k,M,B,H,U,P){let K;K=g(M,H,U,P).length>0?H-u(H,U):M;const Y=H,G=(function(W,Z,z,j,N,$){let I;return I=g(z,j,N,$).length>0?j-u(j,N):Z,W<z&&I<=j||W>=z&&I<j?"C":"D"})(k,M,B,H,U,P);return E(w(k,K,B,Y,G==="C",U).length,T(G,P))})(A,L,S,v,_,b);let D;if(L===v)return D=A>S?"D":"C",E(Math.abs(A-S),T(D,b));D=L>v?"D":"C";const R=Math.abs(L-v);return E((function(k,M){return M.cols-k})(L>v?S:A,_)+(R-1)*_.cols+1+((L>v?A:S)-1),T(D,b))}},1296:function(f,o,c){var h=this&&this.__decorate||function(P,K,Y,G){var W,Z=arguments.length,z=Z<3?K:G===null?G=Object.getOwnPropertyDescriptor(K,Y):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(P,K,Y,G);else for(var j=P.length-1;j>=0;j--)(W=P[j])&&(z=(Z<3?W(z):Z>3?W(K,Y,z):W(K,Y))||z);return Z>3&&z&&Object.defineProperty(K,Y,z),z},g=this&&this.__param||function(P,K){return function(Y,G){K(Y,G,P)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const u=c(3787),y=c(2550),w=c(2223),T=c(6171),E=c(6052),S=c(4725),v=c(8055),_=c(8460),b=c(844),A=c(2585),L="xterm-dom-renderer-owner-",D="xterm-rows",R="xterm-fg-",k="xterm-bg-",M="xterm-focus",B="xterm-selection";let H=1,U=o.DomRenderer=class extends b.Disposable{constructor(P,K,Y,G,W,Z,z,j,N,$,I,re,ve){super(),this._terminal=P,this._document=K,this._element=Y,this._screenElement=G,this._viewportElement=W,this._helperContainer=Z,this._linkifier2=z,this._charSizeService=N,this._optionsService=$,this._bufferService=I,this._coreBrowserService=re,this._themeService=ve,this._terminalClass=H++,this._rowElements=[],this._selectionRenderModel=(0,E.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new _.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,T.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=j.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(L+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,b.toDisposable)((()=>{this._element.classList.remove(L+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new y.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 Y of this._rowElements)Y.style.width=`${this.dimensions.css.canvas.width}px`,Y.style.height=`${this.dimensions.css.cell.height}px`,Y.style.lineHeight=`${this.dimensions.css.cell.height}px`,Y.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const K=`${this._terminalSelector} .${D} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=K,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 K=`${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}`;K+=`${this._terminalSelector} .${D} .xterm-dim { color: ${v.color.multiplyOpacity(P.foreground,.5).css};}`,K+=`${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 Y=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,W=`blink_block_${this._terminalClass}`;K+=`@keyframes ${Y} { 50% { border-bottom-style: hidden; }}`,K+=`@keyframes ${G} { 50% { box-shadow: none; }}`,K+=`@keyframes ${W} { 0% { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css}; } 50% { background-color: inherit; color: ${P.cursor.css}; }}`,K+=`${this._terminalSelector} .${D}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${D}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${D}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${W} 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);}`,K+=`${this._terminalSelector} .${B} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${B} div { position: absolute; background-color: ${P.selectionBackgroundOpaque.css};}${this._terminalSelector} .${B} div { position: absolute; background-color: ${P.selectionInactiveBackgroundOpaque.css};}`;for(const[Z,z]of P.ansi.entries())K+=`${this._terminalSelector} .${R}${Z} { color: ${z.css}; }${this._terminalSelector} .${R}${Z}.xterm-dim { color: ${v.color.multiplyOpacity(z,.5).css}; }${this._terminalSelector} .${k}${Z} { background-color: ${z.css}; }`;K+=`${this._terminalSelector} .${R}${w.INVERTED_DEFAULT_COLOR} { color: ${v.color.opaque(P.background).css}; }${this._terminalSelector} .${R}${w.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${v.color.multiplyOpacity(v.color.opaque(P.background),.5).css}; }${this._terminalSelector} .${k}${w.INVERTED_DEFAULT_COLOR} { background-color: ${P.foreground.css}; }`,this._themeStyleElement.textContent=K}_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,K){for(let Y=this._rowElements.length;Y<=K;Y++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>K;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(P,K){this._refreshRowElements(P,K),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(M),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(M),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(P,K,Y){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(P,K,Y),this.renderRows(0,this._bufferService.rows-1),!P||!K)return;this._selectionRenderModel.update(this._terminal,P,K,Y);const G=this._selectionRenderModel.viewportStartRow,W=this._selectionRenderModel.viewportEndRow,Z=this._selectionRenderModel.viewportCappedStartRow,z=this._selectionRenderModel.viewportCappedEndRow;if(Z>=this._bufferService.rows||z<0)return;const j=this._document.createDocumentFragment();if(Y){const N=P[0]>K[0];j.appendChild(this._createSelectionElement(Z,N?K[0]:P[0],N?P[0]:K[0],z-Z+1))}else{const N=G===Z?P[0]:0,$=Z===W?K[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(Z,N,$));const I=z-Z-1;if(j.appendChild(this._createSelectionElement(Z+1,0,this._bufferService.cols,I)),Z!==z){const re=W===z?K[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(z,0,re))}}this._selectionContainer.appendChild(j)}_createSelectionElement(P,K,Y,G=1){const W=this._document.createElement("div"),Z=K*this.dimensions.css.cell.width;let z=this.dimensions.css.cell.width*(Y-K);return Z+z>this.dimensions.css.canvas.width&&(z=this.dimensions.css.canvas.width-Z),W.style.height=G*this.dimensions.css.cell.height+"px",W.style.top=P*this.dimensions.css.cell.height+"px",W.style.left=`${Z}px`,W.style.width=`${z}px`,W}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,K){const Y=this._bufferService.buffer,G=Y.ybase+Y.y,W=Math.min(Y.x,this._bufferService.cols-1),Z=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,j=this._optionsService.rawOptions.cursorInactiveStyle;for(let N=P;N<=K;N++){const $=N+Y.ydisp,I=this._rowElements[N],re=Y.lines.get($);if(!I||!re)break;I.replaceChildren(...this._rowFactory.createRow(re,$,$===G,z,j,W,Z,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${L}${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,Y,G,W,Z){Y<0&&(P=0),G<0&&(K=0);const z=this._bufferService.rows-1;Y=Math.max(Math.min(Y,z),0),G=Math.max(Math.min(G,z),0),W=Math.min(W,this._bufferService.cols);const j=this._bufferService.buffer,N=j.ybase+j.y,$=Math.min(j.x,W-1),I=this._optionsService.rawOptions.cursorBlink,re=this._optionsService.rawOptions.cursorStyle,ve=this._optionsService.rawOptions.cursorInactiveStyle;for(let me=Y;me<=G;++me){const Q=me+j.ydisp,q=this._rowElements[me],te=j.lines.get(Q);if(!q||!te)break;q.replaceChildren(...this._rowFactory.createRow(te,Q,Q===N,re,ve,$,I,this.dimensions.css.cell.width,this._widthCache,Z?me===Y?P:0:-1,Z?(me===G?K:W)-1:-1))}}};o.DomRenderer=U=h([g(7,A.IInstantiationService),g(8,S.ICharSizeService),g(9,A.IOptionsService),g(10,A.IBufferService),g(11,S.ICoreBrowserService),g(12,S.IThemeService)],U)},3787:function(f,o,c){var h=this&&this.__decorate||function(D,R,k,M){var B,H=arguments.length,U=H<3?R:M===null?M=Object.getOwnPropertyDescriptor(R,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(D,R,k,M);else for(var P=D.length-1;P>=0;P--)(B=D[P])&&(U=(H<3?B(U):H>3?B(R,k,U):B(R,k))||U);return H>3&&U&&Object.defineProperty(R,k,U),U},g=this&&this.__param||function(D,R){return function(k,M){R(k,M,D)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const u=c(2223),y=c(643),w=c(511),T=c(2585),E=c(8055),S=c(4725),v=c(4269),_=c(6171),b=c(3734);let A=o.DomRendererRowFactory=class{constructor(D,R,k,M,B,H,U){this._document=D,this._characterJoinerService=R,this._optionsService=k,this._coreBrowserService=M,this._coreService=B,this._decorationService=H,this._themeService=U,this._workCell=new w.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(D,R,k){this._selectionStart=D,this._selectionEnd=R,this._columnSelectMode=k}createRow(D,R,k,M,B,H,U,P,K,Y,G){const W=[],Z=this._characterJoinerService.getJoinedCharacters(R),z=this._themeService.colors;let j,N=D.getNoBgTrimmedLength();k&&N<H+1&&(N=H+1);let $=0,I="",re=0,ve=0,me=0,Q=!1,q=0,te=!1,ae=0;const pe=[],se=Y!==-1&&G!==-1;for(let we=0;we<N;we++){D.loadCell(we,this._workCell);let je=this._workCell.getWidth();if(je===0)continue;let ze=!1,Pe=we,xe=this._workCell;if(Z.length>0&&we===Z[0][0]){ze=!0;const Fe=Z.shift();xe=new v.JoinedCellData(this._workCell,D.translateToString(!0,Fe[0],Fe[1]),Fe[1]-Fe[0]),Pe=Fe[1]-1,je=xe.getWidth()}const xt=this._isCellInSelection(we,R),yt=k&&we===H,Nt=se&&we>=Y&&we<=G;let Gt=!1;this._decorationService.forEachDecorationAtCell(we,R,void 0,(Fe=>{Gt=!0}));let Sn=xe.getChars()||y.WHITESPACE_CELL_CHAR;if(Sn===" "&&(xe.isUnderline()||xe.isOverline())&&(Sn=" "),ae=je*P-K.get(Sn,xe.isBold(),xe.isItalic()),j){if($&&(xt&&te||!xt&&!te&&xe.bg===re)&&(xt&&te&&z.selectionForeground||xe.fg===ve)&&xe.extended.ext===me&&Nt===Q&&ae===q&&!yt&&!ze&&!Gt){xe.isInvisible()?I+=y.WHITESPACE_CELL_CHAR:I+=Sn,$++;continue}$&&(j.textContent=I),j=this._document.createElement("span"),$=0,I=""}else j=this._document.createElement("span");if(re=xe.bg,ve=xe.fg,me=xe.extended.ext,Q=Nt,q=ae,te=xt,ze&&H>=we&&H<=Pe&&(H=we),!this._coreService.isCursorHidden&&yt&&this._coreService.isCursorInitialized){if(pe.push("xterm-cursor"),this._coreBrowserService.isFocused)U&&pe.push("xterm-cursor-blink"),pe.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(B)switch(B){case"outline":pe.push("xterm-cursor-outline");break;case"block":pe.push("xterm-cursor-block");break;case"bar":pe.push("xterm-cursor-bar");break;case"underline":pe.push("xterm-cursor-underline")}}if(xe.isBold()&&pe.push("xterm-bold"),xe.isItalic()&&pe.push("xterm-italic"),xe.isDim()&&pe.push("xterm-dim"),I=xe.isInvisible()?y.WHITESPACE_CELL_CHAR:xe.getChars()||y.WHITESPACE_CELL_CHAR,xe.isUnderline()&&(pe.push(`xterm-underline-${xe.extended.underlineStyle}`),I===" "&&(I=" "),!xe.isUnderlineColorDefault()))if(xe.isUnderlineColorRGB())j.style.textDecorationColor=`rgb(${b.AttributeData.toColorRGB(xe.getUnderlineColor()).join(",")})`;else{let Fe=xe.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&xe.isBold()&&Fe<8&&(Fe+=8),j.style.textDecorationColor=z.ansi[Fe].css}xe.isOverline()&&(pe.push("xterm-overline"),I===" "&&(I=" ")),xe.isStrikethrough()&&pe.push("xterm-strikethrough"),Nt&&(j.style.textDecoration="underline");let St=xe.getFgColor(),tt=xe.getFgColorMode(),Lt=xe.getBgColor(),he=xe.getBgColorMode();const Se=!!xe.isInverse();if(Se){const Fe=St;St=Lt,Lt=Fe;const gt=tt;tt=he,he=gt}let Ae,Le,Oe,ut=!1;switch(this._decorationService.forEachDecorationAtCell(we,R,void 0,(Fe=>{Fe.options.layer!=="top"&&ut||(Fe.backgroundColorRGB&&(he=50331648,Lt=Fe.backgroundColorRGB.rgba>>8&16777215,Ae=Fe.backgroundColorRGB),Fe.foregroundColorRGB&&(tt=50331648,St=Fe.foregroundColorRGB.rgba>>8&16777215,Le=Fe.foregroundColorRGB),ut=Fe.options.layer==="top")})),!ut&&xt&&(Ae=this._coreBrowserService.isFocused?z.selectionBackgroundOpaque:z.selectionInactiveBackgroundOpaque,Lt=Ae.rgba>>8&16777215,he=50331648,ut=!0,z.selectionForeground&&(tt=50331648,St=z.selectionForeground.rgba>>8&16777215,Le=z.selectionForeground)),ut&&pe.push("xterm-decoration-top"),he){case 16777216:case 33554432:Oe=z.ansi[Lt],pe.push(`xterm-bg-${Lt}`);break;case 50331648:Oe=E.channels.toColor(Lt>>16,Lt>>8&255,255&Lt),this._addStyle(j,`background-color:#${L((Lt>>>0).toString(16),"0",6)}`);break;default:Se?(Oe=z.foreground,pe.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):Oe=z.background}switch(Ae||xe.isDim()&&(Ae=E.color.multiplyOpacity(Oe,.5)),tt){case 16777216:case 33554432:xe.isBold()&&St<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(St+=8),this._applyMinimumContrast(j,Oe,z.ansi[St],xe,Ae,void 0)||pe.push(`xterm-fg-${St}`);break;case 50331648:const Fe=E.channels.toColor(St>>16&255,St>>8&255,255&St);this._applyMinimumContrast(j,Oe,Fe,xe,Ae,Le)||this._addStyle(j,`color:#${L(St.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(j,Oe,z.foreground,xe,Ae,Le)||Se&&pe.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}pe.length&&(j.className=pe.join(" "),pe.length=0),yt||ze||Gt?j.textContent=I:$++,ae!==this.defaultSpacing&&(j.style.letterSpacing=`${ae}px`),W.push(j),we=Pe}return j&&$&&(j.textContent=I),W}_applyMinimumContrast(D,R,k,M,B,H){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,_.treatGlyphAsBackgroundColor)(M.getCode()))return!1;const U=this._getContrastCache(M);let P;if(B||H||(P=U.getColor(R.rgba,k.rgba)),P===void 0){const K=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);P=E.color.ensureContrastRatio(B||R,H||k,K),U.setColor((B||R).rgba,(H||k).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,R){D.setAttribute("style",`${D.getAttribute("style")||""}${R};`)}_isCellInSelection(D,R){const k=this._selectionStart,M=this._selectionEnd;return!(!k||!M)&&(this._columnSelectMode?k[0]<=M[0]?D>=k[0]&&R>=k[1]&&D<M[0]&&R<=M[1]:D<k[0]&&R>=k[1]&&D>=M[0]&&R<=M[1]:R>k[1]&&R<M[1]||k[1]===M[1]&&R===k[1]&&D>=k[0]&&D<M[0]||k[1]<M[1]&&R===M[1]&&D<M[0]||k[1]<M[1]&&R===k[1]&&D>=k[0])}};function L(D,R,k){for(;D.length<k;)D=R+D;return D}o.DomRendererRowFactory=A=h([g(1,S.ICharacterJoinerService),g(2,T.IOptionsService),g(3,S.ICoreBrowserService),g(4,T.ICoreService),g(5,T.IDecorationService),g(6,S.IThemeService)],A)},2550:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.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 g=c.createElement("span");g.classList.add("xterm-char-measure-element");const u=c.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const y=c.createElement("span");y.classList.add("xterm-char-measure-element"),y.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=[g,u,y,w],this._container.appendChild(g),this._container.appendChild(u),this._container.appendChild(y),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,g,u){c===this._font&&h===this._fontSize&&g===this._weight&&u===this._weightBold||(this._font=c,this._fontSize=h,this._weight=g,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(c,h,g){let u=0;if(!h&&!g&&c.length===1&&(u=c.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const T=this._measure(c,0);return T>0&&(this._flat[u]=T),T}let y=c;h&&(y+="B"),g&&(y+="I");let w=this._holey.get(y);if(w===void 0){let T=0;h&&(T|=1),g&&(T|=2),w=this._measure(c,T),w>0&&this._holey.set(y,w)}return w}_measure(c,h){const g=this._measureElements[h];return g.textContent=c.repeat(32),g.offsetWidth/32}}},2223:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const h=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(f,o)=>{function c(g){return 57508<=g&&g<=57558}function h(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},o.isEmoji=h,o.allowRescaling=function(g,u,y,w){return u===1&&y>Math.ceil(1.5*w)&&g!==void 0&&g>255&&!h(g)&&!c(g)&&!(function(T){return 57344<=T&&T<=63743})(g)},o.treatGlyphAsBackgroundColor=function(g){return c(g)||(function(u){return 9472<=u&&u<=9631})(g)},o.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}}}},o.computeNextVariantOffset=function(g,u,y=0){return(g-(2*Math.round(u)-y))%(2*Math.round(u))}},6052:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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(g,u,y,w=!1){if(this.selectionStart=u,this.selectionEnd=y,!u||!y||u[0]===y[0]&&u[1]===y[1])return void this.clear();const T=g.buffers.active.ydisp,E=u[1]-T,S=y[1]-T,v=Math.max(E,0),_=Math.min(S,g.rows-1);v>=g.rows||_<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=E,this.viewportEndRow=S,this.viewportCappedStartRow=v,this.viewportCappedEndRow=_,this.startCol=u[0],this.endCol=y[0])}isCellSelected(g,u,y){return!!this.hasSelection&&(y-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&y>=this.viewportCappedStartRow&&u<this.endCol&&y<=this.viewportCappedEndRow:u<this.startCol&&y>=this.viewportCappedStartRow&&u>=this.endCol&&y<=this.viewportCappedEndRow:y>this.viewportStartRow&&y<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&y===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportStartRow&&u>=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.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,o,c){var h=this&&this.__decorate||function(_,b,A,L){var D,R=arguments.length,k=R<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,b,A,L);else for(var M=_.length-1;M>=0;M--)(D=_[M])&&(k=(R<3?D(k):R>3?D(b,A,k):D(b,A))||k);return R>3&&k&&Object.defineProperty(b,A,k),k},g=this&&this.__param||function(_,b){return function(A,L){b(A,L,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const u=c(2585),y=c(8460),w=c(844);let T=o.CharSizeService=class extends w.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(_,b,A){super(),this._optionsService=A,this.width=0,this.height=0,this._onCharSizeChange=this.register(new y.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new v(this._optionsService))}catch{this._measureStrategy=this.register(new S(_,b,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const _=this._measureStrategy.measure();_.width===this.width&&_.height===this.height||(this.width=_.width,this.height=_.height,this._onCharSizeChange.fire())}};o.CharSizeService=T=h([g(2,u.IOptionsService)],T);class E extends w.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(b,A){b!==void 0&&b>0&&A!==void 0&&A>0&&(this._result.width=b,this._result.height=A)}}class S extends E{constructor(b,A,L){super(),this._document=b,this._parentElement=A,this._optionsService=L,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 v extends E{constructor(b){super(),this._optionsService=b,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const A=this._ctx.measureText("W");if(!("width"in A&&"fontBoundingBoxAscent"in A&&"fontBoundingBoxDescent"in A))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const b=this._ctx.measureText("W");return this._validateAndSet(b.width,b.fontBoundingBoxAscent+b.fontBoundingBoxDescent),this._result}}},4269:function(f,o,c){var h=this&&this.__decorate||function(v,_,b,A){var L,D=arguments.length,R=D<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,b):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(v,_,b,A);else for(var k=v.length-1;k>=0;k--)(L=v[k])&&(R=(D<3?L(R):D>3?L(_,b,R):L(_,b))||R);return D>3&&R&&Object.defineProperty(_,b,R),R},g=this&&this.__param||function(v,_){return function(b,A){_(b,A,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const u=c(3734),y=c(643),w=c(511),T=c(2585);class E extends u.AttributeData{constructor(_,b,A){super(),this.content=0,this.combinedData="",this.fg=_.fg,this.bg=_.bg,this.combinedData=b,this._width=A}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(_){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=E;let S=o.CharacterJoinerService=class i_{constructor(_){this._bufferService=_,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new w.CellData}register(_){const b={id:this._nextCharacterJoinerId++,handler:_};return this._characterJoiners.push(b),b.id}deregister(_){for(let b=0;b<this._characterJoiners.length;b++)if(this._characterJoiners[b].id===_)return this._characterJoiners.splice(b,1),!0;return!1}getJoinedCharacters(_){if(this._characterJoiners.length===0)return[];const b=this._bufferService.buffer.lines.get(_);if(!b||b.length===0)return[];const A=[],L=b.translateToString(!0);let D=0,R=0,k=0,M=b.getFg(0),B=b.getBg(0);for(let H=0;H<b.getTrimmedLength();H++)if(b.loadCell(H,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==M||this._workCell.bg!==B){if(H-D>1){const U=this._getJoinedRanges(L,k,R,b,D);for(let P=0;P<U.length;P++)A.push(U[P])}D=H,k=R,M=this._workCell.fg,B=this._workCell.bg}R+=this._workCell.getChars().length||y.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-D>1){const H=this._getJoinedRanges(L,k,R,b,D);for(let U=0;U<H.length;U++)A.push(H[U])}return A}_getJoinedRanges(_,b,A,L,D){const R=_.substring(b,A);let k=[];try{k=this._characterJoiners[0].handler(R)}catch(M){console.error(M)}for(let M=1;M<this._characterJoiners.length;M++)try{const B=this._characterJoiners[M].handler(R);for(let H=0;H<B.length;H++)i_._mergeRanges(k,B[H])}catch(B){console.error(B)}return this._stringRangesToCellRanges(k,L,D),k}_stringRangesToCellRanges(_,b,A){let L=0,D=!1,R=0,k=_[L];if(k){for(let M=A;M<this._bufferService.cols;M++){const B=b.getWidth(M),H=b.getString(M).length||y.WHITESPACE_CELL_CHAR.length;if(B!==0){if(!D&&k[0]<=R&&(k[0]=M,D=!0),k[1]<=R){if(k[1]=M,k=_[++L],!k)break;k[0]<=R?(k[0]=M,D=!0):D=!1}R+=H}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(_,b){let A=!1;for(let L=0;L<_.length;L++){const D=_[L];if(A){if(b[1]<=D[0])return _[L-1][1]=b[1],_;if(b[1]<=D[1])return _[L-1][1]=Math.max(b[1],D[1]),_.splice(L,1),_;_.splice(L,1),L--}else{if(b[1]<=D[0])return _.splice(L,0,b),_;if(b[1]<=D[1])return D[0]=Math.min(b[0],D[0]),_;b[0]<D[1]&&(D[0]=Math.min(b[0],D[0]),A=!0)}}return A?_[_.length-1][1]=b[1]:_.push(b),_}};o.CharacterJoinerService=S=h([g(0,T.IBufferService)],S)},5114:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const h=c(844),g=c(8460),u=c(3656);class y extends h.Disposable{constructor(E,S,v){super(),this._textarea=E,this._window=S,this.mainDocument=v,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new w(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((_=>this._screenDprMonitor.setWindow(_)))),this.register((0,g.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(E){this._window!==E&&(this._window=E,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=y;class w extends h.Disposable{constructor(E){super(),this._parentWindow=E,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new g.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(E){this._parentWindow=E,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 E;this._outerListener&&((E=this._resolutionMediaMatchList)==null||E.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const h=c(844);class g extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(y){return this.linkProviders.push(y),{dispose:()=>{const w=this.linkProviders.indexOf(y);w!==-1&&this.linkProviders.splice(w,1)}}}}o.LinkProviderService=g},8934:function(f,o,c){var h=this&&this.__decorate||function(T,E,S,v){var _,b=arguments.length,A=b<3?E:v===null?v=Object.getOwnPropertyDescriptor(E,S):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(T,E,S,v);else for(var L=T.length-1;L>=0;L--)(_=T[L])&&(A=(b<3?_(A):b>3?_(E,S,A):_(E,S))||A);return b>3&&A&&Object.defineProperty(E,S,A),A},g=this&&this.__param||function(T,E){return function(S,v){E(S,v,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const u=c(4725),y=c(9806);let w=o.MouseService=class{constructor(T,E){this._renderService=T,this._charSizeService=E}getCoords(T,E,S,v,_){return(0,y.getCoords)(window,T,E,S,v,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,_)}getMouseReportCoords(T,E){const S=(0,y.getCoordsRelativeToElement)(window,T,E);if(this._charSizeService.hasValidSize)return S[0]=Math.min(Math.max(S[0],0),this._renderService.dimensions.css.canvas.width-1),S[1]=Math.min(Math.max(S[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(S[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(S[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(S[0]),y:Math.floor(S[1])}}};o.MouseService=w=h([g(0,u.IRenderService),g(1,u.ICharSizeService)],w)},3230:function(f,o,c){var h=this&&this.__decorate||function(_,b,A,L){var D,R=arguments.length,k=R<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,b,A,L);else for(var M=_.length-1;M>=0;M--)(D=_[M])&&(k=(R<3?D(k):R>3?D(b,A,k):D(b,A))||k);return R>3&&k&&Object.defineProperty(b,A,k),k},g=this&&this.__param||function(_,b){return function(A,L){b(A,L,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const u=c(6193),y=c(4725),w=c(8460),T=c(844),E=c(7226),S=c(2585);let v=o.RenderService=class extends T.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(_,b,A,L,D,R,k,M){super(),this._rowCount=_,this._charSizeService=L,this._renderer=this.register(new T.MutableDisposable),this._pausedResizeTask=new E.DebouncedIdleTask,this._observerDisposable=this.register(new T.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(((B,H)=>this._renderRows(B,H)),k),this.register(this._renderDebouncer),this.register(k.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(R.onResize((()=>this._fullRefresh()))),this.register(R.buffers.onBufferActivate((()=>{var B;return(B=this._renderer.value)==null?void 0:B.clear()}))),this.register(A.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(D.onDecorationRegistered((()=>this._fullRefresh()))),this.register(D.onDecorationRemoved((()=>this._fullRefresh()))),this.register(A.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(R.cols,R.rows),this._fullRefresh()}))),this.register(A.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(R.buffer.y,R.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(k.window,b),this.register(k.onWindowChange((B=>this._registerIntersectionObserver(B,b))))}_registerIntersectionObserver(_,b){if("IntersectionObserver"in _){const A=new _.IntersectionObserver((L=>this._handleIntersectionChange(L[L.length-1])),{threshold:0});A.observe(b),this._observerDisposable.value=(0,T.toDisposable)((()=>A.disconnect()))}}_handleIntersectionChange(_){this._isPaused=_.isIntersecting===void 0?_.intersectionRatio===0:!_.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(_,b,A=!1){this._isPaused?this._needsFullRefresh=!0:(A||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(_,b,this._rowCount))}_renderRows(_,b){this._renderer.value&&(_=Math.min(_,this._rowCount-1),b=Math.min(b,this._rowCount-1),this._renderer.value.renderRows(_,b),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:_,end:b}),this._onRender.fire({start:_,end:b}),this._isNextRenderRedrawOnly=!0)}resize(_,b){this._rowCount=b,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(_){this._renderer.value=_,this._renderer.value&&(this._renderer.value.onRequestRedraw((b=>this.refreshRows(b.start,b.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(_){return this._renderDebouncer.addRefreshCallback(_)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var _,b;this._renderer.value&&((b=(_=this._renderer.value).clearTextureAtlas)==null||b.call(_),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(_,b){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var A;return(A=this._renderer.value)==null?void 0:A.handleResize(_,b)})):this._renderer.value.handleResize(_,b),this._fullRefresh())}handleCharSizeChanged(){var _;(_=this._renderer.value)==null||_.handleCharSizeChanged()}handleBlur(){var _;(_=this._renderer.value)==null||_.handleBlur()}handleFocus(){var _;(_=this._renderer.value)==null||_.handleFocus()}handleSelectionChanged(_,b,A){var L;this._selectionState.start=_,this._selectionState.end=b,this._selectionState.columnSelectMode=A,(L=this._renderer.value)==null||L.handleSelectionChanged(_,b,A)}handleCursorMove(){var _;(_=this._renderer.value)==null||_.handleCursorMove()}clear(){var _;(_=this._renderer.value)==null||_.clear()}};o.RenderService=v=h([g(2,S.IOptionsService),g(3,y.ICharSizeService),g(4,S.IDecorationService),g(5,S.IBufferService),g(6,y.ICoreBrowserService),g(7,y.IThemeService)],v)},9312:function(f,o,c){var h=this&&this.__decorate||function(k,M,B,H){var U,P=arguments.length,K=P<3?M:H===null?H=Object.getOwnPropertyDescriptor(M,B):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(k,M,B,H);else for(var Y=k.length-1;Y>=0;Y--)(U=k[Y])&&(K=(P<3?U(K):P>3?U(M,B,K):U(M,B))||K);return P>3&&K&&Object.defineProperty(M,B,K),K},g=this&&this.__param||function(k,M){return function(B,H){M(B,H,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const u=c(9806),y=c(9504),w=c(456),T=c(4725),E=c(8460),S=c(844),v=c(6114),_=c(4841),b=c(511),A=c(2585),L=" ",D=new RegExp(L,"g");let R=o.SelectionService=class extends S.Disposable{constructor(k,M,B,H,U,P,K,Y,G){super(),this._element=k,this._screenElement=M,this._linkifier=B,this._bufferService=H,this._coreService=U,this._mouseService=P,this._optionsService=K,this._renderService=Y,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new b.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new E.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new E.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new E.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new E.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=W=>this._handleMouseMove(W),this._mouseUpListener=W=>this._handleMouseUp(W),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((W=>this._handleTrim(W))),this.register(this._bufferService.buffers.onBufferActivate((W=>this._handleBufferActivate(W)))),this.enable(),this._model=new w.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,S.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 k=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!k||!M||k[0]===M[0]&&k[1]===M[1])}get selectionText(){const k=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!k||!M)return"";const B=this._bufferService.buffer,H=[];if(this._activeSelectionMode===3){if(k[0]===M[0])return"";const U=k[0]<M[0]?k[0]:M[0],P=k[0]<M[0]?M[0]:k[0];for(let K=k[1];K<=M[1];K++){const Y=B.translateBufferLineToString(K,!0,U,P);H.push(Y)}}else{const U=k[1]===M[1]?M[0]:void 0;H.push(B.translateBufferLineToString(k[1],!0,k[0],U));for(let P=k[1]+1;P<=M[1]-1;P++){const K=B.lines.get(P),Y=B.translateBufferLineToString(P,!0);K!=null&&K.isWrapped?H[H.length-1]+=Y:H.push(Y)}if(k[1]!==M[1]){const P=B.lines.get(M[1]),K=B.translateBufferLineToString(M[1],!0,0,M[0]);P&&P.isWrapped?H[H.length-1]+=K:H.push(K)}}return H.map((U=>U.replace(D," "))).join(v.isWindows?`\r
|
|
56
56
|
`:`
|
|
57
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(k){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),y.isLinux&&k&&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(k){const M=this._getMouseBufferCoords(k),B=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!!(B&&H&&M)&&this._areCoordsInSelection(M,B,H)}isCellInSelection(k,M){const B=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!(!B||!H)&&this._areCoordsInSelection([k,M],B,H)}_areCoordsInSelection(k,M,B){return k[1]>M[1]&&k[1]<B[1]||M[1]===B[1]&&k[1]===M[1]&&k[0]>=M[0]&&k[0]<B[0]||M[1]<B[1]&&k[1]===B[1]&&k[0]<B[0]||M[1]<B[1]&&k[1]===M[1]&&k[0]>=M[0]}_selectWordAtCursor(k,M){var U,P;const B=(P=(U=this._linkifier.currentLink)==null?void 0:U.link)==null?void 0:P.range;if(B)return this._model.selectionStart=[B.start.x-1,B.start.y-1],this._model.selectionStartLength=(0,_.getRangeLength)(B,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const H=this._getMouseBufferCoords(k);return!!H&&(this._selectWordAt(H,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(k,M){this._model.clearSelection(),k=Math.max(k,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,k],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(k){this._model.handleTrim(k)&&this.refresh()}_getMouseBufferCoords(k){const M=this._mouseService.getCoords(k,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(k){let M=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,k,this._screenElement)[1];const B=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=B?0:(M>B&&(M-=B),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(k){return y.isMac?k.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:k.shiftKey}handleMouseDown(k){if(this._mouseDownTimeStamp=k.timeStamp,(k.button!==2||!this.hasSelection)&&k.button===0){if(!this._enabled){if(!this.shouldForceSelection(k))return;k.stopPropagation()}k.preventDefault(),this._dragScrollAmount=0,this._enabled&&k.shiftKey?this._handleIncrementalClick(k):k.detail===1?this._handleSingleClick(k):k.detail===2?this._handleDoubleClick(k):k.detail===3&&this._handleTripleClick(k),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(k){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(k))}_handleSingleClick(k){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(k)?3:0,this._model.selectionStart=this._getMouseBufferCoords(k),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(k){this._selectWordAtCursor(k,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(k){const M=this._getMouseBufferCoords(k);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(k){return k.altKey&&!(y.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(k){if(k.stopImmediatePropagation(),!this._model.selectionStart)return;const M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(k),!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(k),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]++}M&&M[0]===this._model.selectionEnd[0]&&M[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 k=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(k.ydisp+this._bufferService.rows,k.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=k.ydisp),this.refresh()}}_handleMouseUp(k){const M=k.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&k.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const B=this._mouseService.getCoords(k,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(B&&B[0]!==void 0&&B[1]!==void 0){const H=(0,v.moveToCellSequence)(B[0]-1,B[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(H,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const k=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,B=!(!k||!M||k[0]===M[0]&&k[1]===M[1]);B?k&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&k[0]===this._oldSelectionStart[0]&&k[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(k,M,B)):this._oldHasSelection&&this._fireOnSelectionChange(k,M,B)}_fireOnSelectionChange(k,M,B){this._oldSelectionStart=k,this._oldSelectionEnd=M,this._oldHasSelection=B,this._onSelectionChange.fire()}_handleBufferActivate(k){this.clearSelection(),this._trimListener.dispose(),this._trimListener=k.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(k,M){let B=M;for(let H=0;M>=H;H++){const U=k.loadCell(H,this._workCell).getChars().length;this._workCell.getWidth()===0?B--:U>1&&M!==H&&(B+=U-1)}return B}setSelection(k,M,B){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[k,M],this._model.selectionStartLength=B,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(k){this._isClickInSelection(k)||(this._selectWordAtCursor(k,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(k,M,B=!0,H=!0){if(k[0]>=this._bufferService.cols)return;const U=this._bufferService.buffer,P=U.lines.get(k[1]);if(!P)return;const K=U.translateBufferLineToString(k[1],!1);let Y=this._convertViewportColToCharacterIndex(P,k[0]),G=Y;const W=k[0]-Y;let Z=0,z=0,j=0,N=0;if(K.charAt(Y)===" "){for(;Y>0&&K.charAt(Y-1)===" ";)Y--;for(;G<K.length&&K.charAt(G+1)===" ";)G++}else{let re=k[0],ve=k[0];P.getWidth(re)===0&&(Z++,re--),P.getWidth(ve)===2&&(z++,ve++);const me=P.getString(ve).length;for(me>1&&(N+=me-1,G+=me-1);re>0&&Y>0&&!this._isCharWordSeparator(P.loadCell(re-1,this._workCell));){P.loadCell(re-1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===0?(Z++,re--):Q>1&&(j+=Q-1,Y-=Q-1),Y--,re--}for(;ve<P.length&&G+1<K.length&&!this._isCharWordSeparator(P.loadCell(ve+1,this._workCell));){P.loadCell(ve+1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===2?(z++,ve++):Q>1&&(N+=Q-1,G+=Q-1),G++,ve++}}G++;let $=Y+W-Z+j,I=Math.min(this._bufferService.cols,G-Y+Z+z-j-N);if(M||K.slice(Y,G).trim()!==""){if(B&&$===0&&P.getCodePoint(0)!==32){const re=U.lines.get(k[1]-1);if(re&&P.isWrapped&&re.getCodePoint(this._bufferService.cols-1)!==32){const ve=this._getWordAt([this._bufferService.cols-1,k[1]-1],!1,!0,!1);if(ve){const me=this._bufferService.cols-ve.start;$-=me,I+=me}}}if(H&&$+I===this._bufferService.cols&&P.getCodePoint(this._bufferService.cols-1)!==32){const re=U.lines.get(k[1]+1);if(re!=null&&re.isWrapped&&re.getCodePoint(0)!==32){const ve=this._getWordAt([0,k[1]+1],!1,!1,!0);ve&&(I+=ve.length)}}return{start:$,length:I}}}_selectWordAt(k,M){const B=this._getWordAt(k,M);if(B){for(;B.start<0;)B.start+=this._bufferService.cols,k[1]--;this._model.selectionStart=[B.start,k[1]],this._model.selectionStartLength=B.length}}_selectToWordAt(k){const M=this._getWordAt(k,!0);if(M){let B=k[1];for(;M.start<0;)M.start+=this._bufferService.cols,B--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,B++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,B]}}_isCharWordSeparator(k){return k.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(k.getChars())>=0}_selectLineAt(k){const M=this._bufferService.buffer.getWrappedRangeForLine(k),B={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,_.getRangeLength)(B,this._bufferService.cols)}};o.SelectionService=R=h([p(3,A.IBufferService),p(4,A.ICoreService),p(5,T.IMouseService),p(6,A.IOptionsService),p(7,T.IRenderService),p(8,T.ICoreBrowserService)],R)},4725:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const h=c(8343);o.ICharSizeService=(0,h.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),o.IMouseService=(0,h.createDecorator)("MouseService"),o.IRenderService=(0,h.createDecorator)("RenderService"),o.ISelectionService=(0,h.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,h.createDecorator)("ThemeService"),o.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(f,o,c){var h=this&&this.__decorate||function(R,k,M,B){var H,U=arguments.length,P=U<3?k:B===null?B=Object.getOwnPropertyDescriptor(k,M):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(R,k,M,B);else for(var K=R.length-1;K>=0;K--)(H=R[K])&&(P=(U<3?H(P):U>3?H(k,M,P):H(k,M))||P);return U>3&&P&&Object.defineProperty(k,M,P),P},p=this&&this.__param||function(R,k){return function(M,B){k(M,B,R)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const u=c(7239),v=c(8055),C=c(8460),T=c(844),E=c(2585),b=v.css.toColor("#ffffff"),y=v.css.toColor("#000000"),_=v.css.toColor("#ffffff"),S=v.css.toColor("#000000"),A={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const R=[v.css.toColor("#2e3436"),v.css.toColor("#cc0000"),v.css.toColor("#4e9a06"),v.css.toColor("#c4a000"),v.css.toColor("#3465a4"),v.css.toColor("#75507b"),v.css.toColor("#06989a"),v.css.toColor("#d3d7cf"),v.css.toColor("#555753"),v.css.toColor("#ef2929"),v.css.toColor("#8ae234"),v.css.toColor("#fce94f"),v.css.toColor("#729fcf"),v.css.toColor("#ad7fa8"),v.css.toColor("#34e2e2"),v.css.toColor("#eeeeec")],k=[0,95,135,175,215,255];for(let M=0;M<216;M++){const B=k[M/36%6|0],H=k[M/6%6|0],U=k[M%6];R.push({css:v.channels.toCss(B,H,U),rgba:v.channels.toRgba(B,H,U)})}for(let M=0;M<24;M++){const B=8+10*M;R.push({css:v.channels.toCss(B,B,B),rgba:v.channels.toRgba(B,B,B)})}return R})());let L=o.ThemeService=class extends T.Disposable{get colors(){return this._colors}constructor(R){super(),this._optionsService=R,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:y,cursor:_,cursorAccent:S,selectionForeground:void 0,selectionBackgroundTransparent:A,selectionBackgroundOpaque:v.color.blend(y,A),selectionInactiveBackgroundTransparent:A,selectionInactiveBackgroundOpaque:v.color.blend(y,A),ansi:o.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(R={}){const k=this._colors;if(k.foreground=D(R.foreground,b),k.background=D(R.background,y),k.cursor=D(R.cursor,_),k.cursorAccent=D(R.cursorAccent,S),k.selectionBackgroundTransparent=D(R.selectionBackground,A),k.selectionBackgroundOpaque=v.color.blend(k.background,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundTransparent=D(R.selectionInactiveBackground,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundOpaque=v.color.blend(k.background,k.selectionInactiveBackgroundTransparent),k.selectionForeground=R.selectionForeground?D(R.selectionForeground,v.NULL_COLOR):void 0,k.selectionForeground===v.NULL_COLOR&&(k.selectionForeground=void 0),v.color.isOpaque(k.selectionBackgroundTransparent)&&(k.selectionBackgroundTransparent=v.color.opacity(k.selectionBackgroundTransparent,.3)),v.color.isOpaque(k.selectionInactiveBackgroundTransparent)&&(k.selectionInactiveBackgroundTransparent=v.color.opacity(k.selectionInactiveBackgroundTransparent,.3)),k.ansi=o.DEFAULT_ANSI_COLORS.slice(),k.ansi[0]=D(R.black,o.DEFAULT_ANSI_COLORS[0]),k.ansi[1]=D(R.red,o.DEFAULT_ANSI_COLORS[1]),k.ansi[2]=D(R.green,o.DEFAULT_ANSI_COLORS[2]),k.ansi[3]=D(R.yellow,o.DEFAULT_ANSI_COLORS[3]),k.ansi[4]=D(R.blue,o.DEFAULT_ANSI_COLORS[4]),k.ansi[5]=D(R.magenta,o.DEFAULT_ANSI_COLORS[5]),k.ansi[6]=D(R.cyan,o.DEFAULT_ANSI_COLORS[6]),k.ansi[7]=D(R.white,o.DEFAULT_ANSI_COLORS[7]),k.ansi[8]=D(R.brightBlack,o.DEFAULT_ANSI_COLORS[8]),k.ansi[9]=D(R.brightRed,o.DEFAULT_ANSI_COLORS[9]),k.ansi[10]=D(R.brightGreen,o.DEFAULT_ANSI_COLORS[10]),k.ansi[11]=D(R.brightYellow,o.DEFAULT_ANSI_COLORS[11]),k.ansi[12]=D(R.brightBlue,o.DEFAULT_ANSI_COLORS[12]),k.ansi[13]=D(R.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),k.ansi[14]=D(R.brightCyan,o.DEFAULT_ANSI_COLORS[14]),k.ansi[15]=D(R.brightWhite,o.DEFAULT_ANSI_COLORS[15]),R.extendedAnsi){const M=Math.min(k.ansi.length-16,R.extendedAnsi.length);for(let B=0;B<M;B++)k.ansi[B+16]=D(R.extendedAnsi[B],o.DEFAULT_ANSI_COLORS[B+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(R){this._restoreColor(R),this._onChangeColors.fire(this.colors)}_restoreColor(R){if(R!==void 0)switch(R){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[R]=this._restoreColors.ansi[R]}else for(let k=0;k<this._restoreColors.ansi.length;++k)this._colors.ansi[k]=this._restoreColors.ansi[k]}modifyColors(R){R(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(R,k){if(R!==void 0)try{return v.css.toColor(R)}catch{}return k}o.ThemeService=L=h([p(0,E.IOptionsService)],L)},6349:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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 T=new Array(C);for(let E=0;E<Math.min(C,this.length);E++)T[E]=this._array[this._getCyclicIndex(E)];this._array=T,this._maxLength=C,this._startIndex=0}get length(){return this._length}set length(C){if(C>this._length)for(let T=this._length;T<C;T++)this._array[T]=void 0;this._length=C}get(C){return this._array[this._getCyclicIndex(C)]}set(C,T){this._array[this._getCyclicIndex(C)]=T}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,T,...E){if(T){for(let b=C;b<this._length-T;b++)this._array[this._getCyclicIndex(b)]=this._array[this._getCyclicIndex(b+T)];this._length-=T,this.onDeleteEmitter.fire({index:C,amount:T})}for(let b=this._length-1;b>=C;b--)this._array[this._getCyclicIndex(b+E.length)]=this._array[this._getCyclicIndex(b)];for(let b=0;b<E.length;b++)this._array[this._getCyclicIndex(C+b)]=E[b];if(E.length&&this.onInsertEmitter.fire({index:C,amount:E.length}),this._length+E.length>this._maxLength){const b=this._length+E.length-this._maxLength;this._startIndex+=b,this._length=this._maxLength,this.onTrimEmitter.fire(b)}else this._length+=E.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,T,E){if(!(T<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+E<0)throw new Error("Cannot shift elements in list beyond index 0");if(E>0){for(let y=T-1;y>=0;y--)this.set(C+y+E,this.get(C+y));const b=C+T+E-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<T;b++)this.set(C+b+E,this.get(C+b))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}o.CircularList=u},1439:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(h,p=5){if(typeof h!="object")return h;const u=Array.isArray(h)?[]:{};for(const v in h)u[v]=p<=1?h[v]:h[v]&&c(h[v],p-1);return u}},8055:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,h=0,p=0,u=0;var v,C,T,E,b;function y(S){const A=S.toString(16);return A.length<2?"0"+A:A}function _(S,A){return S<A?(A+.05)/(S+.05):(S+.05)/(A+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(S){S.toCss=function(A,L,D,R){return R!==void 0?`#${y(A)}${y(L)}${y(D)}${y(R)}`:`#${y(A)}${y(L)}${y(D)}`},S.toRgba=function(A,L,D,R=255){return(A<<24|L<<16|D<<8|R)>>>0},S.toColor=function(A,L,D,R){return{css:S.toCss(A,L,D,R),rgba:S.toRgba(A,L,D,R)}}})(v||(o.channels=v={})),(function(S){function A(L,D){return u=Math.round(255*D),[c,h,p]=b.toChannels(L.rgba),{css:v.toCss(c,h,p,u),rgba:v.toRgba(c,h,p,u)}}S.blend=function(L,D){if(u=(255&D.rgba)/255,u===1)return{css:D.css,rgba:D.rgba};const R=D.rgba>>24&255,k=D.rgba>>16&255,M=D.rgba>>8&255,B=L.rgba>>24&255,H=L.rgba>>16&255,U=L.rgba>>8&255;return c=B+Math.round((R-B)*u),h=H+Math.round((k-H)*u),p=U+Math.round((M-U)*u),{css:v.toCss(c,h,p),rgba:v.toRgba(c,h,p)}},S.isOpaque=function(L){return(255&L.rgba)==255},S.ensureContrastRatio=function(L,D,R){const k=b.ensureContrastRatio(L.rgba,D.rgba,R);if(k)return v.toColor(k>>24&255,k>>16&255,k>>8&255)},S.opaque=function(L){const D=(255|L.rgba)>>>0;return[c,h,p]=b.toChannels(D),{css:v.toCss(c,h,p),rgba:D}},S.opacity=A,S.multiplyOpacity=function(L,D){return u=255&L.rgba,A(L,u*D/255)},S.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(C||(o.color=C={})),(function(S){let A,L;try{const D=document.createElement("canvas");D.width=1,D.height=1;const R=D.getContext("2d",{willReadFrequently:!0});R&&(A=R,A.globalCompositeOperation="copy",L=A.createLinearGradient(0,0,1,1))}catch{}S.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),v.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),v.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 R=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(R)return c=parseInt(R[1]),h=parseInt(R[2]),p=parseInt(R[3]),u=Math.round(255*(R[5]===void 0?1:parseFloat(R[5]))),v.toColor(c,h,p,u);if(!A||!L)throw new Error("css.toColor: Unsupported css format");if(A.fillStyle=L,A.fillStyle=D,typeof A.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(A.fillRect(0,0,1,1),[c,h,p,u]=A.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:v.toRgba(c,h,p,u),css:D}}})(T||(o.css=T={})),(function(S){function A(L,D,R){const k=L/255,M=D/255,B=R/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))}S.relativeLuminance=function(L){return A(L>>16&255,L>>8&255,255&L)},S.relativeLuminance2=A})(E||(o.rgb=E={})),(function(S){function A(D,R,k){const M=D>>24&255,B=D>>16&255,H=D>>8&255;let U=R>>24&255,P=R>>16&255,K=R>>8&255,Y=_(E.relativeLuminance2(U,P,K),E.relativeLuminance2(M,B,H));for(;Y<k&&(U>0||P>0||K>0);)U-=Math.max(0,Math.ceil(.1*U)),P-=Math.max(0,Math.ceil(.1*P)),K-=Math.max(0,Math.ceil(.1*K)),Y=_(E.relativeLuminance2(U,P,K),E.relativeLuminance2(M,B,H));return(U<<24|P<<16|K<<8|255)>>>0}function L(D,R,k){const M=D>>24&255,B=D>>16&255,H=D>>8&255;let U=R>>24&255,P=R>>16&255,K=R>>8&255,Y=_(E.relativeLuminance2(U,P,K),E.relativeLuminance2(M,B,H));for(;Y<k&&(U<255||P<255||K<255);)U=Math.min(255,U+Math.ceil(.1*(255-U))),P=Math.min(255,P+Math.ceil(.1*(255-P))),K=Math.min(255,K+Math.ceil(.1*(255-K))),Y=_(E.relativeLuminance2(U,P,K),E.relativeLuminance2(M,B,H));return(U<<24|P<<16|K<<8|255)>>>0}S.blend=function(D,R){if(u=(255&R)/255,u===1)return R;const k=R>>24&255,M=R>>16&255,B=R>>8&255,H=D>>24&255,U=D>>16&255,P=D>>8&255;return c=H+Math.round((k-H)*u),h=U+Math.round((M-U)*u),p=P+Math.round((B-P)*u),v.toRgba(c,h,p)},S.ensureContrastRatio=function(D,R,k){const M=E.relativeLuminance(D>>8),B=E.relativeLuminance(R>>8);if(_(M,B)<k){if(B<M){const P=A(D,R,k),K=_(M,E.relativeLuminance(P>>8));if(K<k){const Y=L(D,R,k);return K>_(M,E.relativeLuminance(Y>>8))?P:Y}return P}const H=L(D,R,k),U=_(M,E.relativeLuminance(H>>8));if(U<k){const P=A(D,R,k);return U>_(M,E.relativeLuminance(P>>8))?H:P}return H}},S.reduceLuminance=A,S.increaseLuminance=L,S.toChannels=function(D){return[D>>24&255,D>>16&255,D>>8&255,255&D]}})(b||(o.rgba=b={})),o.toPaddedHex=y,o.contrastRatio=_},8969:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const h=c(844),p=c(2585),u=c(4348),v=c(7866),C=c(744),T=c(7302),E=c(6975),b=c(8460),y=c(1753),_=c(1480),S=c(7994),A=c(9282),L=c(5435),D=c(5981),R=c(2660);let k=!1;class M extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new b.EventEmitter),this._onScroll.event((H=>{var U;(U=this._onScrollApi)==null||U.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 U in H)this.optionsService.options[U]=H[U]}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 T.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(v.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(E.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(y.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(_.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(S.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(R.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new L.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((U=>{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((U=>{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(((U,P)=>this._inputHandler.parse(U,P)))),this.register((0,b.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(H,U){this._writeBuffer.write(H,U)}writeSync(H,U){this._logService.logLevel<=p.LogLevelEnum.WARN&&!k&&(this._logService.warn("writeSync is unreliable and will be removed soon."),k=!0),this._writeBuffer.writeSync(H,U)}input(H,U=!0){this.coreService.triggerDataEvent(H,U)}resize(H,U){isNaN(H)||isNaN(U)||(H=Math.max(H,C.MINIMUM_COLS),U=Math.max(U,C.MINIMUM_ROWS),this._bufferService.resize(H,U))}scroll(H,U=!1){this._bufferService.scroll(H,U)}scrollLines(H,U,P){this._bufferService.scrollLines(H,U,P)}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 U=H-this._bufferService.buffer.ydisp;U!==0&&this.scrollLines(U)}registerEscHandler(H,U){return this._inputHandler.registerEscHandler(H,U)}registerDcsHandler(H,U){return this._inputHandler.registerDcsHandler(H,U)}registerCsiHandler(H,U){return this._inputHandler.registerCsiHandler(H,U)}registerOscHandler(H,U){return this._inputHandler.registerOscHandler(H,U)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let H=!1;const U=this.optionsService.rawOptions.windowsPty;U&&U.buildNumber!==void 0&&U.buildNumber!==void 0?H=U.backend==="conpty"&&U.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(A.updateWindowsModeWrappedState.bind(null,this._bufferService))),H.push(this.registerCsiHandler({final:"H"},(()=>((0,A.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const U of H)U.dispose()}))}}}o.CoreTerminal=M},8460:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.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)}},o.forwardEvent=function(c,h){return c((p=>h.fire(p)))},o.runAndSubscribe=function(c,h){return h(void 0),c((p=>h(p)))}},5435:function(f,o,c){var h=this&&this.__decorate||function(Z,z,j,N){var $,I=arguments.length,re=I<3?z:N===null?N=Object.getOwnPropertyDescriptor(z,j):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")re=Reflect.decorate(Z,z,j,N);else for(var ve=Z.length-1;ve>=0;ve--)($=Z[ve])&&(re=(I<3?$(re):I>3?$(z,j,re):$(z,j))||re);return I>3&&re&&Object.defineProperty(z,j,re),re},p=this&&this.__param||function(Z,z){return function(j,N){z(j,N,Z)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const u=c(2584),v=c(7116),C=c(2015),T=c(844),E=c(482),b=c(8437),y=c(8460),_=c(643),S=c(511),A=c(3734),L=c(2585),D=c(1480),R=c(6242),k=c(6351),M=c(5941),B={"(":0,")":1,"*":2,"+":3,"-":1,".":2},H=131072;function U(Z,z){if(Z>24)return z.setWinLines||!1;switch(Z){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 P;(function(Z){Z[Z.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Z[Z.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(o.WindowsOptionsReportType=P={}));let K=0;class Y extends T.Disposable{getAttrData(){return this._curAttrData}constructor(z,j,N,$,I,re,ve,me,Q=new C.EscapeSequenceParser){super(),this._bufferService=z,this._charsetService=j,this._coreService=N,this._logService=$,this._optionsService=I,this._oscLinkService=re,this._coreMouseService=ve,this._unicodeService=me,this._parser=Q,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new E.StringToUtf32,this._utf8Decoder=new E.Utf8ToUtf32,this._workCell=new S.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 y.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new y.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new y.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new y.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new y.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new y.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new y.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new y.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new y.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new y.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new y.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new y.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,ee)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(q),params:ee.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,ee,ae)=>{this._logService.debug("Unknown OSC code: ",{identifier:q,action:ee,data:ae})})),this._parser.setDcsHandlerFallback(((q,ee,ae)=>{ee==="HOOK"&&(ae=ae.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(q),action:ee,payload:ae})})),this._parser.setPrintHandler(((q,ee,ae)=>this.print(q,ee,ae))),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 R.OscHandler((q=>(this.setTitle(q),this.setIconName(q),!0)))),this._parser.registerOscHandler(1,new R.OscHandler((q=>this.setIconName(q)))),this._parser.registerOscHandler(2,new R.OscHandler((q=>this.setTitle(q)))),this._parser.registerOscHandler(4,new R.OscHandler((q=>this.setOrReportIndexedColor(q)))),this._parser.registerOscHandler(8,new R.OscHandler((q=>this.setHyperlink(q)))),this._parser.registerOscHandler(10,new R.OscHandler((q=>this.setOrReportFgColor(q)))),this._parser.registerOscHandler(11,new R.OscHandler((q=>this.setOrReportBgColor(q)))),this._parser.registerOscHandler(12,new R.OscHandler((q=>this.setOrReportCursorColor(q)))),this._parser.registerOscHandler(104,new R.OscHandler((q=>this.restoreIndexedColor(q)))),this._parser.registerOscHandler(110,new R.OscHandler((q=>this.restoreFgColor(q)))),this._parser.registerOscHandler(111,new R.OscHandler((q=>this.restoreBgColor(q)))),this._parser.registerOscHandler(112,new R.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 v.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 k.DcsHandler(((q,ee)=>this.requestStatusString(q,ee))))}_preserveStack(z,j,N,$){this._parseStack.paused=!0,this._parseStack.cursorStartX=z,this._parseStack.cursorStartY=j,this._parseStack.decodedLength=N,this._parseStack.position=$}_logSlowResolvingAsync(z){this._logService.logLevel<=L.LogLevelEnum.WARN&&Promise.race([z,new Promise(((j,N)=>setTimeout((()=>N("#SLOW_TIMEOUT")),5e3)))]).catch((j=>{if(j!=="#SLOW_TIMEOUT")throw j;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(z,j){let N,$=this._activeBuffer.x,I=this._activeBuffer.y,re=0;const ve=this._parseStack.paused;if(ve){if(N=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,j))return this._logSlowResolvingAsync(N),N;$=this._parseStack.cursorStartX,I=this._parseStack.cursorStartY,this._parseStack.paused=!1,z.length>H&&(re=this._parseStack.position+H)}if(this._logService.logLevel<=L.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))),ve||this._dirtyRowTracker.clearRange(),z.length>H)for(let q=re;q<z.length;q+=H){const ee=q+H<z.length?q+H:z.length,ae=typeof z=="string"?this._stringDecoder.decode(z.substring(q,ee),this._parseBuffer):this._utf8Decoder.decode(z.subarray(q,ee),this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,ae))return this._preserveStack($,I,ae,q),this._logSlowResolvingAsync(N),N}else if(!ve){const q=typeof z=="string"?this._stringDecoder.decode(z,this._parseBuffer):this._utf8Decoder.decode(z,this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,q))return this._preserveStack($,I,q,0),this._logSlowResolvingAsync(N),N}this._activeBuffer.x===$&&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,j,N){let $,I;const re=this._charsetService.charset,ve=this._optionsService.rawOptions.screenReaderMode,me=this._bufferService.cols,Q=this._coreService.decPrivateModes.wraparound,q=this._coreService.modes.insertMode,ee=this._curAttrData;let ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&N-j>0&&ae.getWidth(this._activeBuffer.x-1)===2&&ae.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ee);let pe=this._parser.precedingJoinState;for(let se=j;se<N;++se){if($=z[se],$<127&&re){const Pe=re[String.fromCharCode($)];Pe&&($=Pe.charCodeAt(0))}const we=this._unicodeService.charProperties($,pe);I=D.UnicodeService.extractWidth(we);const je=D.UnicodeService.extractShouldJoin(we),ze=je?D.UnicodeService.extractWidth(pe):0;if(pe=we,ve&&this._onA11yChar.fire((0,E.stringFromCodePoint)($)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+I-ze>me){if(Q){const Pe=ae;let xe=this._activeBuffer.x-ze;for(this._activeBuffer.x=ze,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),ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ze>0&&ae instanceof b.BufferLine&&ae.copyCellsFrom(Pe,xe,0,ze,!1);xe<me;)Pe.setCellFromCodepoint(xe++,0,1,ee)}else if(this._activeBuffer.x=me-1,I===2)continue}if(je&&this._activeBuffer.x){const Pe=ae.getWidth(this._activeBuffer.x-1)?1:2;ae.addCodepointToCell(this._activeBuffer.x-Pe,$,I);for(let xe=I-ze;--xe>=0;)ae.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}else if(q&&(ae.insertCells(this._activeBuffer.x,I-ze,this._activeBuffer.getNullCell(ee)),ae.getWidth(me-1)===2&&ae.setCellFromCodepoint(me-1,_.NULL_CELL_CODE,_.NULL_CELL_WIDTH,ee)),ae.setCellFromCodepoint(this._activeBuffer.x++,$,I,ee),I>0)for(;--I;)ae.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}this._parser.precedingJoinState=pe,this._activeBuffer.x<me&&N-j>0&&ae.getWidth(this._activeBuffer.x)===0&&!ae.hasContent(this._activeBuffer.x)&&ae.setCellFromCodepoint(this._activeBuffer.x,0,1,ee),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(z,j){return z.final!=="t"||z.prefix||z.intermediates?this._parser.registerCsiHandler(z,j):this._parser.registerCsiHandler(z,(N=>!U(N.params[0],this._optionsService.rawOptions.windowOptions)||j(N)))}registerDcsHandler(z,j){return this._parser.registerDcsHandler(z,new k.DcsHandler(j))}registerEscHandler(z,j){return this._parser.registerEscHandler(z,j)}registerOscHandler(z,j){return this._parser.registerOscHandler(z,new R.OscHandler(j))}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 j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);j.hasWidth(this._activeBuffer.x)&&!j.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,j){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=z,this._activeBuffer.y=this._activeBuffer.scrollTop+j):(this._activeBuffer.x=z,this._activeBuffer.y=j),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(z,j){this._restrictCursor(),this._setCursor(this._activeBuffer.x+z,this._activeBuffer.y+j)}cursorUp(z){const j=this._activeBuffer.y-this._activeBuffer.scrollTop;return j>=0?this._moveCursor(0,-Math.min(j,z.params[0]||1)):this._moveCursor(0,-(z.params[0]||1)),!0}cursorDown(z){const j=this._activeBuffer.scrollBottom-this._activeBuffer.y;return j>=0?this._moveCursor(0,Math.min(j,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 j=z.params[0];return j===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:j===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let j=z.params[0]||1;for(;j--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let j=z.params[0]||1;for(;j--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(z){const j=z.params[0];return j===1&&(this._curAttrData.bg|=536870912),j!==2&&j!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(z,j,N,$=!1,I=!1){const re=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);re.replaceCells(j,N,this._activeBuffer.getNullCell(this._eraseAttrData()),I),$&&(re.isWrapped=!1)}_resetBufferLine(z,j=!1){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);N&&(N.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),j),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+z),N.isWrapped=!1)}eraseInDisplay(z,j=!1){let N;switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,j);N<this._bufferService.rows;N++)this._resetBufferLine(N,j);this._dirtyRowTracker.markDirty(N);break;case 1:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N,0,this._activeBuffer.x+1,!0,j),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(N+1).isWrapped=!1);N--;)this._resetBufferLine(N,j);this._dirtyRowTracker.markDirty(0);break;case 2:for(N=this._bufferService.rows,this._dirtyRowTracker.markDirty(N-1);N--;)this._resetBufferLine(N,j);this._dirtyRowTracker.markDirty(0);break;case 3:const $=this._activeBuffer.lines.length-this._bufferService.rows;$>0&&(this._activeBuffer.lines.trimStart($),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-$,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-$,0),this._onScroll.fire(0))}return!0}eraseInLine(z,j=!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,j);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,j);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,j)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(z){this._restrictCursor();let j=z.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y,$=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-$+1;for(;j--;)this._activeBuffer.lines.splice(I-1,1),this._activeBuffer.lines.splice(N,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(z){this._restrictCursor();let j=z.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y;let $;for($=this._bufferService.rows-1-this._activeBuffer.scrollBottom,$=this._bufferService.rows-1+this._activeBuffer.ybase-$;j--;)this._activeBuffer.lines.splice(N,1),this._activeBuffer.lines.splice($,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 j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return j&&(j.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 j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return j&&(j.deleteCells(this._activeBuffer.x,z.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(z){let j=z.params[0]||1;for(;j--;)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 j=z.params[0]||1;for(;j--;)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 j=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);$.deleteCells(0,j,this._activeBuffer.getNullCell(this._eraseAttrData())),$.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 j=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);$.insertCells(0,j,this._activeBuffer.getNullCell(this._eraseAttrData())),$.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 j=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);$.insertCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(this._eraseAttrData())),$.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 j=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);$.deleteCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(z){this._restrictCursor();const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return j&&(j.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 j=this._parser.precedingJoinState;if(!j)return!0;const N=z.params[0]||1,$=D.UnicodeService.extractWidth(j),I=this._activeBuffer.x-$,re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(I),ve=new Uint32Array(re.length*N);let me=0;for(let q=0;q<re.length;){const ee=re.codePointAt(q)||0;ve[me++]=ee,q+=ee>65535?2:1}let Q=me;for(let q=1;q<N;++q)ve.copyWithin(Q,0,me),Q+=me;return this.print(ve,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 j=0;j<z.length;j++)switch(z.params[j]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(z){for(let j=0;j<z.length;j++)switch(z.params[j]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),this._charsetService.setgCharset(1,v.DEFAULT_CHARSET),this._charsetService.setgCharset(2,v.DEFAULT_CHARSET),this._charsetService.setgCharset(3,v.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 j=0;j<z.length;j++)switch(z.params[j]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(z){for(let j=0;j<z.length;j++)switch(z.params[j]){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[j]===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,j){const N=this._coreService.decPrivateModes,{activeProtocol:$,activeEncoding:I}=this._coreMouseService,re=this._coreService,{buffers:ve,cols:me}=this._bufferService,{active:Q,alt:q}=ve,ee=this._optionsService.rawOptions,ae=je=>je?1:2,pe=z.params[0];return se=pe,we=j?pe===2?4:pe===4?ae(re.modes.insertMode):pe===12?3:pe===20?ae(ee.convertEol):0:pe===1?ae(N.applicationCursorKeys):pe===3?ee.windowOptions.setWinLines?me===80?2:me===132?1:0:0:pe===6?ae(N.origin):pe===7?ae(N.wraparound):pe===8?3:pe===9?ae($==="X10"):pe===12?ae(ee.cursorBlink):pe===25?ae(!re.isCursorHidden):pe===45?ae(N.reverseWraparound):pe===66?ae(N.applicationKeypad):pe===67?4:pe===1e3?ae($==="VT200"):pe===1002?ae($==="DRAG"):pe===1003?ae($==="ANY"):pe===1004?ae(N.sendFocus):pe===1005?4:pe===1006?ae(I==="SGR"):pe===1015?4:pe===1016?ae(I==="SGR_PIXELS"):pe===1048?1:pe===47||pe===1047||pe===1049?ae(Q===q):pe===2004?ae(N.bracketedPasteMode):0,re.triggerDataEvent(`${u.C0.ESC}[${j?"":"?"}${se};${we}$y`),!0;var se,we}_updateAttrColor(z,j,N,$,I){return j===2?(z|=50331648,z&=-16777216,z|=A.AttributeData.fromColorRGB([N,$,I])):j===5&&(z&=-50331904,z|=33554432|255&N),z}_extractColor(z,j,N){const $=[0,0,-1,0,0,0];let I=0,re=0;do{if($[re+I]=z.params[j+re],z.hasSubParams(j+re)){const ve=z.getSubParams(j+re);let me=0;do $[1]===5&&(I=1),$[re+me+1+I]=ve[me];while(++me<ve.length&&me+re+1+I<$.length);break}if($[1]===5&&re+I>=2||$[1]===2&&re+I>=5)break;$[1]&&(I=1)}while(++re+j<z.length&&re+I<$.length);for(let ve=2;ve<$.length;++ve)$[ve]===-1&&($[ve]=0);switch($[0]){case 38:N.fg=this._updateAttrColor(N.fg,$[1],$[3],$[4],$[5]);break;case 48:N.bg=this._updateAttrColor(N.bg,$[1],$[3],$[4],$[5]);break;case 58:N.extended=N.extended.clone(),N.extended.underlineColor=this._updateAttrColor(N.extended.underlineColor,$[1],$[3],$[4],$[5])}return re}_processUnderline(z,j){j.extended=j.extended.clone(),(!~z||z>5)&&(z=1),j.extended.underlineStyle=z,j.fg|=268435456,z===0&&(j.fg&=-268435457),j.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 j=z.length;let N;const $=this._curAttrData;for(let I=0;I<j;I++)N=z.params[I],N>=30&&N<=37?($.fg&=-50331904,$.fg|=16777216|N-30):N>=40&&N<=47?($.bg&=-50331904,$.bg|=16777216|N-40):N>=90&&N<=97?($.fg&=-50331904,$.fg|=16777224|N-90):N>=100&&N<=107?($.bg&=-50331904,$.bg|=16777224|N-100):N===0?this._processSGR0($):N===1?$.fg|=134217728:N===3?$.bg|=67108864:N===4?($.fg|=268435456,this._processUnderline(z.hasSubParams(I)?z.getSubParams(I)[0]:1,$)):N===5?$.fg|=536870912:N===7?$.fg|=67108864:N===8?$.fg|=1073741824:N===9?$.fg|=2147483648:N===2?$.bg|=134217728:N===21?this._processUnderline(2,$):N===22?($.fg&=-134217729,$.bg&=-134217729):N===23?$.bg&=-67108865:N===24?($.fg&=-268435457,this._processUnderline(0,$)):N===25?$.fg&=-536870913:N===27?$.fg&=-67108865:N===28?$.fg&=-1073741825:N===29?$.fg&=2147483647:N===39?($.fg&=-67108864,$.fg|=16777215&b.DEFAULT_ATTR_DATA.fg):N===49?($.bg&=-67108864,$.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):N===38||N===48||N===58?I+=this._extractColor(z,I,$):N===53?$.bg|=1073741824:N===55?$.bg&=-1073741825:N===59?($.extended=$.extended.clone(),$.extended.underlineColor=-1,$.updateExtended()):N===100?($.fg&=-67108864,$.fg|=16777215&b.DEFAULT_ATTR_DATA.fg,$.bg&=-67108864,$.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",N);return!0}deviceStatus(z){switch(z.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const j=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${j};${N}R`)}return!0}deviceStatusPrivate(z){if(z.params[0]===6){const j=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${j};${N}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 j=z.params[0]||1;switch(j){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 N=j%2==1;return this._optionsService.options.cursorBlink=N,!0}setScrollRegion(z){const j=z.params[0]||1;let N;return(z.length<2||(N=z.params[1])>this._bufferService.rows||N===0)&&(N=this._bufferService.rows),N>j&&(this._activeBuffer.scrollTop=j-1,this._activeBuffer.scrollBottom=N-1,this._setCursor(0,0)),!0}windowOptions(z){if(!U(z.params[0],this._optionsService.rawOptions.windowOptions))return!0;const j=z.length>1?z.params[1]:0;switch(z.params[0]){case 14:j!==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:j!==0&&j!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),j!==0&&j!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:j!==0&&j!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),j!==0&&j!==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 j=[],N=z.split(";");for(;N.length>1;){const $=N.shift(),I=N.shift();if(/^\d+$/.exec($)){const re=parseInt($);if(W(re))if(I==="?")j.push({type:0,index:re});else{const ve=(0,M.parseColor)(I);ve&&j.push({type:1,index:re,color:ve})}}}return j.length&&this._onColor.fire(j),!0}setHyperlink(z){const j=z.split(";");return!(j.length<2)&&(j[1]?this._createHyperlink(j[0],j[1]):!j[0]&&this._finishHyperlink())}_createHyperlink(z,j){this._getCurrentLinkId()&&this._finishHyperlink();const N=z.split(":");let $;const I=N.findIndex((re=>re.startsWith("id=")));return I!==-1&&($=N[I].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:$,uri:j}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(z,j){const N=z.split(";");for(let $=0;$<N.length&&!(j>=this._specialColors.length);++$,++j)if(N[$]==="?")this._onColor.fire([{type:0,index:this._specialColors[j]}]);else{const I=(0,M.parseColor)(N[$]);I&&this._onColor.fire([{type:1,index:this._specialColors[j],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 j=[],N=z.split(";");for(let $=0;$<N.length;++$)if(/^\d+$/.exec(N[$])){const I=parseInt(N[$]);W(I)&&j.push({type:2,index:I})}return j.length&&this._onColor.fire(j),!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,v.DEFAULT_CHARSET),!0}selectCharset(z){return z.length!==2?(this.selectDefaultCharset(),!0):(z[0]==="/"||this._charsetService.setgCharset(B[z[0]],v.CHARSETS[z[1]]||v.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 S.CellData;z.content=4194373,z.fg=this._curAttrData.fg,z.bg=this._curAttrData.bg,this._setCursor(0,0);for(let j=0;j<this._bufferService.rows;++j){const N=this._activeBuffer.ybase+this._activeBuffer.y+j,$=this._activeBuffer.lines.get(N);$&&($.fill(z),$.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(z,j){const N=this._bufferService.buffer,$=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${N.scrollTop+1};${N.scrollBottom+1}r`:z==="m"?"P1$r0m":z===" q"?`P1$r${{block:2,underline:4,bar:6}[$.cursorStyle]-($.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(z,j){this._dirtyRowTracker.markRangeDirty(z,j)}}o.InputHandler=Y;let G=class{constructor(Z){this._bufferService=Z,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Z){Z<this.start?this.start=Z:Z>this.end&&(this.end=Z)}markRangeDirty(Z,z){Z>z&&(K=Z,Z=z,z=K),Z<this.start&&(this.start=Z),z>this.end&&(this.end=z)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function W(Z){return 0<=Z&&Z<256}G=h([p(0,L.IBufferService)],G)},844:(f,o)=>{function c(h){for(const p of h)p.dispose();h.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.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)}},o.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}},o.toDisposable=function(h){return{dispose:h}},o.disposeArray=c,o.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(p,u,v){this._data[p]||(this._data[p]={}),this._data[p][u]=v}get(p,u){return this._data[p]?this._data[p][u]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(h,p,u,v,C){this._data.get(h,p)||this._data.set(h,p,new c),this._data.get(h,p).set(u,v,C)}get(h,p,u,v){var C;return(C=this._data.get(h,p))==null?void 0:C.get(u,v)}clear(){this._data.clear()}}},6114:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,h=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const p=c.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),o.isIpad=h==="iPad",o.isIphone=h==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),o.isLinux=h.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.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 v=p+u>>1;const C=this._getKey(this._array[v]);if(C>h)u=v-1;else{if(!(C<h)){for(;v>0&&this._getKey(this._array[v-1])===h;)v--;return v}p=v+1}}return p}}},7226:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.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 T=0,E=0,b=C.timeRemaining(),y=0;for(;this._i<this._tasks.length;){if(T=Date.now(),this._tasks[this._i]()||this._i++,T=Math.max(1,Date.now()-T),E=Math.max(T,E),y=C.timeRemaining(),1.5*E>y)return b-T<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(b-T))}ms`),void this._start();b=y}this.clear()}}class u extends p{_requestCallback(C){return setTimeout((()=>C(this._createDeadline(16))))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const T=Date.now()+C;return{timeRemaining:()=>Math.max(0,T-Date.now())}}}o.PriorityTaskQueue=u,o.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:u,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},9282:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const h=c(643);o.updateWindowsModeWrappedState=function(p){const u=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),v=u==null?void 0:u.get(p.cols-1),C=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);C&&v&&(C.isWrapped=v[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&v[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.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}}o.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,v=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=v}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=h},9092:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const h=c(6349),p=c(7226),u=c(3734),v=c(8437),C=c(4634),T=c(511),E=c(643),b=c(4863),y=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(_,S,A){this._hasScrollback=_,this._optionsService=S,this._bufferService=A,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=v.DEFAULT_ATTR_DATA.clone(),this.savedCharset=y.DEFAULT_CHARSET,this.markers=[],this._nullCell=T.CellData.fromCharData([0,E.NULL_CELL_CHAR,E.NULL_CELL_WIDTH,E.NULL_CELL_CODE]),this._whitespaceCell=T.CellData.fromCharData([0,E.WHITESPACE_CELL_CHAR,E.WHITESPACE_CELL_WIDTH,E.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(_){return _?(this._nullCell.fg=_.fg,this._nullCell.bg=_.bg,this._nullCell.extended=_.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(_){return _?(this._whitespaceCell.fg=_.fg,this._whitespaceCell.bg=_.bg,this._whitespaceCell.extended=_.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(_,S){return new v.BufferLine(this._bufferService.cols,this.getNullCell(_),S)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const _=this.ybase+this.y-this.ydisp;return _>=0&&_<this._rows}_getCorrectBufferLength(_){if(!this._hasScrollback)return _;const S=_+this._optionsService.rawOptions.scrollback;return S>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:S}fillViewportRows(_){if(this.lines.length===0){_===void 0&&(_=v.DEFAULT_ATTR_DATA);let S=this._rows;for(;S--;)this.lines.push(this.getBlankLine(_))}}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(_,S){const A=this.getNullCell(v.DEFAULT_ATTR_DATA);let L=0;const D=this._getCorrectBufferLength(S);if(D>this.lines.maxLength&&(this.lines.maxLength=D),this.lines.length>0){if(this._cols<_)for(let k=0;k<this.lines.length;k++)L+=+this.lines.get(k).resize(_,A);let R=0;if(this._rows<S)for(let k=this._rows;k<S;k++)this.lines.length<S+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new v.BufferLine(_,A)):this.ybase>0&&this.lines.length<=this.ybase+this.y+R+1?(this.ybase--,R++,this.ydisp>0&&this.ydisp--):this.lines.push(new v.BufferLine(_,A)));else for(let k=this._rows;k>S;k--)this.lines.length>S+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(D<this.lines.maxLength){const k=this.lines.length-D;k>0&&(this.lines.trimStart(k),this.ybase=Math.max(this.ybase-k,0),this.ydisp=Math.max(this.ydisp-k,0),this.savedY=Math.max(this.savedY-k,0)),this.lines.maxLength=D}this.x=Math.min(this.x,_-1),this.y=Math.min(this.y,S-1),R&&(this.y+=R),this.savedX=Math.min(this.savedX,_-1),this.scrollTop=0}if(this.scrollBottom=S-1,this._isReflowEnabled&&(this._reflow(_,S),this._cols>_))for(let R=0;R<this.lines.length;R++)L+=+this.lines.get(R).resize(_,A);this._cols=_,this._rows=S,this._memoryCleanupQueue.clear(),L>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let _=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,_=!1);let S=0;for(;this._memoryCleanupPosition<this.lines.length;)if(S+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),S>100)return!0;return _}get _isReflowEnabled(){const _=this._optionsService.rawOptions.windowsPty;return _&&_.buildNumber?this._hasScrollback&&_.backend==="conpty"&&_.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(_,S){this._cols!==_&&(_>this._cols?this._reflowLarger(_,S):this._reflowSmaller(_,S))}_reflowLarger(_,S){const A=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,_,this.ybase+this.y,this.getNullCell(v.DEFAULT_ATTR_DATA));if(A.length>0){const L=(0,C.reflowLargerCreateNewLayout)(this.lines,A);(0,C.reflowLargerApplyNewLayout)(this.lines,L.layout),this._reflowLargerAdjustViewport(_,S,L.countRemoved)}}_reflowLargerAdjustViewport(_,S,A){const L=this.getNullCell(v.DEFAULT_ATTR_DATA);let D=A;for(;D-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<S&&this.lines.push(new v.BufferLine(_,L))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-A,0)}_reflowSmaller(_,S){const A=this.getNullCell(v.DEFAULT_ATTR_DATA),L=[];let D=0;for(let R=this.lines.length-1;R>=0;R--){let k=this.lines.get(R);if(!k||!k.isWrapped&&k.getTrimmedLength()<=_)continue;const M=[k];for(;k.isWrapped&&R>0;)k=this.lines.get(--R),M.unshift(k);const B=this.ybase+this.y;if(B>=R&&B<R+M.length)continue;const H=M[M.length-1].getTrimmedLength(),U=(0,C.reflowSmallerGetNewLineLengths)(M,this._cols,_),P=U.length-M.length;let K;K=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 Y=[];for(let N=0;N<P;N++){const $=this.getBlankLine(v.DEFAULT_ATTR_DATA,!0);Y.push($)}Y.length>0&&(L.push({start:R+M.length+D,newLines:Y}),D+=Y.length),M.push(...Y);let G=U.length-1,W=U[G];W===0&&(G--,W=U[G]);let Z=M.length-P-1,z=H;for(;Z>=0;){const N=Math.min(z,W);if(M[G]===void 0)break;if(M[G].copyCellsFrom(M[Z],z-N,W-N,N,!0),W-=N,W===0&&(G--,W=U[G]),z-=N,z===0){Z--;const $=Math.max(Z,0);z=(0,C.getWrappedLineTrimmedLength)(M,$,this._cols)}}for(let N=0;N<M.length;N++)U[N]<_&&M[N].setCell(U[N],A);let j=P-K;for(;j-- >0;)this.ybase===0?this.y<S-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+D)-S&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+P,this.ybase+S-1)}if(L.length>0){const R=[],k=[];for(let G=0;G<this.lines.length;G++)k.push(this.lines.get(G));const M=this.lines.length;let B=M-1,H=0,U=L[H];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+D);let P=0;for(let G=Math.min(this.lines.maxLength-1,M+D-1);G>=0;G--)if(U&&U.start>B+P){for(let W=U.newLines.length-1;W>=0;W--)this.lines.set(G--,U.newLines[W]);G++,R.push({index:B+1,amount:U.newLines.length}),P+=U.newLines.length,U=L[++H]}else this.lines.set(G,k[B--]);let K=0;for(let G=R.length-1;G>=0;G--)R[G].index+=K,this.lines.onInsertEmitter.fire(R[G]),K+=R[G].amount;const Y=Math.max(0,M+D-this.lines.maxLength);Y>0&&this.lines.onTrimEmitter.fire(Y)}}translateBufferLineToString(_,S,A=0,L){const D=this.lines.get(_);return D?D.translateToString(S,A,L):""}getWrappedRangeForLine(_){let S=_,A=_;for(;S>0&&this.lines.get(S).isWrapped;)S--;for(;A+1<this.lines.length&&this.lines.get(A+1).isWrapped;)A++;return{first:S,last:A}}setupTabStops(_){for(_!=null?this.tabs[_]||(_=this.prevStop(_)):(this.tabs={},_=0);_<this._cols;_+=this._optionsService.rawOptions.tabStopWidth)this.tabs[_]=!0}prevStop(_){for(_==null&&(_=this.x);!this.tabs[--_]&&_>0;);return _>=this._cols?this._cols-1:_<0?0:_}nextStop(_){for(_==null&&(_=this.x);!this.tabs[++_]&&_<this._cols;);return _>=this._cols?this._cols-1:_<0?0:_}clearMarkers(_){this._isClearing=!0;for(let S=0;S<this.markers.length;S++)this.markers[S].line===_&&(this.markers[S].dispose(),this.markers.splice(S--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let _=0;_<this.markers.length;_++)this.markers[_].dispose(),this.markers.splice(_--,1);this._isClearing=!1}addMarker(_){const S=new b.Marker(_);return this.markers.push(S),S.register(this.lines.onTrim((A=>{S.line-=A,S.line<0&&S.dispose()}))),S.register(this.lines.onInsert((A=>{S.line>=A.index&&(S.line+=A.amount)}))),S.register(this.lines.onDelete((A=>{S.line>=A.index&&S.line<A.index+A.amount&&S.dispose(),S.line>A.index&&(S.line-=A.amount)}))),S.register(S.onDispose((()=>this._removeMarker(S)))),S}_removeMarker(_){this._isClearing||this.markers.splice(this.markers.indexOf(_),1)}}},8437:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const h=c(3734),p=c(511),u=c(643),v=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let C=0;class T{constructor(b,y,_=!1){this.isWrapped=_,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*b);const S=y||p.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let A=0;A<b;++A)this.setCell(A,S);this.length=b}get(b){const y=this._data[3*b+0],_=2097151&y;return[this._data[3*b+1],2097152&y?this._combined[b]:_?(0,v.stringFromCodePoint)(_):"",y>>22,2097152&y?this._combined[b].charCodeAt(this._combined[b].length-1):_]}set(b,y){this._data[3*b+1]=y[u.CHAR_DATA_ATTR_INDEX],y[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[b]=y[1],this._data[3*b+0]=2097152|b|y[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*b+0]=y[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[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 y=this._data[3*b+0];return 2097152&y?this._combined[b].charCodeAt(this._combined[b].length-1):2097151&y}isCombined(b){return 2097152&this._data[3*b+0]}getString(b){const y=this._data[3*b+0];return 2097152&y?this._combined[b]:2097151&y?(0,v.stringFromCodePoint)(2097151&y):""}isProtected(b){return 536870912&this._data[3*b+2]}loadCell(b,y){return C=3*b,y.content=this._data[C+0],y.fg=this._data[C+1],y.bg=this._data[C+2],2097152&y.content&&(y.combinedData=this._combined[b]),268435456&y.bg&&(y.extended=this._extendedAttrs[b]),y}setCell(b,y){2097152&y.content&&(this._combined[b]=y.combinedData),268435456&y.bg&&(this._extendedAttrs[b]=y.extended),this._data[3*b+0]=y.content,this._data[3*b+1]=y.fg,this._data[3*b+2]=y.bg}setCellFromCodepoint(b,y,_,S){268435456&S.bg&&(this._extendedAttrs[b]=S.extended),this._data[3*b+0]=y|_<<22,this._data[3*b+1]=S.fg,this._data[3*b+2]=S.bg}addCodepointToCell(b,y,_){let S=this._data[3*b+0];2097152&S?this._combined[b]+=(0,v.stringFromCodePoint)(y):2097151&S?(this._combined[b]=(0,v.stringFromCodePoint)(2097151&S)+(0,v.stringFromCodePoint)(y),S&=-2097152,S|=2097152):S=y|4194304,_&&(S&=-12582913,S|=_<<22),this._data[3*b+0]=S}insertCells(b,y,_){if((b%=this.length)&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,_),y<this.length-b){const S=new p.CellData;for(let A=this.length-b-y-1;A>=0;--A)this.setCell(b+y+A,this.loadCell(b+A,S));for(let A=0;A<y;++A)this.setCell(b+A,_)}else for(let S=b;S<this.length;++S)this.setCell(S,_);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,_)}deleteCells(b,y,_){if(b%=this.length,y<this.length-b){const S=new p.CellData;for(let A=0;A<this.length-b-y;++A)this.setCell(b+A,this.loadCell(b+y+A,S));for(let A=this.length-y;A<this.length;++A)this.setCell(A,_)}else for(let S=b;S<this.length;++S)this.setCell(S,_);b&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,_),this.getWidth(b)!==0||this.hasContent(b)||this.setCellFromCodepoint(b,0,1,_)}replaceCells(b,y,_,S=!1){if(S)for(b&&this.getWidth(b-1)===2&&!this.isProtected(b-1)&&this.setCellFromCodepoint(b-1,0,1,_),y<this.length&&this.getWidth(y-1)===2&&!this.isProtected(y)&&this.setCellFromCodepoint(y,0,1,_);b<y&&b<this.length;)this.isProtected(b)||this.setCell(b,_),b++;else for(b&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,_),y<this.length&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y,0,1,_);b<y&&b<this.length;)this.setCell(b++,_)}resize(b,y){if(b===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const _=3*b;if(b>this.length){if(this._data.buffer.byteLength>=4*_)this._data=new Uint32Array(this._data.buffer,0,_);else{const S=new Uint32Array(_);S.set(this._data),this._data=S}for(let S=this.length;S<b;++S)this.setCell(S,y)}else{this._data=this._data.subarray(0,_);const S=Object.keys(this._combined);for(let L=0;L<S.length;L++){const D=parseInt(S[L],10);D>=b&&delete this._combined[D]}const A=Object.keys(this._extendedAttrs);for(let L=0;L<A.length;L++){const D=parseInt(A[L],10);D>=b&&delete this._extendedAttrs[D]}}return this.length=b,4*_*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,y=!1){if(y)for(let _=0;_<this.length;++_)this.isProtected(_)||this.setCell(_,b);else{this._combined={},this._extendedAttrs={};for(let _=0;_<this.length;++_)this.setCell(_,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 y in b._combined)this._combined[y]=b._combined[y];this._extendedAttrs={};for(const y in b._extendedAttrs)this._extendedAttrs[y]=b._extendedAttrs[y];this.isWrapped=b.isWrapped}clone(){const b=new T(0);b._data=new Uint32Array(this._data),b.length=this.length;for(const y in this._combined)b._combined[y]=this._combined[y];for(const y in this._extendedAttrs)b._extendedAttrs[y]=this._extendedAttrs[y];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,y,_,S,A){const L=b._data;if(A)for(let R=S-1;R>=0;R--){for(let k=0;k<3;k++)this._data[3*(_+R)+k]=L[3*(y+R)+k];268435456&L[3*(y+R)+2]&&(this._extendedAttrs[_+R]=b._extendedAttrs[y+R])}else for(let R=0;R<S;R++){for(let k=0;k<3;k++)this._data[3*(_+R)+k]=L[3*(y+R)+k];268435456&L[3*(y+R)+2]&&(this._extendedAttrs[_+R]=b._extendedAttrs[y+R])}const D=Object.keys(b._combined);for(let R=0;R<D.length;R++){const k=parseInt(D[R],10);k>=y&&(this._combined[k-y+_]=b._combined[k])}}translateToString(b,y,_,S){y=y??0,_=_??this.length,b&&(_=Math.min(_,this.getTrimmedLength())),S&&(S.length=0);let A="";for(;y<_;){const L=this._data[3*y+0],D=2097151&L,R=2097152&L?this._combined[y]:D?(0,v.stringFromCodePoint)(D):u.WHITESPACE_CELL_CHAR;if(A+=R,S)for(let k=0;k<R.length;++k)S.push(y);y+=L>>22||1}return S&&S.push(y),A}}o.BufferLine=T},4841:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.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,o)=>{function c(h,p,u){if(p===h.length-1)return h[p].getTrimmedLength();const v=!h[p].hasContent(u-1)&&h[p].getWidth(u-1)===1,C=h[p+1].getWidth(0)===2;return v&&C?u-1:u}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(h,p,u,v,C){const T=[];for(let E=0;E<h.length-1;E++){let b=E,y=h.get(++b);if(!y.isWrapped)continue;const _=[h.get(E)];for(;b<h.length&&y.isWrapped;)_.push(y),y=h.get(++b);if(v>=E&&v<b){E+=_.length-1;continue}let S=0,A=c(_,S,p),L=1,D=0;for(;L<_.length;){const k=c(_,L,p),M=k-D,B=u-A,H=Math.min(M,B);_[S].copyCellsFrom(_[L],D,A,H,!1),A+=H,A===u&&(S++,A=0),D+=H,D===k&&(L++,D=0),A===0&&S!==0&&_[S-1].getWidth(u-1)===2&&(_[S].copyCellsFrom(_[S-1],u-1,A++,1,!1),_[S-1].setCell(u-1,C))}_[S].replaceCells(A,u,C);let R=0;for(let k=_.length-1;k>0&&(k>S||_[k].getTrimmedLength()===0);k--)R++;R>0&&(T.push(E+_.length-R),T.push(R)),E+=_.length-1}return T},o.reflowLargerCreateNewLayout=function(h,p){const u=[];let v=0,C=p[v],T=0;for(let E=0;E<h.length;E++)if(C===E){const b=p[++v];h.onDeleteEmitter.fire({index:E-T,amount:b}),E+=b-1,T+=b,C=p[++v]}else u.push(E);return{layout:u,countRemoved:T}},o.reflowLargerApplyNewLayout=function(h,p){const u=[];for(let v=0;v<p.length;v++)u.push(h.get(p[v]));for(let v=0;v<u.length;v++)h.set(v,u[v]);h.length=p.length},o.reflowSmallerGetNewLineLengths=function(h,p,u){const v=[],C=h.map(((y,_)=>c(h,_,p))).reduce(((y,_)=>y+_));let T=0,E=0,b=0;for(;b<C;){if(C-b<u){v.push(C-b);break}T+=u;const y=c(h,E,p);T>y&&(T-=y,E++);const _=h[E].getWidth(T-1)===2;_&&T--;const S=_?u-1:u;v.push(S),b+=S}return v},o.getWrappedLineTrimmedLength=c},5295:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const h=c(8460),p=c(844),u=c(9092);class v extends p.Disposable{constructor(T,E){super(),this._optionsService=T,this._bufferService=E,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(T){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(T),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(T,E){this._normal.resize(T,E),this._alt.resize(T,E),this.setupTabStops(T)}setupTabStops(T){this._normal.setupTabStops(T),this._alt.setupTabStops(T)}}o.BufferSet=v},511:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const h=c(482),p=c(643),u=c(3734);class v extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(T){const E=new v;return E.setFromCharData(T),E}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(T){this.fg=T[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let E=!1;if(T[p.CHAR_DATA_CHAR_INDEX].length>2)E=!0;else if(T[p.CHAR_DATA_CHAR_INDEX].length===2){const b=T[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=b&&b<=56319){const y=T[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=y&&y<=57343?this.content=1024*(b-55296)+y-56320+65536|T[p.CHAR_DATA_WIDTH_INDEX]<<22:E=!0}else E=!0}else this.content=T[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|T[p.CHAR_DATA_WIDTH_INDEX]<<22;E&&(this.combinedData=T[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|T[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=v},643:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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}}o.Marker=u,u._nextId=1},7116:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.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:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(f,o)=>{var c,h,p;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.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||(o.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||(o.C1=h={})),(function(u){u.ST=`${c.ESC}\\`})(p||(o.C1_ESCAPED=p={}))},7399:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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:["'",'"']};o.evaluateKeyboardEvent=function(u,v,C,T){const E={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"?E.key=v?h.C0.ESC+"OA":h.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?E.key=v?h.C0.ESC+"OD":h.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?E.key=v?h.C0.ESC+"OC":h.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(E.key=v?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:E.key=u.ctrlKey?"\b":h.C0.DEL,u.altKey&&(E.key=h.C0.ESC+E.key);break;case 9:if(u.shiftKey){E.key=h.C0.ESC+"[Z";break}E.key=h.C0.HT,E.cancel=!0;break;case 13:E.key=u.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,E.cancel=!0;break;case 27:E.key=h.C0.ESC,u.altKey&&(E.key=h.C0.ESC+h.C0.ESC),E.cancel=!0;break;case 37:if(u.metaKey)break;b?(E.key=h.C0.ESC+"[1;"+(b+1)+"D",E.key===h.C0.ESC+"[1;3D"&&(E.key=h.C0.ESC+(C?"b":"[1;5D"))):E.key=v?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(u.metaKey)break;b?(E.key=h.C0.ESC+"[1;"+(b+1)+"C",E.key===h.C0.ESC+"[1;3C"&&(E.key=h.C0.ESC+(C?"f":"[1;5C"))):E.key=v?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(u.metaKey)break;b?(E.key=h.C0.ESC+"[1;"+(b+1)+"A",C||E.key!==h.C0.ESC+"[1;3A"||(E.key=h.C0.ESC+"[1;5A")):E.key=v?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(u.metaKey)break;b?(E.key=h.C0.ESC+"[1;"+(b+1)+"B",C||E.key!==h.C0.ESC+"[1;3B"||(E.key=h.C0.ESC+"[1;5B")):E.key=v?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(E.key=h.C0.ESC+"[2~");break;case 46:E.key=b?h.C0.ESC+"[3;"+(b+1)+"~":h.C0.ESC+"[3~";break;case 36:E.key=b?h.C0.ESC+"[1;"+(b+1)+"H":v?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:E.key=b?h.C0.ESC+"[1;"+(b+1)+"F":v?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:u.shiftKey?E.type=2:u.ctrlKey?E.key=h.C0.ESC+"[5;"+(b+1)+"~":E.key=h.C0.ESC+"[5~";break;case 34:u.shiftKey?E.type=3:u.ctrlKey?E.key=h.C0.ESC+"[6;"+(b+1)+"~":E.key=h.C0.ESC+"[6~";break;case 112:E.key=b?h.C0.ESC+"[1;"+(b+1)+"P":h.C0.ESC+"OP";break;case 113:E.key=b?h.C0.ESC+"[1;"+(b+1)+"Q":h.C0.ESC+"OQ";break;case 114:E.key=b?h.C0.ESC+"[1;"+(b+1)+"R":h.C0.ESC+"OR";break;case 115:E.key=b?h.C0.ESC+"[1;"+(b+1)+"S":h.C0.ESC+"OS";break;case 116:E.key=b?h.C0.ESC+"[15;"+(b+1)+"~":h.C0.ESC+"[15~";break;case 117:E.key=b?h.C0.ESC+"[17;"+(b+1)+"~":h.C0.ESC+"[17~";break;case 118:E.key=b?h.C0.ESC+"[18;"+(b+1)+"~":h.C0.ESC+"[18~";break;case 119:E.key=b?h.C0.ESC+"[19;"+(b+1)+"~":h.C0.ESC+"[19~";break;case 120:E.key=b?h.C0.ESC+"[20;"+(b+1)+"~":h.C0.ESC+"[20~";break;case 121:E.key=b?h.C0.ESC+"[21;"+(b+1)+"~":h.C0.ESC+"[21~";break;case 122:E.key=b?h.C0.ESC+"[23;"+(b+1)+"~":h.C0.ESC+"[23~";break;case 123:E.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&&!T||!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?E.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(E.key=h.C0.US),u.key==="@"&&(E.key=h.C0.NUL)):u.keyCode===65&&(E.type=1);else{const y=p[u.keyCode],_=y==null?void 0:y[u.shiftKey?1:0];if(_)E.key=h.C0.ESC+_;else if(u.keyCode>=65&&u.keyCode<=90){const S=u.ctrlKey?u.keyCode-64:u.keyCode+32;let A=String.fromCharCode(S);u.shiftKey&&(A=A.toUpperCase()),E.key=h.C0.ESC+A}else if(u.keyCode===32)E.key=h.C0.ESC+(u.ctrlKey?h.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let S=u.code.slice(3,4);u.shiftKey||(S=S.toLowerCase()),E.key=h.C0.ESC+S,E.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?E.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?E.key=h.C0.NUL:u.keyCode>=51&&u.keyCode<=55?E.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?E.key=h.C0.DEL:u.keyCode===219?E.key=h.C0.ESC:u.keyCode===220?E.key=h.C0.FS:u.keyCode===221&&(E.key=h.C0.GS)}return E}},482:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,h=0,p=c.length){let u="";for(let v=h;v<p;++v){let C=c[v];C>65535?(C-=65536,u+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):u+=String.fromCharCode(C)}return u},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,h){const p=c.length;if(!p)return 0;let u=0,v=0;if(this._interim){const C=c.charCodeAt(v++);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=v;C<p;++C){const T=c.charCodeAt(C);if(55296<=T&&T<=56319){if(++C>=p)return this._interim=T,u;const E=c.charCodeAt(C);56320<=E&&E<=57343?h[u++]=1024*(T-55296)+E-56320+65536:(h[u++]=T,h[u++]=E)}else T!==65279&&(h[u++]=T)}return u}},o.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,v,C,T,E=0,b=0,y=0;if(this.interim[0]){let A=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let D,R=0;for(;(D=63&this.interim[++R])&&R<4;)L<<=6,L|=D;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=k-R;for(;y<M;){if(y>=p)return 0;if(D=c[y++],(192&D)!=128){y--,A=!0;break}this.interim[R++]=D,L<<=6,L|=63&D}A||(k===2?L<128?y--:h[E++]=L:k===3?L<2048||L>=55296&&L<=57343||L===65279||(h[E++]=L):L<65536||L>1114111||(h[E++]=L)),this.interim.fill(0)}const _=p-4;let S=y;for(;S<p;){for(;!(!(S<_)||128&(u=c[S])||128&(v=c[S+1])||128&(C=c[S+2])||128&(T=c[S+3]));)h[E++]=u,h[E++]=v,h[E++]=C,h[E++]=T,S+=4;if(u=c[S++],u<128)h[E++]=u;else if((224&u)==192){if(S>=p)return this.interim[0]=u,E;if(v=c[S++],(192&v)!=128){S--;continue}if(b=(31&u)<<6|63&v,b<128){S--;continue}h[E++]=b}else if((240&u)==224){if(S>=p)return this.interim[0]=u,E;if(v=c[S++],(192&v)!=128){S--;continue}if(S>=p)return this.interim[0]=u,this.interim[1]=v,E;if(C=c[S++],(192&C)!=128){S--;continue}if(b=(15&u)<<12|(63&v)<<6|63&C,b<2048||b>=55296&&b<=57343||b===65279)continue;h[E++]=b}else if((248&u)==240){if(S>=p)return this.interim[0]=u,E;if(v=c[S++],(192&v)!=128){S--;continue}if(S>=p)return this.interim[0]=u,this.interim[1]=v,E;if(C=c[S++],(192&C)!=128){S--;continue}if(S>=p)return this.interim[0]=u,this.interim[1]=v,this.interim[2]=C,E;if(T=c[S++],(192&T)!=128){S--;continue}if(b=(7&u)<<18|(63&v)<<12|(63&C)<<6|63&T,b<65536||b>1114111)continue;h[E++]=b}}return E}}},225:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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 v;o.UnicodeV6=class{constructor(){if(this.version="6",!v){v=new Uint8Array(65536),v.fill(1),v[0]=0,v.fill(0,1,32),v.fill(0,127,160),v.fill(2,4352,4448),v[9001]=2,v[9002]=2,v.fill(2,11904,42192),v[12351]=1,v.fill(2,44032,55204),v.fill(2,63744,64256),v.fill(2,65040,65050),v.fill(2,65072,65136),v.fill(2,65280,65377),v.fill(2,65504,65511);for(let C=0;C<p.length;++C)v.fill(0,p[C][0],p[C][1]+1)}}wcwidth(C){return C<32?0:C<127?1:C<65536?v[C]:(function(T,E){let b,y=0,_=E.length-1;if(T<E[0][0]||T>E[_][1])return!1;for(;_>=y;)if(b=y+_>>1,T>E[b][1])y=b+1;else{if(!(T<E[b][0]))return!0;_=b-1}return!1})(C,u)?0:C>=131072&&C<=196605||C>=196608&&C<=262141?2:1}charProperties(C,T){let E=this.wcwidth(C),b=E===0&&T!==0;if(b){const y=h.UnicodeService.extractWidth(T);y===0?b=!1:y>E&&(E=y)}return h.UnicodeService.createPropertyValue(0,E,b)}}},5981:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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,T){if(T!==void 0&&this._syncCalls>T)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 E;for(this._isSyncWriting=!0;E=this._writeBuffer.shift();){this._action(E);const b=this._callbacks.shift();b&&b()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(C,T){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(T),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(T)}_innerWrite(C=0,T=!0){const E=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const b=this._writeBuffer[this._bufferOffset],y=this._action(b,T);if(y){const S=A=>Date.now()-E>=12?setTimeout((()=>this._innerWrite(0,A))):this._innerWrite(E,A);return void y.catch((A=>(queueMicrotask((()=>{throw A})),Promise.resolve(!1)))).then(S)}const _=this._callbacks[this._bufferOffset];if(_&&_(),this._bufferOffset++,this._pendingData-=b.length,Date.now()-E>=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()}}o.WriteBuffer=u},5941:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.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,v){const C=u.toString(16),T=C.length<2?"0"+C:C;switch(v){case 4:return C[0];case 8:return T;case 12:return(T+T).slice(0,3);default:return T+T}}o.parseColor=function(u){if(!u)return;let v=u.toLowerCase();if(v.indexOf("rgb:")===0){v=v.slice(4);const C=c.exec(v);if(C){const T=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/T*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/T*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/T*255)]}}else if(v.indexOf("#")===0&&(v=v.slice(1),h.exec(v)&&[3,6,9,12].includes(v.length))){const C=v.length/3,T=[0,0,0];for(let E=0;E<3;++E){const b=parseInt(v.slice(C*E,C*E+C),16);T[E]=C===1?b<<4:C===2?b:C===3?b>>4:b>>8}return T}},o.toRgbString=function(u,v=16){const[C,T,E]=u;return`rgb:${p(C,v)}/${p(T,v)}/${p(E,v)}`}},5770:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const h=c(482),p=c(8742),u=c(5770),v=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=v,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=v}registerHandler(T,E){this._handlers[T]===void 0&&(this._handlers[T]=[]);const b=this._handlers[T];return b.push(E),{dispose:()=>{const y=b.indexOf(E);y!==-1&&b.splice(y,1)}}}clearHandler(T){this._handlers[T]&&delete this._handlers[T]}setHandlerFallback(T){this._handlerFb=T}reset(){if(this._active.length)for(let T=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;T>=0;--T)this._active[T].unhook(!1);this._stack.paused=!1,this._active=v,this._ident=0}hook(T,E){if(this.reset(),this._ident=T,this._active=this._handlers[T]||v,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].hook(E);else this._handlerFb(this._ident,"HOOK",E)}put(T,E,b){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(T,E,b);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(T,E,b))}unhook(T,E=!0){if(this._active.length){let b=!1,y=this._active.length-1,_=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,b=E,_=this._stack.fallThrough,this._stack.paused=!1),!_&&b===!1){for(;y>=0&&(b=this._active[y].unhook(T),b!==!0);y--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,b;y--}for(;y>=0;y--)if(b=this._active[y].unhook(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,b}else this._handlerFb(this._ident,"UNHOOK",T);this._active=v,this._ident=0}};const C=new p.Params;C.addParam(0),o.DcsHandler=class{constructor(T){this._handler=T,this._data="",this._params=C,this._hitLimit=!1}hook(T){this._params=T.length>1||T.params[0]?T.clone():C,this._data="",this._hitLimit=!1}put(T,E,b){this._hitLimit||(this._data+=(0,h.utf32ToString)(T,E,b),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(T){let E=!1;if(this._hitLimit)E=!1;else if(T&&(E=this._handler(this._data,this._params),E instanceof Promise))return E.then((b=>(this._params=C,this._data="",this._hitLimit=!1,b)));return this._params=C,this._data="",this._hitLimit=!1,E}}},2015:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const h=c(844),p=c(8742),u=c(6242),v=c(6351);class C{constructor(y){this.table=new Uint8Array(y)}setDefault(y,_){this.table.fill(y<<4|_)}add(y,_,S,A){this.table[_<<8|y]=S<<4|A}addMany(y,_,S,A){for(let L=0;L<y.length;L++)this.table[_<<8|y[L]]=S<<4|A}}o.TransitionTable=C;const T=160;o.VT500_TRANSITION_TABLE=(function(){const b=new C(4095),y=Array.apply(null,Array(256)).map(((R,k)=>k)),_=(R,k)=>y.slice(R,k),S=_(32,127),A=_(0,24);A.push(25),A.push.apply(A,_(28,32));const L=_(0,14);let D;for(D in b.setDefault(1,0),b.addMany(S,0,2,0),L)b.addMany([24,26,153,154],D,3,0),b.addMany(_(128,144),D,3,0),b.addMany(_(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(A,0,3,0),b.addMany(A,1,3,1),b.add(127,1,0,1),b.addMany(A,8,0,8),b.addMany(A,3,3,3),b.add(127,3,0,3),b.addMany(A,4,3,4),b.add(127,4,0,4),b.addMany(A,6,3,6),b.addMany(A,5,3,5),b.add(127,5,0,5),b.addMany(A,2,3,2),b.add(127,2,0,2),b.add(93,1,4,8),b.addMany(S,8,5,8),b.add(127,8,5,8),b.addMany([156,27,24,26,7],8,6,0),b.addMany(_(28,32),8,0,8),b.addMany([88,94,95],1,0,7),b.addMany(S,7,0,7),b.addMany(A,7,0,7),b.add(156,7,0,0),b.add(127,7,0,7),b.add(91,1,11,3),b.addMany(_(64,127),3,7,0),b.addMany(_(48,60),3,8,4),b.addMany([60,61,62,63],3,9,4),b.addMany(_(48,60),4,8,4),b.addMany(_(64,127),4,7,0),b.addMany([60,61,62,63],4,0,6),b.addMany(_(32,64),6,0,6),b.add(127,6,0,6),b.addMany(_(64,127),6,0,0),b.addMany(_(32,48),3,9,5),b.addMany(_(32,48),5,9,5),b.addMany(_(48,64),5,0,6),b.addMany(_(64,127),5,7,0),b.addMany(_(32,48),4,9,5),b.addMany(_(32,48),1,9,2),b.addMany(_(32,48),2,9,2),b.addMany(_(48,127),2,10,0),b.addMany(_(48,80),1,10,0),b.addMany(_(81,88),1,10,0),b.addMany([89,90,92],1,10,0),b.addMany(_(96,127),1,10,0),b.add(80,1,11,9),b.addMany(A,9,0,9),b.add(127,9,0,9),b.addMany(_(28,32),9,0,9),b.addMany(_(32,48),9,9,12),b.addMany(_(48,60),9,8,10),b.addMany([60,61,62,63],9,9,10),b.addMany(A,11,0,11),b.addMany(_(32,128),11,0,11),b.addMany(_(28,32),11,0,11),b.addMany(A,10,0,10),b.add(127,10,0,10),b.addMany(_(28,32),10,0,10),b.addMany(_(48,60),10,8,10),b.addMany([60,61,62,63],10,0,11),b.addMany(_(32,48),10,9,12),b.addMany(A,12,0,12),b.add(127,12,0,12),b.addMany(_(28,32),12,0,12),b.addMany(_(32,48),12,9,12),b.addMany(_(48,64),12,0,11),b.addMany(_(64,127),12,12,13),b.addMany(_(64,127),10,12,13),b.addMany(_(64,127),9,12,13),b.addMany(A,13,13,13),b.addMany(S,13,13,13),b.add(127,13,0,13),b.addMany([27,156,24,26],13,14,0),b.add(T,0,2,0),b.add(T,8,5,8),b.add(T,6,0,6),b.add(T,11,0,11),b.add(T,13,13,13),b})();class E extends h.Disposable{constructor(y=o.VT500_TRANSITION_TABLE){super(),this._transitions=y,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=(_,S,A)=>{},this._executeHandlerFb=_=>{},this._csiHandlerFb=(_,S)=>{},this._escHandlerFb=_=>{},this._errorHandlerFb=_=>_,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 v.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(y,_=[64,126]){let S=0;if(y.prefix){if(y.prefix.length>1)throw new Error("only one byte as prefix supported");if(S=y.prefix.charCodeAt(0),S&&60>S||S>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(y.intermediates){if(y.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let L=0;L<y.intermediates.length;++L){const D=y.intermediates.charCodeAt(L);if(32>D||D>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");S<<=8,S|=D}}if(y.final.length!==1)throw new Error("final must be a single byte");const A=y.final.charCodeAt(0);if(_[0]>A||A>_[1])throw new Error(`final must be in range ${_[0]} .. ${_[1]}`);return S<<=8,S|=A,S}identToString(y){const _=[];for(;y;)_.push(String.fromCharCode(255&y)),y>>=8;return _.reverse().join("")}setPrintHandler(y){this._printHandler=y}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(y,_){const S=this._identifier(y,[48,126]);this._escHandlers[S]===void 0&&(this._escHandlers[S]=[]);const A=this._escHandlers[S];return A.push(_),{dispose:()=>{const L=A.indexOf(_);L!==-1&&A.splice(L,1)}}}clearEscHandler(y){this._escHandlers[this._identifier(y,[48,126])]&&delete this._escHandlers[this._identifier(y,[48,126])]}setEscHandlerFallback(y){this._escHandlerFb=y}setExecuteHandler(y,_){this._executeHandlers[y.charCodeAt(0)]=_}clearExecuteHandler(y){this._executeHandlers[y.charCodeAt(0)]&&delete this._executeHandlers[y.charCodeAt(0)]}setExecuteHandlerFallback(y){this._executeHandlerFb=y}registerCsiHandler(y,_){const S=this._identifier(y);this._csiHandlers[S]===void 0&&(this._csiHandlers[S]=[]);const A=this._csiHandlers[S];return A.push(_),{dispose:()=>{const L=A.indexOf(_);L!==-1&&A.splice(L,1)}}}clearCsiHandler(y){this._csiHandlers[this._identifier(y)]&&delete this._csiHandlers[this._identifier(y)]}setCsiHandlerFallback(y){this._csiHandlerFb=y}registerDcsHandler(y,_){return this._dcsParser.registerHandler(this._identifier(y),_)}clearDcsHandler(y){this._dcsParser.clearHandler(this._identifier(y))}setDcsHandlerFallback(y){this._dcsParser.setHandlerFallback(y)}registerOscHandler(y,_){return this._oscParser.registerHandler(y,_)}clearOscHandler(y){this._oscParser.clearHandler(y)}setOscHandlerFallback(y){this._oscParser.setHandlerFallback(y)}setErrorHandler(y){this._errorHandler=y}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(y,_,S,A,L){this._parseStack.state=y,this._parseStack.handlers=_,this._parseStack.handlerPos=S,this._parseStack.transition=A,this._parseStack.chunkPos=L}parse(y,_,S){let A,L=0,D=0,R=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,R=this._parseStack.chunkPos+1;else{if(S===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const k=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(S===!1&&M>-1){for(;M>=0&&(A=k[M](this._params),A!==!0);M--)if(A instanceof Promise)return this._parseStack.handlerPos=M,A}this._parseStack.handlers=[];break;case 4:if(S===!1&&M>-1){for(;M>=0&&(A=k[M](),A!==!0);M--)if(A instanceof Promise)return this._parseStack.handlerPos=M,A}this._parseStack.handlers=[];break;case 6:if(L=y[this._parseStack.chunkPos],A=this._dcsParser.unhook(L!==24&&L!==26,S),A)return A;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(L=y[this._parseStack.chunkPos],A=this._oscParser.end(L!==24&&L!==26,S),A)return A;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,R=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let k=R;k<_;++k){switch(L=y[k],D=this._transitions.table[this.currentState<<8|(L<160?L:T)],D>>4){case 2:for(let P=k+1;;++P){if(P>=_||(L=y[P])<32||L>126&&L<T){this._printHandler(y,k,P),k=P-1;break}if(++P>=_||(L=y[P])<32||L>126&&L<T){this._printHandler(y,k,P),k=P-1;break}if(++P>=_||(L=y[P])<32||L>126&&L<T){this._printHandler(y,k,P),k=P-1;break}if(++P>=_||(L=y[P])<32||L>126&&L<T){this._printHandler(y,k,P),k=P-1;break}}break;case 3:this._executeHandlers[L]?this._executeHandlers[L]():this._executeHandlerFb(L),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:k,code:L,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const M=this._csiHandlers[this._collect<<8|L];let B=M?M.length-1:-1;for(;B>=0&&(A=M[B](this._params),A!==!0);B--)if(A instanceof Promise)return this._preserveStack(3,M,B,D,k),A;B<0&&this._csiHandlerFb(this._collect<<8|L,this._params),this.precedingJoinState=0;break;case 8:do switch(L){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(L-48)}while(++k<_&&(L=y[k])>47&&L<60);k--;break;case 9:this._collect<<=8,this._collect|=L;break;case 10:const H=this._escHandlers[this._collect<<8|L];let U=H?H.length-1:-1;for(;U>=0&&(A=H[U](),A!==!0);U--)if(A instanceof Promise)return this._preserveStack(4,H,U,D,k),A;U<0&&this._escHandlerFb(this._collect<<8|L),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|L,this._params);break;case 13:for(let P=k+1;;++P)if(P>=_||(L=y[P])===24||L===26||L===27||L>127&&L<T){this._dcsParser.put(y,k,P),k=P-1;break}break;case 14:if(A=this._dcsParser.unhook(L!==24&&L!==26),A)return this._preserveStack(6,[],0,D,k),A;L===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=k+1;;P++)if(P>=_||(L=y[P])<32||L>127&&L<T){this._oscParser.put(y,k,P),k=P-1;break}break;case 6:if(A=this._oscParser.end(L!==24&&L!==26),A)return this._preserveStack(5,[],0,D,k),A;L===27&&(D|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&D}}}o.EscapeSequenceParser=E},6242:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const h=c(5770),p=c(482),u=[];o.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(v,C){this._handlers[v]===void 0&&(this._handlers[v]=[]);const T=this._handlers[v];return T.push(C),{dispose:()=>{const E=T.indexOf(C);E!==-1&&T.splice(E,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].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 v=this._active.length-1;v>=0;v--)this._active[v].start();else this._handlerFb(this._id,"START")}_put(v,C,T){if(this._active.length)for(let E=this._active.length-1;E>=0;E--)this._active[E].put(v,C,T);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(v,C,T))}start(){this.reset(),this._state=1}put(v,C,T){if(this._state!==3){if(this._state===1)for(;C<T;){const E=v[C++];if(E===59){this._state=2,this._start();break}if(E<48||57<E)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+E-48}this._state===2&&T-C>0&&this._put(v,C,T)}}end(v,C=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let T=!1,E=this._active.length-1,b=!1;if(this._stack.paused&&(E=this._stack.loopPosition-1,T=C,b=this._stack.fallThrough,this._stack.paused=!1),!b&&T===!1){for(;E>=0&&(T=this._active[E].end(v),T!==!0);E--)if(T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!1,T;E--}for(;E>=0;E--)if(T=this._active[E].end(!1),T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!0,T}else this._handlerFb(this._id,"END",v);this._active=u,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(v){this._handler=v,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(v,C,T){this._hitLimit||(this._data+=(0,p.utf32ToString)(v,C,T),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(v){let C=!1;if(this._hitLimit)C=!1;else if(v&&(C=this._handler(this._data),C instanceof Promise))return C.then((T=>(this._data="",this._hitLimit=!1,T)));return this._data="",this._hitLimit=!1,C}}},8742:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class h{static fromArray(u){const v=new h;if(!u.length)return v;for(let C=Array.isArray(u[0])?1:0;C<u.length;++C){const T=u[C];if(Array.isArray(T))for(let E=0;E<T.length;++E)v.addSubParam(T[E]);else v.addParam(T)}return v}constructor(u=32,v=32){if(this.maxLength=u,this.maxSubParamsLength=v,v>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(v),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 v=0;v<this.length;++v){u.push(this.params[v]);const C=this._subParamsIdx[v]>>8,T=255&this._subParamsIdx[v];T-C>0&&u.push(Array.prototype.slice.call(this._subParams,C,T))}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 v=this._subParamsIdx[u]>>8,C=255&this._subParamsIdx[u];return C-v>0?this._subParams.subarray(v,C):null}getSubParamsAll(){const u={};for(let v=0;v<this.length;++v){const C=this._subParamsIdx[v]>>8,T=255&this._subParamsIdx[v];T-C>0&&(u[v]=this._subParams.slice(C,T))}return u}addDigit(u){let v;if(this._rejectDigits||!(v=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const C=this._digitIsSub?this._subParams:this.params,T=C[v-1];C[v-1]=~T?Math.min(10*T+u,c):u}}o.Params=h},5741:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.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,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const h=c(3785),p=c(511);o.BufferApiView=class{constructor(u,v){this._buffer=u,this.type=v}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 v=this._buffer.lines.get(u);if(v)return new h.BufferLineApiView(v)}getNullCell(){return new p.CellData}}},3785:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const h=c(511);o.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,v){return this._line.translateToString(p,u,v)}}},8285:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const h=c(8771),p=c(8460),u=c(844);class v extends u.Disposable{constructor(T){super(),this._core=T,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)}}o.BufferNamespaceApi=v},7975:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.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,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.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,o,c){var h=this&&this.__decorate||function(b,y,_,S){var A,L=arguments.length,D=L<3?y:S===null?S=Object.getOwnPropertyDescriptor(y,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(b,y,_,S);else for(var R=b.length-1;R>=0;R--)(A=b[R])&&(D=(L<3?A(D):L>3?A(y,_,D):A(y,_))||D);return L>3&&D&&Object.defineProperty(y,_,D),D},p=this&&this.__param||function(b,y){return function(_,S){y(_,S,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const u=c(8460),v=c(844),C=c(5295),T=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let E=o.BufferService=class extends v.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,o.MINIMUM_COLS),this.rows=Math.max(b.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new C.BufferSet(b,this))}resize(b,y){this.cols=b,this.rows=y,this.buffers.resize(b,y),this._onResize.fire({cols:b,rows:y})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(b,y=!1){const _=this.buffer;let S;S=this._cachedBlankLine,S&&S.length===this.cols&&S.getFg(0)===b.fg&&S.getBg(0)===b.bg||(S=_.getBlankLine(b,y),this._cachedBlankLine=S),S.isWrapped=y;const A=_.ybase+_.scrollTop,L=_.ybase+_.scrollBottom;if(_.scrollTop===0){const D=_.lines.isFull;L===_.lines.length-1?D?_.lines.recycle().copyFrom(S):_.lines.push(S.clone()):_.lines.splice(L+1,0,S.clone()),D?this.isUserScrolling&&(_.ydisp=Math.max(_.ydisp-1,0)):(_.ybase++,this.isUserScrolling||_.ydisp++)}else{const D=L-A+1;_.lines.shiftElements(A+1,D-1,-1),_.lines.set(L,S.clone())}this.isUserScrolling||(_.ydisp=_.ybase),this._onScroll.fire(_.ydisp)}scrollLines(b,y,_){const S=this.buffer;if(b<0){if(S.ydisp===0)return;this.isUserScrolling=!0}else b+S.ydisp>=S.ybase&&(this.isUserScrolling=!1);const A=S.ydisp;S.ydisp=Math.max(Math.min(S.ydisp+b,S.ybase),0),A!==S.ydisp&&(y||this._onScroll.fire(S.ydisp))}};o.BufferService=E=h([p(0,T.IOptionsService)],E)},7994:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.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,o,c){var h=this&&this.__decorate||function(S,A,L,D){var R,k=arguments.length,M=k<3?A:D===null?D=Object.getOwnPropertyDescriptor(A,L):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(S,A,L,D);else for(var B=S.length-1;B>=0;B--)(R=S[B])&&(M=(k<3?R(M):k>3?R(A,L,M):R(A,L))||M);return k>3&&M&&Object.defineProperty(A,L,M),M},p=this&&this.__param||function(S,A){return function(L,D){A(L,D,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const u=c(2585),v=c(8460),C=c(844),T={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:S=>S.button!==4&&S.action===1&&(S.ctrl=!1,S.alt=!1,S.shift=!1,!0)},VT200:{events:19,restrict:S=>S.action!==32},DRAG:{events:23,restrict:S=>S.action!==32||S.button!==3},ANY:{events:31,restrict:S=>!0}};function E(S,A){let L=(S.ctrl?16:0)|(S.shift?4:0)|(S.alt?8:0);return S.button===4?(L|=64,L|=S.action):(L|=3&S.button,4&S.button&&(L|=64),8&S.button&&(L|=128),S.action===32?L|=32:S.action!==0||A||(L|=3)),L}const b=String.fromCharCode,y={DEFAULT:S=>{const A=[E(S,!1)+32,S.col+32,S.row+32];return A[0]>255||A[1]>255||A[2]>255?"":`\x1B[M${b(A[0])}${b(A[1])}${b(A[2])}`},SGR:S=>{const A=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${E(S,!0)};${S.col};${S.row}${A}`},SGR_PIXELS:S=>{const A=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${E(S,!0)};${S.x};${S.y}${A}`}};let _=o.CoreMouseService=class extends C.Disposable{constructor(S,A){super(),this._bufferService=S,this._coreService=A,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new v.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const L of Object.keys(T))this.addProtocol(L,T[L]);for(const L of Object.keys(y))this.addEncoding(L,y[L]);this.reset()}addProtocol(S,A){this._protocols[S]=A}addEncoding(S,A){this._encodings[S]=A}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(S){if(!this._protocols[S])throw new Error(`unknown protocol "${S}"`);this._activeProtocol=S,this._onProtocolChange.fire(this._protocols[S].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(S){if(!this._encodings[S])throw new Error(`unknown encoding "${S}"`);this._activeEncoding=S}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(S){if(S.col<0||S.col>=this._bufferService.cols||S.row<0||S.row>=this._bufferService.rows||S.button===4&&S.action===32||S.button===3&&S.action!==32||S.button!==4&&(S.action===2||S.action===3)||(S.col++,S.row++,S.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,S,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(S))return!1;const A=this._encodings[this._activeEncoding](S);return A&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(A):this._coreService.triggerDataEvent(A,!0)),this._lastEvent=S,!0}explainEvents(S){return{down:!!(1&S),up:!!(2&S),drag:!!(4&S),move:!!(8&S),wheel:!!(16&S)}}_equalEvents(S,A,L){if(L){if(S.x!==A.x||S.y!==A.y)return!1}else if(S.col!==A.col||S.row!==A.row)return!1;return S.button===A.button&&S.action===A.action&&S.ctrl===A.ctrl&&S.alt===A.alt&&S.shift===A.shift}};o.CoreMouseService=_=h([p(0,u.IBufferService),p(1,u.ICoreService)],_)},6975:function(f,o,c){var h=this&&this.__decorate||function(_,S,A,L){var D,R=arguments.length,k=R<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,S,A,L);else for(var M=_.length-1;M>=0;M--)(D=_[M])&&(k=(R<3?D(k):R>3?D(S,A,k):D(S,A))||k);return R>3&&k&&Object.defineProperty(S,A,k),k},p=this&&this.__param||function(_,S){return function(A,L){S(A,L,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const u=c(1439),v=c(8460),C=c(844),T=c(2585),E=Object.freeze({insertMode:!1}),b=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let y=o.CoreService=class extends C.Disposable{constructor(_,S,A){super(),this._bufferService=_,this._logService=S,this._optionsService=A,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new v.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new v.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(E),this.decPrivateModes=(0,u.clone)(b)}reset(){this.modes=(0,u.clone)(E),this.decPrivateModes=(0,u.clone)(b)}triggerDataEvent(_,S=!1){if(this._optionsService.rawOptions.disableStdin)return;const A=this._bufferService.buffer;S&&this._optionsService.rawOptions.scrollOnUserInput&&A.ybase!==A.ydisp&&this._onRequestScrollToBottom.fire(),S&&this._onUserInput.fire(),this._logService.debug(`sending data "${_}"`,(()=>_.split("").map((L=>L.charCodeAt(0))))),this._onData.fire(_)}triggerBinaryEvent(_){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${_}"`,(()=>_.split("").map((S=>S.charCodeAt(0))))),this._onBinary.fire(_))}};o.CoreService=y=h([p(0,T.IBufferService),p(1,T.ILogService),p(2,T.IOptionsService)],y)},9074:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const h=c(8055),p=c(8460),u=c(844),v=c(6106);let C=0,T=0;class E extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new v.SortedList((_=>_==null?void 0:_.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(_){if(_.marker.isDisposed)return;const S=new b(_);if(S){const A=S.marker.onDispose((()=>S.dispose()));S.onDispose((()=>{S&&(this._decorations.delete(S)&&this._onDecorationRemoved.fire(S),A.dispose())})),this._decorations.insert(S),this._onDecorationRegistered.fire(S)}return S}reset(){for(const _ of this._decorations.values())_.dispose();this._decorations.clear()}*getDecorationsAtCell(_,S,A){let L=0,D=0;for(const R of this._decorations.getKeyIterator(S))L=R.options.x??0,D=L+(R.options.width??1),_>=L&&_<D&&(!A||(R.options.layer??"bottom")===A)&&(yield R)}forEachDecorationAtCell(_,S,A,L){this._decorations.forEachByKey(S,(D=>{C=D.options.x??0,T=C+(D.options.width??1),_>=C&&_<T&&(!A||(D.options.layer??"bottom")===A)&&L(D)}))}}o.DecorationService=E;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(_){super(),this.options=_,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=_.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const h=c(2585),p=c(8343);class u{constructor(...C){this._entries=new Map;for(const[T,E]of C)this.set(T,E)}set(C,T){const E=this._entries.get(C);return this._entries.set(C,T),E}forEach(C){for(const[T,E]of this._entries.entries())C(T,E)}has(C){return this._entries.has(C)}get(C){return this._entries.get(C)}}o.ServiceCollection=u,o.InstantiationService=class{constructor(){this._services=new u,this._services.set(h.IInstantiationService,this)}setService(v,C){this._services.set(v,C)}getService(v){return this._services.get(v)}createInstance(v,...C){const T=(0,p.getServiceDependencies)(v).sort(((y,_)=>y.index-_.index)),E=[];for(const y of T){const _=this._services.get(y.id);if(!_)throw new Error(`[createInstance] ${v.name} depends on UNKNOWN service ${y.id}.`);E.push(_)}const b=T.length>0?T[0].index:C.length;if(C.length!==b)throw new Error(`[createInstance] First service dependency of ${v.name} at position ${b+1} conflicts with ${C.length} static arguments`);return new v(...C,...E)}}},7866:function(f,o,c){var h=this&&this.__decorate||function(b,y,_,S){var A,L=arguments.length,D=L<3?y:S===null?S=Object.getOwnPropertyDescriptor(y,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(b,y,_,S);else for(var R=b.length-1;R>=0;R--)(A=b[R])&&(D=(L<3?A(D):L>3?A(y,_,D):A(y,_))||D);return L>3&&D&&Object.defineProperty(y,_,D),D},p=this&&this.__param||function(b,y){return function(_,S){y(_,S,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const u=c(844),v=c(2585),C={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let T,E=o.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(b){super(),this._optionsService=b,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),T=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(b){for(let y=0;y<b.length;y++)typeof b[y]=="function"&&(b[y]=b[y]())}_log(b,y,_){this._evalLazyOptionalParams(_),b.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+y,..._)}trace(b,...y){var _;this._logLevel<=v.LogLevelEnum.TRACE&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.trace.bind(this._optionsService.options.logger))??console.log,b,y)}debug(b,...y){var _;this._logLevel<=v.LogLevelEnum.DEBUG&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.debug.bind(this._optionsService.options.logger))??console.log,b,y)}info(b,...y){var _;this._logLevel<=v.LogLevelEnum.INFO&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.info.bind(this._optionsService.options.logger))??console.info,b,y)}warn(b,...y){var _;this._logLevel<=v.LogLevelEnum.WARN&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.warn.bind(this._optionsService.options.logger))??console.warn,b,y)}error(b,...y){var _;this._logLevel<=v.LogLevelEnum.ERROR&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.error.bind(this._optionsService.options.logger))??console.error,b,y)}};o.LogService=E=h([p(0,v.IOptionsService)],E),o.setTraceLogger=function(b){T=b},o.traceCall=function(b,y,_){if(typeof _.value!="function")throw new Error("not supported");const S=_.value;_.value=function(...A){if(T.logLevel!==v.LogLevelEnum.TRACE)return S.apply(this,A);T.trace(`GlyphRenderer#${S.name}(${A.map((D=>JSON.stringify(D))).join(", ")})`);const L=S.apply(this,A);return T.trace(`GlyphRenderer#${S.name} return`,L),L}}},7302:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const h=c(8460),p=c(844),u=c(6114);o.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 v=["normal","bold","100","200","300","400","500","600","700","800","900"];class C extends p.Disposable{constructor(E){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const b={...o.DEFAULT_OPTIONS};for(const y in E)if(y in b)try{const _=E[y];b[y]=this._sanitizeAndValidateOption(y,_)}catch(_){console.error(_)}this.rawOptions=b,this.options={...b},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(E,b){return this.onOptionChange((y=>{y===E&&b(this.rawOptions[E])}))}onMultipleOptionChange(E,b){return this.onOptionChange((y=>{E.indexOf(y)!==-1&&b()}))}_setupOptions(){const E=y=>{if(!(y in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);return this.rawOptions[y]},b=(y,_)=>{if(!(y in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);_=this._sanitizeAndValidateOption(y,_),this.rawOptions[y]!==_&&(this.rawOptions[y]=_,this._onOptionChange.fire(y))};for(const y in this.rawOptions){const _={get:E.bind(this,y),set:b.bind(this,y)};Object.defineProperty(this.options,y,_)}}_sanitizeAndValidateOption(E,b){switch(E){case"cursorStyle":if(b||(b=o.DEFAULT_OPTIONS[E]),!(function(y){return y==="block"||y==="underline"||y==="bar"})(b))throw new Error(`"${b}" is not a valid value for ${E}`);break;case"wordSeparator":b||(b=o.DEFAULT_OPTIONS[E]);break;case"fontWeight":case"fontWeightBold":if(typeof b=="number"&&1<=b&&b<=1e3)break;b=v.includes(b)?b:o.DEFAULT_OPTIONS[E];break;case"cursorWidth":b=Math.floor(b);case"lineHeight":case"tabStopWidth":if(b<1)throw new Error(`${E} 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(`${E} cannot be less than 0, value: ${b}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(b<=0)throw new Error(`${E} cannot be less than or equal to 0, value: ${b}`);break;case"rows":case"cols":if(!b&&b!==0)throw new Error(`${E} must be numeric, value: ${b}`);break;case"windowsPty":b=b??{}}return b}}o.OptionsService=C},2660:function(f,o,c){var h=this&&this.__decorate||function(C,T,E,b){var y,_=arguments.length,S=_<3?T:b===null?b=Object.getOwnPropertyDescriptor(T,E):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(C,T,E,b);else for(var A=C.length-1;A>=0;A--)(y=C[A])&&(S=(_<3?y(S):_>3?y(T,E,S):y(T,E))||S);return _>3&&S&&Object.defineProperty(T,E,S),S},p=this&&this.__param||function(C,T){return function(E,b){T(E,b,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const u=c(2585);let v=o.OscLinkService=class{constructor(C){this._bufferService=C,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(C){const T=this._bufferService.buffer;if(C.id===void 0){const A=T.addMarker(T.ybase+T.y),L={data:C,id:this._nextId++,lines:[A]};return A.onDispose((()=>this._removeMarkerFromLink(L,A))),this._dataByLinkId.set(L.id,L),L.id}const E=C,b=this._getEntryIdKey(E),y=this._entriesWithId.get(b);if(y)return this.addLineToLink(y.id,T.ybase+T.y),y.id;const _=T.addMarker(T.ybase+T.y),S={id:this._nextId++,key:this._getEntryIdKey(E),data:E,lines:[_]};return _.onDispose((()=>this._removeMarkerFromLink(S,_))),this._entriesWithId.set(S.key,S),this._dataByLinkId.set(S.id,S),S.id}addLineToLink(C,T){const E=this._dataByLinkId.get(C);if(E&&E.lines.every((b=>b.line!==T))){const b=this._bufferService.buffer.addMarker(T);E.lines.push(b),b.onDispose((()=>this._removeMarkerFromLink(E,b)))}}getLinkData(C){var T;return(T=this._dataByLinkId.get(C))==null?void 0:T.data}_getEntryIdKey(C){return`${C.id};;${C.uri}`}_removeMarkerFromLink(C,T){const E=C.lines.indexOf(T);E!==-1&&(C.lines.splice(E,1),C.lines.length===0&&(C.data.id!==void 0&&this._entriesWithId.delete(C.key),this._dataByLinkId.delete(C.id)))}};o.OscLinkService=v=h([p(0,u.IBufferService)],v)},8343:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",h="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(p){return p[h]||[]},o.createDecorator=function(p){if(o.serviceRegistry.has(p))return o.serviceRegistry.get(p);const u=function(v,C,T){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(E,b,y){b[c]===b?b[h].push({id:E,index:y}):(b[h]=[{id:E,index:y}],b[c]=b)})(u,v,T)};return u.toString=()=>p,o.serviceRegistry.set(p,u),u}},2585:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const h=c(8343);var p;o.IBufferService=(0,h.createDecorator)("BufferService"),o.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),o.ICoreService=(0,h.createDecorator)("CoreService"),o.ICharsetService=(0,h.createDecorator)("CharsetService"),o.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||(o.LogLevelEnum=p={})),o.ILogService=(0,h.createDecorator)("LogService"),o.IOptionsService=(0,h.createDecorator)("OptionsService"),o.IOscLinkService=(0,h.createDecorator)("OscLinkService"),o.IUnicodeService=(0,h.createDecorator)("UnicodeService"),o.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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,T,E=!1){return(16777215&C)<<3|(3&T)<<1|(E?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 T=0,E=0;const b=C.length;for(let y=0;y<b;++y){let _=C.charCodeAt(y);if(55296<=_&&_<=56319){if(++y>=b)return T+this.wcwidth(_);const L=C.charCodeAt(y);56320<=L&&L<=57343?_=1024*(_-55296)+L-56320+65536:T+=this.wcwidth(L)}const S=this.charProperties(_,E);let A=u.extractWidth(S);u.extractShouldJoin(S)&&(A-=u.extractWidth(E)),T+=A,E=S}return T}charProperties(C,T){return this._activeProvider.charProperties(C,T)}}o.UnicodeService=u}},l={};function d(f){var o=l[f];if(o!==void 0)return o.exports;var c=l[f]={exports:{}};return s[f].call(c.exports,c,c.exports,d),c.exports}var m={};return(()=>{var f=m;Object.defineProperty(f,"__esModule",{value:!0}),f.Terminal=void 0;const o=d(9042),c=d(3236),h=d(844),p=d(5741),u=d(8285),v=d(7975),C=d(7090),T=["cols","rows"];class E extends h.Disposable{constructor(y){super(),this._core=this.register(new c.Terminal(y)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const _=A=>this._core.options[A],S=(A,L)=>{this._checkReadonlyOptions(A),this._core.options[A]=L};for(const A in this._core.options){const L={get:_.bind(this,A),set:S.bind(this,A)};Object.defineProperty(this._publicOptions,A,L)}}_checkReadonlyOptions(y){if(T.includes(y))throw new Error(`Option "${y}" 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 v.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 y=this._core.coreService.decPrivateModes;let _="none";switch(this._core.coreMouseService.activeProtocol){case"X10":_="x10";break;case"VT200":_="vt200";break;case"DRAG":_="drag";break;case"ANY":_="any"}return{applicationCursorKeysMode:y.applicationCursorKeys,applicationKeypadMode:y.applicationKeypad,bracketedPasteMode:y.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:_,originMode:y.origin,reverseWraparoundMode:y.reverseWraparound,sendFocusMode:y.sendFocus,wraparoundMode:y.wraparound}}get options(){return this._publicOptions}set options(y){for(const _ in y)this._publicOptions[_]=y[_]}blur(){this._core.blur()}focus(){this._core.focus()}input(y,_=!0){this._core.input(y,_)}resize(y,_){this._verifyIntegers(y,_),this._core.resize(y,_)}open(y){this._core.open(y)}attachCustomKeyEventHandler(y){this._core.attachCustomKeyEventHandler(y)}attachCustomWheelEventHandler(y){this._core.attachCustomWheelEventHandler(y)}registerLinkProvider(y){return this._core.registerLinkProvider(y)}registerCharacterJoiner(y){return this._checkProposedApi(),this._core.registerCharacterJoiner(y)}deregisterCharacterJoiner(y){this._checkProposedApi(),this._core.deregisterCharacterJoiner(y)}registerMarker(y=0){return this._verifyIntegers(y),this._core.registerMarker(y)}registerDecoration(y){return this._checkProposedApi(),this._verifyPositiveIntegers(y.x??0,y.width??0,y.height??0),this._core.registerDecoration(y)}hasSelection(){return this._core.hasSelection()}select(y,_,S){this._verifyIntegers(y,_,S),this._core.select(y,_,S)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(y,_){this._verifyIntegers(y,_),this._core.selectLines(y,_)}dispose(){super.dispose()}scrollLines(y){this._verifyIntegers(y),this._core.scrollLines(y)}scrollPages(y){this._verifyIntegers(y),this._core.scrollPages(y)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(y){this._verifyIntegers(y),this._core.scrollToLine(y)}clear(){this._core.clear()}write(y,_){this._core.write(y,_)}writeln(y,_){this._core.write(y),this._core.write(`\r
|
|
59
|
-
`,_)}paste(
|
|
60
|
-
[VCM] ${A}`),(L=c.current)==null||L.call(c,A)}});d.current=C,p.cols>=qm&&p.rows>=$m&&C.resize(p.cols,p.rows);const T=p.onData(A=>{C.sendInput(A)});let E=0,b=0,y=0;const _=()=>{E&&window.cancelAnimationFrame(E),E=window.requestAnimationFrame(()=>{E=0,h({focus:o.current})})},S=new ResizeObserver(()=>{_()});return S.observe(l.current),b=window.requestAnimationFrame(_),y=window.setTimeout(_,120),()=>{E&&window.cancelAnimationFrame(E),b&&window.cancelAnimationFrame(b),y&&window.clearTimeout(y),S.disconnect(),T.dispose(),C.close(),p.dispose(),d.current=null,f.current=null,m.current=null}},[n]),te.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 v of p)window.cancelAnimationFrame(v);for(const v of u)window.clearTimeout(v)}},[r]),te.useEffect(()=>{const p=()=>{o.current&&h()};return window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]),x.jsx("div",{className:"terminal-frame",ref:l,onMouseDown:()=>{var p;return(p=f.current)==null?void 0:p.focus()}})}const Pm=160,Fm=80,qm=20,$m=5;function v1(n){if(!(n.type!=="keydown"||n.altKey||n.key.toLowerCase()!=="c"))return n.metaKey?"command":n.ctrlKey?"control":void 0}function y1(n,r){S1(r)||b1(r),n.focus()}function S1(n){const r=document.createElement("textarea");r.value=n,r.setAttribute("readonly","true"),r.style.position="fixed",r.style.top="0",r.style.left="-9999px",r.style.opacity="0",document.body.appendChild(r),r.focus(),r.select();try{return document.execCommand("copy")}finally{r.remove()}}async function b1(n){var r;try{await((r=navigator.clipboard)==null?void 0:r.writeText(n))}catch{}}const C1={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"},i_=[{value:"bypassPermissions",label:"bypassPermissions",description:"Bypass prompts; recommended in DevContainer worktrees"},{value:"plan",label:"plan",description:"Plan-only permission mode"},{value:"default",label:"default",description:"Claude Code default permission behavior"}],r_=[{value:"default",label:"Default",description:"Account default"},{value:"fable",label:"Fable",description:"Claude Fable"},{value:"opus",label:"Opus",description:"Latest Opus"},{value:"sonnet",label:"Sonnet",description:"Latest Sonnet"}],w1=[{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"}],s_=[...w1,{value:"max",label:"Max",description:"Maximum reasoning"},{value:"ultracode",label:"Ultracode",description:"Claude Code dynamic workflows with xhigh reasoning"}];function Hi({status:n}){return x.jsx("span",{className:`status-badge status-${n}`,children:n.replaceAll("_"," ")})}function Mh({role:n,session:r,permissionMode:s,model:l,effort:d,busy:m=!1,onPermissionModeChange:f,onModelChange:o,onEffortChange:c,onStart:h,onResume:p,onStop:u,onRestart:v,onNotifyHarnessUpdated:C}){const T=(r==null?void 0:r.status)==="running",E=!!(r!=null&&r.claudeSessionId&&!T),b=!T&&!(r!=null&&r.claudeSessionId),y=!!(r!=null&&r.harnessOutdated);return x.jsxs("div",{className:"session-controls",children:[x.jsxs("label",{className:"session-option-field permission-mode-field",children:[x.jsx("span",{children:"Permission"}),x.jsx("select",{value:s,onChange:_=>f(_.target.value),children:i_.map(_=>x.jsx("option",{value:_.value,children:_.label},_.value))})]}),x.jsxs("label",{className:"session-option-field model-field",children:[x.jsx("span",{children:"Model"}),x.jsx("select",{value:l,onChange:_=>o(_.target.value),children:r_.map(_=>x.jsx("option",{value:_.value,children:_.label},_.value))})]}),x.jsxs("label",{className:"session-option-field effort-field",children:[x.jsx("span",{children:"Effort"}),x.jsx("select",{value:d,onChange:_=>c(_.target.value),children:s_.map(_=>x.jsx("option",{value:_.value,children:_.label},_.value))})]}),x.jsxs("div",{className:"session-toolbar",children:[x.jsx("button",{type:"button",disabled:m||!b,onClick:h,children:"Start"}),x.jsx("button",{type:"button",disabled:m||!E,onClick:p,children:"Resume"}),x.jsx("button",{type:"button",disabled:m||!r,onClick:v,children:"Restart"}),x.jsx("button",{type:"button",disabled:m||!r,onClick:u,children:"Stop"})]}),y?x.jsxs("div",{className:"session-harness-notice",children:[x.jsx(Hi,{status:"outdated"}),x.jsxs("span",{children:["Harness updated",(r==null?void 0:r.harnessRevision)!==void 0&&r.harnessCurrentRevision!==void 0?` (${r.harnessRevision} -> ${r.harnessCurrentRevision})`:""]}),x.jsx("button",{type:"button",disabled:m||!T||!C,onClick:C,children:"Notify role"})]}):null]})}function x1({busy:n,effort:r,model:s,open:l,permissionMode:d,taskSlug:m,bootstrapStatus:f,engineerSession:o,status:c,onClose:h,onEffortChange:p,onModelChange:u,onPermissionModeChange:v,onEngineerResume:C,onEngineerRestart:T,onEngineerStart:E,onEngineerStop:b,onEngineerNotifyHarnessUpdated:y,onOpenRepositoryDiff:_,onReviewTaskHarness:S,onRefresh:A}){const[L,D]=te.useState(null),[R,k]=te.useState(null),[M,B]=te.useState(""),[H,U]=te.useState(!1),[P,K]=te.useState(!1),[,Y]=zi(null),[G,W]=te.useState(null),Z=(c==null?void 0:c.files)??[],z=Z.filter(ee=>ee.kind.startsWith("agent-")),j=z.filter(ee=>Gm(ee)),N=z.filter(ee=>!Gm(ee)),$=Z.filter(ee=>ee.kind.startsWith("skill-")),I=Z.filter(ee=>ee.kind.startsWith("tool-")),re=Z.filter(ee=>ee.kind==="root-claude"||ee.kind==="gitignore"||ee.kind==="pull-request-template"),ve=!!(R&&M!==R.content);te.useEffect(()=>{l||(D(null),k(null),B(""),U(!1),Y(null))},[Z,l,L]),te.useEffect(()=>{if(!l||!L||!m)return;let ee=!1;return K(!0),Y(null),U(!1),ye.getHarnessFileContent(m,L).then(ae=>{ee||(k(ae),B(ae.content))}).catch(ae=>{ee||Y(dt(`Load harness file ${L}`,ae))}).finally(()=>{ee||K(!1)}),()=>{ee=!0}},[l,L,m]);async function me(){if(!(!R||!R.editable||!ve||!m)){K(!0),Y(null);try{const ee=await ye.updateHarnessFileContent(m,R.path,{content:M});k(ee.file),B(ee.file.content),U(!1),A()}catch(ee){Y(dt(`Save harness file ${R.path}`,ee))}finally{K(!1)}}}function Q(){D(null),k(null),B(""),U(!1),Y(null)}async function q(ee){Y(null);try{await E1(ee),W(ee),window.setTimeout(()=>{W(ae=>ae===ee?null:ae)},1200)}catch(ae){Y(dt(`Copy harness file path ${ee}`,ae))}}return l?x.jsx(x.Fragment,{children:x.jsx("div",{className:"modal-backdrop harness-studio-backdrop",children:x.jsxs("section",{className:"harness-studio-modal",role:"dialog","aria-modal":"true","aria-label":"Harness Studio",children:[x.jsxs("header",{className:"harness-studio-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Harness Studio"}),m?null:x.jsx("p",{className:"muted",children:"Create or select a task before editing harness files."})]}),x.jsxs("div",{className:"harness-studio-header-actions",children:[x.jsx("button",{type:"button",disabled:n||!m,onClick:S,children:"Review Task Harness"}),x.jsx("button",{type:"button",disabled:n,onClick:_,children:"Review Diff"}),x.jsx("button",{type:"button",disabled:n,onClick:A,children:"Refresh"}),x.jsx("button",{type:"button",onClick:h,children:"Close"})]})]}),x.jsxs("div",{className:"harness-studio-layout",children:[x.jsx("aside",{className:L?"harness-studio-left harness-studio-left-preview":"harness-studio-left",children:L?x.jsxs("section",{className:"harness-studio-section harness-studio-file-preview",children:[x.jsxs("header",{className:"harness-studio-file-editor-header",children:[x.jsxs("div",{children:[x.jsx("h3",{children:(R==null?void 0:R.title)??"Harness File"}),x.jsx("p",{className:"muted",children:(R==null?void 0:R.path)??L})]}),x.jsxs("div",{className:"harness-studio-file-editor-actions",children:[R?x.jsx(Hi,{status:R.editable?"ok":"unknown"}):null,H?x.jsxs(x.Fragment,{children:[x.jsx("button",{type:"button",disabled:P||!m||!(R!=null&&R.editable)||!ve,onClick:()=>void me(),children:"Save"}),x.jsx("button",{type:"button",disabled:P,onClick:()=>{B((R==null?void 0:R.content)??""),U(!1)},children:"Cancel"})]}):x.jsx("button",{type:"button",disabled:P||!m||!(R!=null&&R.editable),onClick:()=>U(!0),children:"Edit"}),x.jsx("button",{type:"button",onClick:Q,children:"Return"})]})]}),R!=null&&R.readonlyReason?x.jsx("p",{className:"muted",children:R.readonlyReason}):null,x.jsx("textarea",{className:H?"harness-studio-file-textarea is-editing":"harness-studio-file-textarea",value:M,spellCheck:!1,readOnly:!H,disabled:P,onChange:ee=>B(ee.target.value)})]}):x.jsxs(x.Fragment,{children:[x.jsx(Na,{title:"VCM Roles",files:j,selectedPath:L,copiedPath:G,onCopy:ee=>void q(ee),onSelect:D}),x.jsx(Na,{title:"Auxiliary Roles",files:N,selectedPath:L,copiedPath:G,onCopy:ee=>void q(ee),onSelect:D}),x.jsx(dh,{title:"Overview",children:x.jsxs("section",{className:"harness-studio-overview",children:[x.jsxs("div",{className:"harness-studio-metrics",children:[x.jsx(Rs,{label:"Fixed install",value:c?c.initialized?c.needsApply?"updates":"current":"new":"unknown"}),x.jsx(Rs,{label:"Revision",value:String((c==null?void 0:c.harnessRevision)??0)}),x.jsx(Rs,{label:"Managed files",value:String(Z.length)}),x.jsx(Rs,{label:"Pending updates",value:String((c==null?void 0:c.plannedChanges.length)??0)}),x.jsx(Rs,{label:"Bootstrap",value:(f==null?void 0:f.status.replaceAll("_"," "))??"unknown"}),x.jsx(Rs,{label:"Engineer",value:Vm(o)})]}),c!=null&&c.warnings.length?x.jsx("ul",{className:"warnings",children:c.warnings.map(ee=>x.jsx("li",{children:ee},ee))}):null]})}),x.jsx(Na,{title:"Skills",files:$,selectedPath:L,copiedPath:G,onCopy:ee=>void q(ee),onSelect:D,collapsible:!0}),x.jsx(Na,{title:"Root Context",files:re,selectedPath:L,copiedPath:G,onCopy:ee=>void q(ee),onSelect:D,collapsible:!0}),x.jsx(Na,{title:"Tools",files:I,selectedPath:L,copiedPath:G,onCopy:ee=>void q(ee),onSelect:D,collapsible:!0}),x.jsx(dh,{title:"Project Docs",children:x.jsx("ul",{className:"harness-studio-doc-list",children:(f==null?void 0:f.checks.map(ee=>x.jsxs("li",{children:[x.jsx("span",{children:ee.path??ee.label}),x.jsx(Hi,{status:ee.status})]},ee.key)))??x.jsx("li",{children:x.jsx("span",{children:"No bootstrap status loaded."})})})})]})}),x.jsxs("section",{className:"harness-studio-section harness-studio-engineer",children:[x.jsxs("div",{className:"harness-studio-engineer-header",children:[x.jsxs("div",{children:[x.jsx("h3",{children:"Harness Engineer"}),x.jsx("p",{className:"muted",children:Vm(o)})]}),x.jsx(Hi,{status:(o==null?void 0:o.status)??"unknown"})]}),x.jsx(Mh,{role:"harness-engineer",session:o??void 0,permissionMode:d,model:s,effort:r,busy:n,onPermissionModeChange:v,onModelChange:u,onEffortChange:p,onStart:E,onResume:C,onRestart:T,onStop:b,onNotifyHarnessUpdated:y}),x.jsx("div",{className:"harness-engineer-terminal",children:(o==null?void 0:o.status)==="running"?x.jsx(Oo,{sessionId:o.id,active:l},o.id):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:"harness-engineer"}),x.jsx("span",{children:o!=null&&o.claudeSessionId?"Resume this project Harness Engineer session.":"Start this project Harness Engineer session."})]})})]})]})]})})}):null}function Rs({label:n,value:r}){return x.jsxs("div",{className:"harness-studio-metric",children:[x.jsx("span",{children:n}),x.jsx("strong",{children:r})]})}function Na({title:n,files:r,selectedPath:s,copiedPath:l,onCopy:d,onSelect:m,collapsible:f=!1}){const o=x.jsx("ol",{className:"harness-studio-file-list",children:r.length?r.map(c=>x.jsxs("li",{className:c.path===s?"selected":void 0,children:[x.jsx("button",{className:"harness-studio-file-path-button",type:"button",title:c.path,onClick:()=>m(c.path),children:c.path}),x.jsx("button",{className:"harness-studio-file-copy-button",type:"button",title:`Copy ${c.path}`,onClick:()=>d(c.path),children:l===c.path?"Copied":"Copy"}),x.jsx(Hi,{status:c.action})]},c.path)):x.jsx("li",{children:x.jsx("span",{children:"No files."})})});return f?x.jsx(dh,{title:n,children:o}):x.jsxs("section",{className:"harness-studio-section",children:[x.jsx("h3",{children:n}),o]})}function dh({title:n,children:r}){return x.jsxs("details",{className:"harness-studio-section harness-studio-collapsible-section",children:[x.jsxs("summary",{children:[x.jsx("h3",{children:n}),x.jsx("span",{children:"Show"})]}),x.jsx("div",{className:"harness-studio-collapsible-content",children:r})]})}function Gm(n){return n.kind==="agent-project-manager"||n.kind==="agent-architect"||n.kind==="agent-coder"||n.kind==="agent-reviewer"||n.kind==="agent-gate-reviewer"}function Vm(n){return n?n.status==="running"?`${n.status} / ${n.activityStatus??"idle"}`:n.status:"not started"}async function E1(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 k1({open:n,taskSlug:r,onClose:s}){var k;const[l,d]=te.useState(null),[m,f]=te.useState(null),[o,c]=te.useState(null),[h,p]=te.useState(null),[u,v]=te.useState(null),[C,T]=te.useState(!1),[E,b]=te.useState(!1),[,y]=zi(null),[_,S]=te.useState(null),A=te.useMemo(()=>(l==null?void 0:l.files.find(M=>M.path===o))??(l==null?void 0:l.files[0])??null,[l,o]);async function L(M=m){var B;T(!0),y(null);try{if(!r)throw new Error("Create or select a task before reviewing harness commits.");const H=await ye.getRepositoryDiff(r,M);d(H),p(null),f(((B=H.commit)==null?void 0:B.sha)??null),c(U=>{var P;return U&&H.files.some(K=>K.path===U)?U:((P=H.files[0])==null?void 0:P.path)??null})}catch(H){y(dt(M?`Load commit diff ${M}`:"Load latest commit diff",H))}finally{T(!1)}}te.useEffect(()=>{n&&(f(null),S(null),L(null))},[n,r]);async function D(M){v(M),y(null);try{if(!r)throw new Error("Create or select a task before reviewing file diffs.");const B=await ye.getRepositoryFileDiff(r,M);p(B),c(M)}catch(B){y(dt(`Load task file diff for ${M}`,B))}finally{v(null)}}async function R(){if(y(null),S(null),!r){y("Create or select a task before merging the task branch.");return}if(!l){y("Load the commit diff before merging the task branch.");return}const M=l.commits.length?l.commits.map(H=>`- ${H.shortSha} ${H.subject}`):["- No new commits found."];if(window.confirm([`Merge ${l.sourceBranch} into ${l.targetBranch}?`,"","VCM will run a fast-forward merge only.","The merge will fail if the task worktree or connected repository has uncommitted changes.","If the connected repository branch has diverged, rebase or merge manually first.","","Commits:",...M].join(`
|
|
61
|
-
`))){
|
|
62
|
-
`).filter(r=>!D1(r)).map((r,s)=>x.jsx("span",{className:`repository-diff-line ${R1(r)}`,children:r||" "},`${s}:${r}`))}function R1(n){return n.startsWith("+")&&!n.startsWith("+++")?"repository-diff-line-added":n.startsWith("-")&&!n.startsWith("---")?"repository-diff-line-deleted":n.startsWith("@@")?"repository-diff-line-hunk":"repository-diff-line-context"}function D1(n){return n.startsWith("diff --git")||n.startsWith("index ")||n.startsWith("new file mode ")||n.startsWith("deleted file mode ")||n.startsWith("similarity index ")||n.startsWith("rename from ")||n.startsWith("rename to ")||n.startsWith("--- ")||n.startsWith("+++ ")}function M1({busy:n,effort:r,model:s,open:l,permissionMode:d,session:m,onClose:f,onEffortChange:o,onModelChange:c,onPermissionModeChange:h,onResume:p,onRestart:u,onStart:v,onStop:C,onNotifyHarnessUpdated:T}){return l?x.jsx("div",{className:"modal-backdrop translator-session-backdrop",children:x.jsxs("section",{className:"translator-session-modal",role:"dialog","aria-modal":"true","aria-label":"Translator Session",children:[x.jsxs("header",{className:"translator-session-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Translator Session"}),x.jsx("p",{children:L1(m)})]}),x.jsx("button",{type:"button",onClick:f,children:"Close"})]}),x.jsx(Mh,{role:"translator",session:m??void 0,permissionMode:d,model:s,effort:r,busy:n,onPermissionModeChange:h,onModelChange:c,onEffortChange:o,onStart:v,onResume:p,onRestart:u,onStop:C,onNotifyHarnessUpdated:T}),x.jsx("div",{className:"translator-session-terminal",children:(m==null?void 0:m.status)==="running"?x.jsx(Oo,{sessionId:m.id,active:l},m.id):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:"translator"}),x.jsx("span",{children:m!=null&&m.claudeSessionId?"Resume this project translator session.":"Start the project translator session."})]})})]})}):null}function L1(n){if(!n)return"not started";const r=n.status==="running"?` · ${n.activityStatus??"idle"}`:"";return`${n.status}${r}`}function O1(n,r){const s={};return(n[n.length-1]===""?[...n,""]:n).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const B1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,j1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,N1={};function Km(n,r){return(N1.jsx?j1:B1).test(n)}const H1=/[ \t\n\f\r]/g;function z1(n){return typeof n=="object"?n.type==="text"?Ym(n.value):!1:Ym(n)}function Ym(n){return n.replace(H1,"")===""}class Qa{constructor(r,s,l){this.normal=s,this.property=r,l&&(this.space=l)}}Qa.prototype.normal={};Qa.prototype.property={};Qa.prototype.space=void 0;function l_(n,r){const s={},l={};for(const d of n)Object.assign(s,d.property),Object.assign(l,d.normal);return new Qa(s,l,r)}function gh(n){return n.toLowerCase()}class yn{constructor(r,s){this.attribute=s,this.property=r}}yn.prototype.attribute="";yn.prototype.booleanish=!1;yn.prototype.boolean=!1;yn.prototype.commaOrSpaceSeparated=!1;yn.prototype.commaSeparated=!1;yn.prototype.defined=!1;yn.prototype.mustUseProperty=!1;yn.prototype.number=!1;yn.prototype.overloadedBoolean=!1;yn.prototype.property="";yn.prototype.spaceSeparated=!1;yn.prototype.space=void 0;let I1=0;const Ue=Fr(),Mt=Fr(),_h=Fr(),Ce=Fr(),ct=Fr(),Bs=Fr(),Dn=Fr();function Fr(){return 2**++I1}const vh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ue,booleanish:Mt,commaOrSpaceSeparated:Dn,commaSeparated:Bs,number:Ce,overloadedBoolean:_h,spaceSeparated:ct},Symbol.toStringTag,{value:"Module"})),Vu=Object.keys(vh);class Lh extends yn{constructor(r,s,l,d){let m=-1;if(super(r,s),Xm(this,"space",d),typeof l=="number")for(;++m<Vu.length;){const f=Vu[m];Xm(this,Vu[m],(l&vh[f])===vh[f])}}}Lh.prototype.defined=!0;function Xm(n,r,s){s&&(n[r]=s)}function zs(n){const r={},s={};for(const[l,d]of Object.entries(n.properties)){const m=new Lh(l,n.transform(n.attributes||{},l),d,n.space);n.mustUseProperty&&n.mustUseProperty.includes(l)&&(m.mustUseProperty=!0),r[l]=m,s[gh(l)]=l,s[gh(m.attribute)]=l}return new Qa(r,s,n.space)}const o_=zs({properties:{ariaActiveDescendant:null,ariaAtomic:Mt,ariaAutoComplete:null,ariaBusy:Mt,ariaChecked:Mt,ariaColCount:Ce,ariaColIndex:Ce,ariaColSpan:Ce,ariaControls:ct,ariaCurrent:null,ariaDescribedBy:ct,ariaDetails:null,ariaDisabled:Mt,ariaDropEffect:ct,ariaErrorMessage:null,ariaExpanded:Mt,ariaFlowTo:ct,ariaGrabbed:Mt,ariaHasPopup:null,ariaHidden:Mt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ct,ariaLevel:Ce,ariaLive:null,ariaModal:Mt,ariaMultiLine:Mt,ariaMultiSelectable:Mt,ariaOrientation:null,ariaOwns:ct,ariaPlaceholder:null,ariaPosInSet:Ce,ariaPressed:Mt,ariaReadOnly:Mt,ariaRelevant:null,ariaRequired:Mt,ariaRoleDescription:ct,ariaRowCount:Ce,ariaRowIndex:Ce,ariaRowSpan:Ce,ariaSelected:Mt,ariaSetSize:Ce,ariaSort:null,ariaValueMax:Ce,ariaValueMin:Ce,ariaValueNow:Ce,ariaValueText:null,role:null},transform(n,r){return r==="role"?r:"aria-"+r.slice(4).toLowerCase()}});function c_(n,r){return r in n?n[r]:r}function u_(n,r){return c_(n,r.toLowerCase())}const U1=zs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Bs,acceptCharset:ct,accessKey:ct,action:null,allow:null,allowFullScreen:Ue,allowPaymentRequest:Ue,allowUserMedia:Ue,alt:null,as:null,async:Ue,autoCapitalize:null,autoComplete:ct,autoFocus:Ue,autoPlay:Ue,blocking:ct,capture:null,charSet:null,checked:Ue,cite:null,className:ct,cols:Ce,colSpan:null,content:null,contentEditable:Mt,controls:Ue,controlsList:ct,coords:Ce|Bs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ue,defer:Ue,dir:null,dirName:null,disabled:Ue,download:_h,draggable:Mt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ue,formTarget:null,headers:ct,height:Ce,hidden:_h,high:Ce,href:null,hrefLang:null,htmlFor:ct,httpEquiv:ct,id:null,imageSizes:null,imageSrcSet:null,inert:Ue,inputMode:null,integrity:null,is:null,isMap:Ue,itemId:null,itemProp:ct,itemRef:ct,itemScope:Ue,itemType:ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ue,low:Ce,manifest:null,max:null,maxLength:Ce,media:null,method:null,min:null,minLength:Ce,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:Ce,pattern:null,ping:ct,placeholder:null,playsInline:Ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ue,referrerPolicy:null,rel:ct,required:Ue,reversed:Ue,rows:Ce,rowSpan:Ce,sandbox:ct,scope:null,scoped:Ue,seamless:Ue,selected:Ue,shadowRootClonable:Ue,shadowRootDelegatesFocus:Ue,shadowRootMode:null,shape:null,size:Ce,sizes:null,slot:null,span:Ce,spellCheck:Mt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ce,step:null,style:null,tabIndex:Ce,target:null,title:null,translate:null,type:null,typeMustMatch:Ue,useMap:null,value:Mt,width:Ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ct,axis:null,background:null,bgColor:null,border:Ce,borderColor:null,bottomMargin:Ce,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:Ce,leftMargin:Ce,link:null,longDesc:null,lowSrc:null,marginHeight:Ce,marginWidth:Ce,noResize:Ue,noHref:Ue,noShade:Ue,noWrap:Ue,object:null,profile:null,prompt:null,rev:null,rightMargin:Ce,rules:null,scheme:null,scrolling:Mt,standby:null,summary:null,text:null,topMargin:Ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ce,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ue,disableRemotePlayback:Ue,prefix:null,property:null,results:Ce,security:null,unselectable:null},space:"html",transform:u_}),P1=zs({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:Dn,accentHeight:Ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ce,amplitude:Ce,arabicForm:null,ascent:Ce,attributeName:null,attributeType:null,azimuth:Ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ce,by:null,calcMode:null,capHeight:Ce,className:ct,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:Ce,diffuseConstant:Ce,direction:null,display:null,dur:null,divisor:Ce,dominantBaseline:null,download:Ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ce,enableBackground:null,end:null,event:null,exponent:Ce,externalResourcesRequired:null,fill:null,fillOpacity:Ce,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Bs,g2:Bs,glyphName:Bs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ce,horizOriginX:Ce,horizOriginY:Ce,id:null,ideographic:Ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ce,k:Ce,k1:Ce,k2:Ce,k3:Ce,k4:Ce,kernelMatrix:Dn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ce,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:Ce,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:Ce,overlineThickness:Ce,paintOrder:null,panose1:null,path:null,pathLength:Ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ce,pointsAtY:Ce,pointsAtZ:Ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Dn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Dn,rev:Dn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Dn,requiredFeatures:Dn,requiredFonts:Dn,requiredFormats:Dn,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:Ce,specularExponent:Ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ce,strikethroughThickness:Ce,string:null,stroke:null,strokeDashArray:Dn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ce,strokeOpacity:Ce,strokeWidth:null,style:null,surfaceScale:Ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Dn,tabIndex:Ce,tableValues:null,target:null,targetX:Ce,targetY:Ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Dn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ce,underlineThickness:Ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ce,values:null,vAlphabetic:Ce,vMathematical:Ce,vectorEffect:null,vHanging:Ce,vIdeographic:Ce,version:null,vertAdvY:Ce,vertOriginX:Ce,vertOriginY:Ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:c_}),h_=zs({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()}}),f_=zs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:u_}),d_=zs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,r){return"xml:"+r.slice(3).toLowerCase()}}),F1={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"},q1=/[A-Z]/g,Qm=/-[a-z]/g,$1=/^data[-\w.:]+$/i;function G1(n,r){const s=gh(r);let l=r,d=yn;if(s in n.normal)return n.property[n.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&$1.test(r)){if(r.charAt(4)==="-"){const m=r.slice(5).replace(Qm,W1);l="data"+m.charAt(0).toUpperCase()+m.slice(1)}else{const m=r.slice(4);if(!Qm.test(m)){let f=m.replace(q1,V1);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}d=Lh}return new d(l,r)}function V1(n){return"-"+n.toLowerCase()}function W1(n){return n.charAt(1).toUpperCase()}const K1=l_([o_,U1,h_,f_,d_],"html"),Oh=l_([o_,P1,h_,f_,d_],"svg");function Y1(n){return n.join(" ").trim()}var Ds={},Wu,Jm;function X1(){if(Jm)return Wu;Jm=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,s=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,d=/^:\s*/,m=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,o=/^\s+|\s+$/g,c=`
|
|
63
|
-
`,h="/",p="*",u="",v="comment",C="declaration";function T(b,y){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];y=y||{};var _=1,S=1;function A(K){var Y=K.match(r);Y&&(_+=Y.length);var G=K.lastIndexOf(c);S=~G?K.length-G:S+K.length}function L(){var K={line:_,column:S};return function(Y){return Y.position=new D(K),M(),Y}}function D(K){this.start=K,this.end={line:_,column:S},this.source=y.source}D.prototype.content=b;function R(K){var Y=new Error(y.source+":"+_+":"+S+": "+K);if(Y.reason=K,Y.filename=y.source,Y.line=_,Y.column=S,Y.source=b,!y.silent)throw Y}function k(K){var Y=K.exec(b);if(Y){var G=Y[0];return A(G),b=b.slice(G.length),Y}}function M(){k(s)}function B(K){var Y;for(K=K||[];Y=H();)Y!==!1&&K.push(Y);return K}function H(){var K=L();if(!(h!=b.charAt(0)||p!=b.charAt(1))){for(var Y=2;u!=b.charAt(Y)&&(p!=b.charAt(Y)||h!=b.charAt(Y+1));)++Y;if(Y+=2,u===b.charAt(Y-1))return R("End of comment missing");var G=b.slice(2,Y-2);return S+=2,A(G),b=b.slice(Y),S+=2,K({type:v,comment:G})}}function U(){var K=L(),Y=k(l);if(Y){if(H(),!k(d))return R("property missing ':'");var G=k(m),W=K({type:C,property:E(Y[0].replace(n,u)),value:G?E(G[0].replace(n,u)):u});return k(f),W}}function P(){var K=[];B(K);for(var Y;Y=U();)Y!==!1&&(K.push(Y),B(K));return K}return M(),P()}function E(b){return b?b.replace(o,u):u}return Wu=T,Wu}var Zm;function Q1(){if(Zm)return Ds;Zm=1;var n=Ds&&Ds.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.default=s;const r=n(X1());function s(l,d){let m=null;if(!l||typeof l!="string")return m;const f=(0,r.default)(l),o=typeof d=="function";return f.forEach(c=>{if(c.type!=="declaration")return;const{property:h,value:p}=c;o?d(h,p,c):p&&(m=m||{},m[h]=p)}),m}return Ds}var Ha={},eg;function J1(){if(eg)return Ha;eg=1,Object.defineProperty(Ha,"__esModule",{value:!0}),Ha.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,s=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,d=/^-(ms)-/,m=function(h){return!h||s.test(h)||n.test(h)},f=function(h,p){return p.toUpperCase()},o=function(h,p){return"".concat(p,"-")},c=function(h,p){return p===void 0&&(p={}),m(h)?h:(h=h.toLowerCase(),p.reactCompat?h=h.replace(d,o):h=h.replace(l,o),h.replace(r,f))};return Ha.camelCase=c,Ha}var za,tg;function Z1(){if(tg)return za;tg=1;var n=za&&za.__importDefault||function(d){return d&&d.__esModule?d:{default:d}},r=n(Q1()),s=J1();function l(d,m){var f={};return!d||typeof d!="string"||(0,r.default)(d,function(o,c){o&&c&&(f[(0,s.camelCase)(o,m)]=c)}),f}return l.default=l,za=l,za}var eS=Z1();const tS=Xg(eS),p_=m_("end"),Bh=m_("start");function m_(n){return r;function r(s){const l=s&&s.position&&s.position[n]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function nS(n){const r=Bh(n),s=p_(n);if(r&&s)return{start:r,end:s}}function Fa(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?ng(n.position):"start"in n||"end"in n?ng(n):"line"in n||"column"in n?yh(n):""}function yh(n){return ig(n&&n.line)+":"+ig(n&&n.column)}function ng(n){return yh(n&&n.start)+"-"+yh(n&&n.end)}function ig(n){return n&&typeof n=="number"?n:1}class Xt extends Error{constructor(r,s,l){super(),typeof s=="string"&&(l=s,s=void 0);let d="",m={},f=!1;if(s&&("line"in s&&"column"in s?m={place:s}:"start"in s&&"end"in s?m={place:s}:"type"in s?m={ancestors:[s],place:s.position}:m={...s}),typeof r=="string"?d=r:!m.cause&&r&&(f=!0,d=r.message,m.cause=r),!m.ruleId&&!m.source&&typeof l=="string"){const c=l.indexOf(":");c===-1?m.ruleId=l:(m.source=l.slice(0,c),m.ruleId=l.slice(c+1))}if(!m.place&&m.ancestors&&m.ancestors){const c=m.ancestors[m.ancestors.length-1];c&&(m.place=c.position)}const o=m.place&&"start"in m.place?m.place.start:m.place;this.ancestors=m.ancestors||void 0,this.cause=m.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=d,this.line=o?o.line:void 0,this.name=Fa(m.place)||"1:1",this.place=m.place||void 0,this.reason=this.message,this.ruleId=m.ruleId||void 0,this.source=m.source||void 0,this.stack=f&&m.cause&&typeof m.cause.stack=="string"?m.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Xt.prototype.file="";Xt.prototype.name="";Xt.prototype.reason="";Xt.prototype.message="";Xt.prototype.stack="";Xt.prototype.column=void 0;Xt.prototype.line=void 0;Xt.prototype.ancestors=void 0;Xt.prototype.cause=void 0;Xt.prototype.fatal=void 0;Xt.prototype.place=void 0;Xt.prototype.ruleId=void 0;Xt.prototype.source=void 0;const jh={}.hasOwnProperty,iS=new Map,rS=/[A-Z]/g,sS=new Set(["table","tbody","thead","tfoot","tr"]),aS=new Set(["td","th"]),g_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function lS(n,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=r.filePath||void 0;let l;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=mS(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");l=pS(s,r.jsx,r.jsxs)}const d={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:l,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"?Oh:K1,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},m=__(d,n,void 0);return m&&typeof m!="string"?m:d.create(n,d.Fragment,{children:m||void 0},void 0)}function __(n,r,s){if(r.type==="element")return oS(n,r,s);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return cS(n,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return hS(n,r,s);if(r.type==="mdxjsEsm")return uS(n,r);if(r.type==="root")return fS(n,r,s);if(r.type==="text")return dS(n,r)}function oS(n,r,s){const l=n.schema;let d=l;r.tagName.toLowerCase()==="svg"&&l.space==="html"&&(d=Oh,n.schema=d),n.ancestors.push(r);const m=y_(n,r.tagName,!1),f=gS(n,r);let o=Hh(n,r);return sS.has(r.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!z1(c):!0})),v_(n,f,m,r),Nh(f,o),n.ancestors.pop(),n.schema=l,n.create(r,m,f,s)}function cS(n,r){if(r.data&&r.data.estree&&n.evaluater){const l=r.data.estree.body[0];return l.type,n.evaluater.evaluateExpression(l.expression)}Ka(n,r.position)}function uS(n,r){if(r.data&&r.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(r.data.estree);Ka(n,r.position)}function hS(n,r,s){const l=n.schema;let d=l;r.name==="svg"&&l.space==="html"&&(d=Oh,n.schema=d),n.ancestors.push(r);const m=r.name===null?n.Fragment:y_(n,r.name,!0),f=_S(n,r),o=Hh(n,r);return v_(n,f,m,r),Nh(f,o),n.ancestors.pop(),n.schema=l,n.create(r,m,f,s)}function fS(n,r,s){const l={};return Nh(l,Hh(n,r)),n.create(r,n.Fragment,l,s)}function dS(n,r){return r.value}function v_(n,r,s,l){typeof s!="string"&&s!==n.Fragment&&n.passNode&&(r.node=l)}function Nh(n,r){if(r.length>0){const s=r.length>1?r:r[0];s&&(n.children=s)}}function pS(n,r,s){return l;function l(d,m,f,o){const h=Array.isArray(f.children)?s:r;return o?h(m,f,o):h(m,f)}}function mS(n,r){return s;function s(l,d,m,f){const o=Array.isArray(m.children),c=Bh(l);return r(d,m,f,o,{columnNumber:c?c.column-1:void 0,fileName:n,lineNumber:c?c.line:void 0},void 0)}}function gS(n,r){const s={};let l,d;for(d in r.properties)if(d!=="children"&&jh.call(r.properties,d)){const m=vS(n,d,r.properties[d]);if(m){const[f,o]=m;n.tableCellAlignToStyle&&f==="align"&&typeof o=="string"&&aS.has(r.tagName)?l=o:s[f]=o}}if(l){const m=s.style||(s.style={});m[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return s}function _S(n,r){const s={};for(const l of r.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&n.evaluater){const m=l.data.estree.body[0];m.type;const f=m.expression;f.type;const o=f.properties[0];o.type,Object.assign(s,n.evaluater.evaluateExpression(o.argument))}else Ka(n,r.position);else{const d=l.name;let m;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&n.evaluater){const o=l.value.data.estree.body[0];o.type,m=n.evaluater.evaluateExpression(o.expression)}else Ka(n,r.position);else m=l.value===null?!0:l.value;s[d]=m}return s}function Hh(n,r){const s=[];let l=-1;const d=n.passKeys?new Map:iS;for(;++l<r.children.length;){const m=r.children[l];let f;if(n.passKeys){const c=m.type==="element"?m.tagName:m.type==="mdxJsxFlowElement"||m.type==="mdxJsxTextElement"?m.name:void 0;if(c){const h=d.get(c)||0;f=c+"-"+h,d.set(c,h+1)}}const o=__(n,m,f);o!==void 0&&s.push(o)}return s}function vS(n,r,s){const l=G1(n.schema,r);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=l.commaSeparated?O1(s):Y1(s)),l.property==="style"){let d=typeof s=="object"?s:yS(n,String(s));return n.stylePropertyNameCase==="css"&&(d=SS(d)),["style",d]}return[n.elementAttributeNameCase==="react"&&l.space?F1[l.property]||l.property:l.attribute,s]}}function yS(n,r){try{return tS(r,{reactCompat:!0})}catch(s){if(n.ignoreInvalidStyle)return{};const l=s,d=new Xt("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw d.file=n.filePath||void 0,d.url=g_+"#cannot-parse-style-attribute",d}}function y_(n,r,s){let l;if(!s)l={type:"Literal",value:r};else if(r.includes(".")){const d=r.split(".");let m=-1,f;for(;++m<d.length;){const o=Km(d[m])?{type:"Identifier",name:d[m]}:{type:"Literal",value:d[m]};f=f?{type:"MemberExpression",object:f,property:o,computed:!!(m&&o.type==="Literal"),optional:!1}:o}l=f}else l=Km(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(l.type==="Literal"){const d=l.value;return jh.call(n.components,d)?n.components[d]:d}if(n.evaluater)return n.evaluater.evaluateExpression(l);Ka(n)}function Ka(n,r){const s=new Xt("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=g_+"#cannot-handle-mdx-estrees-without-createevaluater",s}function SS(n){const r={};let s;for(s in n)jh.call(n,s)&&(r[bS(s)]=n[s]);return r}function bS(n){let r=n.replace(rS,CS);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function CS(n){return"-"+n.toLowerCase()}const Ku={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"]},wS={};function zh(n,r){const s=wS,l=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,d=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return S_(n,l,d)}function S_(n,r,s){if(xS(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 rg(n.children,r,s)}return Array.isArray(n)?rg(n,r,s):""}function rg(n,r,s){const l=[];let d=-1;for(;++d<n.length;)l[d]=S_(n[d],r,s);return l.join("")}function xS(n){return!!(n&&typeof n=="object")}const sg=document.createElement("i");function Ih(n){const r="&"+n+";";sg.innerHTML=r;const s=sg.textContent;return s.charCodeAt(s.length-1)===59&&n!=="semi"||s===r?!1:s}function Mn(n,r,s,l){const d=n.length;let m=0,f;if(r<0?r=-r>d?0:d+r:r=r>d?d:r,s=s>0?s:0,l.length<1e4)f=Array.from(l),f.unshift(r,s),n.splice(...f);else for(s&&n.splice(r,s);m<l.length;)f=l.slice(m,m+1e4),f.unshift(r,0),n.splice(...f),m+=1e4,r+=1e4}function Vn(n,r){return n.length>0?(Mn(n,n.length,0,r),n):r}const ag={}.hasOwnProperty;function b_(n){const r={};let s=-1;for(;++s<n.length;)ES(r,n[s]);return r}function ES(n,r){let s;for(s in r){const d=(ag.call(n,s)?n[s]:void 0)||(n[s]={}),m=r[s];let f;if(m)for(f in m){ag.call(d,f)||(d[f]=[]);const o=m[f];kS(d[f],Array.isArray(o)?o:o?[o]:[])}}}function kS(n,r){let s=-1;const l=[];for(;++s<r.length;)(r[s].add==="after"?n:l).push(r[s]);Mn(n,0,0,l)}function C_(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 ni(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const nn=gr(/[A-Za-z]/),Yt=gr(/[\dA-Za-z]/),AS=gr(/[#-'*+\--9=?A-Z^-~]/);function Eo(n){return n!==null&&(n<32||n===127)}const Sh=gr(/\d/),TS=gr(/[\dA-Fa-f]/),RS=gr(/[!-/:-@[-`{-~]/);function De(n){return n!==null&&n<-2}function ot(n){return n!==null&&(n<0||n===32)}function Ve(n){return n===-2||n===-1||n===32}const Bo=gr(new RegExp("\\p{P}|\\p{S}","u")),Ur=gr(/\s/);function gr(n){return r;function r(s){return s!==null&&s>-1&&n.test(String.fromCharCode(s))}}function Is(n){const r=[];let s=-1,l=0,d=0;for(;++s<n.length;){const m=n.charCodeAt(s);let f="";if(m===37&&Yt(n.charCodeAt(s+1))&&Yt(n.charCodeAt(s+2)))d=2;else if(m<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(m))||(f=String.fromCharCode(m));else if(m>55295&&m<57344){const o=n.charCodeAt(s+1);m<56320&&o>56319&&o<57344?(f=String.fromCharCode(m,o),d=1):f="�"}else f=String.fromCharCode(m);f&&(r.push(n.slice(l,s),encodeURIComponent(f)),l=s+d+1,f=""),d&&(s+=d,d=0)}return r.join("")+n.slice(l)}function Xe(n,r,s,l){const d=l?l-1:Number.POSITIVE_INFINITY;let m=0;return f;function f(c){return Ve(c)?(n.enter(s),o(c)):r(c)}function o(c){return Ve(c)&&m++<d?(n.consume(c),o):(n.exit(s),r(c))}}const DS={tokenize:MS};function MS(n){const r=n.attempt(this.parser.constructs.contentInitial,l,d);let s;return r;function l(o){if(o===null){n.consume(o);return}return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),Xe(n,r,"linePrefix")}function d(o){return n.enter("paragraph"),m(o)}function m(o){const c=n.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=c),s=c,f(o)}function f(o){if(o===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(o);return}return De(o)?(n.consume(o),n.exit("chunkText"),m):(n.consume(o),f)}}const LS={tokenize:OS},lg={tokenize:BS};function OS(n){const r=this,s=[];let l=0,d,m,f;return o;function o(S){if(l<s.length){const A=s[l];return r.containerState=A[1],n.attempt(A[0].continuation,c,h)(S)}return h(S)}function c(S){if(l++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,d&&_();const A=r.events.length;let L=A,D;for(;L--;)if(r.events[L][0]==="exit"&&r.events[L][1].type==="chunkFlow"){D=r.events[L][1].end;break}y(l);let R=A;for(;R<r.events.length;)r.events[R][1].end={...D},R++;return Mn(r.events,L+1,0,r.events.slice(A)),r.events.length=R,h(S)}return o(S)}function h(S){if(l===s.length){if(!d)return v(S);if(d.currentConstruct&&d.currentConstruct.concrete)return T(S);r.interrupt=!!(d.currentConstruct&&!d._gfmTableDynamicInterruptHack)}return r.containerState={},n.check(lg,p,u)(S)}function p(S){return d&&_(),y(l),v(S)}function u(S){return r.parser.lazy[r.now().line]=l!==s.length,f=r.now().offset,T(S)}function v(S){return r.containerState={},n.attempt(lg,C,T)(S)}function C(S){return l++,s.push([r.currentConstruct,r.containerState]),v(S)}function T(S){if(S===null){d&&_(),y(0),n.consume(S);return}return d=d||r.parser.flow(r.now()),n.enter("chunkFlow",{_tokenizer:d,contentType:"flow",previous:m}),E(S)}function E(S){if(S===null){b(n.exit("chunkFlow"),!0),y(0),n.consume(S);return}return De(S)?(n.consume(S),b(n.exit("chunkFlow")),l=0,r.interrupt=void 0,o):(n.consume(S),E)}function b(S,A){const L=r.sliceStream(S);if(A&&L.push(null),S.previous=m,m&&(m.next=S),m=S,d.defineSkip(S.start),d.write(L),r.parser.lazy[S.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 R=r.events.length;let k=R,M,B;for(;k--;)if(r.events[k][0]==="exit"&&r.events[k][1].type==="chunkFlow"){if(M){B=r.events[k][1].end;break}M=!0}for(y(l),D=R;D<r.events.length;)r.events[D][1].end={...B},D++;Mn(r.events,k+1,0,r.events.slice(R)),r.events.length=D}}function y(S){let A=s.length;for(;A-- >S;){const L=s[A];r.containerState=L[1],L[0].exit.call(r,n)}s.length=S}function _(){d.write([null]),m=void 0,d=void 0,r.containerState._closeFlow=void 0}}function BS(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 js(n){if(n===null||ot(n)||Ur(n))return 1;if(Bo(n))return 2}function jo(n,r,s){const l=[];let d=-1;for(;++d<n.length;){const m=n[d].resolveAll;m&&!l.includes(m)&&(r=m(r,s),l.push(m))}return r}const bh={name:"attention",resolveAll:jS,tokenize:NS};function jS(n,r){let s=-1,l,d,m,f,o,c,h,p;for(;++s<n.length;)if(n[s][0]==="enter"&&n[s][1].type==="attentionSequence"&&n[s][1]._close){for(l=s;l--;)if(n[l][0]==="exit"&&n[l][1].type==="attentionSequence"&&n[l][1]._open&&r.sliceSerialize(n[l][1]).charCodeAt(0)===r.sliceSerialize(n[s][1]).charCodeAt(0)){if((n[l][1]._close||n[s][1]._open)&&(n[s][1].end.offset-n[s][1].start.offset)%3&&!((n[l][1].end.offset-n[l][1].start.offset+n[s][1].end.offset-n[s][1].start.offset)%3))continue;c=n[l][1].end.offset-n[l][1].start.offset>1&&n[s][1].end.offset-n[s][1].start.offset>1?2:1;const u={...n[l][1].end},v={...n[s][1].start};og(u,-c),og(v,c),f={type:c>1?"strongSequence":"emphasisSequence",start:u,end:{...n[l][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...n[s][1].start},end:v},m={type:c>1?"strongText":"emphasisText",start:{...n[l][1].end},end:{...n[s][1].start}},d={type:c>1?"strong":"emphasis",start:{...f.start},end:{...o.end}},n[l][1].end={...f.start},n[s][1].start={...o.end},h=[],n[l][1].end.offset-n[l][1].start.offset&&(h=Vn(h,[["enter",n[l][1],r],["exit",n[l][1],r]])),h=Vn(h,[["enter",d,r],["enter",f,r],["exit",f,r],["enter",m,r]]),h=Vn(h,jo(r.parser.constructs.insideSpan.null,n.slice(l+1,s),r)),h=Vn(h,[["exit",m,r],["enter",o,r],["exit",o,r],["exit",d,r]]),n[s][1].end.offset-n[s][1].start.offset?(p=2,h=Vn(h,[["enter",n[s][1],r],["exit",n[s][1],r]])):p=0,Mn(n,l-1,s-l+3,h),s=l+h.length-p-2;break}}for(s=-1;++s<n.length;)n[s][1].type==="attentionSequence"&&(n[s][1].type="data");return n}function NS(n,r){const s=this.parser.constructs.attentionMarkers.null,l=this.previous,d=js(l);let m;return f;function f(c){return m=c,n.enter("attentionSequence"),o(c)}function o(c){if(c===m)return n.consume(c),o;const h=n.exit("attentionSequence"),p=js(c),u=!p||p===2&&d||s.includes(c),v=!d||d===2&&p||s.includes(l);return h._open=!!(m===42?u:u&&(d||!v)),h._close=!!(m===42?v:v&&(p||!u)),r(c)}}function og(n,r){n.column+=r,n.offset+=r,n._bufferIndex+=r}const HS={name:"autolink",tokenize:zS};function zS(n,r,s){let l=0;return d;function d(C){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(C),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),m}function m(C){return nn(C)?(n.consume(C),f):C===64?s(C):h(C)}function f(C){return C===43||C===45||C===46||Yt(C)?(l=1,o(C)):h(C)}function o(C){return C===58?(n.consume(C),l=0,c):(C===43||C===45||C===46||Yt(C))&&l++<32?(n.consume(C),o):(l=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||Eo(C)?s(C):(n.consume(C),c)}function h(C){return C===64?(n.consume(C),p):AS(C)?(n.consume(C),h):s(C)}function p(C){return Yt(C)?u(C):s(C)}function u(C){return C===46?(n.consume(C),l=0,p):C===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(C),n.exit("autolinkMarker"),n.exit("autolink"),r):v(C)}function v(C){if((C===45||Yt(C))&&l++<63){const T=C===45?v:u;return n.consume(C),T}return s(C)}}const Ja={partial:!0,tokenize:IS};function IS(n,r,s){return l;function l(m){return Ve(m)?Xe(n,d,"linePrefix")(m):d(m)}function d(m){return m===null||De(m)?r(m):s(m)}}const w_={continuation:{tokenize:PS},exit:FS,name:"blockQuote",tokenize:US};function US(n,r,s){const l=this;return d;function d(f){if(f===62){const o=l.containerState;return o.open||(n.enter("blockQuote",{_container:!0}),o.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(f),n.exit("blockQuoteMarker"),m}return s(f)}function m(f){return Ve(f)?(n.enter("blockQuotePrefixWhitespace"),n.consume(f),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),r):(n.exit("blockQuotePrefix"),r(f))}}function PS(n,r,s){const l=this;return d;function d(f){return Ve(f)?Xe(n,m,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):m(f)}function m(f){return n.attempt(w_,r,s)(f)}}function FS(n){n.exit("blockQuote")}const x_={name:"characterEscape",tokenize:qS};function qS(n,r,s){return l;function l(m){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(m),n.exit("escapeMarker"),d}function d(m){return RS(m)?(n.enter("characterEscapeValue"),n.consume(m),n.exit("characterEscapeValue"),n.exit("characterEscape"),r):s(m)}}const E_={name:"characterReference",tokenize:$S};function $S(n,r,s){const l=this;let d=0,m,f;return o;function o(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"),m=31,f=Yt,p(u))}function h(u){return u===88||u===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(u),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),m=6,f=TS,p):(n.enter("characterReferenceValue"),m=7,f=Sh,p(u))}function p(u){if(u===59&&d){const v=n.exit("characterReferenceValue");return f===Yt&&!Ih(l.sliceSerialize(v))?s(u):(n.enter("characterReferenceMarker"),n.consume(u),n.exit("characterReferenceMarker"),n.exit("characterReference"),r)}return f(u)&&d++<m?(n.consume(u),p):s(u)}}const cg={partial:!0,tokenize:VS},ug={concrete:!0,name:"codeFenced",tokenize:GS};function GS(n,r,s){const l=this,d={partial:!0,tokenize:L};let m=0,f=0,o;return c;function c(D){return h(D)}function h(D){const R=l.events[l.events.length-1];return m=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,o=D,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),p(D)}function p(D){return D===o?(f++,n.consume(D),p):f<3?s(D):(n.exit("codeFencedFenceSequence"),Ve(D)?Xe(n,u,"whitespace")(D):u(D))}function u(D){return D===null||De(D)?(n.exit("codeFencedFence"),l.interrupt?r(D):n.check(cg,E,A)(D)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),v(D))}function v(D){return D===null||De(D)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),u(D)):Ve(D)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),Xe(n,C,"whitespace")(D)):D===96&&D===o?s(D):(n.consume(D),v)}function C(D){return D===null||De(D)?u(D):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),T(D))}function T(D){return D===null||De(D)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),u(D)):D===96&&D===o?s(D):(n.consume(D),T)}function E(D){return n.attempt(d,A,b)(D)}function b(D){return n.enter("lineEnding"),n.consume(D),n.exit("lineEnding"),y}function y(D){return m>0&&Ve(D)?Xe(n,_,"linePrefix",m+1)(D):_(D)}function _(D){return D===null||De(D)?n.check(cg,E,A)(D):(n.enter("codeFlowValue"),S(D))}function S(D){return D===null||De(D)?(n.exit("codeFlowValue"),_(D)):(n.consume(D),S)}function A(D){return n.exit("codeFenced"),r(D)}function L(D,R,k){let M=0;return B;function B(Y){return D.enter("lineEnding"),D.consume(Y),D.exit("lineEnding"),H}function H(Y){return D.enter("codeFencedFence"),Ve(Y)?Xe(D,U,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):U(Y)}function U(Y){return Y===o?(D.enter("codeFencedFenceSequence"),P(Y)):k(Y)}function P(Y){return Y===o?(M++,D.consume(Y),P):M>=f?(D.exit("codeFencedFenceSequence"),Ve(Y)?Xe(D,K,"whitespace")(Y):K(Y)):k(Y)}function K(Y){return Y===null||De(Y)?(D.exit("codeFencedFence"),R(Y)):k(Y)}}}function VS(n,r,s){const l=this;return d;function d(f){return f===null?s(f):(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),m)}function m(f){return l.parser.lazy[l.now().line]?s(f):r(f)}}const Yu={name:"codeIndented",tokenize:KS},WS={partial:!0,tokenize:YS};function KS(n,r,s){const l=this;return d;function d(h){return n.enter("codeIndented"),Xe(n,m,"linePrefix",5)(h)}function m(h){const p=l.events[l.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):De(h)?n.attempt(WS,f,c)(h):(n.enter("codeFlowValue"),o(h))}function o(h){return h===null||De(h)?(n.exit("codeFlowValue"),f(h)):(n.consume(h),o)}function c(h){return n.exit("codeIndented"),r(h)}}function YS(n,r,s){const l=this;return d;function d(f){return l.parser.lazy[l.now().line]?s(f):De(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),d):Xe(n,m,"linePrefix",5)(f)}function m(f){const o=l.events[l.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(f):De(f)?d(f):s(f)}}const XS={name:"codeText",previous:JS,resolve:QS,tokenize:ZS};function QS(n){let r=n.length-4,s=3,l,d;if((n[s][1].type==="lineEnding"||n[s][1].type==="space")&&(n[r][1].type==="lineEnding"||n[r][1].type==="space")){for(l=s;++l<r;)if(n[l][1].type==="codeTextData"){n[s][1].type="codeTextPadding",n[r][1].type="codeTextPadding",s+=2,r-=2;break}}for(l=s-1,r++;++l<=r;)d===void 0?l!==r&&n[l][1].type!=="lineEnding"&&(d=l):(l===r||n[l][1].type==="lineEnding")&&(n[d][1].type="codeTextData",l!==d+2&&(n[d][1].end=n[l-1][1].end,n.splice(d+2,l-d-2),r-=l-d-2,l=d+2),d=void 0);return n}function JS(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ZS(n,r,s){let l=0,d,m;return f;function f(u){return n.enter("codeText"),n.enter("codeTextSequence"),o(u)}function o(u){return u===96?(n.consume(u),l++,o):(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?(m=n.enter("codeTextSequence"),d=0,p(u)):De(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||De(u)?(n.exit("codeTextData"),c(u)):(n.consume(u),h)}function p(u){return u===96?(n.consume(u),d++,p):d===l?(n.exit("codeTextSequence"),n.exit("codeText"),r(u)):(m.type="codeTextData",h(u))}}class eb{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 l=s??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(r,l):r>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(r,s,l){const d=s||0;this.setCursor(Math.trunc(r));const m=this.right.splice(this.right.length-d,Number.POSITIVE_INFINITY);return l&&Ia(this.left,l),m.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),Ia(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Ia(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);Ia(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);Ia(this.left,s.reverse())}}}function Ia(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 k_(n){const r={};let s=-1,l,d,m,f,o,c,h;const p=new eb(n);for(;++s<p.length;){for(;s in r;)s=r[s];if(l=p.get(s),s&&l[1].type==="chunkFlow"&&p.get(s-1)[1].type==="listItemPrefix"&&(c=l[1]._tokenizer.events,m=0,m<c.length&&c[m][1].type==="lineEndingBlank"&&(m+=2),m<c.length&&c[m][1].type==="content"))for(;++m<c.length&&c[m][1].type!=="content";)c[m][1].type==="chunkText"&&(c[m][1]._isInFirstContentOfListItem=!0,m++);if(l[0]==="enter")l[1].contentType&&(Object.assign(r,tb(p,s)),s=r[s],h=!0);else if(l[1]._container){for(m=s,d=void 0;m--;)if(f=p.get(m),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(d&&(p.get(d)[1].type="lineEndingBlank"),f[1].type="lineEnding",d=m);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;d&&(l[1].end={...p.get(d)[1].start},o=p.slice(d,s),o.unshift(l),p.splice(d,s-d+1,o))}}return Mn(n,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function tb(n,r){const s=n.get(r)[1],l=n.get(r)[2];let d=r-1;const m=[];let f=s._tokenizer;f||(f=l.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const o=f.events,c=[],h={};let p,u,v=-1,C=s,T=0,E=0;const b=[E];for(;C;){for(;n.get(++d)[1]!==C;);m.push(d),C._tokenizer||(p=l.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;++v<o.length;)o[v][0]==="exit"&&o[v-1][0]==="enter"&&o[v][1].type===o[v-1][1].type&&o[v][1].start.line!==o[v][1].end.line&&(E=v+1,b.push(E),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(),v=b.length;v--;){const y=o.slice(b[v],b[v+1]),_=m.pop();c.push([_,_+y.length-1]),n.splice(_,2,y)}for(c.reverse(),v=-1;++v<c.length;)h[T+c[v][0]]=T+c[v][1],T+=c[v][1]-c[v][0]-1;return h}const nb={resolve:rb,tokenize:sb},ib={partial:!0,tokenize:ab};function rb(n){return k_(n),n}function sb(n,r){let s;return l;function l(o){return n.enter("content"),s=n.enter("chunkContent",{contentType:"content"}),d(o)}function d(o){return o===null?m(o):De(o)?n.check(ib,f,m)(o):(n.consume(o),d)}function m(o){return n.exit("chunkContent"),n.exit("content"),r(o)}function f(o){return n.consume(o),n.exit("chunkContent"),s.next=n.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,d}}function ab(n,r,s){const l=this;return d;function d(f){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),Xe(n,m,"linePrefix")}function m(f){if(f===null||De(f))return s(f);const o=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(f):n.interrupt(l.parser.constructs.flow,s,r)(f)}}function A_(n,r,s,l,d,m,f,o,c){const h=c||Number.POSITIVE_INFINITY;let p=0;return u;function u(y){return y===60?(n.enter(l),n.enter(d),n.enter(m),n.consume(y),n.exit(m),v):y===null||y===32||y===41||Eo(y)?s(y):(n.enter(l),n.enter(f),n.enter(o),n.enter("chunkString",{contentType:"string"}),E(y))}function v(y){return y===62?(n.enter(m),n.consume(y),n.exit(m),n.exit(d),n.exit(l),r):(n.enter(o),n.enter("chunkString",{contentType:"string"}),C(y))}function C(y){return y===62?(n.exit("chunkString"),n.exit(o),v(y)):y===null||y===60||De(y)?s(y):(n.consume(y),y===92?T:C)}function T(y){return y===60||y===62||y===92?(n.consume(y),C):C(y)}function E(y){return!p&&(y===null||y===41||ot(y))?(n.exit("chunkString"),n.exit(o),n.exit(f),n.exit(l),r(y)):p<h&&y===40?(n.consume(y),p++,E):y===41?(n.consume(y),p--,E):y===null||y===32||y===40||Eo(y)?s(y):(n.consume(y),y===92?b:E)}function b(y){return y===40||y===41||y===92?(n.consume(y),E):E(y)}}function T_(n,r,s,l,d,m){const f=this;let o=0,c;return h;function h(C){return n.enter(l),n.enter(d),n.consume(C),n.exit(d),n.enter(m),p}function p(C){return o>999||C===null||C===91||C===93&&!c||C===94&&!o&&"_hiddenFootnoteSupport"in f.parser.constructs?s(C):C===93?(n.exit(m),n.enter(d),n.consume(C),n.exit(d),n.exit(l),r):De(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||De(C)||o++>999?(n.exit("chunkString"),p(C)):(n.consume(C),c||(c=!Ve(C)),C===92?v:u)}function v(C){return C===91||C===92||C===93?(n.consume(C),o++,u):u(C)}}function R_(n,r,s,l,d,m){let f;return o;function o(v){return v===34||v===39||v===40?(n.enter(l),n.enter(d),n.consume(v),n.exit(d),f=v===40?41:v,c):s(v)}function c(v){return v===f?(n.enter(d),n.consume(v),n.exit(d),n.exit(l),r):(n.enter(m),h(v))}function h(v){return v===f?(n.exit(m),c(f)):v===null?s(v):De(v)?(n.enter("lineEnding"),n.consume(v),n.exit("lineEnding"),Xe(n,h,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===f||v===null||De(v)?(n.exit("chunkString"),h(v)):(n.consume(v),v===92?u:p)}function u(v){return v===f||v===92?(n.consume(v),p):p(v)}}function qa(n,r){let s;return l;function l(d){return De(d)?(n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),s=!0,l):Ve(d)?Xe(n,l,s?"linePrefix":"lineSuffix")(d):r(d)}}const lb={name:"definition",tokenize:cb},ob={partial:!0,tokenize:ub};function cb(n,r,s){const l=this;let d;return m;function m(C){return n.enter("definition"),f(C)}function f(C){return T_.call(l,n,o,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(C)}function o(C){return d=ni(l.sliceSerialize(l.events[l.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 ot(C)?qa(n,h)(C):h(C)}function h(C){return A_(n,p,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(C)}function p(C){return n.attempt(ob,u,u)(C)}function u(C){return Ve(C)?Xe(n,v,"whitespace")(C):v(C)}function v(C){return C===null||De(C)?(n.exit("definition"),l.parser.defined.push(d),r(C)):s(C)}}function ub(n,r,s){return l;function l(o){return ot(o)?qa(n,d)(o):s(o)}function d(o){return R_(n,m,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function m(o){return Ve(o)?Xe(n,f,"whitespace")(o):f(o)}function f(o){return o===null||De(o)?r(o):s(o)}}const hb={name:"hardBreakEscape",tokenize:fb};function fb(n,r,s){return l;function l(m){return n.enter("hardBreakEscape"),n.consume(m),d}function d(m){return De(m)?(n.exit("hardBreakEscape"),r(m)):s(m)}}const db={name:"headingAtx",resolve:pb,tokenize:mb};function pb(n,r){let s=n.length-2,l=3,d,m;return n[l][1].type==="whitespace"&&(l+=2),s-2>l&&n[s][1].type==="whitespace"&&(s-=2),n[s][1].type==="atxHeadingSequence"&&(l===s-1||s-4>l&&n[s-2][1].type==="whitespace")&&(s-=l+1===s?2:4),s>l&&(d={type:"atxHeadingText",start:n[l][1].start,end:n[s][1].end},m={type:"chunkText",start:n[l][1].start,end:n[s][1].end,contentType:"text"},Mn(n,l,s-l+1,[["enter",d,r],["enter",m,r],["exit",m,r],["exit",d,r]])),n}function mb(n,r,s){let l=0;return d;function d(p){return n.enter("atxHeading"),m(p)}function m(p){return n.enter("atxHeadingSequence"),f(p)}function f(p){return p===35&&l++<6?(n.consume(p),f):p===null||ot(p)?(n.exit("atxHeadingSequence"),o(p)):s(p)}function o(p){return p===35?(n.enter("atxHeadingSequence"),c(p)):p===null||De(p)?(n.exit("atxHeading"),r(p)):Ve(p)?Xe(n,o,"whitespace")(p):(n.enter("atxHeadingText"),h(p))}function c(p){return p===35?(n.consume(p),c):(n.exit("atxHeadingSequence"),o(p))}function h(p){return p===null||p===35||ot(p)?(n.exit("atxHeadingText"),o(p)):(n.consume(p),h)}}const gb=["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"],hg=["pre","script","style","textarea"],_b={concrete:!0,name:"htmlFlow",resolveTo:Sb,tokenize:bb},vb={partial:!0,tokenize:wb},yb={partial:!0,tokenize:Cb};function Sb(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 bb(n,r,s){const l=this;let d,m,f,o,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),v):I===47?(n.consume(I),m=!0,E):I===63?(n.consume(I),d=3,l.interrupt?r:j):nn(I)?(n.consume(I),f=String.fromCharCode(I),b):s(I)}function v(I){return I===45?(n.consume(I),d=2,C):I===91?(n.consume(I),d=5,o=0,T):nn(I)?(n.consume(I),d=4,l.interrupt?r:j):s(I)}function C(I){return I===45?(n.consume(I),l.interrupt?r:j):s(I)}function T(I){const re="CDATA[";return I===re.charCodeAt(o++)?(n.consume(I),o===re.length?l.interrupt?r:U:T):s(I)}function E(I){return nn(I)?(n.consume(I),f=String.fromCharCode(I),b):s(I)}function b(I){if(I===null||I===47||I===62||ot(I)){const re=I===47,ve=f.toLowerCase();return!re&&!m&&hg.includes(ve)?(d=1,l.interrupt?r(I):U(I)):gb.includes(f.toLowerCase())?(d=6,re?(n.consume(I),y):l.interrupt?r(I):U(I)):(d=7,l.interrupt&&!l.parser.lazy[l.now().line]?s(I):m?_(I):S(I))}return I===45||Yt(I)?(n.consume(I),f+=String.fromCharCode(I),b):s(I)}function y(I){return I===62?(n.consume(I),l.interrupt?r:U):s(I)}function _(I){return Ve(I)?(n.consume(I),_):B(I)}function S(I){return I===47?(n.consume(I),B):I===58||I===95||nn(I)?(n.consume(I),A):Ve(I)?(n.consume(I),S):B(I)}function A(I){return I===45||I===46||I===58||I===95||Yt(I)?(n.consume(I),A):L(I)}function L(I){return I===61?(n.consume(I),D):Ve(I)?(n.consume(I),L):S(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,R):Ve(I)?(n.consume(I),D):k(I)}function R(I){return I===c?(n.consume(I),c=null,M):I===null||De(I)?s(I):(n.consume(I),R)}function k(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||ot(I)?L(I):(n.consume(I),k)}function M(I){return I===47||I===62||Ve(I)?S(I):s(I)}function B(I){return I===62?(n.consume(I),H):s(I)}function H(I){return I===null||De(I)?U(I):Ve(I)?(n.consume(I),H):s(I)}function U(I){return I===45&&d===2?(n.consume(I),G):I===60&&d===1?(n.consume(I),W):I===62&&d===4?(n.consume(I),N):I===63&&d===3?(n.consume(I),j):I===93&&d===5?(n.consume(I),z):De(I)&&(d===6||d===7)?(n.exit("htmlFlowData"),n.check(vb,$,P)(I)):I===null||De(I)?(n.exit("htmlFlowData"),P(I)):(n.consume(I),U)}function P(I){return n.check(yb,K,$)(I)}function K(I){return n.enter("lineEnding"),n.consume(I),n.exit("lineEnding"),Y}function Y(I){return I===null||De(I)?P(I):(n.enter("htmlFlowData"),U(I))}function G(I){return I===45?(n.consume(I),j):U(I)}function W(I){return I===47?(n.consume(I),f="",Z):U(I)}function Z(I){if(I===62){const re=f.toLowerCase();return hg.includes(re)?(n.consume(I),N):U(I)}return nn(I)&&f.length<8?(n.consume(I),f+=String.fromCharCode(I),Z):U(I)}function z(I){return I===93?(n.consume(I),j):U(I)}function j(I){return I===62?(n.consume(I),N):I===45&&d===2?(n.consume(I),j):U(I)}function N(I){return I===null||De(I)?(n.exit("htmlFlowData"),$(I)):(n.consume(I),N)}function $(I){return n.exit("htmlFlow"),r(I)}}function Cb(n,r,s){const l=this;return d;function d(f){return De(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),m):s(f)}function m(f){return l.parser.lazy[l.now().line]?s(f):r(f)}}function wb(n,r,s){return l;function l(d){return n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),n.attempt(Ja,r,s)}}const xb={name:"htmlText",tokenize:Eb};function Eb(n,r,s){const l=this;let d,m,f;return o;function o(j){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(j),c}function c(j){return j===33?(n.consume(j),h):j===47?(n.consume(j),L):j===63?(n.consume(j),S):nn(j)?(n.consume(j),k):s(j)}function h(j){return j===45?(n.consume(j),p):j===91?(n.consume(j),m=0,T):nn(j)?(n.consume(j),_):s(j)}function p(j){return j===45?(n.consume(j),C):s(j)}function u(j){return j===null?s(j):j===45?(n.consume(j),v):De(j)?(f=u,W(j)):(n.consume(j),u)}function v(j){return j===45?(n.consume(j),C):u(j)}function C(j){return j===62?G(j):j===45?v(j):u(j)}function T(j){const N="CDATA[";return j===N.charCodeAt(m++)?(n.consume(j),m===N.length?E:T):s(j)}function E(j){return j===null?s(j):j===93?(n.consume(j),b):De(j)?(f=E,W(j)):(n.consume(j),E)}function b(j){return j===93?(n.consume(j),y):E(j)}function y(j){return j===62?G(j):j===93?(n.consume(j),y):E(j)}function _(j){return j===null||j===62?G(j):De(j)?(f=_,W(j)):(n.consume(j),_)}function S(j){return j===null?s(j):j===63?(n.consume(j),A):De(j)?(f=S,W(j)):(n.consume(j),S)}function A(j){return j===62?G(j):S(j)}function L(j){return nn(j)?(n.consume(j),D):s(j)}function D(j){return j===45||Yt(j)?(n.consume(j),D):R(j)}function R(j){return De(j)?(f=R,W(j)):Ve(j)?(n.consume(j),R):G(j)}function k(j){return j===45||Yt(j)?(n.consume(j),k):j===47||j===62||ot(j)?M(j):s(j)}function M(j){return j===47?(n.consume(j),G):j===58||j===95||nn(j)?(n.consume(j),B):De(j)?(f=M,W(j)):Ve(j)?(n.consume(j),M):G(j)}function B(j){return j===45||j===46||j===58||j===95||Yt(j)?(n.consume(j),B):H(j)}function H(j){return j===61?(n.consume(j),U):De(j)?(f=H,W(j)):Ve(j)?(n.consume(j),H):M(j)}function U(j){return j===null||j===60||j===61||j===62||j===96?s(j):j===34||j===39?(n.consume(j),d=j,P):De(j)?(f=U,W(j)):Ve(j)?(n.consume(j),U):(n.consume(j),K)}function P(j){return j===d?(n.consume(j),d=void 0,Y):j===null?s(j):De(j)?(f=P,W(j)):(n.consume(j),P)}function K(j){return j===null||j===34||j===39||j===60||j===61||j===96?s(j):j===47||j===62||ot(j)?M(j):(n.consume(j),K)}function Y(j){return j===47||j===62||ot(j)?M(j):s(j)}function G(j){return j===62?(n.consume(j),n.exit("htmlTextData"),n.exit("htmlText"),r):s(j)}function W(j){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(j),n.exit("lineEnding"),Z}function Z(j){return Ve(j)?Xe(n,z,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):z(j)}function z(j){return n.enter("htmlTextData"),f(j)}}const Uh={name:"labelEnd",resolveAll:Rb,resolveTo:Db,tokenize:Mb},kb={tokenize:Lb},Ab={tokenize:Ob},Tb={tokenize:Bb};function Rb(n){let r=-1;const s=[];for(;++r<n.length;){const l=n[r][1];if(s.push(n[r]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const d=l.type==="labelImage"?4:2;l.type="data",r+=d}}return n.length!==s.length&&Mn(n,0,n.length,s),n}function Db(n,r){let s=n.length,l=0,d,m,f,o;for(;s--;)if(d=n[s][1],m){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&&(m=s,d.type!=="labelLink")){l=2;break}}else d.type==="labelEnd"&&(f=s);const c={type:n[m][1].type==="labelLink"?"link":"image",start:{...n[m][1].start},end:{...n[n.length-1][1].end}},h={type:"label",start:{...n[m][1].start},end:{...n[f][1].end}},p={type:"labelText",start:{...n[m+l+2][1].end},end:{...n[f-2][1].start}};return o=[["enter",c,r],["enter",h,r]],o=Vn(o,n.slice(m+1,m+l+3)),o=Vn(o,[["enter",p,r]]),o=Vn(o,jo(r.parser.constructs.insideSpan.null,n.slice(m+l+4,f-3),r)),o=Vn(o,[["exit",p,r],n[f-2],n[f-1],["exit",h,r]]),o=Vn(o,n.slice(f+1)),o=Vn(o,[["exit",c,r]]),Mn(n,m,n.length,o),n}function Mb(n,r,s){const l=this;let d=l.events.length,m,f;for(;d--;)if((l.events[d][1].type==="labelImage"||l.events[d][1].type==="labelLink")&&!l.events[d][1]._balanced){m=l.events[d][1];break}return o;function o(v){return m?m._inactive?u(v):(f=l.parser.defined.includes(ni(l.sliceSerialize({start:m.end,end:l.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(v),n.exit("labelMarker"),n.exit("labelEnd"),c):s(v)}function c(v){return v===40?n.attempt(kb,p,f?p:u)(v):v===91?n.attempt(Ab,p,f?h:u)(v):f?p(v):u(v)}function h(v){return n.attempt(Tb,p,u)(v)}function p(v){return r(v)}function u(v){return m._balanced=!0,s(v)}}function Lb(n,r,s){return l;function l(u){return n.enter("resource"),n.enter("resourceMarker"),n.consume(u),n.exit("resourceMarker"),d}function d(u){return ot(u)?qa(n,m)(u):m(u)}function m(u){return u===41?p(u):A_(n,f,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function f(u){return ot(u)?qa(n,c)(u):p(u)}function o(u){return s(u)}function c(u){return u===34||u===39||u===40?R_(n,h,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):p(u)}function h(u){return ot(u)?qa(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 Ob(n,r,s){const l=this;return d;function d(o){return T_.call(l,n,m,f,"reference","referenceMarker","referenceString")(o)}function m(o){return l.parser.defined.includes(ni(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?r(o):s(o)}function f(o){return s(o)}}function Bb(n,r,s){return l;function l(m){return n.enter("reference"),n.enter("referenceMarker"),n.consume(m),n.exit("referenceMarker"),d}function d(m){return m===93?(n.enter("referenceMarker"),n.consume(m),n.exit("referenceMarker"),n.exit("reference"),r):s(m)}}const jb={name:"labelStartImage",resolveAll:Uh.resolveAll,tokenize:Nb};function Nb(n,r,s){const l=this;return d;function d(o){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(o),n.exit("labelImageMarker"),m}function m(o){return o===91?(n.enter("labelMarker"),n.consume(o),n.exit("labelMarker"),n.exit("labelImage"),f):s(o)}function f(o){return o===94&&"_hiddenFootnoteSupport"in l.parser.constructs?s(o):r(o)}}const Hb={name:"labelStartLink",resolveAll:Uh.resolveAll,tokenize:zb};function zb(n,r,s){const l=this;return d;function d(f){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(f),n.exit("labelMarker"),n.exit("labelLink"),m}function m(f){return f===94&&"_hiddenFootnoteSupport"in l.parser.constructs?s(f):r(f)}}const Xu={name:"lineEnding",tokenize:Ib};function Ib(n,r){return s;function s(l){return n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),Xe(n,r,"linePrefix")}}const Co={name:"thematicBreak",tokenize:Ub};function Ub(n,r,s){let l=0,d;return m;function m(h){return n.enter("thematicBreak"),f(h)}function f(h){return d=h,o(h)}function o(h){return h===d?(n.enter("thematicBreakSequence"),c(h)):l>=3&&(h===null||De(h))?(n.exit("thematicBreak"),r(h)):s(h)}function c(h){return h===d?(n.consume(h),l++,c):(n.exit("thematicBreakSequence"),Ve(h)?Xe(n,o,"whitespace")(h):o(h))}}const vn={continuation:{tokenize:$b},exit:Vb,name:"list",tokenize:qb},Pb={partial:!0,tokenize:Wb},Fb={partial:!0,tokenize:Gb};function qb(n,r,s){const l=this,d=l.events[l.events.length-1];let m=d&&d[1].type==="linePrefix"?d[2].sliceSerialize(d[1],!0).length:0,f=0;return o;function o(C){const T=l.containerState.type||(C===42||C===43||C===45?"listUnordered":"listOrdered");if(T==="listUnordered"?!l.containerState.marker||C===l.containerState.marker:Sh(C)){if(l.containerState.type||(l.containerState.type=T,n.enter(T,{_container:!0})),T==="listUnordered")return n.enter("listItemPrefix"),C===42||C===45?n.check(Co,s,h)(C):h(C);if(!l.interrupt||C===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),c(C)}return s(C)}function c(C){return Sh(C)&&++f<10?(n.consume(C),c):(!l.interrupt||f<2)&&(l.containerState.marker?C===l.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"),l.containerState.marker=l.containerState.marker||C,n.check(Ja,l.interrupt?s:p,n.attempt(Pb,v,u))}function p(C){return l.containerState.initialBlankLine=!0,m++,v(C)}function u(C){return Ve(C)?(n.enter("listItemPrefixWhitespace"),n.consume(C),n.exit("listItemPrefixWhitespace"),v):s(C)}function v(C){return l.containerState.size=m+l.sliceSerialize(n.exit("listItemPrefix"),!0).length,r(C)}}function $b(n,r,s){const l=this;return l.containerState._closeFlow=void 0,n.check(Ja,d,m);function d(o){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,Xe(n,r,"listItemIndent",l.containerState.size+1)(o)}function m(o){return l.containerState.furtherBlankLines||!Ve(o)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,f(o)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,n.attempt(Fb,r,f)(o))}function f(o){return l.containerState._closeFlow=!0,l.interrupt=void 0,Xe(n,n.attempt(vn,r,s),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Gb(n,r,s){const l=this;return Xe(n,d,"listItemIndent",l.containerState.size+1);function d(m){const f=l.events[l.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===l.containerState.size?r(m):s(m)}}function Vb(n){n.exit(this.containerState.type)}function Wb(n,r,s){const l=this;return Xe(n,d,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function d(m){const f=l.events[l.events.length-1];return!Ve(m)&&f&&f[1].type==="listItemPrefixWhitespace"?r(m):s(m)}}const fg={name:"setextUnderline",resolveTo:Kb,tokenize:Yb};function Kb(n,r){let s=n.length,l,d,m;for(;s--;)if(n[s][0]==="enter"){if(n[s][1].type==="content"){l=s;break}n[s][1].type==="paragraph"&&(d=s)}else n[s][1].type==="content"&&n.splice(s,1),!m&&n[s][1].type==="definition"&&(m=s);const f={type:"setextHeading",start:{...n[l][1].start},end:{...n[n.length-1][1].end}};return n[d][1].type="setextHeadingText",m?(n.splice(d,0,["enter",f,r]),n.splice(m+1,0,["exit",n[l][1],r]),n[l][1].end={...n[m][1].end}):n[l][1]=f,n.push(["exit",f,r]),n}function Yb(n,r,s){const l=this;let d;return m;function m(h){let p=l.events.length,u;for(;p--;)if(l.events[p][1].type!=="lineEnding"&&l.events[p][1].type!=="linePrefix"&&l.events[p][1].type!=="content"){u=l.events[p][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||u)?(n.enter("setextHeadingLine"),d=h,f(h)):s(h)}function f(h){return n.enter("setextHeadingLineSequence"),o(h)}function o(h){return h===d?(n.consume(h),o):(n.exit("setextHeadingLineSequence"),Ve(h)?Xe(n,c,"lineSuffix")(h):c(h))}function c(h){return h===null||De(h)?(n.exit("setextHeadingLine"),r(h)):s(h)}}const Xb={tokenize:Qb};function Qb(n){const r=this,s=n.attempt(Ja,l,n.attempt(this.parser.constructs.flowInitial,d,Xe(n,n.attempt(this.parser.constructs.flow,d,n.attempt(nb,d)),"linePrefix")));return s;function l(m){if(m===null){n.consume(m);return}return n.enter("lineEndingBlank"),n.consume(m),n.exit("lineEndingBlank"),r.currentConstruct=void 0,s}function d(m){if(m===null){n.consume(m);return}return n.enter("lineEnding"),n.consume(m),n.exit("lineEnding"),r.currentConstruct=void 0,s}}const Jb={resolveAll:M_()},Zb=D_("string"),eC=D_("text");function D_(n){return{resolveAll:M_(n==="text"?tC:void 0),tokenize:r};function r(s){const l=this,d=this.parser.constructs[n],m=s.attempt(d,f,o);return f;function f(p){return h(p)?m(p):o(p)}function o(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"),m(p)):(s.consume(p),c)}function h(p){if(p===null)return!0;const u=d[p];let v=-1;if(u)for(;++v<u.length;){const C=u[v];if(!C.previous||C.previous.call(l,l.previous))return!0}return!1}}}function M_(n){return r;function r(s,l){let d=-1,m;for(;++d<=s.length;)m===void 0?s[d]&&s[d][1].type==="data"&&(m=d,d++):(!s[d]||s[d][1].type!=="data")&&(d!==m+2&&(s[m][1].end=s[d-1][1].end,s.splice(m+2,d-m-2),d=m+2),m=void 0);return n?n(s,l):s}}function tC(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 l=n[s-1][1],d=r.sliceStream(l);let m=d.length,f=-1,o=0,c;for(;m--;){const h=d[m];if(typeof h=="string"){for(f=h.length;h.charCodeAt(f-1)===32;)o++,f--;if(f)break;f=-1}else if(h===-2)c=!0,o++;else if(h!==-1){m++;break}}if(r._contentTypeTextTrailing&&s===n.length&&(o=0),o){const h={type:s===n.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:m?f:l.start._bufferIndex+f,_index:l.start._index+m,line:l.end.line,column:l.end.column-o,offset:l.end.offset-o},end:{...l.end}};l.end={...h.start},l.start.offset===l.end.offset?Object.assign(l,h):(n.splice(s,0,["enter",h,r],["exit",h,r]),s+=2)}s++}return n}const nC={42:vn,43:vn,45:vn,48:vn,49:vn,50:vn,51:vn,52:vn,53:vn,54:vn,55:vn,56:vn,57:vn,62:w_},iC={91:lb},rC={[-2]:Yu,[-1]:Yu,32:Yu},sC={35:db,42:Co,45:[fg,Co],60:_b,61:fg,95:Co,96:ug,126:ug},aC={38:E_,92:x_},lC={[-5]:Xu,[-4]:Xu,[-3]:Xu,33:jb,38:E_,42:bh,60:[HS,xb],91:Hb,92:[hb,x_],93:Uh,95:bh,96:XS},oC={null:[bh,Jb]},cC={null:[42,95]},uC={null:[]},hC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:cC,contentInitial:iC,disable:uC,document:nC,flow:sC,flowInitial:rC,insideSpan:oC,string:aC,text:lC},Symbol.toStringTag,{value:"Module"}));function fC(n,r,s){let l={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const d={},m=[];let f=[],o=[];const c={attempt:R(L),check:R(D),consume:_,enter:S,exit:A,interrupt:R(D,{interrupt:!0})},h={code:null,containerState:{},defineSkip:E,events:[],now:T,parser:n,previous:null,sliceSerialize:v,sliceStream:C,write:u};let p=r.tokenize.call(h,c);return r.resolveAll&&m.push(r),h;function u(H){return f=Vn(f,H),b(),f[f.length-1]!==null?[]:(k(r,0),h.events=jo(m,h.events,h),h.events)}function v(H,U){return pC(C(H),U)}function C(H){return dC(f,H)}function T(){const{_bufferIndex:H,_index:U,line:P,column:K,offset:Y}=l;return{_bufferIndex:H,_index:U,line:P,column:K,offset:Y}}function E(H){d[H.line]=H.column,B()}function b(){let H;for(;l._index<f.length;){const U=f[l._index];if(typeof U=="string")for(H=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===H&&l._bufferIndex<U.length;)y(U.charCodeAt(l._bufferIndex));else y(U)}}function y(H){p=p(H)}function _(H){De(H)?(l.line++,l.column=1,l.offset+=H===-3?2:1,B()):H!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===f[l._index].length&&(l._bufferIndex=-1,l._index++)),h.previous=H}function S(H,U){const P=U||{};return P.type=H,P.start=T(),h.events.push(["enter",P,h]),o.push(P),P}function A(H){const U=o.pop();return U.end=T(),h.events.push(["exit",U,h]),U}function L(H,U){k(H,U.from)}function D(H,U){U.restore()}function R(H,U){return P;function P(K,Y,G){let W,Z,z,j;return Array.isArray(K)?$(K):"tokenize"in K?$([K]):N(K);function N(me){return Q;function Q(q){const ee=q!==null&&me[q],ae=q!==null&&me.null,pe=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(ae)?ae:ae?[ae]:[]];return $(pe)(q)}}function $(me){return W=me,Z=0,me.length===0?G:I(me[Z])}function I(me){return Q;function Q(q){return j=M(),z=me,me.partial||(h.currentConstruct=me),me.name&&h.parser.constructs.disable.null.includes(me.name)?ve():me.tokenize.call(U?Object.assign(Object.create(h),U):h,c,re,ve)(q)}}function re(me){return H(z,j),Y}function ve(me){return j.restore(),++Z<W.length?I(W[Z]):G}}}function k(H,U){H.resolveAll&&!m.includes(H)&&m.push(H),H.resolve&&Mn(h.events,U,h.events.length-U,H.resolve(h.events.slice(U),h)),H.resolveTo&&(h.events=H.resolveTo(h.events,h))}function M(){const H=T(),U=h.previous,P=h.currentConstruct,K=h.events.length,Y=Array.from(o);return{from:K,restore:G};function G(){l=H,h.previous=U,h.currentConstruct=P,h.events.length=K,o=Y,B()}}function B(){l.line in d&&l.column<2&&(l.column=d[l.line],l.offset+=d[l.line]-1)}}function dC(n,r){const s=r.start._index,l=r.start._bufferIndex,d=r.end._index,m=r.end._bufferIndex;let f;if(s===d)f=[n[s].slice(l,m)];else{if(f=n.slice(s,d),l>-1){const o=f[0];typeof o=="string"?f[0]=o.slice(l):f.shift()}m>0&&f.push(n[d].slice(0,m))}return f}function pC(n,r){let s=-1;const l=[];let d;for(;++s<n.length;){const m=n[s];let f;if(typeof m=="string")f=m;else switch(m){case-5:{f="\r";break}case-4:{f=`
|
|
57
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(k){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),v.isLinux&&k&&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(k){const M=this._getMouseBufferCoords(k),B=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!!(B&&H&&M)&&this._areCoordsInSelection(M,B,H)}isCellInSelection(k,M){const B=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!(!B||!H)&&this._areCoordsInSelection([k,M],B,H)}_areCoordsInSelection(k,M,B){return k[1]>M[1]&&k[1]<B[1]||M[1]===B[1]&&k[1]===M[1]&&k[0]>=M[0]&&k[0]<B[0]||M[1]<B[1]&&k[1]===B[1]&&k[0]<B[0]||M[1]<B[1]&&k[1]===M[1]&&k[0]>=M[0]}_selectWordAtCursor(k,M){var U,P;const B=(P=(U=this._linkifier.currentLink)==null?void 0:U.link)==null?void 0:P.range;if(B)return this._model.selectionStart=[B.start.x-1,B.start.y-1],this._model.selectionStartLength=(0,_.getRangeLength)(B,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const H=this._getMouseBufferCoords(k);return!!H&&(this._selectWordAt(H,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(k,M){this._model.clearSelection(),k=Math.max(k,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,k],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(k){this._model.handleTrim(k)&&this.refresh()}_getMouseBufferCoords(k){const M=this._mouseService.getCoords(k,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(k){let M=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,k,this._screenElement)[1];const B=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=B?0:(M>B&&(M-=B),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(k){return v.isMac?k.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:k.shiftKey}handleMouseDown(k){if(this._mouseDownTimeStamp=k.timeStamp,(k.button!==2||!this.hasSelection)&&k.button===0){if(!this._enabled){if(!this.shouldForceSelection(k))return;k.stopPropagation()}k.preventDefault(),this._dragScrollAmount=0,this._enabled&&k.shiftKey?this._handleIncrementalClick(k):k.detail===1?this._handleSingleClick(k):k.detail===2?this._handleDoubleClick(k):k.detail===3&&this._handleTripleClick(k),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(k){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(k))}_handleSingleClick(k){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(k)?3:0,this._model.selectionStart=this._getMouseBufferCoords(k),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(k){this._selectWordAtCursor(k,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(k){const M=this._getMouseBufferCoords(k);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(k){return k.altKey&&!(v.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(k){if(k.stopImmediatePropagation(),!this._model.selectionStart)return;const M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(k),!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(k),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]++}M&&M[0]===this._model.selectionEnd[0]&&M[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 k=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(k.ydisp+this._bufferService.rows,k.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=k.ydisp),this.refresh()}}_handleMouseUp(k){const M=k.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&k.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const B=this._mouseService.getCoords(k,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(B&&B[0]!==void 0&&B[1]!==void 0){const H=(0,y.moveToCellSequence)(B[0]-1,B[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(H,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const k=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,B=!(!k||!M||k[0]===M[0]&&k[1]===M[1]);B?k&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&k[0]===this._oldSelectionStart[0]&&k[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(k,M,B)):this._oldHasSelection&&this._fireOnSelectionChange(k,M,B)}_fireOnSelectionChange(k,M,B){this._oldSelectionStart=k,this._oldSelectionEnd=M,this._oldHasSelection=B,this._onSelectionChange.fire()}_handleBufferActivate(k){this.clearSelection(),this._trimListener.dispose(),this._trimListener=k.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(k,M){let B=M;for(let H=0;M>=H;H++){const U=k.loadCell(H,this._workCell).getChars().length;this._workCell.getWidth()===0?B--:U>1&&M!==H&&(B+=U-1)}return B}setSelection(k,M,B){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[k,M],this._model.selectionStartLength=B,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(k){this._isClickInSelection(k)||(this._selectWordAtCursor(k,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(k,M,B=!0,H=!0){if(k[0]>=this._bufferService.cols)return;const U=this._bufferService.buffer,P=U.lines.get(k[1]);if(!P)return;const K=U.translateBufferLineToString(k[1],!1);let Y=this._convertViewportColToCharacterIndex(P,k[0]),G=Y;const W=k[0]-Y;let Z=0,z=0,j=0,N=0;if(K.charAt(Y)===" "){for(;Y>0&&K.charAt(Y-1)===" ";)Y--;for(;G<K.length&&K.charAt(G+1)===" ";)G++}else{let re=k[0],ve=k[0];P.getWidth(re)===0&&(Z++,re--),P.getWidth(ve)===2&&(z++,ve++);const me=P.getString(ve).length;for(me>1&&(N+=me-1,G+=me-1);re>0&&Y>0&&!this._isCharWordSeparator(P.loadCell(re-1,this._workCell));){P.loadCell(re-1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===0?(Z++,re--):Q>1&&(j+=Q-1,Y-=Q-1),Y--,re--}for(;ve<P.length&&G+1<K.length&&!this._isCharWordSeparator(P.loadCell(ve+1,this._workCell));){P.loadCell(ve+1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===2?(z++,ve++):Q>1&&(N+=Q-1,G+=Q-1),G++,ve++}}G++;let $=Y+W-Z+j,I=Math.min(this._bufferService.cols,G-Y+Z+z-j-N);if(M||K.slice(Y,G).trim()!==""){if(B&&$===0&&P.getCodePoint(0)!==32){const re=U.lines.get(k[1]-1);if(re&&P.isWrapped&&re.getCodePoint(this._bufferService.cols-1)!==32){const ve=this._getWordAt([this._bufferService.cols-1,k[1]-1],!1,!0,!1);if(ve){const me=this._bufferService.cols-ve.start;$-=me,I+=me}}}if(H&&$+I===this._bufferService.cols&&P.getCodePoint(this._bufferService.cols-1)!==32){const re=U.lines.get(k[1]+1);if(re!=null&&re.isWrapped&&re.getCodePoint(0)!==32){const ve=this._getWordAt([0,k[1]+1],!1,!1,!0);ve&&(I+=ve.length)}}return{start:$,length:I}}}_selectWordAt(k,M){const B=this._getWordAt(k,M);if(B){for(;B.start<0;)B.start+=this._bufferService.cols,k[1]--;this._model.selectionStart=[B.start,k[1]],this._model.selectionStartLength=B.length}}_selectToWordAt(k){const M=this._getWordAt(k,!0);if(M){let B=k[1];for(;M.start<0;)M.start+=this._bufferService.cols,B--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,B++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,B]}}_isCharWordSeparator(k){return k.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(k.getChars())>=0}_selectLineAt(k){const M=this._bufferService.buffer.getWrappedRangeForLine(k),B={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,_.getRangeLength)(B,this._bufferService.cols)}};o.SelectionService=R=h([g(3,A.IBufferService),g(4,A.ICoreService),g(5,T.IMouseService),g(6,A.IOptionsService),g(7,T.IRenderService),g(8,T.ICoreBrowserService)],R)},4725:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const h=c(8343);o.ICharSizeService=(0,h.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),o.IMouseService=(0,h.createDecorator)("MouseService"),o.IRenderService=(0,h.createDecorator)("RenderService"),o.ISelectionService=(0,h.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,h.createDecorator)("ThemeService"),o.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(f,o,c){var h=this&&this.__decorate||function(R,k,M,B){var H,U=arguments.length,P=U<3?k:B===null?B=Object.getOwnPropertyDescriptor(k,M):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(R,k,M,B);else for(var K=R.length-1;K>=0;K--)(H=R[K])&&(P=(U<3?H(P):U>3?H(k,M,P):H(k,M))||P);return U>3&&P&&Object.defineProperty(k,M,P),P},g=this&&this.__param||function(R,k){return function(M,B){k(M,B,R)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const u=c(7239),y=c(8055),w=c(8460),T=c(844),E=c(2585),S=y.css.toColor("#ffffff"),v=y.css.toColor("#000000"),_=y.css.toColor("#ffffff"),b=y.css.toColor("#000000"),A={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const R=[y.css.toColor("#2e3436"),y.css.toColor("#cc0000"),y.css.toColor("#4e9a06"),y.css.toColor("#c4a000"),y.css.toColor("#3465a4"),y.css.toColor("#75507b"),y.css.toColor("#06989a"),y.css.toColor("#d3d7cf"),y.css.toColor("#555753"),y.css.toColor("#ef2929"),y.css.toColor("#8ae234"),y.css.toColor("#fce94f"),y.css.toColor("#729fcf"),y.css.toColor("#ad7fa8"),y.css.toColor("#34e2e2"),y.css.toColor("#eeeeec")],k=[0,95,135,175,215,255];for(let M=0;M<216;M++){const B=k[M/36%6|0],H=k[M/6%6|0],U=k[M%6];R.push({css:y.channels.toCss(B,H,U),rgba:y.channels.toRgba(B,H,U)})}for(let M=0;M<24;M++){const B=8+10*M;R.push({css:y.channels.toCss(B,B,B),rgba:y.channels.toRgba(B,B,B)})}return R})());let L=o.ThemeService=class extends T.Disposable{get colors(){return this._colors}constructor(R){super(),this._optionsService=R,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:S,background:v,cursor:_,cursorAccent:b,selectionForeground:void 0,selectionBackgroundTransparent:A,selectionBackgroundOpaque:y.color.blend(v,A),selectionInactiveBackgroundTransparent:A,selectionInactiveBackgroundOpaque:y.color.blend(v,A),ansi:o.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(R={}){const k=this._colors;if(k.foreground=D(R.foreground,S),k.background=D(R.background,v),k.cursor=D(R.cursor,_),k.cursorAccent=D(R.cursorAccent,b),k.selectionBackgroundTransparent=D(R.selectionBackground,A),k.selectionBackgroundOpaque=y.color.blend(k.background,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundTransparent=D(R.selectionInactiveBackground,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundOpaque=y.color.blend(k.background,k.selectionInactiveBackgroundTransparent),k.selectionForeground=R.selectionForeground?D(R.selectionForeground,y.NULL_COLOR):void 0,k.selectionForeground===y.NULL_COLOR&&(k.selectionForeground=void 0),y.color.isOpaque(k.selectionBackgroundTransparent)&&(k.selectionBackgroundTransparent=y.color.opacity(k.selectionBackgroundTransparent,.3)),y.color.isOpaque(k.selectionInactiveBackgroundTransparent)&&(k.selectionInactiveBackgroundTransparent=y.color.opacity(k.selectionInactiveBackgroundTransparent,.3)),k.ansi=o.DEFAULT_ANSI_COLORS.slice(),k.ansi[0]=D(R.black,o.DEFAULT_ANSI_COLORS[0]),k.ansi[1]=D(R.red,o.DEFAULT_ANSI_COLORS[1]),k.ansi[2]=D(R.green,o.DEFAULT_ANSI_COLORS[2]),k.ansi[3]=D(R.yellow,o.DEFAULT_ANSI_COLORS[3]),k.ansi[4]=D(R.blue,o.DEFAULT_ANSI_COLORS[4]),k.ansi[5]=D(R.magenta,o.DEFAULT_ANSI_COLORS[5]),k.ansi[6]=D(R.cyan,o.DEFAULT_ANSI_COLORS[6]),k.ansi[7]=D(R.white,o.DEFAULT_ANSI_COLORS[7]),k.ansi[8]=D(R.brightBlack,o.DEFAULT_ANSI_COLORS[8]),k.ansi[9]=D(R.brightRed,o.DEFAULT_ANSI_COLORS[9]),k.ansi[10]=D(R.brightGreen,o.DEFAULT_ANSI_COLORS[10]),k.ansi[11]=D(R.brightYellow,o.DEFAULT_ANSI_COLORS[11]),k.ansi[12]=D(R.brightBlue,o.DEFAULT_ANSI_COLORS[12]),k.ansi[13]=D(R.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),k.ansi[14]=D(R.brightCyan,o.DEFAULT_ANSI_COLORS[14]),k.ansi[15]=D(R.brightWhite,o.DEFAULT_ANSI_COLORS[15]),R.extendedAnsi){const M=Math.min(k.ansi.length-16,R.extendedAnsi.length);for(let B=0;B<M;B++)k.ansi[B+16]=D(R.extendedAnsi[B],o.DEFAULT_ANSI_COLORS[B+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(R){this._restoreColor(R),this._onChangeColors.fire(this.colors)}_restoreColor(R){if(R!==void 0)switch(R){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[R]=this._restoreColors.ansi[R]}else for(let k=0;k<this._restoreColors.ansi.length;++k)this._colors.ansi[k]=this._restoreColors.ansi[k]}modifyColors(R){R(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(R,k){if(R!==void 0)try{return y.css.toColor(R)}catch{}return k}o.ThemeService=L=h([g(0,E.IOptionsService)],L)},6349:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const h=c(8460),g=c(844);class u extends g.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 T=new Array(w);for(let E=0;E<Math.min(w,this.length);E++)T[E]=this._array[this._getCyclicIndex(E)];this._array=T,this._maxLength=w,this._startIndex=0}get length(){return this._length}set length(w){if(w>this._length)for(let T=this._length;T<w;T++)this._array[T]=void 0;this._length=w}get(w){return this._array[this._getCyclicIndex(w)]}set(w,T){this._array[this._getCyclicIndex(w)]=T}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,T,...E){if(T){for(let S=w;S<this._length-T;S++)this._array[this._getCyclicIndex(S)]=this._array[this._getCyclicIndex(S+T)];this._length-=T,this.onDeleteEmitter.fire({index:w,amount:T})}for(let S=this._length-1;S>=w;S--)this._array[this._getCyclicIndex(S+E.length)]=this._array[this._getCyclicIndex(S)];for(let S=0;S<E.length;S++)this._array[this._getCyclicIndex(w+S)]=E[S];if(E.length&&this.onInsertEmitter.fire({index:w,amount:E.length}),this._length+E.length>this._maxLength){const S=this._length+E.length-this._maxLength;this._startIndex+=S,this._length=this._maxLength,this.onTrimEmitter.fire(S)}else this._length+=E.length}trimStart(w){w>this._length&&(w=this._length),this._startIndex+=w,this._length-=w,this.onTrimEmitter.fire(w)}shiftElements(w,T,E){if(!(T<=0)){if(w<0||w>=this._length)throw new Error("start argument out of range");if(w+E<0)throw new Error("Cannot shift elements in list beyond index 0");if(E>0){for(let v=T-1;v>=0;v--)this.set(w+v+E,this.get(w+v));const S=w+T+E-this._length;if(S>0)for(this._length+=S;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let S=0;S<T;S++)this.set(w+S+E,this.get(w+S))}}_getCyclicIndex(w){return(this._startIndex+w)%this._maxLength}}o.CircularList=u},1439:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(h,g=5){if(typeof h!="object")return h;const u=Array.isArray(h)?[]:{};for(const y in h)u[y]=g<=1?h[y]:h[y]&&c(h[y],g-1);return u}},8055:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,h=0,g=0,u=0;var y,w,T,E,S;function v(b){const A=b.toString(16);return A.length<2?"0"+A:A}function _(b,A){return b<A?(A+.05)/(b+.05):(b+.05)/(A+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(b){b.toCss=function(A,L,D,R){return R!==void 0?`#${v(A)}${v(L)}${v(D)}${v(R)}`:`#${v(A)}${v(L)}${v(D)}`},b.toRgba=function(A,L,D,R=255){return(A<<24|L<<16|D<<8|R)>>>0},b.toColor=function(A,L,D,R){return{css:b.toCss(A,L,D,R),rgba:b.toRgba(A,L,D,R)}}})(y||(o.channels=y={})),(function(b){function A(L,D){return u=Math.round(255*D),[c,h,g]=S.toChannels(L.rgba),{css:y.toCss(c,h,g,u),rgba:y.toRgba(c,h,g,u)}}b.blend=function(L,D){if(u=(255&D.rgba)/255,u===1)return{css:D.css,rgba:D.rgba};const R=D.rgba>>24&255,k=D.rgba>>16&255,M=D.rgba>>8&255,B=L.rgba>>24&255,H=L.rgba>>16&255,U=L.rgba>>8&255;return c=B+Math.round((R-B)*u),h=H+Math.round((k-H)*u),g=U+Math.round((M-U)*u),{css:y.toCss(c,h,g),rgba:y.toRgba(c,h,g)}},b.isOpaque=function(L){return(255&L.rgba)==255},b.ensureContrastRatio=function(L,D,R){const k=S.ensureContrastRatio(L.rgba,D.rgba,R);if(k)return y.toColor(k>>24&255,k>>16&255,k>>8&255)},b.opaque=function(L){const D=(255|L.rgba)>>>0;return[c,h,g]=S.toChannels(D),{css:y.toCss(c,h,g),rgba:D}},b.opacity=A,b.multiplyOpacity=function(L,D){return u=255&L.rgba,A(L,u*D/255)},b.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(w||(o.color=w={})),(function(b){let A,L;try{const D=document.createElement("canvas");D.width=1,D.height=1;const R=D.getContext("2d",{willReadFrequently:!0});R&&(A=R,A.globalCompositeOperation="copy",L=A.createLinearGradient(0,0,1,1))}catch{}b.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),g=parseInt(D.slice(3,4).repeat(2),16),y.toColor(c,h,g);case 5:return c=parseInt(D.slice(1,2).repeat(2),16),h=parseInt(D.slice(2,3).repeat(2),16),g=parseInt(D.slice(3,4).repeat(2),16),u=parseInt(D.slice(4,5).repeat(2),16),y.toColor(c,h,g,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 R=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(R)return c=parseInt(R[1]),h=parseInt(R[2]),g=parseInt(R[3]),u=Math.round(255*(R[5]===void 0?1:parseFloat(R[5]))),y.toColor(c,h,g,u);if(!A||!L)throw new Error("css.toColor: Unsupported css format");if(A.fillStyle=L,A.fillStyle=D,typeof A.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(A.fillRect(0,0,1,1),[c,h,g,u]=A.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:y.toRgba(c,h,g,u),css:D}}})(T||(o.css=T={})),(function(b){function A(L,D,R){const k=L/255,M=D/255,B=R/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))}b.relativeLuminance=function(L){return A(L>>16&255,L>>8&255,255&L)},b.relativeLuminance2=A})(E||(o.rgb=E={})),(function(b){function A(D,R,k){const M=D>>24&255,B=D>>16&255,H=D>>8&255;let U=R>>24&255,P=R>>16&255,K=R>>8&255,Y=_(E.relativeLuminance2(U,P,K),E.relativeLuminance2(M,B,H));for(;Y<k&&(U>0||P>0||K>0);)U-=Math.max(0,Math.ceil(.1*U)),P-=Math.max(0,Math.ceil(.1*P)),K-=Math.max(0,Math.ceil(.1*K)),Y=_(E.relativeLuminance2(U,P,K),E.relativeLuminance2(M,B,H));return(U<<24|P<<16|K<<8|255)>>>0}function L(D,R,k){const M=D>>24&255,B=D>>16&255,H=D>>8&255;let U=R>>24&255,P=R>>16&255,K=R>>8&255,Y=_(E.relativeLuminance2(U,P,K),E.relativeLuminance2(M,B,H));for(;Y<k&&(U<255||P<255||K<255);)U=Math.min(255,U+Math.ceil(.1*(255-U))),P=Math.min(255,P+Math.ceil(.1*(255-P))),K=Math.min(255,K+Math.ceil(.1*(255-K))),Y=_(E.relativeLuminance2(U,P,K),E.relativeLuminance2(M,B,H));return(U<<24|P<<16|K<<8|255)>>>0}b.blend=function(D,R){if(u=(255&R)/255,u===1)return R;const k=R>>24&255,M=R>>16&255,B=R>>8&255,H=D>>24&255,U=D>>16&255,P=D>>8&255;return c=H+Math.round((k-H)*u),h=U+Math.round((M-U)*u),g=P+Math.round((B-P)*u),y.toRgba(c,h,g)},b.ensureContrastRatio=function(D,R,k){const M=E.relativeLuminance(D>>8),B=E.relativeLuminance(R>>8);if(_(M,B)<k){if(B<M){const P=A(D,R,k),K=_(M,E.relativeLuminance(P>>8));if(K<k){const Y=L(D,R,k);return K>_(M,E.relativeLuminance(Y>>8))?P:Y}return P}const H=L(D,R,k),U=_(M,E.relativeLuminance(H>>8));if(U<k){const P=A(D,R,k);return U>_(M,E.relativeLuminance(P>>8))?H:P}return H}},b.reduceLuminance=A,b.increaseLuminance=L,b.toChannels=function(D){return[D>>24&255,D>>16&255,D>>8&255,255&D]}})(S||(o.rgba=S={})),o.toPaddedHex=v,o.contrastRatio=_},8969:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const h=c(844),g=c(2585),u=c(4348),y=c(7866),w=c(744),T=c(7302),E=c(6975),S=c(8460),v=c(1753),_=c(1480),b=c(7994),A=c(9282),L=c(5435),D=c(5981),R=c(2660);let k=!1;class M extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new S.EventEmitter),this._onScroll.event((H=>{var U;(U=this._onScrollApi)==null||U.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 U in H)this.optionsService.options[U]=H[U]}constructor(H){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new S.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new S.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new S.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new S.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new S.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new S.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new T.OptionsService(H)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(w.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(y.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(E.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(v.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(_.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(b.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(R.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new L.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,S.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,S.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,S.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,S.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((U=>{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((U=>{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(((U,P)=>this._inputHandler.parse(U,P)))),this.register((0,S.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(H,U){this._writeBuffer.write(H,U)}writeSync(H,U){this._logService.logLevel<=g.LogLevelEnum.WARN&&!k&&(this._logService.warn("writeSync is unreliable and will be removed soon."),k=!0),this._writeBuffer.writeSync(H,U)}input(H,U=!0){this.coreService.triggerDataEvent(H,U)}resize(H,U){isNaN(H)||isNaN(U)||(H=Math.max(H,w.MINIMUM_COLS),U=Math.max(U,w.MINIMUM_ROWS),this._bufferService.resize(H,U))}scroll(H,U=!1){this._bufferService.scroll(H,U)}scrollLines(H,U,P){this._bufferService.scrollLines(H,U,P)}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 U=H-this._bufferService.buffer.ydisp;U!==0&&this.scrollLines(U)}registerEscHandler(H,U){return this._inputHandler.registerEscHandler(H,U)}registerDcsHandler(H,U){return this._inputHandler.registerDcsHandler(H,U)}registerCsiHandler(H,U){return this._inputHandler.registerCsiHandler(H,U)}registerOscHandler(H,U){return this._inputHandler.registerOscHandler(H,U)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let H=!1;const U=this.optionsService.rawOptions.windowsPty;U&&U.buildNumber!==void 0&&U.buildNumber!==void 0?H=U.backend==="conpty"&&U.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(A.updateWindowsModeWrappedState.bind(null,this._bufferService))),H.push(this.registerCsiHandler({final:"H"},(()=>((0,A.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const U of H)U.dispose()}))}}}o.CoreTerminal=M},8460:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.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 g=[];for(let u=0;u<this._listeners.length;u++)g.push(this._listeners[u]);for(let u=0;u<g.length;u++)g[u].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(c,h){return c((g=>h.fire(g)))},o.runAndSubscribe=function(c,h){return h(void 0),c((g=>h(g)))}},5435:function(f,o,c){var h=this&&this.__decorate||function(Z,z,j,N){var $,I=arguments.length,re=I<3?z:N===null?N=Object.getOwnPropertyDescriptor(z,j):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")re=Reflect.decorate(Z,z,j,N);else for(var ve=Z.length-1;ve>=0;ve--)($=Z[ve])&&(re=(I<3?$(re):I>3?$(z,j,re):$(z,j))||re);return I>3&&re&&Object.defineProperty(z,j,re),re},g=this&&this.__param||function(Z,z){return function(j,N){z(j,N,Z)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const u=c(2584),y=c(7116),w=c(2015),T=c(844),E=c(482),S=c(8437),v=c(8460),_=c(643),b=c(511),A=c(3734),L=c(2585),D=c(1480),R=c(6242),k=c(6351),M=c(5941),B={"(":0,")":1,"*":2,"+":3,"-":1,".":2},H=131072;function U(Z,z){if(Z>24)return z.setWinLines||!1;switch(Z){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 P;(function(Z){Z[Z.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Z[Z.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(o.WindowsOptionsReportType=P={}));let K=0;class Y extends T.Disposable{getAttrData(){return this._curAttrData}constructor(z,j,N,$,I,re,ve,me,Q=new w.EscapeSequenceParser){super(),this._bufferService=z,this._charsetService=j,this._coreService=N,this._logService=$,this._optionsService=I,this._oscLinkService=re,this._coreMouseService=ve,this._unicodeService=me,this._parser=Q,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new E.StringToUtf32,this._utf8Decoder=new E.Utf8ToUtf32,this._workCell=new b.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=S.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=S.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new v.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new v.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new v.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new v.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new v.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new v.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new v.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new v.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new v.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new v.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new v.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new v.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,te)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(q),params:te.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,te,ae)=>{this._logService.debug("Unknown OSC code: ",{identifier:q,action:te,data:ae})})),this._parser.setDcsHandlerFallback(((q,te,ae)=>{te==="HOOK"&&(ae=ae.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(q),action:te,payload:ae})})),this._parser.setPrintHandler(((q,te,ae)=>this.print(q,te,ae))),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 R.OscHandler((q=>(this.setTitle(q),this.setIconName(q),!0)))),this._parser.registerOscHandler(1,new R.OscHandler((q=>this.setIconName(q)))),this._parser.registerOscHandler(2,new R.OscHandler((q=>this.setTitle(q)))),this._parser.registerOscHandler(4,new R.OscHandler((q=>this.setOrReportIndexedColor(q)))),this._parser.registerOscHandler(8,new R.OscHandler((q=>this.setHyperlink(q)))),this._parser.registerOscHandler(10,new R.OscHandler((q=>this.setOrReportFgColor(q)))),this._parser.registerOscHandler(11,new R.OscHandler((q=>this.setOrReportBgColor(q)))),this._parser.registerOscHandler(12,new R.OscHandler((q=>this.setOrReportCursorColor(q)))),this._parser.registerOscHandler(104,new R.OscHandler((q=>this.restoreIndexedColor(q)))),this._parser.registerOscHandler(110,new R.OscHandler((q=>this.restoreFgColor(q)))),this._parser.registerOscHandler(111,new R.OscHandler((q=>this.restoreBgColor(q)))),this._parser.registerOscHandler(112,new R.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 y.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 k.DcsHandler(((q,te)=>this.requestStatusString(q,te))))}_preserveStack(z,j,N,$){this._parseStack.paused=!0,this._parseStack.cursorStartX=z,this._parseStack.cursorStartY=j,this._parseStack.decodedLength=N,this._parseStack.position=$}_logSlowResolvingAsync(z){this._logService.logLevel<=L.LogLevelEnum.WARN&&Promise.race([z,new Promise(((j,N)=>setTimeout((()=>N("#SLOW_TIMEOUT")),5e3)))]).catch((j=>{if(j!=="#SLOW_TIMEOUT")throw j;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(z,j){let N,$=this._activeBuffer.x,I=this._activeBuffer.y,re=0;const ve=this._parseStack.paused;if(ve){if(N=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,j))return this._logSlowResolvingAsync(N),N;$=this._parseStack.cursorStartX,I=this._parseStack.cursorStartY,this._parseStack.paused=!1,z.length>H&&(re=this._parseStack.position+H)}if(this._logService.logLevel<=L.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))),ve||this._dirtyRowTracker.clearRange(),z.length>H)for(let q=re;q<z.length;q+=H){const te=q+H<z.length?q+H:z.length,ae=typeof z=="string"?this._stringDecoder.decode(z.substring(q,te),this._parseBuffer):this._utf8Decoder.decode(z.subarray(q,te),this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,ae))return this._preserveStack($,I,ae,q),this._logSlowResolvingAsync(N),N}else if(!ve){const q=typeof z=="string"?this._stringDecoder.decode(z,this._parseBuffer):this._utf8Decoder.decode(z,this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,q))return this._preserveStack($,I,q,0),this._logSlowResolvingAsync(N),N}this._activeBuffer.x===$&&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,j,N){let $,I;const re=this._charsetService.charset,ve=this._optionsService.rawOptions.screenReaderMode,me=this._bufferService.cols,Q=this._coreService.decPrivateModes.wraparound,q=this._coreService.modes.insertMode,te=this._curAttrData;let ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&N-j>0&&ae.getWidth(this._activeBuffer.x-1)===2&&ae.setCellFromCodepoint(this._activeBuffer.x-1,0,1,te);let pe=this._parser.precedingJoinState;for(let se=j;se<N;++se){if($=z[se],$<127&&re){const Pe=re[String.fromCharCode($)];Pe&&($=Pe.charCodeAt(0))}const we=this._unicodeService.charProperties($,pe);I=D.UnicodeService.extractWidth(we);const je=D.UnicodeService.extractShouldJoin(we),ze=je?D.UnicodeService.extractWidth(pe):0;if(pe=we,ve&&this._onA11yChar.fire((0,E.stringFromCodePoint)($)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+I-ze>me){if(Q){const Pe=ae;let xe=this._activeBuffer.x-ze;for(this._activeBuffer.x=ze,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),ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ze>0&&ae instanceof S.BufferLine&&ae.copyCellsFrom(Pe,xe,0,ze,!1);xe<me;)Pe.setCellFromCodepoint(xe++,0,1,te)}else if(this._activeBuffer.x=me-1,I===2)continue}if(je&&this._activeBuffer.x){const Pe=ae.getWidth(this._activeBuffer.x-1)?1:2;ae.addCodepointToCell(this._activeBuffer.x-Pe,$,I);for(let xe=I-ze;--xe>=0;)ae.setCellFromCodepoint(this._activeBuffer.x++,0,0,te)}else if(q&&(ae.insertCells(this._activeBuffer.x,I-ze,this._activeBuffer.getNullCell(te)),ae.getWidth(me-1)===2&&ae.setCellFromCodepoint(me-1,_.NULL_CELL_CODE,_.NULL_CELL_WIDTH,te)),ae.setCellFromCodepoint(this._activeBuffer.x++,$,I,te),I>0)for(;--I;)ae.setCellFromCodepoint(this._activeBuffer.x++,0,0,te)}this._parser.precedingJoinState=pe,this._activeBuffer.x<me&&N-j>0&&ae.getWidth(this._activeBuffer.x)===0&&!ae.hasContent(this._activeBuffer.x)&&ae.setCellFromCodepoint(this._activeBuffer.x,0,1,te),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(z,j){return z.final!=="t"||z.prefix||z.intermediates?this._parser.registerCsiHandler(z,j):this._parser.registerCsiHandler(z,(N=>!U(N.params[0],this._optionsService.rawOptions.windowOptions)||j(N)))}registerDcsHandler(z,j){return this._parser.registerDcsHandler(z,new k.DcsHandler(j))}registerEscHandler(z,j){return this._parser.registerEscHandler(z,j)}registerOscHandler(z,j){return this._parser.registerOscHandler(z,new R.OscHandler(j))}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 j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);j.hasWidth(this._activeBuffer.x)&&!j.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,j){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=z,this._activeBuffer.y=this._activeBuffer.scrollTop+j):(this._activeBuffer.x=z,this._activeBuffer.y=j),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(z,j){this._restrictCursor(),this._setCursor(this._activeBuffer.x+z,this._activeBuffer.y+j)}cursorUp(z){const j=this._activeBuffer.y-this._activeBuffer.scrollTop;return j>=0?this._moveCursor(0,-Math.min(j,z.params[0]||1)):this._moveCursor(0,-(z.params[0]||1)),!0}cursorDown(z){const j=this._activeBuffer.scrollBottom-this._activeBuffer.y;return j>=0?this._moveCursor(0,Math.min(j,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 j=z.params[0];return j===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:j===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let j=z.params[0]||1;for(;j--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let j=z.params[0]||1;for(;j--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(z){const j=z.params[0];return j===1&&(this._curAttrData.bg|=536870912),j!==2&&j!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(z,j,N,$=!1,I=!1){const re=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);re.replaceCells(j,N,this._activeBuffer.getNullCell(this._eraseAttrData()),I),$&&(re.isWrapped=!1)}_resetBufferLine(z,j=!1){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);N&&(N.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),j),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+z),N.isWrapped=!1)}eraseInDisplay(z,j=!1){let N;switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,j);N<this._bufferService.rows;N++)this._resetBufferLine(N,j);this._dirtyRowTracker.markDirty(N);break;case 1:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N,0,this._activeBuffer.x+1,!0,j),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(N+1).isWrapped=!1);N--;)this._resetBufferLine(N,j);this._dirtyRowTracker.markDirty(0);break;case 2:for(N=this._bufferService.rows,this._dirtyRowTracker.markDirty(N-1);N--;)this._resetBufferLine(N,j);this._dirtyRowTracker.markDirty(0);break;case 3:const $=this._activeBuffer.lines.length-this._bufferService.rows;$>0&&(this._activeBuffer.lines.trimStart($),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-$,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-$,0),this._onScroll.fire(0))}return!0}eraseInLine(z,j=!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,j);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,j);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,j)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(z){this._restrictCursor();let j=z.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y,$=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-$+1;for(;j--;)this._activeBuffer.lines.splice(I-1,1),this._activeBuffer.lines.splice(N,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(z){this._restrictCursor();let j=z.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y;let $;for($=this._bufferService.rows-1-this._activeBuffer.scrollBottom,$=this._bufferService.rows-1+this._activeBuffer.ybase-$;j--;)this._activeBuffer.lines.splice(N,1),this._activeBuffer.lines.splice($,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 j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return j&&(j.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 j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return j&&(j.deleteCells(this._activeBuffer.x,z.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(z){let j=z.params[0]||1;for(;j--;)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 j=z.params[0]||1;for(;j--;)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(S.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 j=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);$.deleteCells(0,j,this._activeBuffer.getNullCell(this._eraseAttrData())),$.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 j=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);$.insertCells(0,j,this._activeBuffer.getNullCell(this._eraseAttrData())),$.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 j=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);$.insertCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(this._eraseAttrData())),$.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 j=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);$.deleteCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(z){this._restrictCursor();const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return j&&(j.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 j=this._parser.precedingJoinState;if(!j)return!0;const N=z.params[0]||1,$=D.UnicodeService.extractWidth(j),I=this._activeBuffer.x-$,re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(I),ve=new Uint32Array(re.length*N);let me=0;for(let q=0;q<re.length;){const te=re.codePointAt(q)||0;ve[me++]=te,q+=te>65535?2:1}let Q=me;for(let q=1;q<N;++q)ve.copyWithin(Q,0,me),Q+=me;return this.print(ve,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 j=0;j<z.length;j++)switch(z.params[j]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(z){for(let j=0;j<z.length;j++)switch(z.params[j]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,y.DEFAULT_CHARSET),this._charsetService.setgCharset(1,y.DEFAULT_CHARSET),this._charsetService.setgCharset(2,y.DEFAULT_CHARSET),this._charsetService.setgCharset(3,y.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 j=0;j<z.length;j++)switch(z.params[j]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(z){for(let j=0;j<z.length;j++)switch(z.params[j]){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[j]===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,j){const N=this._coreService.decPrivateModes,{activeProtocol:$,activeEncoding:I}=this._coreMouseService,re=this._coreService,{buffers:ve,cols:me}=this._bufferService,{active:Q,alt:q}=ve,te=this._optionsService.rawOptions,ae=je=>je?1:2,pe=z.params[0];return se=pe,we=j?pe===2?4:pe===4?ae(re.modes.insertMode):pe===12?3:pe===20?ae(te.convertEol):0:pe===1?ae(N.applicationCursorKeys):pe===3?te.windowOptions.setWinLines?me===80?2:me===132?1:0:0:pe===6?ae(N.origin):pe===7?ae(N.wraparound):pe===8?3:pe===9?ae($==="X10"):pe===12?ae(te.cursorBlink):pe===25?ae(!re.isCursorHidden):pe===45?ae(N.reverseWraparound):pe===66?ae(N.applicationKeypad):pe===67?4:pe===1e3?ae($==="VT200"):pe===1002?ae($==="DRAG"):pe===1003?ae($==="ANY"):pe===1004?ae(N.sendFocus):pe===1005?4:pe===1006?ae(I==="SGR"):pe===1015?4:pe===1016?ae(I==="SGR_PIXELS"):pe===1048?1:pe===47||pe===1047||pe===1049?ae(Q===q):pe===2004?ae(N.bracketedPasteMode):0,re.triggerDataEvent(`${u.C0.ESC}[${j?"":"?"}${se};${we}$y`),!0;var se,we}_updateAttrColor(z,j,N,$,I){return j===2?(z|=50331648,z&=-16777216,z|=A.AttributeData.fromColorRGB([N,$,I])):j===5&&(z&=-50331904,z|=33554432|255&N),z}_extractColor(z,j,N){const $=[0,0,-1,0,0,0];let I=0,re=0;do{if($[re+I]=z.params[j+re],z.hasSubParams(j+re)){const ve=z.getSubParams(j+re);let me=0;do $[1]===5&&(I=1),$[re+me+1+I]=ve[me];while(++me<ve.length&&me+re+1+I<$.length);break}if($[1]===5&&re+I>=2||$[1]===2&&re+I>=5)break;$[1]&&(I=1)}while(++re+j<z.length&&re+I<$.length);for(let ve=2;ve<$.length;++ve)$[ve]===-1&&($[ve]=0);switch($[0]){case 38:N.fg=this._updateAttrColor(N.fg,$[1],$[3],$[4],$[5]);break;case 48:N.bg=this._updateAttrColor(N.bg,$[1],$[3],$[4],$[5]);break;case 58:N.extended=N.extended.clone(),N.extended.underlineColor=this._updateAttrColor(N.extended.underlineColor,$[1],$[3],$[4],$[5])}return re}_processUnderline(z,j){j.extended=j.extended.clone(),(!~z||z>5)&&(z=1),j.extended.underlineStyle=z,j.fg|=268435456,z===0&&(j.fg&=-268435457),j.updateExtended()}_processSGR0(z){z.fg=S.DEFAULT_ATTR_DATA.fg,z.bg=S.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 j=z.length;let N;const $=this._curAttrData;for(let I=0;I<j;I++)N=z.params[I],N>=30&&N<=37?($.fg&=-50331904,$.fg|=16777216|N-30):N>=40&&N<=47?($.bg&=-50331904,$.bg|=16777216|N-40):N>=90&&N<=97?($.fg&=-50331904,$.fg|=16777224|N-90):N>=100&&N<=107?($.bg&=-50331904,$.bg|=16777224|N-100):N===0?this._processSGR0($):N===1?$.fg|=134217728:N===3?$.bg|=67108864:N===4?($.fg|=268435456,this._processUnderline(z.hasSubParams(I)?z.getSubParams(I)[0]:1,$)):N===5?$.fg|=536870912:N===7?$.fg|=67108864:N===8?$.fg|=1073741824:N===9?$.fg|=2147483648:N===2?$.bg|=134217728:N===21?this._processUnderline(2,$):N===22?($.fg&=-134217729,$.bg&=-134217729):N===23?$.bg&=-67108865:N===24?($.fg&=-268435457,this._processUnderline(0,$)):N===25?$.fg&=-536870913:N===27?$.fg&=-67108865:N===28?$.fg&=-1073741825:N===29?$.fg&=2147483647:N===39?($.fg&=-67108864,$.fg|=16777215&S.DEFAULT_ATTR_DATA.fg):N===49?($.bg&=-67108864,$.bg|=16777215&S.DEFAULT_ATTR_DATA.bg):N===38||N===48||N===58?I+=this._extractColor(z,I,$):N===53?$.bg|=1073741824:N===55?$.bg&=-1073741825:N===59?($.extended=$.extended.clone(),$.extended.underlineColor=-1,$.updateExtended()):N===100?($.fg&=-67108864,$.fg|=16777215&S.DEFAULT_ATTR_DATA.fg,$.bg&=-67108864,$.bg|=16777215&S.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",N);return!0}deviceStatus(z){switch(z.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const j=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${j};${N}R`)}return!0}deviceStatusPrivate(z){if(z.params[0]===6){const j=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${j};${N}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=S.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 j=z.params[0]||1;switch(j){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 N=j%2==1;return this._optionsService.options.cursorBlink=N,!0}setScrollRegion(z){const j=z.params[0]||1;let N;return(z.length<2||(N=z.params[1])>this._bufferService.rows||N===0)&&(N=this._bufferService.rows),N>j&&(this._activeBuffer.scrollTop=j-1,this._activeBuffer.scrollBottom=N-1,this._setCursor(0,0)),!0}windowOptions(z){if(!U(z.params[0],this._optionsService.rawOptions.windowOptions))return!0;const j=z.length>1?z.params[1]:0;switch(z.params[0]){case 14:j!==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:j!==0&&j!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),j!==0&&j!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:j!==0&&j!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),j!==0&&j!==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 j=[],N=z.split(";");for(;N.length>1;){const $=N.shift(),I=N.shift();if(/^\d+$/.exec($)){const re=parseInt($);if(W(re))if(I==="?")j.push({type:0,index:re});else{const ve=(0,M.parseColor)(I);ve&&j.push({type:1,index:re,color:ve})}}}return j.length&&this._onColor.fire(j),!0}setHyperlink(z){const j=z.split(";");return!(j.length<2)&&(j[1]?this._createHyperlink(j[0],j[1]):!j[0]&&this._finishHyperlink())}_createHyperlink(z,j){this._getCurrentLinkId()&&this._finishHyperlink();const N=z.split(":");let $;const I=N.findIndex((re=>re.startsWith("id=")));return I!==-1&&($=N[I].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:$,uri:j}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(z,j){const N=z.split(";");for(let $=0;$<N.length&&!(j>=this._specialColors.length);++$,++j)if(N[$]==="?")this._onColor.fire([{type:0,index:this._specialColors[j]}]);else{const I=(0,M.parseColor)(N[$]);I&&this._onColor.fire([{type:1,index:this._specialColors[j],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 j=[],N=z.split(";");for(let $=0;$<N.length;++$)if(/^\d+$/.exec(N[$])){const I=parseInt(N[$]);W(I)&&j.push({type:2,index:I})}return j.length&&this._onColor.fire(j),!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,y.DEFAULT_CHARSET),!0}selectCharset(z){return z.length!==2?(this.selectDefaultCharset(),!0):(z[0]==="/"||this._charsetService.setgCharset(B[z[0]],y.CHARSETS[z[1]]||y.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=S.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=S.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 b.CellData;z.content=4194373,z.fg=this._curAttrData.fg,z.bg=this._curAttrData.bg,this._setCursor(0,0);for(let j=0;j<this._bufferService.rows;++j){const N=this._activeBuffer.ybase+this._activeBuffer.y+j,$=this._activeBuffer.lines.get(N);$&&($.fill(z),$.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(z,j){const N=this._bufferService.buffer,$=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${N.scrollTop+1};${N.scrollBottom+1}r`:z==="m"?"P1$r0m":z===" q"?`P1$r${{block:2,underline:4,bar:6}[$.cursorStyle]-($.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(z,j){this._dirtyRowTracker.markRangeDirty(z,j)}}o.InputHandler=Y;let G=class{constructor(Z){this._bufferService=Z,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Z){Z<this.start?this.start=Z:Z>this.end&&(this.end=Z)}markRangeDirty(Z,z){Z>z&&(K=Z,Z=z,z=K),Z<this.start&&(this.start=Z),z>this.end&&(this.end=z)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function W(Z){return 0<=Z&&Z<256}G=h([g(0,L.IBufferService)],G)},844:(f,o)=>{function c(h){for(const g of h)g.dispose();h.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.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 g=this._disposables.indexOf(h);g!==-1&&this._disposables.splice(g,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var g;this._isDisposed||h===this._value||((g=this._value)==null||g.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}},o.toDisposable=function(h){return{dispose:h}},o.disposeArray=c,o.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(g,u,y){this._data[g]||(this._data[g]={}),this._data[g][u]=y}get(g,u){return this._data[g]?this._data[g][u]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(h,g,u,y,w){this._data.get(h,g)||this._data.set(h,g,new c),this._data.get(h,g).set(u,y,w)}get(h,g,u,y){var w;return(w=this._data.get(h,g))==null?void 0:w.get(u,y)}clear(){this._data.clear()}}},6114:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,h=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const g=c.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),o.isIpad=h==="iPad",o.isIphone=h==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),o.isLinux=h.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.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 g=this._getKey(h);if(g===void 0||(c=this._search(g),c===-1)||this._getKey(this._array[c])!==g)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])===g);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,g){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do g(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===h)}values(){return[...this._array].values()}_search(h){let g=0,u=this._array.length-1;for(;u>=g;){let y=g+u>>1;const w=this._getKey(this._array[y]);if(w>h)u=y-1;else{if(!(w<h)){for(;y>0&&this._getKey(this._array[y-1])===h;)y--;return y}g=y+1}}return g}}},7226:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const h=c(6114);class g{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 T=0,E=0,S=w.timeRemaining(),v=0;for(;this._i<this._tasks.length;){if(T=Date.now(),this._tasks[this._i]()||this._i++,T=Math.max(1,Date.now()-T),E=Math.max(T,E),v=w.timeRemaining(),1.5*E>v)return S-T<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(S-T))}ms`),void this._start();S=v}this.clear()}}class u extends g{_requestCallback(w){return setTimeout((()=>w(this._createDeadline(16))))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const T=Date.now()+w;return{timeRemaining:()=>Math.max(0,T-Date.now())}}}o.PriorityTaskQueue=u,o.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(y){return requestIdleCallback(y)}_cancelCallback(y){cancelIdleCallback(y)}}:u,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(y){this._queue.clear(),this._queue.enqueue(y)}flush(){this._queue.flush()}}},9282:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const h=c(643);o.updateWindowsModeWrappedState=function(g){const u=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),y=u==null?void 0:u.get(g.cols-1),w=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);w&&y&&(w.isWrapped=y[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&y[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.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}}o.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,y=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=y}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=h},9092:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const h=c(6349),g=c(7226),u=c(3734),y=c(8437),w=c(4634),T=c(511),E=c(643),S=c(4863),v=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(_,b,A){this._hasScrollback=_,this._optionsService=b,this._bufferService=A,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=y.DEFAULT_ATTR_DATA.clone(),this.savedCharset=v.DEFAULT_CHARSET,this.markers=[],this._nullCell=T.CellData.fromCharData([0,E.NULL_CELL_CHAR,E.NULL_CELL_WIDTH,E.NULL_CELL_CODE]),this._whitespaceCell=T.CellData.fromCharData([0,E.WHITESPACE_CELL_CHAR,E.WHITESPACE_CELL_WIDTH,E.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.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(_){return _?(this._nullCell.fg=_.fg,this._nullCell.bg=_.bg,this._nullCell.extended=_.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(_){return _?(this._whitespaceCell.fg=_.fg,this._whitespaceCell.bg=_.bg,this._whitespaceCell.extended=_.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(_,b){return new y.BufferLine(this._bufferService.cols,this.getNullCell(_),b)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const _=this.ybase+this.y-this.ydisp;return _>=0&&_<this._rows}_getCorrectBufferLength(_){if(!this._hasScrollback)return _;const b=_+this._optionsService.rawOptions.scrollback;return b>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:b}fillViewportRows(_){if(this.lines.length===0){_===void 0&&(_=y.DEFAULT_ATTR_DATA);let b=this._rows;for(;b--;)this.lines.push(this.getBlankLine(_))}}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(_,b){const A=this.getNullCell(y.DEFAULT_ATTR_DATA);let L=0;const D=this._getCorrectBufferLength(b);if(D>this.lines.maxLength&&(this.lines.maxLength=D),this.lines.length>0){if(this._cols<_)for(let k=0;k<this.lines.length;k++)L+=+this.lines.get(k).resize(_,A);let R=0;if(this._rows<b)for(let k=this._rows;k<b;k++)this.lines.length<b+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new y.BufferLine(_,A)):this.ybase>0&&this.lines.length<=this.ybase+this.y+R+1?(this.ybase--,R++,this.ydisp>0&&this.ydisp--):this.lines.push(new y.BufferLine(_,A)));else for(let k=this._rows;k>b;k--)this.lines.length>b+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(D<this.lines.maxLength){const k=this.lines.length-D;k>0&&(this.lines.trimStart(k),this.ybase=Math.max(this.ybase-k,0),this.ydisp=Math.max(this.ydisp-k,0),this.savedY=Math.max(this.savedY-k,0)),this.lines.maxLength=D}this.x=Math.min(this.x,_-1),this.y=Math.min(this.y,b-1),R&&(this.y+=R),this.savedX=Math.min(this.savedX,_-1),this.scrollTop=0}if(this.scrollBottom=b-1,this._isReflowEnabled&&(this._reflow(_,b),this._cols>_))for(let R=0;R<this.lines.length;R++)L+=+this.lines.get(R).resize(_,A);this._cols=_,this._rows=b,this._memoryCleanupQueue.clear(),L>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let _=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,_=!1);let b=0;for(;this._memoryCleanupPosition<this.lines.length;)if(b+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),b>100)return!0;return _}get _isReflowEnabled(){const _=this._optionsService.rawOptions.windowsPty;return _&&_.buildNumber?this._hasScrollback&&_.backend==="conpty"&&_.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(_,b){this._cols!==_&&(_>this._cols?this._reflowLarger(_,b):this._reflowSmaller(_,b))}_reflowLarger(_,b){const A=(0,w.reflowLargerGetLinesToRemove)(this.lines,this._cols,_,this.ybase+this.y,this.getNullCell(y.DEFAULT_ATTR_DATA));if(A.length>0){const L=(0,w.reflowLargerCreateNewLayout)(this.lines,A);(0,w.reflowLargerApplyNewLayout)(this.lines,L.layout),this._reflowLargerAdjustViewport(_,b,L.countRemoved)}}_reflowLargerAdjustViewport(_,b,A){const L=this.getNullCell(y.DEFAULT_ATTR_DATA);let D=A;for(;D-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<b&&this.lines.push(new y.BufferLine(_,L))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-A,0)}_reflowSmaller(_,b){const A=this.getNullCell(y.DEFAULT_ATTR_DATA),L=[];let D=0;for(let R=this.lines.length-1;R>=0;R--){let k=this.lines.get(R);if(!k||!k.isWrapped&&k.getTrimmedLength()<=_)continue;const M=[k];for(;k.isWrapped&&R>0;)k=this.lines.get(--R),M.unshift(k);const B=this.ybase+this.y;if(B>=R&&B<R+M.length)continue;const H=M[M.length-1].getTrimmedLength(),U=(0,w.reflowSmallerGetNewLineLengths)(M,this._cols,_),P=U.length-M.length;let K;K=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 Y=[];for(let N=0;N<P;N++){const $=this.getBlankLine(y.DEFAULT_ATTR_DATA,!0);Y.push($)}Y.length>0&&(L.push({start:R+M.length+D,newLines:Y}),D+=Y.length),M.push(...Y);let G=U.length-1,W=U[G];W===0&&(G--,W=U[G]);let Z=M.length-P-1,z=H;for(;Z>=0;){const N=Math.min(z,W);if(M[G]===void 0)break;if(M[G].copyCellsFrom(M[Z],z-N,W-N,N,!0),W-=N,W===0&&(G--,W=U[G]),z-=N,z===0){Z--;const $=Math.max(Z,0);z=(0,w.getWrappedLineTrimmedLength)(M,$,this._cols)}}for(let N=0;N<M.length;N++)U[N]<_&&M[N].setCell(U[N],A);let j=P-K;for(;j-- >0;)this.ybase===0?this.y<b-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+D)-b&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+P,this.ybase+b-1)}if(L.length>0){const R=[],k=[];for(let G=0;G<this.lines.length;G++)k.push(this.lines.get(G));const M=this.lines.length;let B=M-1,H=0,U=L[H];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+D);let P=0;for(let G=Math.min(this.lines.maxLength-1,M+D-1);G>=0;G--)if(U&&U.start>B+P){for(let W=U.newLines.length-1;W>=0;W--)this.lines.set(G--,U.newLines[W]);G++,R.push({index:B+1,amount:U.newLines.length}),P+=U.newLines.length,U=L[++H]}else this.lines.set(G,k[B--]);let K=0;for(let G=R.length-1;G>=0;G--)R[G].index+=K,this.lines.onInsertEmitter.fire(R[G]),K+=R[G].amount;const Y=Math.max(0,M+D-this.lines.maxLength);Y>0&&this.lines.onTrimEmitter.fire(Y)}}translateBufferLineToString(_,b,A=0,L){const D=this.lines.get(_);return D?D.translateToString(b,A,L):""}getWrappedRangeForLine(_){let b=_,A=_;for(;b>0&&this.lines.get(b).isWrapped;)b--;for(;A+1<this.lines.length&&this.lines.get(A+1).isWrapped;)A++;return{first:b,last:A}}setupTabStops(_){for(_!=null?this.tabs[_]||(_=this.prevStop(_)):(this.tabs={},_=0);_<this._cols;_+=this._optionsService.rawOptions.tabStopWidth)this.tabs[_]=!0}prevStop(_){for(_==null&&(_=this.x);!this.tabs[--_]&&_>0;);return _>=this._cols?this._cols-1:_<0?0:_}nextStop(_){for(_==null&&(_=this.x);!this.tabs[++_]&&_<this._cols;);return _>=this._cols?this._cols-1:_<0?0:_}clearMarkers(_){this._isClearing=!0;for(let b=0;b<this.markers.length;b++)this.markers[b].line===_&&(this.markers[b].dispose(),this.markers.splice(b--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let _=0;_<this.markers.length;_++)this.markers[_].dispose(),this.markers.splice(_--,1);this._isClearing=!1}addMarker(_){const b=new S.Marker(_);return this.markers.push(b),b.register(this.lines.onTrim((A=>{b.line-=A,b.line<0&&b.dispose()}))),b.register(this.lines.onInsert((A=>{b.line>=A.index&&(b.line+=A.amount)}))),b.register(this.lines.onDelete((A=>{b.line>=A.index&&b.line<A.index+A.amount&&b.dispose(),b.line>A.index&&(b.line-=A.amount)}))),b.register(b.onDispose((()=>this._removeMarker(b)))),b}_removeMarker(_){this._isClearing||this.markers.splice(this.markers.indexOf(_),1)}}},8437:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const h=c(3734),g=c(511),u=c(643),y=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let w=0;class T{constructor(S,v,_=!1){this.isWrapped=_,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*S);const b=v||g.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let A=0;A<S;++A)this.setCell(A,b);this.length=S}get(S){const v=this._data[3*S+0],_=2097151&v;return[this._data[3*S+1],2097152&v?this._combined[S]:_?(0,y.stringFromCodePoint)(_):"",v>>22,2097152&v?this._combined[S].charCodeAt(this._combined[S].length-1):_]}set(S,v){this._data[3*S+1]=v[u.CHAR_DATA_ATTR_INDEX],v[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[S]=v[1],this._data[3*S+0]=2097152|S|v[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*S+0]=v[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(S){return this._data[3*S+0]>>22}hasWidth(S){return 12582912&this._data[3*S+0]}getFg(S){return this._data[3*S+1]}getBg(S){return this._data[3*S+2]}hasContent(S){return 4194303&this._data[3*S+0]}getCodePoint(S){const v=this._data[3*S+0];return 2097152&v?this._combined[S].charCodeAt(this._combined[S].length-1):2097151&v}isCombined(S){return 2097152&this._data[3*S+0]}getString(S){const v=this._data[3*S+0];return 2097152&v?this._combined[S]:2097151&v?(0,y.stringFromCodePoint)(2097151&v):""}isProtected(S){return 536870912&this._data[3*S+2]}loadCell(S,v){return w=3*S,v.content=this._data[w+0],v.fg=this._data[w+1],v.bg=this._data[w+2],2097152&v.content&&(v.combinedData=this._combined[S]),268435456&v.bg&&(v.extended=this._extendedAttrs[S]),v}setCell(S,v){2097152&v.content&&(this._combined[S]=v.combinedData),268435456&v.bg&&(this._extendedAttrs[S]=v.extended),this._data[3*S+0]=v.content,this._data[3*S+1]=v.fg,this._data[3*S+2]=v.bg}setCellFromCodepoint(S,v,_,b){268435456&b.bg&&(this._extendedAttrs[S]=b.extended),this._data[3*S+0]=v|_<<22,this._data[3*S+1]=b.fg,this._data[3*S+2]=b.bg}addCodepointToCell(S,v,_){let b=this._data[3*S+0];2097152&b?this._combined[S]+=(0,y.stringFromCodePoint)(v):2097151&b?(this._combined[S]=(0,y.stringFromCodePoint)(2097151&b)+(0,y.stringFromCodePoint)(v),b&=-2097152,b|=2097152):b=v|4194304,_&&(b&=-12582913,b|=_<<22),this._data[3*S+0]=b}insertCells(S,v,_){if((S%=this.length)&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S-1,0,1,_),v<this.length-S){const b=new g.CellData;for(let A=this.length-S-v-1;A>=0;--A)this.setCell(S+v+A,this.loadCell(S+A,b));for(let A=0;A<v;++A)this.setCell(S+A,_)}else for(let b=S;b<this.length;++b)this.setCell(b,_);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,_)}deleteCells(S,v,_){if(S%=this.length,v<this.length-S){const b=new g.CellData;for(let A=0;A<this.length-S-v;++A)this.setCell(S+A,this.loadCell(S+v+A,b));for(let A=this.length-v;A<this.length;++A)this.setCell(A,_)}else for(let b=S;b<this.length;++b)this.setCell(b,_);S&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S-1,0,1,_),this.getWidth(S)!==0||this.hasContent(S)||this.setCellFromCodepoint(S,0,1,_)}replaceCells(S,v,_,b=!1){if(b)for(S&&this.getWidth(S-1)===2&&!this.isProtected(S-1)&&this.setCellFromCodepoint(S-1,0,1,_),v<this.length&&this.getWidth(v-1)===2&&!this.isProtected(v)&&this.setCellFromCodepoint(v,0,1,_);S<v&&S<this.length;)this.isProtected(S)||this.setCell(S,_),S++;else for(S&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S-1,0,1,_),v<this.length&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v,0,1,_);S<v&&S<this.length;)this.setCell(S++,_)}resize(S,v){if(S===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const _=3*S;if(S>this.length){if(this._data.buffer.byteLength>=4*_)this._data=new Uint32Array(this._data.buffer,0,_);else{const b=new Uint32Array(_);b.set(this._data),this._data=b}for(let b=this.length;b<S;++b)this.setCell(b,v)}else{this._data=this._data.subarray(0,_);const b=Object.keys(this._combined);for(let L=0;L<b.length;L++){const D=parseInt(b[L],10);D>=S&&delete this._combined[D]}const A=Object.keys(this._extendedAttrs);for(let L=0;L<A.length;L++){const D=parseInt(A[L],10);D>=S&&delete this._extendedAttrs[D]}}return this.length=S,4*_*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const S=new Uint32Array(this._data.length);return S.set(this._data),this._data=S,1}return 0}fill(S,v=!1){if(v)for(let _=0;_<this.length;++_)this.isProtected(_)||this.setCell(_,S);else{this._combined={},this._extendedAttrs={};for(let _=0;_<this.length;++_)this.setCell(_,S)}}copyFrom(S){this.length!==S.length?this._data=new Uint32Array(S._data):this._data.set(S._data),this.length=S.length,this._combined={};for(const v in S._combined)this._combined[v]=S._combined[v];this._extendedAttrs={};for(const v in S._extendedAttrs)this._extendedAttrs[v]=S._extendedAttrs[v];this.isWrapped=S.isWrapped}clone(){const S=new T(0);S._data=new Uint32Array(this._data),S.length=this.length;for(const v in this._combined)S._combined[v]=this._combined[v];for(const v in this._extendedAttrs)S._extendedAttrs[v]=this._extendedAttrs[v];return S.isWrapped=this.isWrapped,S}getTrimmedLength(){for(let S=this.length-1;S>=0;--S)if(4194303&this._data[3*S+0])return S+(this._data[3*S+0]>>22);return 0}getNoBgTrimmedLength(){for(let S=this.length-1;S>=0;--S)if(4194303&this._data[3*S+0]||50331648&this._data[3*S+2])return S+(this._data[3*S+0]>>22);return 0}copyCellsFrom(S,v,_,b,A){const L=S._data;if(A)for(let R=b-1;R>=0;R--){for(let k=0;k<3;k++)this._data[3*(_+R)+k]=L[3*(v+R)+k];268435456&L[3*(v+R)+2]&&(this._extendedAttrs[_+R]=S._extendedAttrs[v+R])}else for(let R=0;R<b;R++){for(let k=0;k<3;k++)this._data[3*(_+R)+k]=L[3*(v+R)+k];268435456&L[3*(v+R)+2]&&(this._extendedAttrs[_+R]=S._extendedAttrs[v+R])}const D=Object.keys(S._combined);for(let R=0;R<D.length;R++){const k=parseInt(D[R],10);k>=v&&(this._combined[k-v+_]=S._combined[k])}}translateToString(S,v,_,b){v=v??0,_=_??this.length,S&&(_=Math.min(_,this.getTrimmedLength())),b&&(b.length=0);let A="";for(;v<_;){const L=this._data[3*v+0],D=2097151&L,R=2097152&L?this._combined[v]:D?(0,y.stringFromCodePoint)(D):u.WHITESPACE_CELL_CHAR;if(A+=R,b)for(let k=0;k<R.length;++k)b.push(v);v+=L>>22||1}return b&&b.push(v),A}}o.BufferLine=T},4841:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.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,o)=>{function c(h,g,u){if(g===h.length-1)return h[g].getTrimmedLength();const y=!h[g].hasContent(u-1)&&h[g].getWidth(u-1)===1,w=h[g+1].getWidth(0)===2;return y&&w?u-1:u}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(h,g,u,y,w){const T=[];for(let E=0;E<h.length-1;E++){let S=E,v=h.get(++S);if(!v.isWrapped)continue;const _=[h.get(E)];for(;S<h.length&&v.isWrapped;)_.push(v),v=h.get(++S);if(y>=E&&y<S){E+=_.length-1;continue}let b=0,A=c(_,b,g),L=1,D=0;for(;L<_.length;){const k=c(_,L,g),M=k-D,B=u-A,H=Math.min(M,B);_[b].copyCellsFrom(_[L],D,A,H,!1),A+=H,A===u&&(b++,A=0),D+=H,D===k&&(L++,D=0),A===0&&b!==0&&_[b-1].getWidth(u-1)===2&&(_[b].copyCellsFrom(_[b-1],u-1,A++,1,!1),_[b-1].setCell(u-1,w))}_[b].replaceCells(A,u,w);let R=0;for(let k=_.length-1;k>0&&(k>b||_[k].getTrimmedLength()===0);k--)R++;R>0&&(T.push(E+_.length-R),T.push(R)),E+=_.length-1}return T},o.reflowLargerCreateNewLayout=function(h,g){const u=[];let y=0,w=g[y],T=0;for(let E=0;E<h.length;E++)if(w===E){const S=g[++y];h.onDeleteEmitter.fire({index:E-T,amount:S}),E+=S-1,T+=S,w=g[++y]}else u.push(E);return{layout:u,countRemoved:T}},o.reflowLargerApplyNewLayout=function(h,g){const u=[];for(let y=0;y<g.length;y++)u.push(h.get(g[y]));for(let y=0;y<u.length;y++)h.set(y,u[y]);h.length=g.length},o.reflowSmallerGetNewLineLengths=function(h,g,u){const y=[],w=h.map(((v,_)=>c(h,_,g))).reduce(((v,_)=>v+_));let T=0,E=0,S=0;for(;S<w;){if(w-S<u){y.push(w-S);break}T+=u;const v=c(h,E,g);T>v&&(T-=v,E++);const _=h[E].getWidth(T-1)===2;_&&T--;const b=_?u-1:u;y.push(b),S+=b}return y},o.getWrappedLineTrimmedLength=c},5295:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const h=c(8460),g=c(844),u=c(9092);class y extends g.Disposable{constructor(T,E){super(),this._optionsService=T,this._bufferService=E,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(T){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(T),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(T,E){this._normal.resize(T,E),this._alt.resize(T,E),this.setupTabStops(T)}setupTabStops(T){this._normal.setupTabStops(T),this._alt.setupTabStops(T)}}o.BufferSet=y},511:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const h=c(482),g=c(643),u=c(3734);class y extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(T){const E=new y;return E.setFromCharData(T),E}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(T){this.fg=T[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let E=!1;if(T[g.CHAR_DATA_CHAR_INDEX].length>2)E=!0;else if(T[g.CHAR_DATA_CHAR_INDEX].length===2){const S=T[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=S&&S<=56319){const v=T[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(S-55296)+v-56320+65536|T[g.CHAR_DATA_WIDTH_INDEX]<<22:E=!0}else E=!0}else this.content=T[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|T[g.CHAR_DATA_WIDTH_INDEX]<<22;E&&(this.combinedData=T[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|T[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=y},643:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const h=c(8460),g=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,g.disposeArray)(this._disposables),this._disposables.length=0)}register(w){return this._disposables.push(w),w}}o.Marker=u,u._nextId=1},7116:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.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:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(f,o)=>{var c,h,g;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.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||(o.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||(o.C1=h={})),(function(u){u.ST=`${c.ESC}\\`})(g||(o.C1_ESCAPED=g={}))},7399:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const h=c(2584),g={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:["'",'"']};o.evaluateKeyboardEvent=function(u,y,w,T){const E={type:0,cancel:!1,key:void 0},S=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?E.key=y?h.C0.ESC+"OA":h.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?E.key=y?h.C0.ESC+"OD":h.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?E.key=y?h.C0.ESC+"OC":h.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(E.key=y?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:E.key=u.ctrlKey?"\b":h.C0.DEL,u.altKey&&(E.key=h.C0.ESC+E.key);break;case 9:if(u.shiftKey){E.key=h.C0.ESC+"[Z";break}E.key=h.C0.HT,E.cancel=!0;break;case 13:E.key=u.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,E.cancel=!0;break;case 27:E.key=h.C0.ESC,u.altKey&&(E.key=h.C0.ESC+h.C0.ESC),E.cancel=!0;break;case 37:if(u.metaKey)break;S?(E.key=h.C0.ESC+"[1;"+(S+1)+"D",E.key===h.C0.ESC+"[1;3D"&&(E.key=h.C0.ESC+(w?"b":"[1;5D"))):E.key=y?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(u.metaKey)break;S?(E.key=h.C0.ESC+"[1;"+(S+1)+"C",E.key===h.C0.ESC+"[1;3C"&&(E.key=h.C0.ESC+(w?"f":"[1;5C"))):E.key=y?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(u.metaKey)break;S?(E.key=h.C0.ESC+"[1;"+(S+1)+"A",w||E.key!==h.C0.ESC+"[1;3A"||(E.key=h.C0.ESC+"[1;5A")):E.key=y?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(u.metaKey)break;S?(E.key=h.C0.ESC+"[1;"+(S+1)+"B",w||E.key!==h.C0.ESC+"[1;3B"||(E.key=h.C0.ESC+"[1;5B")):E.key=y?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(E.key=h.C0.ESC+"[2~");break;case 46:E.key=S?h.C0.ESC+"[3;"+(S+1)+"~":h.C0.ESC+"[3~";break;case 36:E.key=S?h.C0.ESC+"[1;"+(S+1)+"H":y?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:E.key=S?h.C0.ESC+"[1;"+(S+1)+"F":y?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:u.shiftKey?E.type=2:u.ctrlKey?E.key=h.C0.ESC+"[5;"+(S+1)+"~":E.key=h.C0.ESC+"[5~";break;case 34:u.shiftKey?E.type=3:u.ctrlKey?E.key=h.C0.ESC+"[6;"+(S+1)+"~":E.key=h.C0.ESC+"[6~";break;case 112:E.key=S?h.C0.ESC+"[1;"+(S+1)+"P":h.C0.ESC+"OP";break;case 113:E.key=S?h.C0.ESC+"[1;"+(S+1)+"Q":h.C0.ESC+"OQ";break;case 114:E.key=S?h.C0.ESC+"[1;"+(S+1)+"R":h.C0.ESC+"OR";break;case 115:E.key=S?h.C0.ESC+"[1;"+(S+1)+"S":h.C0.ESC+"OS";break;case 116:E.key=S?h.C0.ESC+"[15;"+(S+1)+"~":h.C0.ESC+"[15~";break;case 117:E.key=S?h.C0.ESC+"[17;"+(S+1)+"~":h.C0.ESC+"[17~";break;case 118:E.key=S?h.C0.ESC+"[18;"+(S+1)+"~":h.C0.ESC+"[18~";break;case 119:E.key=S?h.C0.ESC+"[19;"+(S+1)+"~":h.C0.ESC+"[19~";break;case 120:E.key=S?h.C0.ESC+"[20;"+(S+1)+"~":h.C0.ESC+"[20~";break;case 121:E.key=S?h.C0.ESC+"[21;"+(S+1)+"~":h.C0.ESC+"[21~";break;case 122:E.key=S?h.C0.ESC+"[23;"+(S+1)+"~":h.C0.ESC+"[23~";break;case 123:E.key=S?h.C0.ESC+"[24;"+(S+1)+"~":h.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(w&&!T||!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?E.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(E.key=h.C0.US),u.key==="@"&&(E.key=h.C0.NUL)):u.keyCode===65&&(E.type=1);else{const v=g[u.keyCode],_=v==null?void 0:v[u.shiftKey?1:0];if(_)E.key=h.C0.ESC+_;else if(u.keyCode>=65&&u.keyCode<=90){const b=u.ctrlKey?u.keyCode-64:u.keyCode+32;let A=String.fromCharCode(b);u.shiftKey&&(A=A.toUpperCase()),E.key=h.C0.ESC+A}else if(u.keyCode===32)E.key=h.C0.ESC+(u.ctrlKey?h.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let b=u.code.slice(3,4);u.shiftKey||(b=b.toLowerCase()),E.key=h.C0.ESC+b,E.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?E.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?E.key=h.C0.NUL:u.keyCode>=51&&u.keyCode<=55?E.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?E.key=h.C0.DEL:u.keyCode===219?E.key=h.C0.ESC:u.keyCode===220?E.key=h.C0.FS:u.keyCode===221&&(E.key=h.C0.GS)}return E}},482:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,h=0,g=c.length){let u="";for(let y=h;y<g;++y){let w=c[y];w>65535?(w-=65536,u+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):u+=String.fromCharCode(w)}return u},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,h){const g=c.length;if(!g)return 0;let u=0,y=0;if(this._interim){const w=c.charCodeAt(y++);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=y;w<g;++w){const T=c.charCodeAt(w);if(55296<=T&&T<=56319){if(++w>=g)return this._interim=T,u;const E=c.charCodeAt(w);56320<=E&&E<=57343?h[u++]=1024*(T-55296)+E-56320+65536:(h[u++]=T,h[u++]=E)}else T!==65279&&(h[u++]=T)}return u}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,h){const g=c.length;if(!g)return 0;let u,y,w,T,E=0,S=0,v=0;if(this.interim[0]){let A=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let D,R=0;for(;(D=63&this.interim[++R])&&R<4;)L<<=6,L|=D;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=k-R;for(;v<M;){if(v>=g)return 0;if(D=c[v++],(192&D)!=128){v--,A=!0;break}this.interim[R++]=D,L<<=6,L|=63&D}A||(k===2?L<128?v--:h[E++]=L:k===3?L<2048||L>=55296&&L<=57343||L===65279||(h[E++]=L):L<65536||L>1114111||(h[E++]=L)),this.interim.fill(0)}const _=g-4;let b=v;for(;b<g;){for(;!(!(b<_)||128&(u=c[b])||128&(y=c[b+1])||128&(w=c[b+2])||128&(T=c[b+3]));)h[E++]=u,h[E++]=y,h[E++]=w,h[E++]=T,b+=4;if(u=c[b++],u<128)h[E++]=u;else if((224&u)==192){if(b>=g)return this.interim[0]=u,E;if(y=c[b++],(192&y)!=128){b--;continue}if(S=(31&u)<<6|63&y,S<128){b--;continue}h[E++]=S}else if((240&u)==224){if(b>=g)return this.interim[0]=u,E;if(y=c[b++],(192&y)!=128){b--;continue}if(b>=g)return this.interim[0]=u,this.interim[1]=y,E;if(w=c[b++],(192&w)!=128){b--;continue}if(S=(15&u)<<12|(63&y)<<6|63&w,S<2048||S>=55296&&S<=57343||S===65279)continue;h[E++]=S}else if((248&u)==240){if(b>=g)return this.interim[0]=u,E;if(y=c[b++],(192&y)!=128){b--;continue}if(b>=g)return this.interim[0]=u,this.interim[1]=y,E;if(w=c[b++],(192&w)!=128){b--;continue}if(b>=g)return this.interim[0]=u,this.interim[1]=y,this.interim[2]=w,E;if(T=c[b++],(192&T)!=128){b--;continue}if(S=(7&u)<<18|(63&y)<<12|(63&w)<<6|63&T,S<65536||S>1114111)continue;h[E++]=S}}return E}}},225:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const h=c(1480),g=[[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 y;o.UnicodeV6=class{constructor(){if(this.version="6",!y){y=new Uint8Array(65536),y.fill(1),y[0]=0,y.fill(0,1,32),y.fill(0,127,160),y.fill(2,4352,4448),y[9001]=2,y[9002]=2,y.fill(2,11904,42192),y[12351]=1,y.fill(2,44032,55204),y.fill(2,63744,64256),y.fill(2,65040,65050),y.fill(2,65072,65136),y.fill(2,65280,65377),y.fill(2,65504,65511);for(let w=0;w<g.length;++w)y.fill(0,g[w][0],g[w][1]+1)}}wcwidth(w){return w<32?0:w<127?1:w<65536?y[w]:(function(T,E){let S,v=0,_=E.length-1;if(T<E[0][0]||T>E[_][1])return!1;for(;_>=v;)if(S=v+_>>1,T>E[S][1])v=S+1;else{if(!(T<E[S][0]))return!0;_=S-1}return!1})(w,u)?0:w>=131072&&w<=196605||w>=196608&&w<=262141?2:1}charProperties(w,T){let E=this.wcwidth(w),S=E===0&&T!==0;if(S){const v=h.UnicodeService.extractWidth(T);v===0?S=!1:v>E&&(E=v)}return h.UnicodeService.createPropertyValue(0,E,S)}}},5981:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const h=c(8460),g=c(844);class u extends g.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,T){if(T!==void 0&&this._syncCalls>T)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 E;for(this._isSyncWriting=!0;E=this._writeBuffer.shift();){this._action(E);const S=this._callbacks.shift();S&&S()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(w,T){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(T),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(T)}_innerWrite(w=0,T=!0){const E=w||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const S=this._writeBuffer[this._bufferOffset],v=this._action(S,T);if(v){const b=A=>Date.now()-E>=12?setTimeout((()=>this._innerWrite(0,A))):this._innerWrite(E,A);return void v.catch((A=>(queueMicrotask((()=>{throw A})),Promise.resolve(!1)))).then(b)}const _=this._callbacks[this._bufferOffset];if(_&&_(),this._bufferOffset++,this._pendingData-=S.length,Date.now()-E>=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()}}o.WriteBuffer=u},5941:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.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 g(u,y){const w=u.toString(16),T=w.length<2?"0"+w:w;switch(y){case 4:return w[0];case 8:return T;case 12:return(T+T).slice(0,3);default:return T+T}}o.parseColor=function(u){if(!u)return;let y=u.toLowerCase();if(y.indexOf("rgb:")===0){y=y.slice(4);const w=c.exec(y);if(w){const T=w[1]?15:w[4]?255:w[7]?4095:65535;return[Math.round(parseInt(w[1]||w[4]||w[7]||w[10],16)/T*255),Math.round(parseInt(w[2]||w[5]||w[8]||w[11],16)/T*255),Math.round(parseInt(w[3]||w[6]||w[9]||w[12],16)/T*255)]}}else if(y.indexOf("#")===0&&(y=y.slice(1),h.exec(y)&&[3,6,9,12].includes(y.length))){const w=y.length/3,T=[0,0,0];for(let E=0;E<3;++E){const S=parseInt(y.slice(w*E,w*E+w),16);T[E]=w===1?S<<4:w===2?S:w===3?S>>4:S>>8}return T}},o.toRgbString=function(u,y=16){const[w,T,E]=u;return`rgb:${g(w,y)}/${g(T,y)}/${g(E,y)}`}},5770:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const h=c(482),g=c(8742),u=c(5770),y=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=y,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=y}registerHandler(T,E){this._handlers[T]===void 0&&(this._handlers[T]=[]);const S=this._handlers[T];return S.push(E),{dispose:()=>{const v=S.indexOf(E);v!==-1&&S.splice(v,1)}}}clearHandler(T){this._handlers[T]&&delete this._handlers[T]}setHandlerFallback(T){this._handlerFb=T}reset(){if(this._active.length)for(let T=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;T>=0;--T)this._active[T].unhook(!1);this._stack.paused=!1,this._active=y,this._ident=0}hook(T,E){if(this.reset(),this._ident=T,this._active=this._handlers[T]||y,this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].hook(E);else this._handlerFb(this._ident,"HOOK",E)}put(T,E,S){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(T,E,S);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(T,E,S))}unhook(T,E=!0){if(this._active.length){let S=!1,v=this._active.length-1,_=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,S=E,_=this._stack.fallThrough,this._stack.paused=!1),!_&&S===!1){for(;v>=0&&(S=this._active[v].unhook(T),S!==!0);v--)if(S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,S;v--}for(;v>=0;v--)if(S=this._active[v].unhook(!1),S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,S}else this._handlerFb(this._ident,"UNHOOK",T);this._active=y,this._ident=0}};const w=new g.Params;w.addParam(0),o.DcsHandler=class{constructor(T){this._handler=T,this._data="",this._params=w,this._hitLimit=!1}hook(T){this._params=T.length>1||T.params[0]?T.clone():w,this._data="",this._hitLimit=!1}put(T,E,S){this._hitLimit||(this._data+=(0,h.utf32ToString)(T,E,S),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(T){let E=!1;if(this._hitLimit)E=!1;else if(T&&(E=this._handler(this._data,this._params),E instanceof Promise))return E.then((S=>(this._params=w,this._data="",this._hitLimit=!1,S)));return this._params=w,this._data="",this._hitLimit=!1,E}}},2015:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const h=c(844),g=c(8742),u=c(6242),y=c(6351);class w{constructor(v){this.table=new Uint8Array(v)}setDefault(v,_){this.table.fill(v<<4|_)}add(v,_,b,A){this.table[_<<8|v]=b<<4|A}addMany(v,_,b,A){for(let L=0;L<v.length;L++)this.table[_<<8|v[L]]=b<<4|A}}o.TransitionTable=w;const T=160;o.VT500_TRANSITION_TABLE=(function(){const S=new w(4095),v=Array.apply(null,Array(256)).map(((R,k)=>k)),_=(R,k)=>v.slice(R,k),b=_(32,127),A=_(0,24);A.push(25),A.push.apply(A,_(28,32));const L=_(0,14);let D;for(D in S.setDefault(1,0),S.addMany(b,0,2,0),L)S.addMany([24,26,153,154],D,3,0),S.addMany(_(128,144),D,3,0),S.addMany(_(144,152),D,3,0),S.add(156,D,0,0),S.add(27,D,11,1),S.add(157,D,4,8),S.addMany([152,158,159],D,0,7),S.add(155,D,11,3),S.add(144,D,11,9);return S.addMany(A,0,3,0),S.addMany(A,1,3,1),S.add(127,1,0,1),S.addMany(A,8,0,8),S.addMany(A,3,3,3),S.add(127,3,0,3),S.addMany(A,4,3,4),S.add(127,4,0,4),S.addMany(A,6,3,6),S.addMany(A,5,3,5),S.add(127,5,0,5),S.addMany(A,2,3,2),S.add(127,2,0,2),S.add(93,1,4,8),S.addMany(b,8,5,8),S.add(127,8,5,8),S.addMany([156,27,24,26,7],8,6,0),S.addMany(_(28,32),8,0,8),S.addMany([88,94,95],1,0,7),S.addMany(b,7,0,7),S.addMany(A,7,0,7),S.add(156,7,0,0),S.add(127,7,0,7),S.add(91,1,11,3),S.addMany(_(64,127),3,7,0),S.addMany(_(48,60),3,8,4),S.addMany([60,61,62,63],3,9,4),S.addMany(_(48,60),4,8,4),S.addMany(_(64,127),4,7,0),S.addMany([60,61,62,63],4,0,6),S.addMany(_(32,64),6,0,6),S.add(127,6,0,6),S.addMany(_(64,127),6,0,0),S.addMany(_(32,48),3,9,5),S.addMany(_(32,48),5,9,5),S.addMany(_(48,64),5,0,6),S.addMany(_(64,127),5,7,0),S.addMany(_(32,48),4,9,5),S.addMany(_(32,48),1,9,2),S.addMany(_(32,48),2,9,2),S.addMany(_(48,127),2,10,0),S.addMany(_(48,80),1,10,0),S.addMany(_(81,88),1,10,0),S.addMany([89,90,92],1,10,0),S.addMany(_(96,127),1,10,0),S.add(80,1,11,9),S.addMany(A,9,0,9),S.add(127,9,0,9),S.addMany(_(28,32),9,0,9),S.addMany(_(32,48),9,9,12),S.addMany(_(48,60),9,8,10),S.addMany([60,61,62,63],9,9,10),S.addMany(A,11,0,11),S.addMany(_(32,128),11,0,11),S.addMany(_(28,32),11,0,11),S.addMany(A,10,0,10),S.add(127,10,0,10),S.addMany(_(28,32),10,0,10),S.addMany(_(48,60),10,8,10),S.addMany([60,61,62,63],10,0,11),S.addMany(_(32,48),10,9,12),S.addMany(A,12,0,12),S.add(127,12,0,12),S.addMany(_(28,32),12,0,12),S.addMany(_(32,48),12,9,12),S.addMany(_(48,64),12,0,11),S.addMany(_(64,127),12,12,13),S.addMany(_(64,127),10,12,13),S.addMany(_(64,127),9,12,13),S.addMany(A,13,13,13),S.addMany(b,13,13,13),S.add(127,13,0,13),S.addMany([27,156,24,26],13,14,0),S.add(T,0,2,0),S.add(T,8,5,8),S.add(T,6,0,6),S.add(T,11,0,11),S.add(T,13,13,13),S})();class E extends h.Disposable{constructor(v=o.VT500_TRANSITION_TABLE){super(),this._transitions=v,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(_,b,A)=>{},this._executeHandlerFb=_=>{},this._csiHandlerFb=(_,b)=>{},this._escHandlerFb=_=>{},this._errorHandlerFb=_=>_,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 y.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(v,_=[64,126]){let b=0;if(v.prefix){if(v.prefix.length>1)throw new Error("only one byte as prefix supported");if(b=v.prefix.charCodeAt(0),b&&60>b||b>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(v.intermediates){if(v.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let L=0;L<v.intermediates.length;++L){const D=v.intermediates.charCodeAt(L);if(32>D||D>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");b<<=8,b|=D}}if(v.final.length!==1)throw new Error("final must be a single byte");const A=v.final.charCodeAt(0);if(_[0]>A||A>_[1])throw new Error(`final must be in range ${_[0]} .. ${_[1]}`);return b<<=8,b|=A,b}identToString(v){const _=[];for(;v;)_.push(String.fromCharCode(255&v)),v>>=8;return _.reverse().join("")}setPrintHandler(v){this._printHandler=v}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(v,_){const b=this._identifier(v,[48,126]);this._escHandlers[b]===void 0&&(this._escHandlers[b]=[]);const A=this._escHandlers[b];return A.push(_),{dispose:()=>{const L=A.indexOf(_);L!==-1&&A.splice(L,1)}}}clearEscHandler(v){this._escHandlers[this._identifier(v,[48,126])]&&delete this._escHandlers[this._identifier(v,[48,126])]}setEscHandlerFallback(v){this._escHandlerFb=v}setExecuteHandler(v,_){this._executeHandlers[v.charCodeAt(0)]=_}clearExecuteHandler(v){this._executeHandlers[v.charCodeAt(0)]&&delete this._executeHandlers[v.charCodeAt(0)]}setExecuteHandlerFallback(v){this._executeHandlerFb=v}registerCsiHandler(v,_){const b=this._identifier(v);this._csiHandlers[b]===void 0&&(this._csiHandlers[b]=[]);const A=this._csiHandlers[b];return A.push(_),{dispose:()=>{const L=A.indexOf(_);L!==-1&&A.splice(L,1)}}}clearCsiHandler(v){this._csiHandlers[this._identifier(v)]&&delete this._csiHandlers[this._identifier(v)]}setCsiHandlerFallback(v){this._csiHandlerFb=v}registerDcsHandler(v,_){return this._dcsParser.registerHandler(this._identifier(v),_)}clearDcsHandler(v){this._dcsParser.clearHandler(this._identifier(v))}setDcsHandlerFallback(v){this._dcsParser.setHandlerFallback(v)}registerOscHandler(v,_){return this._oscParser.registerHandler(v,_)}clearOscHandler(v){this._oscParser.clearHandler(v)}setOscHandlerFallback(v){this._oscParser.setHandlerFallback(v)}setErrorHandler(v){this._errorHandler=v}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(v,_,b,A,L){this._parseStack.state=v,this._parseStack.handlers=_,this._parseStack.handlerPos=b,this._parseStack.transition=A,this._parseStack.chunkPos=L}parse(v,_,b){let A,L=0,D=0,R=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,R=this._parseStack.chunkPos+1;else{if(b===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const k=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(b===!1&&M>-1){for(;M>=0&&(A=k[M](this._params),A!==!0);M--)if(A instanceof Promise)return this._parseStack.handlerPos=M,A}this._parseStack.handlers=[];break;case 4:if(b===!1&&M>-1){for(;M>=0&&(A=k[M](),A!==!0);M--)if(A instanceof Promise)return this._parseStack.handlerPos=M,A}this._parseStack.handlers=[];break;case 6:if(L=v[this._parseStack.chunkPos],A=this._dcsParser.unhook(L!==24&&L!==26,b),A)return A;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(L=v[this._parseStack.chunkPos],A=this._oscParser.end(L!==24&&L!==26,b),A)return A;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,R=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let k=R;k<_;++k){switch(L=v[k],D=this._transitions.table[this.currentState<<8|(L<160?L:T)],D>>4){case 2:for(let P=k+1;;++P){if(P>=_||(L=v[P])<32||L>126&&L<T){this._printHandler(v,k,P),k=P-1;break}if(++P>=_||(L=v[P])<32||L>126&&L<T){this._printHandler(v,k,P),k=P-1;break}if(++P>=_||(L=v[P])<32||L>126&&L<T){this._printHandler(v,k,P),k=P-1;break}if(++P>=_||(L=v[P])<32||L>126&&L<T){this._printHandler(v,k,P),k=P-1;break}}break;case 3:this._executeHandlers[L]?this._executeHandlers[L]():this._executeHandlerFb(L),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:k,code:L,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const M=this._csiHandlers[this._collect<<8|L];let B=M?M.length-1:-1;for(;B>=0&&(A=M[B](this._params),A!==!0);B--)if(A instanceof Promise)return this._preserveStack(3,M,B,D,k),A;B<0&&this._csiHandlerFb(this._collect<<8|L,this._params),this.precedingJoinState=0;break;case 8:do switch(L){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(L-48)}while(++k<_&&(L=v[k])>47&&L<60);k--;break;case 9:this._collect<<=8,this._collect|=L;break;case 10:const H=this._escHandlers[this._collect<<8|L];let U=H?H.length-1:-1;for(;U>=0&&(A=H[U](),A!==!0);U--)if(A instanceof Promise)return this._preserveStack(4,H,U,D,k),A;U<0&&this._escHandlerFb(this._collect<<8|L),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|L,this._params);break;case 13:for(let P=k+1;;++P)if(P>=_||(L=v[P])===24||L===26||L===27||L>127&&L<T){this._dcsParser.put(v,k,P),k=P-1;break}break;case 14:if(A=this._dcsParser.unhook(L!==24&&L!==26),A)return this._preserveStack(6,[],0,D,k),A;L===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=k+1;;P++)if(P>=_||(L=v[P])<32||L>127&&L<T){this._oscParser.put(v,k,P),k=P-1;break}break;case 6:if(A=this._oscParser.end(L!==24&&L!==26),A)return this._preserveStack(5,[],0,D,k),A;L===27&&(D|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&D}}}o.EscapeSequenceParser=E},6242:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const h=c(5770),g=c(482),u=[];o.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(y,w){this._handlers[y]===void 0&&(this._handlers[y]=[]);const T=this._handlers[y];return T.push(w),{dispose:()=>{const E=T.indexOf(w);E!==-1&&T.splice(E,1)}}}clearHandler(y){this._handlers[y]&&delete this._handlers[y]}setHandlerFallback(y){this._handlerFb=y}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let y=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;y>=0;--y)this._active[y].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 y=this._active.length-1;y>=0;y--)this._active[y].start();else this._handlerFb(this._id,"START")}_put(y,w,T){if(this._active.length)for(let E=this._active.length-1;E>=0;E--)this._active[E].put(y,w,T);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(y,w,T))}start(){this.reset(),this._state=1}put(y,w,T){if(this._state!==3){if(this._state===1)for(;w<T;){const E=y[w++];if(E===59){this._state=2,this._start();break}if(E<48||57<E)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+E-48}this._state===2&&T-w>0&&this._put(y,w,T)}}end(y,w=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let T=!1,E=this._active.length-1,S=!1;if(this._stack.paused&&(E=this._stack.loopPosition-1,T=w,S=this._stack.fallThrough,this._stack.paused=!1),!S&&T===!1){for(;E>=0&&(T=this._active[E].end(y),T!==!0);E--)if(T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!1,T;E--}for(;E>=0;E--)if(T=this._active[E].end(!1),T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!0,T}else this._handlerFb(this._id,"END",y);this._active=u,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(y){this._handler=y,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(y,w,T){this._hitLimit||(this._data+=(0,g.utf32ToString)(y,w,T),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(y){let w=!1;if(this._hitLimit)w=!1;else if(y&&(w=this._handler(this._data),w instanceof Promise))return w.then((T=>(this._data="",this._hitLimit=!1,T)));return this._data="",this._hitLimit=!1,w}}},8742:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class h{static fromArray(u){const y=new h;if(!u.length)return y;for(let w=Array.isArray(u[0])?1:0;w<u.length;++w){const T=u[w];if(Array.isArray(T))for(let E=0;E<T.length;++E)y.addSubParam(T[E]);else y.addParam(T)}return y}constructor(u=32,y=32){if(this.maxLength=u,this.maxSubParamsLength=y,y>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(y),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 y=0;y<this.length;++y){u.push(this.params[y]);const w=this._subParamsIdx[y]>>8,T=255&this._subParamsIdx[y];T-w>0&&u.push(Array.prototype.slice.call(this._subParams,w,T))}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 y=this._subParamsIdx[u]>>8,w=255&this._subParamsIdx[u];return w-y>0?this._subParams.subarray(y,w):null}getSubParamsAll(){const u={};for(let y=0;y<this.length;++y){const w=this._subParamsIdx[y]>>8,T=255&this._subParamsIdx[y];T-w>0&&(u[y]=this._subParams.slice(w,T))}return u}addDigit(u){let y;if(this._rejectDigits||!(y=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const w=this._digitIsSub?this._subParams:this.params,T=w[y-1];w[y-1]=~T?Math.min(10*T+u,c):u}}o.Params=h},5741:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.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 g={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(g),h.dispose=()=>this._wrappedAddonDispose(g),h.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let h=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===c){h=g;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,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const h=c(3785),g=c(511);o.BufferApiView=class{constructor(u,y){this._buffer=u,this.type=y}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 y=this._buffer.lines.get(u);if(y)return new h.BufferLineApiView(y)}getNullCell(){return new g.CellData}}},3785:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const h=c(511);o.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,u){if(!(g<0||g>=this._line.length))return u?(this._line.loadCell(g,u),u):this._line.loadCell(g,new h.CellData)}translateToString(g,u,y){return this._line.translateToString(g,u,y)}}},8285:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const h=c(8771),g=c(8460),u=c(844);class y extends u.Disposable{constructor(T){super(),this._core=T,this._onBufferChange=this.register(new g.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)}}o.BufferNamespaceApi=y},7975:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,h){return this._core.registerCsiHandler(c,(g=>h(g.toArray())))}addCsiHandler(c,h){return this.registerCsiHandler(c,h)}registerDcsHandler(c,h){return this._core.registerDcsHandler(c,((g,u)=>h(g,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,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.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,o,c){var h=this&&this.__decorate||function(S,v,_,b){var A,L=arguments.length,D=L<3?v:b===null?b=Object.getOwnPropertyDescriptor(v,_):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,v,_,b);else for(var R=S.length-1;R>=0;R--)(A=S[R])&&(D=(L<3?A(D):L>3?A(v,_,D):A(v,_))||D);return L>3&&D&&Object.defineProperty(v,_,D),D},g=this&&this.__param||function(S,v){return function(_,b){v(_,b,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const u=c(8460),y=c(844),w=c(5295),T=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let E=o.BufferService=class extends y.Disposable{get buffer(){return this.buffers.active}constructor(S){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(S.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(S.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new w.BufferSet(S,this))}resize(S,v){this.cols=S,this.rows=v,this.buffers.resize(S,v),this._onResize.fire({cols:S,rows:v})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(S,v=!1){const _=this.buffer;let b;b=this._cachedBlankLine,b&&b.length===this.cols&&b.getFg(0)===S.fg&&b.getBg(0)===S.bg||(b=_.getBlankLine(S,v),this._cachedBlankLine=b),b.isWrapped=v;const A=_.ybase+_.scrollTop,L=_.ybase+_.scrollBottom;if(_.scrollTop===0){const D=_.lines.isFull;L===_.lines.length-1?D?_.lines.recycle().copyFrom(b):_.lines.push(b.clone()):_.lines.splice(L+1,0,b.clone()),D?this.isUserScrolling&&(_.ydisp=Math.max(_.ydisp-1,0)):(_.ybase++,this.isUserScrolling||_.ydisp++)}else{const D=L-A+1;_.lines.shiftElements(A+1,D-1,-1),_.lines.set(L,b.clone())}this.isUserScrolling||(_.ydisp=_.ybase),this._onScroll.fire(_.ydisp)}scrollLines(S,v,_){const b=this.buffer;if(S<0){if(b.ydisp===0)return;this.isUserScrolling=!0}else S+b.ydisp>=b.ybase&&(this.isUserScrolling=!1);const A=b.ydisp;b.ydisp=Math.max(Math.min(b.ydisp+S,b.ybase),0),A!==b.ydisp&&(v||this._onScroll.fire(b.ydisp))}};o.BufferService=E=h([g(0,T.IOptionsService)],E)},7994:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.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,o,c){var h=this&&this.__decorate||function(b,A,L,D){var R,k=arguments.length,M=k<3?A:D===null?D=Object.getOwnPropertyDescriptor(A,L):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(b,A,L,D);else for(var B=b.length-1;B>=0;B--)(R=b[B])&&(M=(k<3?R(M):k>3?R(A,L,M):R(A,L))||M);return k>3&&M&&Object.defineProperty(A,L,M),M},g=this&&this.__param||function(b,A){return function(L,D){A(L,D,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const u=c(2585),y=c(8460),w=c(844),T={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:b=>b.button!==4&&b.action===1&&(b.ctrl=!1,b.alt=!1,b.shift=!1,!0)},VT200:{events:19,restrict:b=>b.action!==32},DRAG:{events:23,restrict:b=>b.action!==32||b.button!==3},ANY:{events:31,restrict:b=>!0}};function E(b,A){let L=(b.ctrl?16:0)|(b.shift?4:0)|(b.alt?8:0);return b.button===4?(L|=64,L|=b.action):(L|=3&b.button,4&b.button&&(L|=64),8&b.button&&(L|=128),b.action===32?L|=32:b.action!==0||A||(L|=3)),L}const S=String.fromCharCode,v={DEFAULT:b=>{const A=[E(b,!1)+32,b.col+32,b.row+32];return A[0]>255||A[1]>255||A[2]>255?"":`\x1B[M${S(A[0])}${S(A[1])}${S(A[2])}`},SGR:b=>{const A=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${E(b,!0)};${b.col};${b.row}${A}`},SGR_PIXELS:b=>{const A=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${E(b,!0)};${b.x};${b.y}${A}`}};let _=o.CoreMouseService=class extends w.Disposable{constructor(b,A){super(),this._bufferService=b,this._coreService=A,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new y.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const L of Object.keys(T))this.addProtocol(L,T[L]);for(const L of Object.keys(v))this.addEncoding(L,v[L]);this.reset()}addProtocol(b,A){this._protocols[b]=A}addEncoding(b,A){this._encodings[b]=A}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(b){if(!this._protocols[b])throw new Error(`unknown protocol "${b}"`);this._activeProtocol=b,this._onProtocolChange.fire(this._protocols[b].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(b){if(!this._encodings[b])throw new Error(`unknown encoding "${b}"`);this._activeEncoding=b}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(b){if(b.col<0||b.col>=this._bufferService.cols||b.row<0||b.row>=this._bufferService.rows||b.button===4&&b.action===32||b.button===3&&b.action!==32||b.button!==4&&(b.action===2||b.action===3)||(b.col++,b.row++,b.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,b,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(b))return!1;const A=this._encodings[this._activeEncoding](b);return A&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(A):this._coreService.triggerDataEvent(A,!0)),this._lastEvent=b,!0}explainEvents(b){return{down:!!(1&b),up:!!(2&b),drag:!!(4&b),move:!!(8&b),wheel:!!(16&b)}}_equalEvents(b,A,L){if(L){if(b.x!==A.x||b.y!==A.y)return!1}else if(b.col!==A.col||b.row!==A.row)return!1;return b.button===A.button&&b.action===A.action&&b.ctrl===A.ctrl&&b.alt===A.alt&&b.shift===A.shift}};o.CoreMouseService=_=h([g(0,u.IBufferService),g(1,u.ICoreService)],_)},6975:function(f,o,c){var h=this&&this.__decorate||function(_,b,A,L){var D,R=arguments.length,k=R<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,b,A,L);else for(var M=_.length-1;M>=0;M--)(D=_[M])&&(k=(R<3?D(k):R>3?D(b,A,k):D(b,A))||k);return R>3&&k&&Object.defineProperty(b,A,k),k},g=this&&this.__param||function(_,b){return function(A,L){b(A,L,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const u=c(1439),y=c(8460),w=c(844),T=c(2585),E=Object.freeze({insertMode:!1}),S=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let v=o.CoreService=class extends w.Disposable{constructor(_,b,A){super(),this._bufferService=_,this._logService=b,this._optionsService=A,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new y.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new y.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new y.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new y.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(E),this.decPrivateModes=(0,u.clone)(S)}reset(){this.modes=(0,u.clone)(E),this.decPrivateModes=(0,u.clone)(S)}triggerDataEvent(_,b=!1){if(this._optionsService.rawOptions.disableStdin)return;const A=this._bufferService.buffer;b&&this._optionsService.rawOptions.scrollOnUserInput&&A.ybase!==A.ydisp&&this._onRequestScrollToBottom.fire(),b&&this._onUserInput.fire(),this._logService.debug(`sending data "${_}"`,(()=>_.split("").map((L=>L.charCodeAt(0))))),this._onData.fire(_)}triggerBinaryEvent(_){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${_}"`,(()=>_.split("").map((b=>b.charCodeAt(0))))),this._onBinary.fire(_))}};o.CoreService=v=h([g(0,T.IBufferService),g(1,T.ILogService),g(2,T.IOptionsService)],v)},9074:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const h=c(8055),g=c(8460),u=c(844),y=c(6106);let w=0,T=0;class E extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new y.SortedList((_=>_==null?void 0:_.marker.line)),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)((()=>this.reset())))}registerDecoration(_){if(_.marker.isDisposed)return;const b=new S(_);if(b){const A=b.marker.onDispose((()=>b.dispose()));b.onDispose((()=>{b&&(this._decorations.delete(b)&&this._onDecorationRemoved.fire(b),A.dispose())})),this._decorations.insert(b),this._onDecorationRegistered.fire(b)}return b}reset(){for(const _ of this._decorations.values())_.dispose();this._decorations.clear()}*getDecorationsAtCell(_,b,A){let L=0,D=0;for(const R of this._decorations.getKeyIterator(b))L=R.options.x??0,D=L+(R.options.width??1),_>=L&&_<D&&(!A||(R.options.layer??"bottom")===A)&&(yield R)}forEachDecorationAtCell(_,b,A,L){this._decorations.forEachByKey(b,(D=>{w=D.options.x??0,T=w+(D.options.width??1),_>=w&&_<T&&(!A||(D.options.layer??"bottom")===A)&&L(D)}))}}o.DecorationService=E;class S 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(_){super(),this.options=_,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=_.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const h=c(2585),g=c(8343);class u{constructor(...w){this._entries=new Map;for(const[T,E]of w)this.set(T,E)}set(w,T){const E=this._entries.get(w);return this._entries.set(w,T),E}forEach(w){for(const[T,E]of this._entries.entries())w(T,E)}has(w){return this._entries.has(w)}get(w){return this._entries.get(w)}}o.ServiceCollection=u,o.InstantiationService=class{constructor(){this._services=new u,this._services.set(h.IInstantiationService,this)}setService(y,w){this._services.set(y,w)}getService(y){return this._services.get(y)}createInstance(y,...w){const T=(0,g.getServiceDependencies)(y).sort(((v,_)=>v.index-_.index)),E=[];for(const v of T){const _=this._services.get(v.id);if(!_)throw new Error(`[createInstance] ${y.name} depends on UNKNOWN service ${v.id}.`);E.push(_)}const S=T.length>0?T[0].index:w.length;if(w.length!==S)throw new Error(`[createInstance] First service dependency of ${y.name} at position ${S+1} conflicts with ${w.length} static arguments`);return new y(...w,...E)}}},7866:function(f,o,c){var h=this&&this.__decorate||function(S,v,_,b){var A,L=arguments.length,D=L<3?v:b===null?b=Object.getOwnPropertyDescriptor(v,_):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,v,_,b);else for(var R=S.length-1;R>=0;R--)(A=S[R])&&(D=(L<3?A(D):L>3?A(v,_,D):A(v,_))||D);return L>3&&D&&Object.defineProperty(v,_,D),D},g=this&&this.__param||function(S,v){return function(_,b){v(_,b,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const u=c(844),y=c(2585),w={trace:y.LogLevelEnum.TRACE,debug:y.LogLevelEnum.DEBUG,info:y.LogLevelEnum.INFO,warn:y.LogLevelEnum.WARN,error:y.LogLevelEnum.ERROR,off:y.LogLevelEnum.OFF};let T,E=o.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(S){super(),this._optionsService=S,this._logLevel=y.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),T=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(S){for(let v=0;v<S.length;v++)typeof S[v]=="function"&&(S[v]=S[v]())}_log(S,v,_){this._evalLazyOptionalParams(_),S.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+v,..._)}trace(S,...v){var _;this._logLevel<=y.LogLevelEnum.TRACE&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.trace.bind(this._optionsService.options.logger))??console.log,S,v)}debug(S,...v){var _;this._logLevel<=y.LogLevelEnum.DEBUG&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.debug.bind(this._optionsService.options.logger))??console.log,S,v)}info(S,...v){var _;this._logLevel<=y.LogLevelEnum.INFO&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.info.bind(this._optionsService.options.logger))??console.info,S,v)}warn(S,...v){var _;this._logLevel<=y.LogLevelEnum.WARN&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.warn.bind(this._optionsService.options.logger))??console.warn,S,v)}error(S,...v){var _;this._logLevel<=y.LogLevelEnum.ERROR&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.error.bind(this._optionsService.options.logger))??console.error,S,v)}};o.LogService=E=h([g(0,y.IOptionsService)],E),o.setTraceLogger=function(S){T=S},o.traceCall=function(S,v,_){if(typeof _.value!="function")throw new Error("not supported");const b=_.value;_.value=function(...A){if(T.logLevel!==y.LogLevelEnum.TRACE)return b.apply(this,A);T.trace(`GlyphRenderer#${b.name}(${A.map((D=>JSON.stringify(D))).join(", ")})`);const L=b.apply(this,A);return T.trace(`GlyphRenderer#${b.name} return`,L),L}}},7302:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const h=c(8460),g=c(844),u=c(6114);o.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 y=["normal","bold","100","200","300","400","500","600","700","800","900"];class w extends g.Disposable{constructor(E){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const S={...o.DEFAULT_OPTIONS};for(const v in E)if(v in S)try{const _=E[v];S[v]=this._sanitizeAndValidateOption(v,_)}catch(_){console.error(_)}this.rawOptions=S,this.options={...S},this._setupOptions(),this.register((0,g.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(E,S){return this.onOptionChange((v=>{v===E&&S(this.rawOptions[E])}))}onMultipleOptionChange(E,S){return this.onOptionChange((v=>{E.indexOf(v)!==-1&&S()}))}_setupOptions(){const E=v=>{if(!(v in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);return this.rawOptions[v]},S=(v,_)=>{if(!(v in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);_=this._sanitizeAndValidateOption(v,_),this.rawOptions[v]!==_&&(this.rawOptions[v]=_,this._onOptionChange.fire(v))};for(const v in this.rawOptions){const _={get:E.bind(this,v),set:S.bind(this,v)};Object.defineProperty(this.options,v,_)}}_sanitizeAndValidateOption(E,S){switch(E){case"cursorStyle":if(S||(S=o.DEFAULT_OPTIONS[E]),!(function(v){return v==="block"||v==="underline"||v==="bar"})(S))throw new Error(`"${S}" is not a valid value for ${E}`);break;case"wordSeparator":S||(S=o.DEFAULT_OPTIONS[E]);break;case"fontWeight":case"fontWeightBold":if(typeof S=="number"&&1<=S&&S<=1e3)break;S=y.includes(S)?S:o.DEFAULT_OPTIONS[E];break;case"cursorWidth":S=Math.floor(S);case"lineHeight":case"tabStopWidth":if(S<1)throw new Error(`${E} cannot be less than 1, value: ${S}`);break;case"minimumContrastRatio":S=Math.max(1,Math.min(21,Math.round(10*S)/10));break;case"scrollback":if((S=Math.min(S,4294967295))<0)throw new Error(`${E} cannot be less than 0, value: ${S}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(S<=0)throw new Error(`${E} cannot be less than or equal to 0, value: ${S}`);break;case"rows":case"cols":if(!S&&S!==0)throw new Error(`${E} must be numeric, value: ${S}`);break;case"windowsPty":S=S??{}}return S}}o.OptionsService=w},2660:function(f,o,c){var h=this&&this.__decorate||function(w,T,E,S){var v,_=arguments.length,b=_<3?T:S===null?S=Object.getOwnPropertyDescriptor(T,E):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(w,T,E,S);else for(var A=w.length-1;A>=0;A--)(v=w[A])&&(b=(_<3?v(b):_>3?v(T,E,b):v(T,E))||b);return _>3&&b&&Object.defineProperty(T,E,b),b},g=this&&this.__param||function(w,T){return function(E,S){T(E,S,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const u=c(2585);let y=o.OscLinkService=class{constructor(w){this._bufferService=w,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(w){const T=this._bufferService.buffer;if(w.id===void 0){const A=T.addMarker(T.ybase+T.y),L={data:w,id:this._nextId++,lines:[A]};return A.onDispose((()=>this._removeMarkerFromLink(L,A))),this._dataByLinkId.set(L.id,L),L.id}const E=w,S=this._getEntryIdKey(E),v=this._entriesWithId.get(S);if(v)return this.addLineToLink(v.id,T.ybase+T.y),v.id;const _=T.addMarker(T.ybase+T.y),b={id:this._nextId++,key:this._getEntryIdKey(E),data:E,lines:[_]};return _.onDispose((()=>this._removeMarkerFromLink(b,_))),this._entriesWithId.set(b.key,b),this._dataByLinkId.set(b.id,b),b.id}addLineToLink(w,T){const E=this._dataByLinkId.get(w);if(E&&E.lines.every((S=>S.line!==T))){const S=this._bufferService.buffer.addMarker(T);E.lines.push(S),S.onDispose((()=>this._removeMarkerFromLink(E,S)))}}getLinkData(w){var T;return(T=this._dataByLinkId.get(w))==null?void 0:T.data}_getEntryIdKey(w){return`${w.id};;${w.uri}`}_removeMarkerFromLink(w,T){const E=w.lines.indexOf(T);E!==-1&&(w.lines.splice(E,1),w.lines.length===0&&(w.data.id!==void 0&&this._entriesWithId.delete(w.key),this._dataByLinkId.delete(w.id)))}};o.OscLinkService=y=h([g(0,u.IBufferService)],y)},8343:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",h="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(g){return g[h]||[]},o.createDecorator=function(g){if(o.serviceRegistry.has(g))return o.serviceRegistry.get(g);const u=function(y,w,T){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(E,S,v){S[c]===S?S[h].push({id:E,index:v}):(S[h]=[{id:E,index:v}],S[c]=S)})(u,y,T)};return u.toString=()=>g,o.serviceRegistry.set(g,u),u}},2585:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const h=c(8343);var g;o.IBufferService=(0,h.createDecorator)("BufferService"),o.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),o.ICoreService=(0,h.createDecorator)("CoreService"),o.ICharsetService=(0,h.createDecorator)("CharsetService"),o.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"})(g||(o.LogLevelEnum=g={})),o.ILogService=(0,h.createDecorator)("LogService"),o.IOptionsService=(0,h.createDecorator)("OptionsService"),o.IOscLinkService=(0,h.createDecorator)("OscLinkService"),o.IUnicodeService=(0,h.createDecorator)("UnicodeService"),o.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const h=c(8460),g=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,T,E=!1){return(16777215&w)<<3|(3&T)<<1|(E?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const w=new g.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 T=0,E=0;const S=w.length;for(let v=0;v<S;++v){let _=w.charCodeAt(v);if(55296<=_&&_<=56319){if(++v>=S)return T+this.wcwidth(_);const L=w.charCodeAt(v);56320<=L&&L<=57343?_=1024*(_-55296)+L-56320+65536:T+=this.wcwidth(L)}const b=this.charProperties(_,E);let A=u.extractWidth(b);u.extractShouldJoin(b)&&(A-=u.extractWidth(E)),T+=A,E=b}return T}charProperties(w,T){return this._activeProvider.charProperties(w,T)}}o.UnicodeService=u}},l={};function d(f){var o=l[f];if(o!==void 0)return o.exports;var c=l[f]={exports:{}};return s[f].call(c.exports,c,c.exports,d),c.exports}var p={};return(()=>{var f=p;Object.defineProperty(f,"__esModule",{value:!0}),f.Terminal=void 0;const o=d(9042),c=d(3236),h=d(844),g=d(5741),u=d(8285),y=d(7975),w=d(7090),T=["cols","rows"];class E extends h.Disposable{constructor(v){super(),this._core=this.register(new c.Terminal(v)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const _=A=>this._core.options[A],b=(A,L)=>{this._checkReadonlyOptions(A),this._core.options[A]=L};for(const A in this._core.options){const L={get:_.bind(this,A),set:b.bind(this,A)};Object.defineProperty(this._publicOptions,A,L)}}_checkReadonlyOptions(v){if(T.includes(v))throw new Error(`Option "${v}" 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 y.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 v=this._core.coreService.decPrivateModes;let _="none";switch(this._core.coreMouseService.activeProtocol){case"X10":_="x10";break;case"VT200":_="vt200";break;case"DRAG":_="drag";break;case"ANY":_="any"}return{applicationCursorKeysMode:v.applicationCursorKeys,applicationKeypadMode:v.applicationKeypad,bracketedPasteMode:v.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:_,originMode:v.origin,reverseWraparoundMode:v.reverseWraparound,sendFocusMode:v.sendFocus,wraparoundMode:v.wraparound}}get options(){return this._publicOptions}set options(v){for(const _ in v)this._publicOptions[_]=v[_]}blur(){this._core.blur()}focus(){this._core.focus()}input(v,_=!0){this._core.input(v,_)}resize(v,_){this._verifyIntegers(v,_),this._core.resize(v,_)}open(v){this._core.open(v)}attachCustomKeyEventHandler(v){this._core.attachCustomKeyEventHandler(v)}attachCustomWheelEventHandler(v){this._core.attachCustomWheelEventHandler(v)}registerLinkProvider(v){return this._core.registerLinkProvider(v)}registerCharacterJoiner(v){return this._checkProposedApi(),this._core.registerCharacterJoiner(v)}deregisterCharacterJoiner(v){this._checkProposedApi(),this._core.deregisterCharacterJoiner(v)}registerMarker(v=0){return this._verifyIntegers(v),this._core.registerMarker(v)}registerDecoration(v){return this._checkProposedApi(),this._verifyPositiveIntegers(v.x??0,v.width??0,v.height??0),this._core.registerDecoration(v)}hasSelection(){return this._core.hasSelection()}select(v,_,b){this._verifyIntegers(v,_,b),this._core.select(v,_,b)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(v,_){this._verifyIntegers(v,_),this._core.selectLines(v,_)}dispose(){super.dispose()}scrollLines(v){this._verifyIntegers(v),this._core.scrollLines(v)}scrollPages(v){this._verifyIntegers(v),this._core.scrollPages(v)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(v){this._verifyIntegers(v),this._core.scrollToLine(v)}clear(){this._core.clear()}write(v,_){this._core.write(v,_)}writeln(v,_){this._core.write(v),this._core.write(`\r
|
|
59
|
+
`,_)}paste(v){this._core.paste(v)}refresh(v,_){this._verifyIntegers(v,_),this._core.refresh(v,_)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return o}_verifyIntegers(...v){for(const _ of v)if(_===1/0||isNaN(_)||_%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(const _ of v)if(_&&(_===1/0||isNaN(_)||_%1!=0||_<0))throw new Error("This API only accepts positive integers")}}f.Terminal=E})(),p})()))})(Gu)),Gu.exports}var _1=g1();class v1{constructor(r,s){Em(this,"socket");const d=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal/${encodeURIComponent(r)}`;this.socket=new WebSocket(d),this.socket.addEventListener("message",p=>{var o,c,h;let f;try{f=JSON.parse(p.data)}catch(g){(o=s.onError)==null||o.call(s,`Terminal message parse failed for session ${r}. Reason: ${Lo(g)}`);return}f.type==="output"?s.onOutput(f.data):f.type==="error"?(c=s.onError)==null||c.call(s,f.message):(h=s.onStatus)==null||h.call(s,f)}),this.socket.addEventListener("error",()=>{var p;(p=s.onError)==null||p.call(s,`Terminal WebSocket connection failed for session ${r}. URL: ${d}. Check that the VCM backend is running and the session still exists.`)})}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 Oo({sessionId:n,active:r=!0,onEvent:s}){const l=ee.useRef(null),d=ee.useRef(null),p=ee.useRef(null),f=ee.useRef(null),o=ee.useRef(null),c=ee.useRef(r),h=ee.useRef(s),[g,u]=ee.useState("idle");function y(E){u(E),o.current!==null&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{o.current=null,u("idle")},1600)}async function w(){const E=f.current,S=(E==null?void 0:E.getSelection())??"";if(!S){y("empty"),E==null||E.focus();return}y(await S1(S)?"copied":"failed"),E==null||E.focus()}function T(E={}){const S=l.current,v=d.current,_=p.current,b=f.current;if(!S||!v||!_||!b)return!1;const A=S.getBoundingClientRect();return A.width<Fm||A.height<qm||(_.fit(),b.cols<$m||b.rows<Gm)?!1:(v.resize(b.cols,b.rows),E.focus&&b.focus(),!0)}return ee.useEffect(()=>{h.current=s},[s]),ee.useEffect(()=>{c.current=r},[r]),ee.useEffect(()=>{if(!l.current)return;const E=new _1.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:C1}),S=new d1.FitAddon;E.loadAddon(S),E.loadAddon(new m1.WebLinksAddon),E.open(l.current),f.current=E,p.current=S;const v=l.current.getBoundingClientRect();v.width>=Fm&&v.height>=qm&&S.fit();const _=new v1(n,{onOutput(M){E.write(M)},onStatus(M){var B;(B=h.current)==null||B.call(h,M.type)},onError(M){var B;E.writeln(`\r
|
|
60
|
+
[VCM] ${M}`),(B=h.current)==null||B.call(h,M)}});d.current=_,E.cols>=$m&&E.rows>=Gm&&_.resize(E.cols,E.rows);const b=E.onData(M=>{_.sendInput(M)});let A=0,L=0,D=0;const R=()=>{A&&window.cancelAnimationFrame(A),A=window.requestAnimationFrame(()=>{A=0,T({focus:c.current})})},k=new ResizeObserver(()=>{R()});return k.observe(l.current),L=window.requestAnimationFrame(R),D=window.setTimeout(R,120),()=>{A&&window.cancelAnimationFrame(A),L&&window.cancelAnimationFrame(L),D&&window.clearTimeout(D),k.disconnect(),b.dispose(),_.close(),E.dispose(),d.current=null,f.current=null,p.current=null}},[n]),ee.useEffect(()=>{if(!r)return;const E=[],S=[];return E.push(window.requestAnimationFrame(()=>{T({focus:!0}),E.push(window.requestAnimationFrame(()=>T({focus:!0})))})),S.push(window.setTimeout(()=>T({focus:!0}),160)),S.push(window.setTimeout(()=>T({focus:!0}),360)),()=>{for(const v of E)window.cancelAnimationFrame(v);for(const v of S)window.clearTimeout(v)}},[r]),ee.useEffect(()=>{const E=()=>{c.current&&T()};return window.addEventListener("resize",E),()=>window.removeEventListener("resize",E)},[]),ee.useEffect(()=>()=>{o.current!==null&&window.clearTimeout(o.current)},[]),x.jsxs("div",{className:"terminal-frame-shell",children:[x.jsx("div",{className:"terminal-frame",ref:l,onClick:()=>{var E;return(E=f.current)==null?void 0:E.focus()}}),x.jsx("button",{type:"button",className:`terminal-copy-button is-${g}`,title:"Copy selected terminal text",onMouseDown:Pm,onPointerDown:Pm,onClick:()=>void w(),children:y1(g)})]})}function y1(n){return n==="copied"?"Copied":n==="empty"?"No selection":n==="failed"?"Copy failed":"Copy"}function Pm(n){n.preventDefault(),n.stopPropagation()}async function S1(n){var r;try{if((r=navigator.clipboard)!=null&&r.writeText)return await navigator.clipboard.writeText(n),!0}catch{}return b1(n)}function b1(n){const r=document.createElement("textarea");r.value=n,r.setAttribute("readonly","true"),r.style.position="fixed",r.style.top="0",r.style.left="-9999px",r.style.opacity="0",document.body.appendChild(r),r.focus(),r.select();try{return document.execCommand("copy")}finally{r.remove()}}const Fm=160,qm=80,$m=20,Gm=5,C1={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"},r_=[{value:"bypassPermissions",label:"bypassPermissions",description:"Bypass prompts; recommended in DevContainer worktrees"},{value:"plan",label:"plan",description:"Plan-only permission mode"},{value:"default",label:"default",description:"Claude Code default permission behavior"}],s_=[{value:"default",label:"Default",description:"Account default"},{value:"fable",label:"Fable",description:"Claude Fable"},{value:"opus",label:"Opus",description:"Latest Opus"},{value:"sonnet",label:"Sonnet",description:"Latest Sonnet"}],w1=[{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"}],a_=[...w1,{value:"max",label:"Max",description:"Maximum reasoning"},{value:"ultracode",label:"Ultracode",description:"Claude Code dynamic workflows with xhigh reasoning"}];function Hi({status:n}){return x.jsx("span",{className:`status-badge status-${n}`,children:n.replaceAll("_"," ")})}function Mh({role:n,session:r,permissionMode:s,model:l,effort:d,busy:p=!1,onPermissionModeChange:f,onModelChange:o,onEffortChange:c,onStart:h,onResume:g,onStop:u,onRestart:y,onNotifyHarnessUpdated:w}){const T=(r==null?void 0:r.status)==="running",E=!!(r!=null&&r.claudeSessionId&&!T),S=!T&&!(r!=null&&r.claudeSessionId),v=!!(r!=null&&r.harnessOutdated);return x.jsxs("div",{className:"session-controls",children:[x.jsxs("label",{className:"session-option-field permission-mode-field",children:[x.jsx("span",{children:"Permission"}),x.jsx("select",{value:s,onChange:_=>f(_.target.value),children:r_.map(_=>x.jsx("option",{value:_.value,children:_.label},_.value))})]}),x.jsxs("label",{className:"session-option-field model-field",children:[x.jsx("span",{children:"Model"}),x.jsx("select",{value:l,onChange:_=>o(_.target.value),children:s_.map(_=>x.jsx("option",{value:_.value,children:_.label},_.value))})]}),x.jsxs("label",{className:"session-option-field effort-field",children:[x.jsx("span",{children:"Effort"}),x.jsx("select",{value:d,onChange:_=>c(_.target.value),children:a_.map(_=>x.jsx("option",{value:_.value,children:_.label},_.value))})]}),x.jsxs("div",{className:"session-toolbar",children:[x.jsx("button",{type:"button",disabled:p||!S,onClick:h,children:"Start"}),x.jsx("button",{type:"button",disabled:p||!E,onClick:g,children:"Resume"}),x.jsx("button",{type:"button",disabled:p||!r,onClick:y,children:"Restart"}),x.jsx("button",{type:"button",disabled:p||!r,onClick:u,children:"Stop"})]}),v?x.jsxs("div",{className:"session-harness-notice",children:[x.jsx(Hi,{status:"outdated"}),x.jsxs("span",{children:["Harness updated",(r==null?void 0:r.harnessRevision)!==void 0&&r.harnessCurrentRevision!==void 0?` (${r.harnessRevision} -> ${r.harnessCurrentRevision})`:""]}),x.jsx("button",{type:"button",disabled:p||!T||!w,onClick:w,children:"Notify role"})]}):null]})}function x1({busy:n,effort:r,model:s,open:l,permissionMode:d,taskSlug:p,bootstrapStatus:f,engineerSession:o,status:c,onClose:h,onEffortChange:g,onModelChange:u,onPermissionModeChange:y,onEngineerResume:w,onEngineerRestart:T,onEngineerStart:E,onEngineerStop:S,onEngineerNotifyHarnessUpdated:v,onOpenRepositoryDiff:_,onReviewTaskHarness:b,onRefresh:A}){const[L,D]=ee.useState(null),[R,k]=ee.useState(null),[M,B]=ee.useState(""),[H,U]=ee.useState(!1),[P,K]=ee.useState(!1),[,Y]=zi(null),[G,W]=ee.useState(null),Z=(c==null?void 0:c.files)??[],z=Z.filter(te=>te.kind.startsWith("agent-")),j=z.filter(te=>Vm(te)),N=z.filter(te=>!Vm(te)),$=Z.filter(te=>te.kind.startsWith("skill-")),I=Z.filter(te=>te.kind.startsWith("tool-")),re=Z.filter(te=>te.kind==="root-claude"||te.kind==="gitignore"||te.kind==="pull-request-template"),ve=!!(R&&M!==R.content);ee.useEffect(()=>{l||(D(null),k(null),B(""),U(!1),Y(null))},[Z,l,L]),ee.useEffect(()=>{if(!l||!L||!p)return;let te=!1;return K(!0),Y(null),U(!1),ye.getHarnessFileContent(p,L).then(ae=>{te||(k(ae),B(ae.content))}).catch(ae=>{te||Y(dt(`Load harness file ${L}`,ae))}).finally(()=>{te||K(!1)}),()=>{te=!0}},[l,L,p]);async function me(){if(!(!R||!R.editable||!ve||!p)){K(!0),Y(null);try{const te=await ye.updateHarnessFileContent(p,R.path,{content:M});k(te.file),B(te.file.content),U(!1),A()}catch(te){Y(dt(`Save harness file ${R.path}`,te))}finally{K(!1)}}}function Q(){D(null),k(null),B(""),U(!1),Y(null)}async function q(te){Y(null);try{await E1(te),W(te),window.setTimeout(()=>{W(ae=>ae===te?null:ae)},1200)}catch(ae){Y(dt(`Copy harness file path ${te}`,ae))}}return l?x.jsx(x.Fragment,{children:x.jsx("div",{className:"modal-backdrop harness-studio-backdrop",children:x.jsxs("section",{className:"harness-studio-modal",role:"dialog","aria-modal":"true","aria-label":"Harness Studio",children:[x.jsxs("header",{className:"harness-studio-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Harness Studio"}),p?null:x.jsx("p",{className:"muted",children:"Create or select a task before editing harness files."})]}),x.jsxs("div",{className:"harness-studio-header-actions",children:[x.jsx("button",{type:"button",disabled:n||!p,onClick:b,children:"Review Task Harness"}),x.jsx("button",{type:"button",disabled:n,onClick:_,children:"Review Diff"}),x.jsx("button",{type:"button",disabled:n,onClick:A,children:"Refresh"}),x.jsx("button",{type:"button",onClick:h,children:"Close"})]})]}),x.jsxs("div",{className:"harness-studio-layout",children:[x.jsx("aside",{className:L?"harness-studio-left harness-studio-left-preview":"harness-studio-left",children:L?x.jsxs("section",{className:"harness-studio-section harness-studio-file-preview",children:[x.jsxs("header",{className:"harness-studio-file-editor-header",children:[x.jsxs("div",{children:[x.jsx("h3",{children:(R==null?void 0:R.title)??"Harness File"}),x.jsx("p",{className:"muted",children:(R==null?void 0:R.path)??L})]}),x.jsxs("div",{className:"harness-studio-file-editor-actions",children:[R?x.jsx(Hi,{status:R.editable?"ok":"unknown"}):null,H?x.jsxs(x.Fragment,{children:[x.jsx("button",{type:"button",disabled:P||!p||!(R!=null&&R.editable)||!ve,onClick:()=>void me(),children:"Save"}),x.jsx("button",{type:"button",disabled:P,onClick:()=>{B((R==null?void 0:R.content)??""),U(!1)},children:"Cancel"})]}):x.jsx("button",{type:"button",disabled:P||!p||!(R!=null&&R.editable),onClick:()=>U(!0),children:"Edit"}),x.jsx("button",{type:"button",onClick:Q,children:"Return"})]})]}),R!=null&&R.readonlyReason?x.jsx("p",{className:"muted",children:R.readonlyReason}):null,x.jsx("textarea",{className:H?"harness-studio-file-textarea is-editing":"harness-studio-file-textarea",value:M,spellCheck:!1,readOnly:!H,disabled:P,onChange:te=>B(te.target.value)})]}):x.jsxs(x.Fragment,{children:[x.jsx(Na,{title:"VCM Roles",files:j,selectedPath:L,copiedPath:G,onCopy:te=>void q(te),onSelect:D}),x.jsx(Na,{title:"Auxiliary Roles",files:N,selectedPath:L,copiedPath:G,onCopy:te=>void q(te),onSelect:D}),x.jsx(dh,{title:"Overview",children:x.jsxs("section",{className:"harness-studio-overview",children:[x.jsxs("div",{className:"harness-studio-metrics",children:[x.jsx(Rs,{label:"Fixed install",value:c?c.initialized?c.needsApply?"updates":"current":"new":"unknown"}),x.jsx(Rs,{label:"Revision",value:String((c==null?void 0:c.harnessRevision)??0)}),x.jsx(Rs,{label:"Managed files",value:String(Z.length)}),x.jsx(Rs,{label:"Pending updates",value:String((c==null?void 0:c.plannedChanges.length)??0)}),x.jsx(Rs,{label:"Bootstrap",value:(f==null?void 0:f.status.replaceAll("_"," "))??"unknown"}),x.jsx(Rs,{label:"Engineer",value:Wm(o)})]}),c!=null&&c.warnings.length?x.jsx("ul",{className:"warnings",children:c.warnings.map(te=>x.jsx("li",{children:te},te))}):null]})}),x.jsx(Na,{title:"Skills",files:$,selectedPath:L,copiedPath:G,onCopy:te=>void q(te),onSelect:D,collapsible:!0}),x.jsx(Na,{title:"Root Context",files:re,selectedPath:L,copiedPath:G,onCopy:te=>void q(te),onSelect:D,collapsible:!0}),x.jsx(Na,{title:"Tools",files:I,selectedPath:L,copiedPath:G,onCopy:te=>void q(te),onSelect:D,collapsible:!0}),x.jsx(dh,{title:"Project Docs",children:x.jsx("ul",{className:"harness-studio-doc-list",children:(f==null?void 0:f.checks.map(te=>x.jsxs("li",{children:[x.jsx("span",{children:te.path??te.label}),x.jsx(Hi,{status:te.status})]},te.key)))??x.jsx("li",{children:x.jsx("span",{children:"No bootstrap status loaded."})})})})]})}),x.jsxs("section",{className:"harness-studio-section harness-studio-engineer",children:[x.jsxs("div",{className:"harness-studio-engineer-header",children:[x.jsxs("div",{children:[x.jsx("h3",{children:"Harness Engineer"}),x.jsx("p",{className:"muted",children:Wm(o)})]}),x.jsx(Hi,{status:(o==null?void 0:o.status)??"unknown"})]}),x.jsx(Mh,{role:"harness-engineer",session:o??void 0,permissionMode:d,model:s,effort:r,busy:n,onPermissionModeChange:y,onModelChange:u,onEffortChange:g,onStart:E,onResume:w,onRestart:T,onStop:S,onNotifyHarnessUpdated:v}),x.jsx("div",{className:"harness-engineer-terminal",children:(o==null?void 0:o.status)==="running"?x.jsx(Oo,{sessionId:o.id,active:l},o.id):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:"harness-engineer"}),x.jsx("span",{children:o!=null&&o.claudeSessionId?"Resume this project Harness Engineer session.":"Start this project Harness Engineer session."})]})})]})]})]})})}):null}function Rs({label:n,value:r}){return x.jsxs("div",{className:"harness-studio-metric",children:[x.jsx("span",{children:n}),x.jsx("strong",{children:r})]})}function Na({title:n,files:r,selectedPath:s,copiedPath:l,onCopy:d,onSelect:p,collapsible:f=!1}){const o=x.jsx("ol",{className:"harness-studio-file-list",children:r.length?r.map(c=>x.jsxs("li",{className:c.path===s?"selected":void 0,children:[x.jsx("button",{className:"harness-studio-file-path-button",type:"button",title:c.path,onClick:()=>p(c.path),children:c.path}),x.jsx("button",{className:"harness-studio-file-copy-button",type:"button",title:`Copy ${c.path}`,onClick:()=>d(c.path),children:l===c.path?"Copied":"Copy"}),x.jsx(Hi,{status:c.action})]},c.path)):x.jsx("li",{children:x.jsx("span",{children:"No files."})})});return f?x.jsx(dh,{title:n,children:o}):x.jsxs("section",{className:"harness-studio-section",children:[x.jsx("h3",{children:n}),o]})}function dh({title:n,children:r}){return x.jsxs("details",{className:"harness-studio-section harness-studio-collapsible-section",children:[x.jsxs("summary",{children:[x.jsx("h3",{children:n}),x.jsx("span",{children:"Show"})]}),x.jsx("div",{className:"harness-studio-collapsible-content",children:r})]})}function Vm(n){return n.kind==="agent-project-manager"||n.kind==="agent-architect"||n.kind==="agent-coder"||n.kind==="agent-reviewer"||n.kind==="agent-gate-reviewer"}function Wm(n){return n?n.status==="running"?`${n.status} / ${n.activityStatus??"idle"}`:n.status:"not started"}async function E1(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 k1({open:n,taskSlug:r,onClose:s}){var k;const[l,d]=ee.useState(null),[p,f]=ee.useState(null),[o,c]=ee.useState(null),[h,g]=ee.useState(null),[u,y]=ee.useState(null),[w,T]=ee.useState(!1),[E,S]=ee.useState(!1),[,v]=zi(null),[_,b]=ee.useState(null),A=ee.useMemo(()=>(l==null?void 0:l.files.find(M=>M.path===o))??(l==null?void 0:l.files[0])??null,[l,o]);async function L(M=p){var B;T(!0),v(null);try{if(!r)throw new Error("Create or select a task before reviewing harness commits.");const H=await ye.getRepositoryDiff(r,M);d(H),g(null),f(((B=H.commit)==null?void 0:B.sha)??null),c(U=>{var P;return U&&H.files.some(K=>K.path===U)?U:((P=H.files[0])==null?void 0:P.path)??null})}catch(H){v(dt(M?`Load commit diff ${M}`:"Load latest commit diff",H))}finally{T(!1)}}ee.useEffect(()=>{n&&(f(null),b(null),L(null))},[n,r]);async function D(M){y(M),v(null);try{if(!r)throw new Error("Create or select a task before reviewing file diffs.");const B=await ye.getRepositoryFileDiff(r,M);g(B),c(M)}catch(B){v(dt(`Load task file diff for ${M}`,B))}finally{y(null)}}async function R(){if(v(null),b(null),!r){v("Create or select a task before merging the task branch.");return}if(!l){v("Load the commit diff before merging the task branch.");return}const M=l.commits.length?l.commits.map(H=>`- ${H.shortSha} ${H.subject}`):["- No new commits found."];if(window.confirm([`Merge ${l.sourceBranch} into ${l.targetBranch}?`,"","VCM will run a fast-forward merge only.","The merge will fail if the task worktree or connected repository has uncommitted changes.","If the connected repository branch has diverged, rebase or merge manually first.","","Commits:",...M].join(`
|
|
61
|
+
`))){S(!0);try{const H=await ye.mergeRepositoryDiffToCurrentBranch(r);b(H.changed?`Merged ${H.sourceBranch} into ${H.targetBranch} at ${H.afterSha.slice(0,12)}.`:`${H.targetBranch} already includes ${H.sourceBranch}.`),f(null),await L(null)}catch(H){v(dt("Merge task branch to connected repository branch",H))}finally{S(!1)}}}return n?x.jsx("div",{className:"modal-backdrop repository-diff-backdrop",children:x.jsxs("section",{className:"repository-diff-modal",role:"dialog","aria-modal":"true","aria-label":"Commit Diff",children:[x.jsxs("header",{className:"repository-diff-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Commit Diff"}),x.jsx("p",{children:l?`${((k=l.commit)==null?void 0:k.shortSha)??"HEAD"} · ${l.summary.totalFiles} files · +${l.summary.additions} / -${l.summary.deletions}`:"Review a new commit on the active task worktree branch."})]}),x.jsxs("div",{className:"repository-diff-header-actions",children:[x.jsxs("label",{className:"repository-diff-commit-picker",children:[x.jsx("span",{children:"Commit"}),x.jsx("select",{value:p??"",disabled:w||!(l!=null&&l.commits.length),onChange:M=>{const B=M.target.value||null;f(B),L(B)},children:l==null?void 0:l.commits.map(M=>x.jsxs("option",{value:M.sha,children:[M.shortSha," · ",M.subject]},M.sha))})]}),x.jsx("button",{type:"button",disabled:w,onClick:()=>void L(),children:"Refresh"}),x.jsx("button",{type:"button",disabled:w||E||!r||!(l!=null&&l.commits.length),onClick:()=>void R(),children:E?"Merging...":"Merge to Main"}),x.jsx("button",{type:"button",onClick:s,children:"Close"})]})]}),_?x.jsx("p",{className:"success-banner",children:_}):null,l!=null&&l.warnings.length?x.jsx("ul",{className:"warnings repository-diff-warnings",children:l.warnings.map(M=>x.jsx("li",{children:M},M))}):null,x.jsxs("div",{className:"repository-diff-body",children:[x.jsxs("aside",{className:"repository-diff-sidebar",children:[x.jsx(A1,{report:l,busy:w}),x.jsxs("ol",{className:"repository-diff-file-list",children:[l==null?void 0:l.files.map(M=>x.jsx("li",{className:[(A==null?void 0:A.path)===M.path&&!h?"selected":"",(h==null?void 0:h.path)===M.path?"task-diff-selected":""].filter(Boolean).join(" "),children:x.jsxs("div",{className:"repository-diff-file-row",children:[x.jsxs("button",{className:"repository-diff-file-select",type:"button",onClick:()=>{g(null),c(M.path)},children:[x.jsx("span",{children:M.path}),x.jsxs("small",{children:[mh(M.status)," · ",Km(M.stage)," · ",ph(M.category)]})]}),x.jsx("button",{className:"repository-diff-task-file-button",type:"button",disabled:u===M.path,title:"View this file diff across the whole task worktree",onClick:()=>void D(M.path),children:u===M.path?"...":"Task diff"})]})},M.path)),l&&l.files.length===0?x.jsx("li",{className:"repository-diff-empty",children:l.commits.length===0?"No new commits on this task branch.":"No files in this commit."}):null]})]}),x.jsx("main",{className:"repository-diff-main",children:h?x.jsx(T1,{diff:h,onClose:()=>g(null)}):A?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"repository-diff-file-header",children:[x.jsxs("div",{children:[x.jsx("h3",{children:A.path}),x.jsxs("p",{children:[ph(A.category)," · ",mh(A.status)," · ",Km(A.stage)]})]}),x.jsxs("span",{className:"repository-diff-stats",children:["+",A.additions," / -",A.deletions]})]}),A.binary?x.jsx("p",{className:"muted",children:"Binary or non-regular file. Text diff is not available."}):null,A.truncated?x.jsx("p",{className:"muted",children:"Diff was truncated for display."}):null,x.jsx("pre",{className:"repository-diff-code","aria-label":`${A.path} diff`,children:l_(A.diff)})]}):x.jsx("div",{className:"repository-diff-placeholder",children:w?"Loading commit diff...":"No diff selected."})})]})]})}):null}function A1({report:n,busy:r}){var l;const s=n==null?void 0:n.summary;return x.jsxs("div",{className:"repository-diff-summary",children:[x.jsx("strong",{children:r?"Loading":n?"Commit changes":"Not loaded"}),s?x.jsxs(x.Fragment,{children:[x.jsxs("span",{children:[s.harnessFiles," harness files"]}),x.jsxs("span",{children:[s.productCodeFiles," product code files"]}),x.jsxs("span",{children:[s.committedFiles," committed files"]}),x.jsxs("span",{children:[(n==null?void 0:n.commits.length)??0," branch commits"]}),x.jsx("span",{children:((l=n==null?void 0:n.commit)==null?void 0:l.subject)??"HEAD"})]}):null]})}function T1({diff:n,onClose:r}){const s=n.file;return x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"repository-diff-file-header",children:[x.jsxs("div",{children:[x.jsx("h3",{children:n.path}),x.jsxs("p",{children:["Task diff · ",n.targetBranch," ",n.baseSha.slice(0,12)," → ",n.sourceBranch," worktree ",n.headSha.slice(0,12)]})]}),x.jsxs("div",{className:"repository-diff-task-file-actions",children:[s?x.jsxs("span",{className:"repository-diff-stats",children:["+",s.additions," / -",s.deletions]}):null,x.jsx("button",{type:"button",onClick:r,children:"Commit diff"})]})]}),n.warnings.length>0?x.jsx("ul",{className:"warnings repository-diff-warnings",children:n.warnings.map(l=>x.jsx("li",{children:l},l))}):null,s?x.jsxs(x.Fragment,{children:[x.jsxs("p",{className:"muted",children:[ph(s.category)," · ",mh(s.status)," · whole task comparison"]}),s.binary?x.jsx("p",{className:"muted",children:"Binary or non-regular file. Text diff is not available."}):null,s.truncated?x.jsx("p",{className:"muted",children:"Diff was truncated for display."}):null,x.jsx("pre",{className:"repository-diff-code","aria-label":`${n.path} task diff`,children:l_(s.diff)})]}):x.jsx("div",{className:"repository-diff-placeholder",children:"No task-level diff for this file."})]})}function ph(n){switch(n){case"fixed_harness":return"fixed harness";case"tools_hooks":return"tools/hooks";case"generated_context":return"generated context";case"project_docs":return"project docs";case"product_code":return"product code"}}function Km(n){return n.replaceAll("_"," ")}function mh(n){return n.replaceAll("_"," ")}function l_(n){return n.split(`
|
|
62
|
+
`).filter(r=>!D1(r)).map((r,s)=>x.jsx("span",{className:`repository-diff-line ${R1(r)}`,children:r||" "},`${s}:${r}`))}function R1(n){return n.startsWith("+")&&!n.startsWith("+++")?"repository-diff-line-added":n.startsWith("-")&&!n.startsWith("---")?"repository-diff-line-deleted":n.startsWith("@@")?"repository-diff-line-hunk":"repository-diff-line-context"}function D1(n){return n.startsWith("diff --git")||n.startsWith("index ")||n.startsWith("new file mode ")||n.startsWith("deleted file mode ")||n.startsWith("similarity index ")||n.startsWith("rename from ")||n.startsWith("rename to ")||n.startsWith("--- ")||n.startsWith("+++ ")}function M1({busy:n,effort:r,model:s,open:l,permissionMode:d,session:p,onClose:f,onEffortChange:o,onModelChange:c,onPermissionModeChange:h,onResume:g,onRestart:u,onStart:y,onStop:w,onNotifyHarnessUpdated:T}){return l?x.jsx("div",{className:"modal-backdrop translator-session-backdrop",children:x.jsxs("section",{className:"translator-session-modal",role:"dialog","aria-modal":"true","aria-label":"Translator Session",children:[x.jsxs("header",{className:"translator-session-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Translator Session"}),x.jsx("p",{children:L1(p)})]}),x.jsx("button",{type:"button",onClick:f,children:"Close"})]}),x.jsx(Mh,{role:"translator",session:p??void 0,permissionMode:d,model:s,effort:r,busy:n,onPermissionModeChange:h,onModelChange:c,onEffortChange:o,onStart:y,onResume:g,onRestart:u,onStop:w,onNotifyHarnessUpdated:T}),x.jsx("div",{className:"translator-session-terminal",children:(p==null?void 0:p.status)==="running"?x.jsx(Oo,{sessionId:p.id,active:l},p.id):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:"translator"}),x.jsx("span",{children:p!=null&&p.claudeSessionId?"Resume this project translator session.":"Start the project translator session."})]})})]})}):null}function L1(n){if(!n)return"not started";const r=n.status==="running"?` · ${n.activityStatus??"idle"}`:"";return`${n.status}${r}`}function O1(n,r){const s={};return(n[n.length-1]===""?[...n,""]:n).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const B1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,j1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,N1={};function Ym(n,r){return(N1.jsx?j1:B1).test(n)}const H1=/[ \t\n\f\r]/g;function z1(n){return typeof n=="object"?n.type==="text"?Xm(n.value):!1:Xm(n)}function Xm(n){return n.replace(H1,"")===""}class Qa{constructor(r,s,l){this.normal=s,this.property=r,l&&(this.space=l)}}Qa.prototype.normal={};Qa.prototype.property={};Qa.prototype.space=void 0;function o_(n,r){const s={},l={};for(const d of n)Object.assign(s,d.property),Object.assign(l,d.normal);return new Qa(s,l,r)}function gh(n){return n.toLowerCase()}class yn{constructor(r,s){this.attribute=s,this.property=r}}yn.prototype.attribute="";yn.prototype.booleanish=!1;yn.prototype.boolean=!1;yn.prototype.commaOrSpaceSeparated=!1;yn.prototype.commaSeparated=!1;yn.prototype.defined=!1;yn.prototype.mustUseProperty=!1;yn.prototype.number=!1;yn.prototype.overloadedBoolean=!1;yn.prototype.property="";yn.prototype.spaceSeparated=!1;yn.prototype.space=void 0;let I1=0;const Ue=Fr(),Mt=Fr(),_h=Fr(),Ce=Fr(),ct=Fr(),Bs=Fr(),Dn=Fr();function Fr(){return 2**++I1}const vh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ue,booleanish:Mt,commaOrSpaceSeparated:Dn,commaSeparated:Bs,number:Ce,overloadedBoolean:_h,spaceSeparated:ct},Symbol.toStringTag,{value:"Module"})),Vu=Object.keys(vh);class Lh extends yn{constructor(r,s,l,d){let p=-1;if(super(r,s),Qm(this,"space",d),typeof l=="number")for(;++p<Vu.length;){const f=Vu[p];Qm(this,Vu[p],(l&vh[f])===vh[f])}}}Lh.prototype.defined=!0;function Qm(n,r,s){s&&(n[r]=s)}function zs(n){const r={},s={};for(const[l,d]of Object.entries(n.properties)){const p=new Lh(l,n.transform(n.attributes||{},l),d,n.space);n.mustUseProperty&&n.mustUseProperty.includes(l)&&(p.mustUseProperty=!0),r[l]=p,s[gh(l)]=l,s[gh(p.attribute)]=l}return new Qa(r,s,n.space)}const c_=zs({properties:{ariaActiveDescendant:null,ariaAtomic:Mt,ariaAutoComplete:null,ariaBusy:Mt,ariaChecked:Mt,ariaColCount:Ce,ariaColIndex:Ce,ariaColSpan:Ce,ariaControls:ct,ariaCurrent:null,ariaDescribedBy:ct,ariaDetails:null,ariaDisabled:Mt,ariaDropEffect:ct,ariaErrorMessage:null,ariaExpanded:Mt,ariaFlowTo:ct,ariaGrabbed:Mt,ariaHasPopup:null,ariaHidden:Mt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ct,ariaLevel:Ce,ariaLive:null,ariaModal:Mt,ariaMultiLine:Mt,ariaMultiSelectable:Mt,ariaOrientation:null,ariaOwns:ct,ariaPlaceholder:null,ariaPosInSet:Ce,ariaPressed:Mt,ariaReadOnly:Mt,ariaRelevant:null,ariaRequired:Mt,ariaRoleDescription:ct,ariaRowCount:Ce,ariaRowIndex:Ce,ariaRowSpan:Ce,ariaSelected:Mt,ariaSetSize:Ce,ariaSort:null,ariaValueMax:Ce,ariaValueMin:Ce,ariaValueNow:Ce,ariaValueText:null,role:null},transform(n,r){return r==="role"?r:"aria-"+r.slice(4).toLowerCase()}});function u_(n,r){return r in n?n[r]:r}function h_(n,r){return u_(n,r.toLowerCase())}const U1=zs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Bs,acceptCharset:ct,accessKey:ct,action:null,allow:null,allowFullScreen:Ue,allowPaymentRequest:Ue,allowUserMedia:Ue,alt:null,as:null,async:Ue,autoCapitalize:null,autoComplete:ct,autoFocus:Ue,autoPlay:Ue,blocking:ct,capture:null,charSet:null,checked:Ue,cite:null,className:ct,cols:Ce,colSpan:null,content:null,contentEditable:Mt,controls:Ue,controlsList:ct,coords:Ce|Bs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ue,defer:Ue,dir:null,dirName:null,disabled:Ue,download:_h,draggable:Mt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ue,formTarget:null,headers:ct,height:Ce,hidden:_h,high:Ce,href:null,hrefLang:null,htmlFor:ct,httpEquiv:ct,id:null,imageSizes:null,imageSrcSet:null,inert:Ue,inputMode:null,integrity:null,is:null,isMap:Ue,itemId:null,itemProp:ct,itemRef:ct,itemScope:Ue,itemType:ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ue,low:Ce,manifest:null,max:null,maxLength:Ce,media:null,method:null,min:null,minLength:Ce,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:Ce,pattern:null,ping:ct,placeholder:null,playsInline:Ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ue,referrerPolicy:null,rel:ct,required:Ue,reversed:Ue,rows:Ce,rowSpan:Ce,sandbox:ct,scope:null,scoped:Ue,seamless:Ue,selected:Ue,shadowRootClonable:Ue,shadowRootDelegatesFocus:Ue,shadowRootMode:null,shape:null,size:Ce,sizes:null,slot:null,span:Ce,spellCheck:Mt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ce,step:null,style:null,tabIndex:Ce,target:null,title:null,translate:null,type:null,typeMustMatch:Ue,useMap:null,value:Mt,width:Ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ct,axis:null,background:null,bgColor:null,border:Ce,borderColor:null,bottomMargin:Ce,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:Ce,leftMargin:Ce,link:null,longDesc:null,lowSrc:null,marginHeight:Ce,marginWidth:Ce,noResize:Ue,noHref:Ue,noShade:Ue,noWrap:Ue,object:null,profile:null,prompt:null,rev:null,rightMargin:Ce,rules:null,scheme:null,scrolling:Mt,standby:null,summary:null,text:null,topMargin:Ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ce,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ue,disableRemotePlayback:Ue,prefix:null,property:null,results:Ce,security:null,unselectable:null},space:"html",transform:h_}),P1=zs({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:Dn,accentHeight:Ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ce,amplitude:Ce,arabicForm:null,ascent:Ce,attributeName:null,attributeType:null,azimuth:Ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ce,by:null,calcMode:null,capHeight:Ce,className:ct,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:Ce,diffuseConstant:Ce,direction:null,display:null,dur:null,divisor:Ce,dominantBaseline:null,download:Ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ce,enableBackground:null,end:null,event:null,exponent:Ce,externalResourcesRequired:null,fill:null,fillOpacity:Ce,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Bs,g2:Bs,glyphName:Bs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ce,horizOriginX:Ce,horizOriginY:Ce,id:null,ideographic:Ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ce,k:Ce,k1:Ce,k2:Ce,k3:Ce,k4:Ce,kernelMatrix:Dn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ce,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:Ce,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:Ce,overlineThickness:Ce,paintOrder:null,panose1:null,path:null,pathLength:Ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ce,pointsAtY:Ce,pointsAtZ:Ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Dn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Dn,rev:Dn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Dn,requiredFeatures:Dn,requiredFonts:Dn,requiredFormats:Dn,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:Ce,specularExponent:Ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ce,strikethroughThickness:Ce,string:null,stroke:null,strokeDashArray:Dn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ce,strokeOpacity:Ce,strokeWidth:null,style:null,surfaceScale:Ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Dn,tabIndex:Ce,tableValues:null,target:null,targetX:Ce,targetY:Ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Dn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ce,underlineThickness:Ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ce,values:null,vAlphabetic:Ce,vMathematical:Ce,vectorEffect:null,vHanging:Ce,vIdeographic:Ce,version:null,vertAdvY:Ce,vertOriginX:Ce,vertOriginY:Ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:u_}),f_=zs({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()}}),d_=zs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:h_}),p_=zs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,r){return"xml:"+r.slice(3).toLowerCase()}}),F1={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"},q1=/[A-Z]/g,Jm=/-[a-z]/g,$1=/^data[-\w.:]+$/i;function G1(n,r){const s=gh(r);let l=r,d=yn;if(s in n.normal)return n.property[n.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&$1.test(r)){if(r.charAt(4)==="-"){const p=r.slice(5).replace(Jm,W1);l="data"+p.charAt(0).toUpperCase()+p.slice(1)}else{const p=r.slice(4);if(!Jm.test(p)){let f=p.replace(q1,V1);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}d=Lh}return new d(l,r)}function V1(n){return"-"+n.toLowerCase()}function W1(n){return n.charAt(1).toUpperCase()}const K1=o_([c_,U1,f_,d_,p_],"html"),Oh=o_([c_,P1,f_,d_,p_],"svg");function Y1(n){return n.join(" ").trim()}var Ds={},Wu,Zm;function X1(){if(Zm)return Wu;Zm=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,s=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,d=/^:\s*/,p=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,o=/^\s+|\s+$/g,c=`
|
|
63
|
+
`,h="/",g="*",u="",y="comment",w="declaration";function T(S,v){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];v=v||{};var _=1,b=1;function A(K){var Y=K.match(r);Y&&(_+=Y.length);var G=K.lastIndexOf(c);b=~G?K.length-G:b+K.length}function L(){var K={line:_,column:b};return function(Y){return Y.position=new D(K),M(),Y}}function D(K){this.start=K,this.end={line:_,column:b},this.source=v.source}D.prototype.content=S;function R(K){var Y=new Error(v.source+":"+_+":"+b+": "+K);if(Y.reason=K,Y.filename=v.source,Y.line=_,Y.column=b,Y.source=S,!v.silent)throw Y}function k(K){var Y=K.exec(S);if(Y){var G=Y[0];return A(G),S=S.slice(G.length),Y}}function M(){k(s)}function B(K){var Y;for(K=K||[];Y=H();)Y!==!1&&K.push(Y);return K}function H(){var K=L();if(!(h!=S.charAt(0)||g!=S.charAt(1))){for(var Y=2;u!=S.charAt(Y)&&(g!=S.charAt(Y)||h!=S.charAt(Y+1));)++Y;if(Y+=2,u===S.charAt(Y-1))return R("End of comment missing");var G=S.slice(2,Y-2);return b+=2,A(G),S=S.slice(Y),b+=2,K({type:y,comment:G})}}function U(){var K=L(),Y=k(l);if(Y){if(H(),!k(d))return R("property missing ':'");var G=k(p),W=K({type:w,property:E(Y[0].replace(n,u)),value:G?E(G[0].replace(n,u)):u});return k(f),W}}function P(){var K=[];B(K);for(var Y;Y=U();)Y!==!1&&(K.push(Y),B(K));return K}return M(),P()}function E(S){return S?S.replace(o,u):u}return Wu=T,Wu}var eg;function Q1(){if(eg)return Ds;eg=1;var n=Ds&&Ds.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.default=s;const r=n(X1());function s(l,d){let p=null;if(!l||typeof l!="string")return p;const f=(0,r.default)(l),o=typeof d=="function";return f.forEach(c=>{if(c.type!=="declaration")return;const{property:h,value:g}=c;o?d(h,g,c):g&&(p=p||{},p[h]=g)}),p}return Ds}var Ha={},tg;function J1(){if(tg)return Ha;tg=1,Object.defineProperty(Ha,"__esModule",{value:!0}),Ha.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,s=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,d=/^-(ms)-/,p=function(h){return!h||s.test(h)||n.test(h)},f=function(h,g){return g.toUpperCase()},o=function(h,g){return"".concat(g,"-")},c=function(h,g){return g===void 0&&(g={}),p(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(d,o):h=h.replace(l,o),h.replace(r,f))};return Ha.camelCase=c,Ha}var za,ng;function Z1(){if(ng)return za;ng=1;var n=za&&za.__importDefault||function(d){return d&&d.__esModule?d:{default:d}},r=n(Q1()),s=J1();function l(d,p){var f={};return!d||typeof d!="string"||(0,r.default)(d,function(o,c){o&&c&&(f[(0,s.camelCase)(o,p)]=c)}),f}return l.default=l,za=l,za}var eS=Z1();const tS=Qg(eS),m_=g_("end"),Bh=g_("start");function g_(n){return r;function r(s){const l=s&&s.position&&s.position[n]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function nS(n){const r=Bh(n),s=m_(n);if(r&&s)return{start:r,end:s}}function Fa(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?ig(n.position):"start"in n||"end"in n?ig(n):"line"in n||"column"in n?yh(n):""}function yh(n){return rg(n&&n.line)+":"+rg(n&&n.column)}function ig(n){return yh(n&&n.start)+"-"+yh(n&&n.end)}function rg(n){return n&&typeof n=="number"?n:1}class Xt extends Error{constructor(r,s,l){super(),typeof s=="string"&&(l=s,s=void 0);let d="",p={},f=!1;if(s&&("line"in s&&"column"in s?p={place:s}:"start"in s&&"end"in s?p={place:s}:"type"in s?p={ancestors:[s],place:s.position}:p={...s}),typeof r=="string"?d=r:!p.cause&&r&&(f=!0,d=r.message,p.cause=r),!p.ruleId&&!p.source&&typeof l=="string"){const c=l.indexOf(":");c===-1?p.ruleId=l:(p.source=l.slice(0,c),p.ruleId=l.slice(c+1))}if(!p.place&&p.ancestors&&p.ancestors){const c=p.ancestors[p.ancestors.length-1];c&&(p.place=c.position)}const o=p.place&&"start"in p.place?p.place.start:p.place;this.ancestors=p.ancestors||void 0,this.cause=p.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=d,this.line=o?o.line:void 0,this.name=Fa(p.place)||"1:1",this.place=p.place||void 0,this.reason=this.message,this.ruleId=p.ruleId||void 0,this.source=p.source||void 0,this.stack=f&&p.cause&&typeof p.cause.stack=="string"?p.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Xt.prototype.file="";Xt.prototype.name="";Xt.prototype.reason="";Xt.prototype.message="";Xt.prototype.stack="";Xt.prototype.column=void 0;Xt.prototype.line=void 0;Xt.prototype.ancestors=void 0;Xt.prototype.cause=void 0;Xt.prototype.fatal=void 0;Xt.prototype.place=void 0;Xt.prototype.ruleId=void 0;Xt.prototype.source=void 0;const jh={}.hasOwnProperty,iS=new Map,rS=/[A-Z]/g,sS=new Set(["table","tbody","thead","tfoot","tr"]),aS=new Set(["td","th"]),__="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function lS(n,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=r.filePath||void 0;let l;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=mS(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");l=pS(s,r.jsx,r.jsxs)}const d={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:l,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"?Oh:K1,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},p=v_(d,n,void 0);return p&&typeof p!="string"?p:d.create(n,d.Fragment,{children:p||void 0},void 0)}function v_(n,r,s){if(r.type==="element")return oS(n,r,s);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return cS(n,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return hS(n,r,s);if(r.type==="mdxjsEsm")return uS(n,r);if(r.type==="root")return fS(n,r,s);if(r.type==="text")return dS(n,r)}function oS(n,r,s){const l=n.schema;let d=l;r.tagName.toLowerCase()==="svg"&&l.space==="html"&&(d=Oh,n.schema=d),n.ancestors.push(r);const p=S_(n,r.tagName,!1),f=gS(n,r);let o=Hh(n,r);return sS.has(r.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!z1(c):!0})),y_(n,f,p,r),Nh(f,o),n.ancestors.pop(),n.schema=l,n.create(r,p,f,s)}function cS(n,r){if(r.data&&r.data.estree&&n.evaluater){const l=r.data.estree.body[0];return l.type,n.evaluater.evaluateExpression(l.expression)}Ka(n,r.position)}function uS(n,r){if(r.data&&r.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(r.data.estree);Ka(n,r.position)}function hS(n,r,s){const l=n.schema;let d=l;r.name==="svg"&&l.space==="html"&&(d=Oh,n.schema=d),n.ancestors.push(r);const p=r.name===null?n.Fragment:S_(n,r.name,!0),f=_S(n,r),o=Hh(n,r);return y_(n,f,p,r),Nh(f,o),n.ancestors.pop(),n.schema=l,n.create(r,p,f,s)}function fS(n,r,s){const l={};return Nh(l,Hh(n,r)),n.create(r,n.Fragment,l,s)}function dS(n,r){return r.value}function y_(n,r,s,l){typeof s!="string"&&s!==n.Fragment&&n.passNode&&(r.node=l)}function Nh(n,r){if(r.length>0){const s=r.length>1?r:r[0];s&&(n.children=s)}}function pS(n,r,s){return l;function l(d,p,f,o){const h=Array.isArray(f.children)?s:r;return o?h(p,f,o):h(p,f)}}function mS(n,r){return s;function s(l,d,p,f){const o=Array.isArray(p.children),c=Bh(l);return r(d,p,f,o,{columnNumber:c?c.column-1:void 0,fileName:n,lineNumber:c?c.line:void 0},void 0)}}function gS(n,r){const s={};let l,d;for(d in r.properties)if(d!=="children"&&jh.call(r.properties,d)){const p=vS(n,d,r.properties[d]);if(p){const[f,o]=p;n.tableCellAlignToStyle&&f==="align"&&typeof o=="string"&&aS.has(r.tagName)?l=o:s[f]=o}}if(l){const p=s.style||(s.style={});p[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return s}function _S(n,r){const s={};for(const l of r.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&n.evaluater){const p=l.data.estree.body[0];p.type;const f=p.expression;f.type;const o=f.properties[0];o.type,Object.assign(s,n.evaluater.evaluateExpression(o.argument))}else Ka(n,r.position);else{const d=l.name;let p;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&n.evaluater){const o=l.value.data.estree.body[0];o.type,p=n.evaluater.evaluateExpression(o.expression)}else Ka(n,r.position);else p=l.value===null?!0:l.value;s[d]=p}return s}function Hh(n,r){const s=[];let l=-1;const d=n.passKeys?new Map:iS;for(;++l<r.children.length;){const p=r.children[l];let f;if(n.passKeys){const c=p.type==="element"?p.tagName:p.type==="mdxJsxFlowElement"||p.type==="mdxJsxTextElement"?p.name:void 0;if(c){const h=d.get(c)||0;f=c+"-"+h,d.set(c,h+1)}}const o=v_(n,p,f);o!==void 0&&s.push(o)}return s}function vS(n,r,s){const l=G1(n.schema,r);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=l.commaSeparated?O1(s):Y1(s)),l.property==="style"){let d=typeof s=="object"?s:yS(n,String(s));return n.stylePropertyNameCase==="css"&&(d=SS(d)),["style",d]}return[n.elementAttributeNameCase==="react"&&l.space?F1[l.property]||l.property:l.attribute,s]}}function yS(n,r){try{return tS(r,{reactCompat:!0})}catch(s){if(n.ignoreInvalidStyle)return{};const l=s,d=new Xt("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw d.file=n.filePath||void 0,d.url=__+"#cannot-parse-style-attribute",d}}function S_(n,r,s){let l;if(!s)l={type:"Literal",value:r};else if(r.includes(".")){const d=r.split(".");let p=-1,f;for(;++p<d.length;){const o=Ym(d[p])?{type:"Identifier",name:d[p]}:{type:"Literal",value:d[p]};f=f?{type:"MemberExpression",object:f,property:o,computed:!!(p&&o.type==="Literal"),optional:!1}:o}l=f}else l=Ym(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(l.type==="Literal"){const d=l.value;return jh.call(n.components,d)?n.components[d]:d}if(n.evaluater)return n.evaluater.evaluateExpression(l);Ka(n)}function Ka(n,r){const s=new Xt("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=__+"#cannot-handle-mdx-estrees-without-createevaluater",s}function SS(n){const r={};let s;for(s in n)jh.call(n,s)&&(r[bS(s)]=n[s]);return r}function bS(n){let r=n.replace(rS,CS);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function CS(n){return"-"+n.toLowerCase()}const Ku={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"]},wS={};function zh(n,r){const s=wS,l=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,d=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return b_(n,l,d)}function b_(n,r,s){if(xS(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 sg(n.children,r,s)}return Array.isArray(n)?sg(n,r,s):""}function sg(n,r,s){const l=[];let d=-1;for(;++d<n.length;)l[d]=b_(n[d],r,s);return l.join("")}function xS(n){return!!(n&&typeof n=="object")}const ag=document.createElement("i");function Ih(n){const r="&"+n+";";ag.innerHTML=r;const s=ag.textContent;return s.charCodeAt(s.length-1)===59&&n!=="semi"||s===r?!1:s}function Mn(n,r,s,l){const d=n.length;let p=0,f;if(r<0?r=-r>d?0:d+r:r=r>d?d:r,s=s>0?s:0,l.length<1e4)f=Array.from(l),f.unshift(r,s),n.splice(...f);else for(s&&n.splice(r,s);p<l.length;)f=l.slice(p,p+1e4),f.unshift(r,0),n.splice(...f),p+=1e4,r+=1e4}function Vn(n,r){return n.length>0?(Mn(n,n.length,0,r),n):r}const lg={}.hasOwnProperty;function C_(n){const r={};let s=-1;for(;++s<n.length;)ES(r,n[s]);return r}function ES(n,r){let s;for(s in r){const d=(lg.call(n,s)?n[s]:void 0)||(n[s]={}),p=r[s];let f;if(p)for(f in p){lg.call(d,f)||(d[f]=[]);const o=p[f];kS(d[f],Array.isArray(o)?o:o?[o]:[])}}}function kS(n,r){let s=-1;const l=[];for(;++s<r.length;)(r[s].add==="after"?n:l).push(r[s]);Mn(n,0,0,l)}function w_(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 ni(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const nn=gr(/[A-Za-z]/),Yt=gr(/[\dA-Za-z]/),AS=gr(/[#-'*+\--9=?A-Z^-~]/);function Eo(n){return n!==null&&(n<32||n===127)}const Sh=gr(/\d/),TS=gr(/[\dA-Fa-f]/),RS=gr(/[!-/:-@[-`{-~]/);function De(n){return n!==null&&n<-2}function ot(n){return n!==null&&(n<0||n===32)}function Ve(n){return n===-2||n===-1||n===32}const Bo=gr(new RegExp("\\p{P}|\\p{S}","u")),Ur=gr(/\s/);function gr(n){return r;function r(s){return s!==null&&s>-1&&n.test(String.fromCharCode(s))}}function Is(n){const r=[];let s=-1,l=0,d=0;for(;++s<n.length;){const p=n.charCodeAt(s);let f="";if(p===37&&Yt(n.charCodeAt(s+1))&&Yt(n.charCodeAt(s+2)))d=2;else if(p<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(p))||(f=String.fromCharCode(p));else if(p>55295&&p<57344){const o=n.charCodeAt(s+1);p<56320&&o>56319&&o<57344?(f=String.fromCharCode(p,o),d=1):f="�"}else f=String.fromCharCode(p);f&&(r.push(n.slice(l,s),encodeURIComponent(f)),l=s+d+1,f=""),d&&(s+=d,d=0)}return r.join("")+n.slice(l)}function Xe(n,r,s,l){const d=l?l-1:Number.POSITIVE_INFINITY;let p=0;return f;function f(c){return Ve(c)?(n.enter(s),o(c)):r(c)}function o(c){return Ve(c)&&p++<d?(n.consume(c),o):(n.exit(s),r(c))}}const DS={tokenize:MS};function MS(n){const r=n.attempt(this.parser.constructs.contentInitial,l,d);let s;return r;function l(o){if(o===null){n.consume(o);return}return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),Xe(n,r,"linePrefix")}function d(o){return n.enter("paragraph"),p(o)}function p(o){const c=n.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=c),s=c,f(o)}function f(o){if(o===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(o);return}return De(o)?(n.consume(o),n.exit("chunkText"),p):(n.consume(o),f)}}const LS={tokenize:OS},og={tokenize:BS};function OS(n){const r=this,s=[];let l=0,d,p,f;return o;function o(b){if(l<s.length){const A=s[l];return r.containerState=A[1],n.attempt(A[0].continuation,c,h)(b)}return h(b)}function c(b){if(l++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,d&&_();const A=r.events.length;let L=A,D;for(;L--;)if(r.events[L][0]==="exit"&&r.events[L][1].type==="chunkFlow"){D=r.events[L][1].end;break}v(l);let R=A;for(;R<r.events.length;)r.events[R][1].end={...D},R++;return Mn(r.events,L+1,0,r.events.slice(A)),r.events.length=R,h(b)}return o(b)}function h(b){if(l===s.length){if(!d)return y(b);if(d.currentConstruct&&d.currentConstruct.concrete)return T(b);r.interrupt=!!(d.currentConstruct&&!d._gfmTableDynamicInterruptHack)}return r.containerState={},n.check(og,g,u)(b)}function g(b){return d&&_(),v(l),y(b)}function u(b){return r.parser.lazy[r.now().line]=l!==s.length,f=r.now().offset,T(b)}function y(b){return r.containerState={},n.attempt(og,w,T)(b)}function w(b){return l++,s.push([r.currentConstruct,r.containerState]),y(b)}function T(b){if(b===null){d&&_(),v(0),n.consume(b);return}return d=d||r.parser.flow(r.now()),n.enter("chunkFlow",{_tokenizer:d,contentType:"flow",previous:p}),E(b)}function E(b){if(b===null){S(n.exit("chunkFlow"),!0),v(0),n.consume(b);return}return De(b)?(n.consume(b),S(n.exit("chunkFlow")),l=0,r.interrupt=void 0,o):(n.consume(b),E)}function S(b,A){const L=r.sliceStream(b);if(A&&L.push(null),b.previous=p,p&&(p.next=b),p=b,d.defineSkip(b.start),d.write(L),r.parser.lazy[b.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 R=r.events.length;let k=R,M,B;for(;k--;)if(r.events[k][0]==="exit"&&r.events[k][1].type==="chunkFlow"){if(M){B=r.events[k][1].end;break}M=!0}for(v(l),D=R;D<r.events.length;)r.events[D][1].end={...B},D++;Mn(r.events,k+1,0,r.events.slice(R)),r.events.length=D}}function v(b){let A=s.length;for(;A-- >b;){const L=s[A];r.containerState=L[1],L[0].exit.call(r,n)}s.length=b}function _(){d.write([null]),p=void 0,d=void 0,r.containerState._closeFlow=void 0}}function BS(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 js(n){if(n===null||ot(n)||Ur(n))return 1;if(Bo(n))return 2}function jo(n,r,s){const l=[];let d=-1;for(;++d<n.length;){const p=n[d].resolveAll;p&&!l.includes(p)&&(r=p(r,s),l.push(p))}return r}const bh={name:"attention",resolveAll:jS,tokenize:NS};function jS(n,r){let s=-1,l,d,p,f,o,c,h,g;for(;++s<n.length;)if(n[s][0]==="enter"&&n[s][1].type==="attentionSequence"&&n[s][1]._close){for(l=s;l--;)if(n[l][0]==="exit"&&n[l][1].type==="attentionSequence"&&n[l][1]._open&&r.sliceSerialize(n[l][1]).charCodeAt(0)===r.sliceSerialize(n[s][1]).charCodeAt(0)){if((n[l][1]._close||n[s][1]._open)&&(n[s][1].end.offset-n[s][1].start.offset)%3&&!((n[l][1].end.offset-n[l][1].start.offset+n[s][1].end.offset-n[s][1].start.offset)%3))continue;c=n[l][1].end.offset-n[l][1].start.offset>1&&n[s][1].end.offset-n[s][1].start.offset>1?2:1;const u={...n[l][1].end},y={...n[s][1].start};cg(u,-c),cg(y,c),f={type:c>1?"strongSequence":"emphasisSequence",start:u,end:{...n[l][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...n[s][1].start},end:y},p={type:c>1?"strongText":"emphasisText",start:{...n[l][1].end},end:{...n[s][1].start}},d={type:c>1?"strong":"emphasis",start:{...f.start},end:{...o.end}},n[l][1].end={...f.start},n[s][1].start={...o.end},h=[],n[l][1].end.offset-n[l][1].start.offset&&(h=Vn(h,[["enter",n[l][1],r],["exit",n[l][1],r]])),h=Vn(h,[["enter",d,r],["enter",f,r],["exit",f,r],["enter",p,r]]),h=Vn(h,jo(r.parser.constructs.insideSpan.null,n.slice(l+1,s),r)),h=Vn(h,[["exit",p,r],["enter",o,r],["exit",o,r],["exit",d,r]]),n[s][1].end.offset-n[s][1].start.offset?(g=2,h=Vn(h,[["enter",n[s][1],r],["exit",n[s][1],r]])):g=0,Mn(n,l-1,s-l+3,h),s=l+h.length-g-2;break}}for(s=-1;++s<n.length;)n[s][1].type==="attentionSequence"&&(n[s][1].type="data");return n}function NS(n,r){const s=this.parser.constructs.attentionMarkers.null,l=this.previous,d=js(l);let p;return f;function f(c){return p=c,n.enter("attentionSequence"),o(c)}function o(c){if(c===p)return n.consume(c),o;const h=n.exit("attentionSequence"),g=js(c),u=!g||g===2&&d||s.includes(c),y=!d||d===2&&g||s.includes(l);return h._open=!!(p===42?u:u&&(d||!y)),h._close=!!(p===42?y:y&&(g||!u)),r(c)}}function cg(n,r){n.column+=r,n.offset+=r,n._bufferIndex+=r}const HS={name:"autolink",tokenize:zS};function zS(n,r,s){let l=0;return d;function d(w){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(w),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),p}function p(w){return nn(w)?(n.consume(w),f):w===64?s(w):h(w)}function f(w){return w===43||w===45||w===46||Yt(w)?(l=1,o(w)):h(w)}function o(w){return w===58?(n.consume(w),l=0,c):(w===43||w===45||w===46||Yt(w))&&l++<32?(n.consume(w),o):(l=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||Eo(w)?s(w):(n.consume(w),c)}function h(w){return w===64?(n.consume(w),g):AS(w)?(n.consume(w),h):s(w)}function g(w){return Yt(w)?u(w):s(w)}function u(w){return w===46?(n.consume(w),l=0,g):w===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(w),n.exit("autolinkMarker"),n.exit("autolink"),r):y(w)}function y(w){if((w===45||Yt(w))&&l++<63){const T=w===45?y:u;return n.consume(w),T}return s(w)}}const Ja={partial:!0,tokenize:IS};function IS(n,r,s){return l;function l(p){return Ve(p)?Xe(n,d,"linePrefix")(p):d(p)}function d(p){return p===null||De(p)?r(p):s(p)}}const x_={continuation:{tokenize:PS},exit:FS,name:"blockQuote",tokenize:US};function US(n,r,s){const l=this;return d;function d(f){if(f===62){const o=l.containerState;return o.open||(n.enter("blockQuote",{_container:!0}),o.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(f),n.exit("blockQuoteMarker"),p}return s(f)}function p(f){return Ve(f)?(n.enter("blockQuotePrefixWhitespace"),n.consume(f),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),r):(n.exit("blockQuotePrefix"),r(f))}}function PS(n,r,s){const l=this;return d;function d(f){return Ve(f)?Xe(n,p,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):p(f)}function p(f){return n.attempt(x_,r,s)(f)}}function FS(n){n.exit("blockQuote")}const E_={name:"characterEscape",tokenize:qS};function qS(n,r,s){return l;function l(p){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(p),n.exit("escapeMarker"),d}function d(p){return RS(p)?(n.enter("characterEscapeValue"),n.consume(p),n.exit("characterEscapeValue"),n.exit("characterEscape"),r):s(p)}}const k_={name:"characterReference",tokenize:$S};function $S(n,r,s){const l=this;let d=0,p,f;return o;function o(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"),p=31,f=Yt,g(u))}function h(u){return u===88||u===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(u),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),p=6,f=TS,g):(n.enter("characterReferenceValue"),p=7,f=Sh,g(u))}function g(u){if(u===59&&d){const y=n.exit("characterReferenceValue");return f===Yt&&!Ih(l.sliceSerialize(y))?s(u):(n.enter("characterReferenceMarker"),n.consume(u),n.exit("characterReferenceMarker"),n.exit("characterReference"),r)}return f(u)&&d++<p?(n.consume(u),g):s(u)}}const ug={partial:!0,tokenize:VS},hg={concrete:!0,name:"codeFenced",tokenize:GS};function GS(n,r,s){const l=this,d={partial:!0,tokenize:L};let p=0,f=0,o;return c;function c(D){return h(D)}function h(D){const R=l.events[l.events.length-1];return p=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,o=D,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),g(D)}function g(D){return D===o?(f++,n.consume(D),g):f<3?s(D):(n.exit("codeFencedFenceSequence"),Ve(D)?Xe(n,u,"whitespace")(D):u(D))}function u(D){return D===null||De(D)?(n.exit("codeFencedFence"),l.interrupt?r(D):n.check(ug,E,A)(D)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),y(D))}function y(D){return D===null||De(D)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),u(D)):Ve(D)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),Xe(n,w,"whitespace")(D)):D===96&&D===o?s(D):(n.consume(D),y)}function w(D){return D===null||De(D)?u(D):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),T(D))}function T(D){return D===null||De(D)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),u(D)):D===96&&D===o?s(D):(n.consume(D),T)}function E(D){return n.attempt(d,A,S)(D)}function S(D){return n.enter("lineEnding"),n.consume(D),n.exit("lineEnding"),v}function v(D){return p>0&&Ve(D)?Xe(n,_,"linePrefix",p+1)(D):_(D)}function _(D){return D===null||De(D)?n.check(ug,E,A)(D):(n.enter("codeFlowValue"),b(D))}function b(D){return D===null||De(D)?(n.exit("codeFlowValue"),_(D)):(n.consume(D),b)}function A(D){return n.exit("codeFenced"),r(D)}function L(D,R,k){let M=0;return B;function B(Y){return D.enter("lineEnding"),D.consume(Y),D.exit("lineEnding"),H}function H(Y){return D.enter("codeFencedFence"),Ve(Y)?Xe(D,U,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):U(Y)}function U(Y){return Y===o?(D.enter("codeFencedFenceSequence"),P(Y)):k(Y)}function P(Y){return Y===o?(M++,D.consume(Y),P):M>=f?(D.exit("codeFencedFenceSequence"),Ve(Y)?Xe(D,K,"whitespace")(Y):K(Y)):k(Y)}function K(Y){return Y===null||De(Y)?(D.exit("codeFencedFence"),R(Y)):k(Y)}}}function VS(n,r,s){const l=this;return d;function d(f){return f===null?s(f):(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),p)}function p(f){return l.parser.lazy[l.now().line]?s(f):r(f)}}const Yu={name:"codeIndented",tokenize:KS},WS={partial:!0,tokenize:YS};function KS(n,r,s){const l=this;return d;function d(h){return n.enter("codeIndented"),Xe(n,p,"linePrefix",5)(h)}function p(h){const g=l.events[l.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?f(h):s(h)}function f(h){return h===null?c(h):De(h)?n.attempt(WS,f,c)(h):(n.enter("codeFlowValue"),o(h))}function o(h){return h===null||De(h)?(n.exit("codeFlowValue"),f(h)):(n.consume(h),o)}function c(h){return n.exit("codeIndented"),r(h)}}function YS(n,r,s){const l=this;return d;function d(f){return l.parser.lazy[l.now().line]?s(f):De(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),d):Xe(n,p,"linePrefix",5)(f)}function p(f){const o=l.events[l.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(f):De(f)?d(f):s(f)}}const XS={name:"codeText",previous:JS,resolve:QS,tokenize:ZS};function QS(n){let r=n.length-4,s=3,l,d;if((n[s][1].type==="lineEnding"||n[s][1].type==="space")&&(n[r][1].type==="lineEnding"||n[r][1].type==="space")){for(l=s;++l<r;)if(n[l][1].type==="codeTextData"){n[s][1].type="codeTextPadding",n[r][1].type="codeTextPadding",s+=2,r-=2;break}}for(l=s-1,r++;++l<=r;)d===void 0?l!==r&&n[l][1].type!=="lineEnding"&&(d=l):(l===r||n[l][1].type==="lineEnding")&&(n[d][1].type="codeTextData",l!==d+2&&(n[d][1].end=n[l-1][1].end,n.splice(d+2,l-d-2),r-=l-d-2,l=d+2),d=void 0);return n}function JS(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ZS(n,r,s){let l=0,d,p;return f;function f(u){return n.enter("codeText"),n.enter("codeTextSequence"),o(u)}function o(u){return u===96?(n.consume(u),l++,o):(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?(p=n.enter("codeTextSequence"),d=0,g(u)):De(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||De(u)?(n.exit("codeTextData"),c(u)):(n.consume(u),h)}function g(u){return u===96?(n.consume(u),d++,g):d===l?(n.exit("codeTextSequence"),n.exit("codeText"),r(u)):(p.type="codeTextData",h(u))}}class eb{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 l=s??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(r,l):r>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(r,s,l){const d=s||0;this.setCursor(Math.trunc(r));const p=this.right.splice(this.right.length-d,Number.POSITIVE_INFINITY);return l&&Ia(this.left,l),p.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),Ia(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Ia(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);Ia(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);Ia(this.left,s.reverse())}}}function Ia(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 A_(n){const r={};let s=-1,l,d,p,f,o,c,h;const g=new eb(n);for(;++s<g.length;){for(;s in r;)s=r[s];if(l=g.get(s),s&&l[1].type==="chunkFlow"&&g.get(s-1)[1].type==="listItemPrefix"&&(c=l[1]._tokenizer.events,p=0,p<c.length&&c[p][1].type==="lineEndingBlank"&&(p+=2),p<c.length&&c[p][1].type==="content"))for(;++p<c.length&&c[p][1].type!=="content";)c[p][1].type==="chunkText"&&(c[p][1]._isInFirstContentOfListItem=!0,p++);if(l[0]==="enter")l[1].contentType&&(Object.assign(r,tb(g,s)),s=r[s],h=!0);else if(l[1]._container){for(p=s,d=void 0;p--;)if(f=g.get(p),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(d&&(g.get(d)[1].type="lineEndingBlank"),f[1].type="lineEnding",d=p);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;d&&(l[1].end={...g.get(d)[1].start},o=g.slice(d,s),o.unshift(l),g.splice(d,s-d+1,o))}}return Mn(n,0,Number.POSITIVE_INFINITY,g.slice(0)),!h}function tb(n,r){const s=n.get(r)[1],l=n.get(r)[2];let d=r-1;const p=[];let f=s._tokenizer;f||(f=l.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const o=f.events,c=[],h={};let g,u,y=-1,w=s,T=0,E=0;const S=[E];for(;w;){for(;n.get(++d)[1]!==w;);p.push(d),w._tokenizer||(g=l.sliceStream(w),w.next||g.push(null),u&&f.defineSkip(w.start),w._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(g),w._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),u=w,w=w.next}for(w=s;++y<o.length;)o[y][0]==="exit"&&o[y-1][0]==="enter"&&o[y][1].type===o[y-1][1].type&&o[y][1].start.line!==o[y][1].end.line&&(E=y+1,S.push(E),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(f.events=[],w?(w._tokenizer=void 0,w.previous=void 0):S.pop(),y=S.length;y--;){const v=o.slice(S[y],S[y+1]),_=p.pop();c.push([_,_+v.length-1]),n.splice(_,2,v)}for(c.reverse(),y=-1;++y<c.length;)h[T+c[y][0]]=T+c[y][1],T+=c[y][1]-c[y][0]-1;return h}const nb={resolve:rb,tokenize:sb},ib={partial:!0,tokenize:ab};function rb(n){return A_(n),n}function sb(n,r){let s;return l;function l(o){return n.enter("content"),s=n.enter("chunkContent",{contentType:"content"}),d(o)}function d(o){return o===null?p(o):De(o)?n.check(ib,f,p)(o):(n.consume(o),d)}function p(o){return n.exit("chunkContent"),n.exit("content"),r(o)}function f(o){return n.consume(o),n.exit("chunkContent"),s.next=n.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,d}}function ab(n,r,s){const l=this;return d;function d(f){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),Xe(n,p,"linePrefix")}function p(f){if(f===null||De(f))return s(f);const o=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(f):n.interrupt(l.parser.constructs.flow,s,r)(f)}}function T_(n,r,s,l,d,p,f,o,c){const h=c||Number.POSITIVE_INFINITY;let g=0;return u;function u(v){return v===60?(n.enter(l),n.enter(d),n.enter(p),n.consume(v),n.exit(p),y):v===null||v===32||v===41||Eo(v)?s(v):(n.enter(l),n.enter(f),n.enter(o),n.enter("chunkString",{contentType:"string"}),E(v))}function y(v){return v===62?(n.enter(p),n.consume(v),n.exit(p),n.exit(d),n.exit(l),r):(n.enter(o),n.enter("chunkString",{contentType:"string"}),w(v))}function w(v){return v===62?(n.exit("chunkString"),n.exit(o),y(v)):v===null||v===60||De(v)?s(v):(n.consume(v),v===92?T:w)}function T(v){return v===60||v===62||v===92?(n.consume(v),w):w(v)}function E(v){return!g&&(v===null||v===41||ot(v))?(n.exit("chunkString"),n.exit(o),n.exit(f),n.exit(l),r(v)):g<h&&v===40?(n.consume(v),g++,E):v===41?(n.consume(v),g--,E):v===null||v===32||v===40||Eo(v)?s(v):(n.consume(v),v===92?S:E)}function S(v){return v===40||v===41||v===92?(n.consume(v),E):E(v)}}function R_(n,r,s,l,d,p){const f=this;let o=0,c;return h;function h(w){return n.enter(l),n.enter(d),n.consume(w),n.exit(d),n.enter(p),g}function g(w){return o>999||w===null||w===91||w===93&&!c||w===94&&!o&&"_hiddenFootnoteSupport"in f.parser.constructs?s(w):w===93?(n.exit(p),n.enter(d),n.consume(w),n.exit(d),n.exit(l),r):De(w)?(n.enter("lineEnding"),n.consume(w),n.exit("lineEnding"),g):(n.enter("chunkString",{contentType:"string"}),u(w))}function u(w){return w===null||w===91||w===93||De(w)||o++>999?(n.exit("chunkString"),g(w)):(n.consume(w),c||(c=!Ve(w)),w===92?y:u)}function y(w){return w===91||w===92||w===93?(n.consume(w),o++,u):u(w)}}function D_(n,r,s,l,d,p){let f;return o;function o(y){return y===34||y===39||y===40?(n.enter(l),n.enter(d),n.consume(y),n.exit(d),f=y===40?41:y,c):s(y)}function c(y){return y===f?(n.enter(d),n.consume(y),n.exit(d),n.exit(l),r):(n.enter(p),h(y))}function h(y){return y===f?(n.exit(p),c(f)):y===null?s(y):De(y)?(n.enter("lineEnding"),n.consume(y),n.exit("lineEnding"),Xe(n,h,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),g(y))}function g(y){return y===f||y===null||De(y)?(n.exit("chunkString"),h(y)):(n.consume(y),y===92?u:g)}function u(y){return y===f||y===92?(n.consume(y),g):g(y)}}function qa(n,r){let s;return l;function l(d){return De(d)?(n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),s=!0,l):Ve(d)?Xe(n,l,s?"linePrefix":"lineSuffix")(d):r(d)}}const lb={name:"definition",tokenize:cb},ob={partial:!0,tokenize:ub};function cb(n,r,s){const l=this;let d;return p;function p(w){return n.enter("definition"),f(w)}function f(w){return R_.call(l,n,o,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function o(w){return d=ni(l.sliceSerialize(l.events[l.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 ot(w)?qa(n,h)(w):h(w)}function h(w){return T_(n,g,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function g(w){return n.attempt(ob,u,u)(w)}function u(w){return Ve(w)?Xe(n,y,"whitespace")(w):y(w)}function y(w){return w===null||De(w)?(n.exit("definition"),l.parser.defined.push(d),r(w)):s(w)}}function ub(n,r,s){return l;function l(o){return ot(o)?qa(n,d)(o):s(o)}function d(o){return D_(n,p,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function p(o){return Ve(o)?Xe(n,f,"whitespace")(o):f(o)}function f(o){return o===null||De(o)?r(o):s(o)}}const hb={name:"hardBreakEscape",tokenize:fb};function fb(n,r,s){return l;function l(p){return n.enter("hardBreakEscape"),n.consume(p),d}function d(p){return De(p)?(n.exit("hardBreakEscape"),r(p)):s(p)}}const db={name:"headingAtx",resolve:pb,tokenize:mb};function pb(n,r){let s=n.length-2,l=3,d,p;return n[l][1].type==="whitespace"&&(l+=2),s-2>l&&n[s][1].type==="whitespace"&&(s-=2),n[s][1].type==="atxHeadingSequence"&&(l===s-1||s-4>l&&n[s-2][1].type==="whitespace")&&(s-=l+1===s?2:4),s>l&&(d={type:"atxHeadingText",start:n[l][1].start,end:n[s][1].end},p={type:"chunkText",start:n[l][1].start,end:n[s][1].end,contentType:"text"},Mn(n,l,s-l+1,[["enter",d,r],["enter",p,r],["exit",p,r],["exit",d,r]])),n}function mb(n,r,s){let l=0;return d;function d(g){return n.enter("atxHeading"),p(g)}function p(g){return n.enter("atxHeadingSequence"),f(g)}function f(g){return g===35&&l++<6?(n.consume(g),f):g===null||ot(g)?(n.exit("atxHeadingSequence"),o(g)):s(g)}function o(g){return g===35?(n.enter("atxHeadingSequence"),c(g)):g===null||De(g)?(n.exit("atxHeading"),r(g)):Ve(g)?Xe(n,o,"whitespace")(g):(n.enter("atxHeadingText"),h(g))}function c(g){return g===35?(n.consume(g),c):(n.exit("atxHeadingSequence"),o(g))}function h(g){return g===null||g===35||ot(g)?(n.exit("atxHeadingText"),o(g)):(n.consume(g),h)}}const gb=["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"],fg=["pre","script","style","textarea"],_b={concrete:!0,name:"htmlFlow",resolveTo:Sb,tokenize:bb},vb={partial:!0,tokenize:wb},yb={partial:!0,tokenize:Cb};function Sb(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 bb(n,r,s){const l=this;let d,p,f,o,c;return h;function h(I){return g(I)}function g(I){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(I),u}function u(I){return I===33?(n.consume(I),y):I===47?(n.consume(I),p=!0,E):I===63?(n.consume(I),d=3,l.interrupt?r:j):nn(I)?(n.consume(I),f=String.fromCharCode(I),S):s(I)}function y(I){return I===45?(n.consume(I),d=2,w):I===91?(n.consume(I),d=5,o=0,T):nn(I)?(n.consume(I),d=4,l.interrupt?r:j):s(I)}function w(I){return I===45?(n.consume(I),l.interrupt?r:j):s(I)}function T(I){const re="CDATA[";return I===re.charCodeAt(o++)?(n.consume(I),o===re.length?l.interrupt?r:U:T):s(I)}function E(I){return nn(I)?(n.consume(I),f=String.fromCharCode(I),S):s(I)}function S(I){if(I===null||I===47||I===62||ot(I)){const re=I===47,ve=f.toLowerCase();return!re&&!p&&fg.includes(ve)?(d=1,l.interrupt?r(I):U(I)):gb.includes(f.toLowerCase())?(d=6,re?(n.consume(I),v):l.interrupt?r(I):U(I)):(d=7,l.interrupt&&!l.parser.lazy[l.now().line]?s(I):p?_(I):b(I))}return I===45||Yt(I)?(n.consume(I),f+=String.fromCharCode(I),S):s(I)}function v(I){return I===62?(n.consume(I),l.interrupt?r:U):s(I)}function _(I){return Ve(I)?(n.consume(I),_):B(I)}function b(I){return I===47?(n.consume(I),B):I===58||I===95||nn(I)?(n.consume(I),A):Ve(I)?(n.consume(I),b):B(I)}function A(I){return I===45||I===46||I===58||I===95||Yt(I)?(n.consume(I),A):L(I)}function L(I){return I===61?(n.consume(I),D):Ve(I)?(n.consume(I),L):b(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,R):Ve(I)?(n.consume(I),D):k(I)}function R(I){return I===c?(n.consume(I),c=null,M):I===null||De(I)?s(I):(n.consume(I),R)}function k(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||ot(I)?L(I):(n.consume(I),k)}function M(I){return I===47||I===62||Ve(I)?b(I):s(I)}function B(I){return I===62?(n.consume(I),H):s(I)}function H(I){return I===null||De(I)?U(I):Ve(I)?(n.consume(I),H):s(I)}function U(I){return I===45&&d===2?(n.consume(I),G):I===60&&d===1?(n.consume(I),W):I===62&&d===4?(n.consume(I),N):I===63&&d===3?(n.consume(I),j):I===93&&d===5?(n.consume(I),z):De(I)&&(d===6||d===7)?(n.exit("htmlFlowData"),n.check(vb,$,P)(I)):I===null||De(I)?(n.exit("htmlFlowData"),P(I)):(n.consume(I),U)}function P(I){return n.check(yb,K,$)(I)}function K(I){return n.enter("lineEnding"),n.consume(I),n.exit("lineEnding"),Y}function Y(I){return I===null||De(I)?P(I):(n.enter("htmlFlowData"),U(I))}function G(I){return I===45?(n.consume(I),j):U(I)}function W(I){return I===47?(n.consume(I),f="",Z):U(I)}function Z(I){if(I===62){const re=f.toLowerCase();return fg.includes(re)?(n.consume(I),N):U(I)}return nn(I)&&f.length<8?(n.consume(I),f+=String.fromCharCode(I),Z):U(I)}function z(I){return I===93?(n.consume(I),j):U(I)}function j(I){return I===62?(n.consume(I),N):I===45&&d===2?(n.consume(I),j):U(I)}function N(I){return I===null||De(I)?(n.exit("htmlFlowData"),$(I)):(n.consume(I),N)}function $(I){return n.exit("htmlFlow"),r(I)}}function Cb(n,r,s){const l=this;return d;function d(f){return De(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),p):s(f)}function p(f){return l.parser.lazy[l.now().line]?s(f):r(f)}}function wb(n,r,s){return l;function l(d){return n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),n.attempt(Ja,r,s)}}const xb={name:"htmlText",tokenize:Eb};function Eb(n,r,s){const l=this;let d,p,f;return o;function o(j){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(j),c}function c(j){return j===33?(n.consume(j),h):j===47?(n.consume(j),L):j===63?(n.consume(j),b):nn(j)?(n.consume(j),k):s(j)}function h(j){return j===45?(n.consume(j),g):j===91?(n.consume(j),p=0,T):nn(j)?(n.consume(j),_):s(j)}function g(j){return j===45?(n.consume(j),w):s(j)}function u(j){return j===null?s(j):j===45?(n.consume(j),y):De(j)?(f=u,W(j)):(n.consume(j),u)}function y(j){return j===45?(n.consume(j),w):u(j)}function w(j){return j===62?G(j):j===45?y(j):u(j)}function T(j){const N="CDATA[";return j===N.charCodeAt(p++)?(n.consume(j),p===N.length?E:T):s(j)}function E(j){return j===null?s(j):j===93?(n.consume(j),S):De(j)?(f=E,W(j)):(n.consume(j),E)}function S(j){return j===93?(n.consume(j),v):E(j)}function v(j){return j===62?G(j):j===93?(n.consume(j),v):E(j)}function _(j){return j===null||j===62?G(j):De(j)?(f=_,W(j)):(n.consume(j),_)}function b(j){return j===null?s(j):j===63?(n.consume(j),A):De(j)?(f=b,W(j)):(n.consume(j),b)}function A(j){return j===62?G(j):b(j)}function L(j){return nn(j)?(n.consume(j),D):s(j)}function D(j){return j===45||Yt(j)?(n.consume(j),D):R(j)}function R(j){return De(j)?(f=R,W(j)):Ve(j)?(n.consume(j),R):G(j)}function k(j){return j===45||Yt(j)?(n.consume(j),k):j===47||j===62||ot(j)?M(j):s(j)}function M(j){return j===47?(n.consume(j),G):j===58||j===95||nn(j)?(n.consume(j),B):De(j)?(f=M,W(j)):Ve(j)?(n.consume(j),M):G(j)}function B(j){return j===45||j===46||j===58||j===95||Yt(j)?(n.consume(j),B):H(j)}function H(j){return j===61?(n.consume(j),U):De(j)?(f=H,W(j)):Ve(j)?(n.consume(j),H):M(j)}function U(j){return j===null||j===60||j===61||j===62||j===96?s(j):j===34||j===39?(n.consume(j),d=j,P):De(j)?(f=U,W(j)):Ve(j)?(n.consume(j),U):(n.consume(j),K)}function P(j){return j===d?(n.consume(j),d=void 0,Y):j===null?s(j):De(j)?(f=P,W(j)):(n.consume(j),P)}function K(j){return j===null||j===34||j===39||j===60||j===61||j===96?s(j):j===47||j===62||ot(j)?M(j):(n.consume(j),K)}function Y(j){return j===47||j===62||ot(j)?M(j):s(j)}function G(j){return j===62?(n.consume(j),n.exit("htmlTextData"),n.exit("htmlText"),r):s(j)}function W(j){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(j),n.exit("lineEnding"),Z}function Z(j){return Ve(j)?Xe(n,z,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):z(j)}function z(j){return n.enter("htmlTextData"),f(j)}}const Uh={name:"labelEnd",resolveAll:Rb,resolveTo:Db,tokenize:Mb},kb={tokenize:Lb},Ab={tokenize:Ob},Tb={tokenize:Bb};function Rb(n){let r=-1;const s=[];for(;++r<n.length;){const l=n[r][1];if(s.push(n[r]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const d=l.type==="labelImage"?4:2;l.type="data",r+=d}}return n.length!==s.length&&Mn(n,0,n.length,s),n}function Db(n,r){let s=n.length,l=0,d,p,f,o;for(;s--;)if(d=n[s][1],p){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&&(p=s,d.type!=="labelLink")){l=2;break}}else d.type==="labelEnd"&&(f=s);const c={type:n[p][1].type==="labelLink"?"link":"image",start:{...n[p][1].start},end:{...n[n.length-1][1].end}},h={type:"label",start:{...n[p][1].start},end:{...n[f][1].end}},g={type:"labelText",start:{...n[p+l+2][1].end},end:{...n[f-2][1].start}};return o=[["enter",c,r],["enter",h,r]],o=Vn(o,n.slice(p+1,p+l+3)),o=Vn(o,[["enter",g,r]]),o=Vn(o,jo(r.parser.constructs.insideSpan.null,n.slice(p+l+4,f-3),r)),o=Vn(o,[["exit",g,r],n[f-2],n[f-1],["exit",h,r]]),o=Vn(o,n.slice(f+1)),o=Vn(o,[["exit",c,r]]),Mn(n,p,n.length,o),n}function Mb(n,r,s){const l=this;let d=l.events.length,p,f;for(;d--;)if((l.events[d][1].type==="labelImage"||l.events[d][1].type==="labelLink")&&!l.events[d][1]._balanced){p=l.events[d][1];break}return o;function o(y){return p?p._inactive?u(y):(f=l.parser.defined.includes(ni(l.sliceSerialize({start:p.end,end:l.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(y),n.exit("labelMarker"),n.exit("labelEnd"),c):s(y)}function c(y){return y===40?n.attempt(kb,g,f?g:u)(y):y===91?n.attempt(Ab,g,f?h:u)(y):f?g(y):u(y)}function h(y){return n.attempt(Tb,g,u)(y)}function g(y){return r(y)}function u(y){return p._balanced=!0,s(y)}}function Lb(n,r,s){return l;function l(u){return n.enter("resource"),n.enter("resourceMarker"),n.consume(u),n.exit("resourceMarker"),d}function d(u){return ot(u)?qa(n,p)(u):p(u)}function p(u){return u===41?g(u):T_(n,f,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function f(u){return ot(u)?qa(n,c)(u):g(u)}function o(u){return s(u)}function c(u){return u===34||u===39||u===40?D_(n,h,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):g(u)}function h(u){return ot(u)?qa(n,g)(u):g(u)}function g(u){return u===41?(n.enter("resourceMarker"),n.consume(u),n.exit("resourceMarker"),n.exit("resource"),r):s(u)}}function Ob(n,r,s){const l=this;return d;function d(o){return R_.call(l,n,p,f,"reference","referenceMarker","referenceString")(o)}function p(o){return l.parser.defined.includes(ni(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?r(o):s(o)}function f(o){return s(o)}}function Bb(n,r,s){return l;function l(p){return n.enter("reference"),n.enter("referenceMarker"),n.consume(p),n.exit("referenceMarker"),d}function d(p){return p===93?(n.enter("referenceMarker"),n.consume(p),n.exit("referenceMarker"),n.exit("reference"),r):s(p)}}const jb={name:"labelStartImage",resolveAll:Uh.resolveAll,tokenize:Nb};function Nb(n,r,s){const l=this;return d;function d(o){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(o),n.exit("labelImageMarker"),p}function p(o){return o===91?(n.enter("labelMarker"),n.consume(o),n.exit("labelMarker"),n.exit("labelImage"),f):s(o)}function f(o){return o===94&&"_hiddenFootnoteSupport"in l.parser.constructs?s(o):r(o)}}const Hb={name:"labelStartLink",resolveAll:Uh.resolveAll,tokenize:zb};function zb(n,r,s){const l=this;return d;function d(f){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(f),n.exit("labelMarker"),n.exit("labelLink"),p}function p(f){return f===94&&"_hiddenFootnoteSupport"in l.parser.constructs?s(f):r(f)}}const Xu={name:"lineEnding",tokenize:Ib};function Ib(n,r){return s;function s(l){return n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),Xe(n,r,"linePrefix")}}const Co={name:"thematicBreak",tokenize:Ub};function Ub(n,r,s){let l=0,d;return p;function p(h){return n.enter("thematicBreak"),f(h)}function f(h){return d=h,o(h)}function o(h){return h===d?(n.enter("thematicBreakSequence"),c(h)):l>=3&&(h===null||De(h))?(n.exit("thematicBreak"),r(h)):s(h)}function c(h){return h===d?(n.consume(h),l++,c):(n.exit("thematicBreakSequence"),Ve(h)?Xe(n,o,"whitespace")(h):o(h))}}const vn={continuation:{tokenize:$b},exit:Vb,name:"list",tokenize:qb},Pb={partial:!0,tokenize:Wb},Fb={partial:!0,tokenize:Gb};function qb(n,r,s){const l=this,d=l.events[l.events.length-1];let p=d&&d[1].type==="linePrefix"?d[2].sliceSerialize(d[1],!0).length:0,f=0;return o;function o(w){const T=l.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(T==="listUnordered"?!l.containerState.marker||w===l.containerState.marker:Sh(w)){if(l.containerState.type||(l.containerState.type=T,n.enter(T,{_container:!0})),T==="listUnordered")return n.enter("listItemPrefix"),w===42||w===45?n.check(Co,s,h)(w):h(w);if(!l.interrupt||w===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),c(w)}return s(w)}function c(w){return Sh(w)&&++f<10?(n.consume(w),c):(!l.interrupt||f<2)&&(l.containerState.marker?w===l.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"),l.containerState.marker=l.containerState.marker||w,n.check(Ja,l.interrupt?s:g,n.attempt(Pb,y,u))}function g(w){return l.containerState.initialBlankLine=!0,p++,y(w)}function u(w){return Ve(w)?(n.enter("listItemPrefixWhitespace"),n.consume(w),n.exit("listItemPrefixWhitespace"),y):s(w)}function y(w){return l.containerState.size=p+l.sliceSerialize(n.exit("listItemPrefix"),!0).length,r(w)}}function $b(n,r,s){const l=this;return l.containerState._closeFlow=void 0,n.check(Ja,d,p);function d(o){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,Xe(n,r,"listItemIndent",l.containerState.size+1)(o)}function p(o){return l.containerState.furtherBlankLines||!Ve(o)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,f(o)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,n.attempt(Fb,r,f)(o))}function f(o){return l.containerState._closeFlow=!0,l.interrupt=void 0,Xe(n,n.attempt(vn,r,s),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Gb(n,r,s){const l=this;return Xe(n,d,"listItemIndent",l.containerState.size+1);function d(p){const f=l.events[l.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===l.containerState.size?r(p):s(p)}}function Vb(n){n.exit(this.containerState.type)}function Wb(n,r,s){const l=this;return Xe(n,d,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function d(p){const f=l.events[l.events.length-1];return!Ve(p)&&f&&f[1].type==="listItemPrefixWhitespace"?r(p):s(p)}}const dg={name:"setextUnderline",resolveTo:Kb,tokenize:Yb};function Kb(n,r){let s=n.length,l,d,p;for(;s--;)if(n[s][0]==="enter"){if(n[s][1].type==="content"){l=s;break}n[s][1].type==="paragraph"&&(d=s)}else n[s][1].type==="content"&&n.splice(s,1),!p&&n[s][1].type==="definition"&&(p=s);const f={type:"setextHeading",start:{...n[l][1].start},end:{...n[n.length-1][1].end}};return n[d][1].type="setextHeadingText",p?(n.splice(d,0,["enter",f,r]),n.splice(p+1,0,["exit",n[l][1],r]),n[l][1].end={...n[p][1].end}):n[l][1]=f,n.push(["exit",f,r]),n}function Yb(n,r,s){const l=this;let d;return p;function p(h){let g=l.events.length,u;for(;g--;)if(l.events[g][1].type!=="lineEnding"&&l.events[g][1].type!=="linePrefix"&&l.events[g][1].type!=="content"){u=l.events[g][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||u)?(n.enter("setextHeadingLine"),d=h,f(h)):s(h)}function f(h){return n.enter("setextHeadingLineSequence"),o(h)}function o(h){return h===d?(n.consume(h),o):(n.exit("setextHeadingLineSequence"),Ve(h)?Xe(n,c,"lineSuffix")(h):c(h))}function c(h){return h===null||De(h)?(n.exit("setextHeadingLine"),r(h)):s(h)}}const Xb={tokenize:Qb};function Qb(n){const r=this,s=n.attempt(Ja,l,n.attempt(this.parser.constructs.flowInitial,d,Xe(n,n.attempt(this.parser.constructs.flow,d,n.attempt(nb,d)),"linePrefix")));return s;function l(p){if(p===null){n.consume(p);return}return n.enter("lineEndingBlank"),n.consume(p),n.exit("lineEndingBlank"),r.currentConstruct=void 0,s}function d(p){if(p===null){n.consume(p);return}return n.enter("lineEnding"),n.consume(p),n.exit("lineEnding"),r.currentConstruct=void 0,s}}const Jb={resolveAll:L_()},Zb=M_("string"),eC=M_("text");function M_(n){return{resolveAll:L_(n==="text"?tC:void 0),tokenize:r};function r(s){const l=this,d=this.parser.constructs[n],p=s.attempt(d,f,o);return f;function f(g){return h(g)?p(g):o(g)}function o(g){if(g===null){s.consume(g);return}return s.enter("data"),s.consume(g),c}function c(g){return h(g)?(s.exit("data"),p(g)):(s.consume(g),c)}function h(g){if(g===null)return!0;const u=d[g];let y=-1;if(u)for(;++y<u.length;){const w=u[y];if(!w.previous||w.previous.call(l,l.previous))return!0}return!1}}}function L_(n){return r;function r(s,l){let d=-1,p;for(;++d<=s.length;)p===void 0?s[d]&&s[d][1].type==="data"&&(p=d,d++):(!s[d]||s[d][1].type!=="data")&&(d!==p+2&&(s[p][1].end=s[d-1][1].end,s.splice(p+2,d-p-2),d=p+2),p=void 0);return n?n(s,l):s}}function tC(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 l=n[s-1][1],d=r.sliceStream(l);let p=d.length,f=-1,o=0,c;for(;p--;){const h=d[p];if(typeof h=="string"){for(f=h.length;h.charCodeAt(f-1)===32;)o++,f--;if(f)break;f=-1}else if(h===-2)c=!0,o++;else if(h!==-1){p++;break}}if(r._contentTypeTextTrailing&&s===n.length&&(o=0),o){const h={type:s===n.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:p?f:l.start._bufferIndex+f,_index:l.start._index+p,line:l.end.line,column:l.end.column-o,offset:l.end.offset-o},end:{...l.end}};l.end={...h.start},l.start.offset===l.end.offset?Object.assign(l,h):(n.splice(s,0,["enter",h,r],["exit",h,r]),s+=2)}s++}return n}const nC={42:vn,43:vn,45:vn,48:vn,49:vn,50:vn,51:vn,52:vn,53:vn,54:vn,55:vn,56:vn,57:vn,62:x_},iC={91:lb},rC={[-2]:Yu,[-1]:Yu,32:Yu},sC={35:db,42:Co,45:[dg,Co],60:_b,61:dg,95:Co,96:hg,126:hg},aC={38:k_,92:E_},lC={[-5]:Xu,[-4]:Xu,[-3]:Xu,33:jb,38:k_,42:bh,60:[HS,xb],91:Hb,92:[hb,E_],93:Uh,95:bh,96:XS},oC={null:[bh,Jb]},cC={null:[42,95]},uC={null:[]},hC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:cC,contentInitial:iC,disable:uC,document:nC,flow:sC,flowInitial:rC,insideSpan:oC,string:aC,text:lC},Symbol.toStringTag,{value:"Module"}));function fC(n,r,s){let l={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const d={},p=[];let f=[],o=[];const c={attempt:R(L),check:R(D),consume:_,enter:b,exit:A,interrupt:R(D,{interrupt:!0})},h={code:null,containerState:{},defineSkip:E,events:[],now:T,parser:n,previous:null,sliceSerialize:y,sliceStream:w,write:u};let g=r.tokenize.call(h,c);return r.resolveAll&&p.push(r),h;function u(H){return f=Vn(f,H),S(),f[f.length-1]!==null?[]:(k(r,0),h.events=jo(p,h.events,h),h.events)}function y(H,U){return pC(w(H),U)}function w(H){return dC(f,H)}function T(){const{_bufferIndex:H,_index:U,line:P,column:K,offset:Y}=l;return{_bufferIndex:H,_index:U,line:P,column:K,offset:Y}}function E(H){d[H.line]=H.column,B()}function S(){let H;for(;l._index<f.length;){const U=f[l._index];if(typeof U=="string")for(H=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===H&&l._bufferIndex<U.length;)v(U.charCodeAt(l._bufferIndex));else v(U)}}function v(H){g=g(H)}function _(H){De(H)?(l.line++,l.column=1,l.offset+=H===-3?2:1,B()):H!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===f[l._index].length&&(l._bufferIndex=-1,l._index++)),h.previous=H}function b(H,U){const P=U||{};return P.type=H,P.start=T(),h.events.push(["enter",P,h]),o.push(P),P}function A(H){const U=o.pop();return U.end=T(),h.events.push(["exit",U,h]),U}function L(H,U){k(H,U.from)}function D(H,U){U.restore()}function R(H,U){return P;function P(K,Y,G){let W,Z,z,j;return Array.isArray(K)?$(K):"tokenize"in K?$([K]):N(K);function N(me){return Q;function Q(q){const te=q!==null&&me[q],ae=q!==null&&me.null,pe=[...Array.isArray(te)?te:te?[te]:[],...Array.isArray(ae)?ae:ae?[ae]:[]];return $(pe)(q)}}function $(me){return W=me,Z=0,me.length===0?G:I(me[Z])}function I(me){return Q;function Q(q){return j=M(),z=me,me.partial||(h.currentConstruct=me),me.name&&h.parser.constructs.disable.null.includes(me.name)?ve():me.tokenize.call(U?Object.assign(Object.create(h),U):h,c,re,ve)(q)}}function re(me){return H(z,j),Y}function ve(me){return j.restore(),++Z<W.length?I(W[Z]):G}}}function k(H,U){H.resolveAll&&!p.includes(H)&&p.push(H),H.resolve&&Mn(h.events,U,h.events.length-U,H.resolve(h.events.slice(U),h)),H.resolveTo&&(h.events=H.resolveTo(h.events,h))}function M(){const H=T(),U=h.previous,P=h.currentConstruct,K=h.events.length,Y=Array.from(o);return{from:K,restore:G};function G(){l=H,h.previous=U,h.currentConstruct=P,h.events.length=K,o=Y,B()}}function B(){l.line in d&&l.column<2&&(l.column=d[l.line],l.offset+=d[l.line]-1)}}function dC(n,r){const s=r.start._index,l=r.start._bufferIndex,d=r.end._index,p=r.end._bufferIndex;let f;if(s===d)f=[n[s].slice(l,p)];else{if(f=n.slice(s,d),l>-1){const o=f[0];typeof o=="string"?f[0]=o.slice(l):f.shift()}p>0&&f.push(n[d].slice(0,p))}return f}function pC(n,r){let s=-1;const l=[];let d;for(;++s<n.length;){const p=n[s];let f;if(typeof p=="string")f=p;else switch(p){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(m)}d=m===-2,l.push(f)}return l.join("")}function mC(n){const l={constructs:b_([hC,...(n||{}).extensions||[]]),content:d(DS),defined:[],document:d(LS),flow:d(Xb),lazy:{},string:d(Zb),text:d(eC)};return l;function d(m){return f;function f(o){return fC(l,m,o)}}}function gC(n){for(;!k_(n););return n}const dg=/[\0\t\n\r]/g;function _C(){let n=1,r="",s=!0,l;return d;function d(m,f,o){const c=[];let h,p,u,v,C;for(m=r+(typeof m=="string"?m.toString():new TextDecoder(f||void 0).decode(m)),u=0,r="",s&&(m.charCodeAt(0)===65279&&u++,s=void 0);u<m.length;){if(dg.lastIndex=u,h=dg.exec(m),v=h&&h.index!==void 0?h.index:m.length,C=m.charCodeAt(v),!h){r=m.slice(u);break}if(C===10&&u===v&&l)c.push(-3),l=void 0;else switch(l&&(c.push(-5),l=void 0),u<v&&(c.push(m.slice(u,v)),n+=v-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:l=!0,n=1}u=v+1}return o&&(l&&c.push(-5),r&&c.push(r),c.push(null)),c}}const vC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function yC(n){return n.replace(vC,SC)}function SC(n,r,s){if(r)return r;if(s.charCodeAt(0)===35){const d=s.charCodeAt(1),m=d===120||d===88;return C_(s.slice(m?2:1),m?16:10)}return Ih(s)||n}const L_={}.hasOwnProperty;function bC(n,r,s){return r&&typeof r=="object"&&(s=r,r=void 0),CC(s)(gC(mC(s).document().write(_C()(n,r,!0))))}function CC(n){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:m(yt),autolinkProtocol:M,autolinkEmail:M,atxHeading:m(ze),blockQuote:m(ae),characterEscape:M,characterReference:M,codeFenced:m(pe),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:m(pe,f),codeText:m(se,f),codeTextData:M,data:M,codeFlowValue:M,definition:m(we),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:m(je),hardBreakEscape:m(Pe),hardBreakTrailing:m(Pe),htmlFlow:m(xe,f),htmlFlowData:M,htmlText:m(xe,f),htmlTextData:M,image:m(xt),label:f,link:m(yt),listItem:m(Gt),listItemValue:v,listOrdered:m(Nt,u),listUnordered:m(Nt),paragraph:m(Sn),reference:I,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:m(ze),strong:m(St),thematicBreak:m(Lt)},exit:{atxHeading:c(),atxHeadingSequence:L,autolink:c(),autolinkEmail:ee,autolinkProtocol:q,blockQuote:c(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:ve,characterReferenceMarkerNumeric:ve,characterReferenceValue:me,characterReference:Q,codeFenced:c(b),codeFencedFence:E,codeFencedFenceInfo:C,codeFencedFenceMeta:T,codeFlowValue:B,codeIndented:c(y),codeText:c(Y),codeTextData:B,data:B,definition:c(),definitionDestinationString:A,definitionLabelString:_,definitionTitleString:S,emphasis:c(),hardBreakEscape:c(U),hardBreakTrailing:c(U),htmlFlow:c(P),htmlFlowData:B,htmlText:c(K),htmlTextData:B,image:c(W),label:z,labelText:Z,lineEnding:H,link:c(G),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:re,resourceDestinationString:j,resourceTitleString:N,resource:$,setextHeading:c(k),setextHeadingLineSequence:R,setextHeadingText:D,strong:c(),thematicBreak:c()}};O_(r,(n||{}).mdastExtensions||[]);const s={};return l;function l(he){let Se={type:"root",children:[]};const Ae={stack:[Se],tokenStack:[],config:r,enter:o,exit:h,buffer:f,resume:p,data:s},Le=[];let Oe=-1;for(;++Oe<he.length;)if(he[Oe][1].type==="listOrdered"||he[Oe][1].type==="listUnordered")if(he[Oe][0]==="enter")Le.push(Oe);else{const ut=Le.pop();Oe=d(he,ut,Oe)}for(Oe=-1;++Oe<he.length;){const ut=r[he[Oe][0]];L_.call(ut,he[Oe][1].type)&&ut[he[Oe][1].type].call(Object.assign({sliceSerialize:he[Oe][2].sliceSerialize},Ae),he[Oe][1])}if(Ae.tokenStack.length>0){const ut=Ae.tokenStack[Ae.tokenStack.length-1];(ut[1]||pg).call(Ae,void 0,ut[0])}for(Se.position={start:pr(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:pr(he.length>0?he[he.length-2][1].end:{line:1,column:1,offset:0})},Oe=-1;++Oe<r.transforms.length;)Se=r.transforms[Oe](Se)||Se;return Se}function d(he,Se,Ae){let Le=Se-1,Oe=-1,ut=!1,Fe,gt,mt,Ot;for(;++Le<=Ae;){const Ze=he[Le];switch(Ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ze[0]==="enter"?Oe++:Oe--,Ot=void 0;break}case"lineEndingBlank":{Ze[0]==="enter"&&(Fe&&!Ot&&!Oe&&!mt&&(mt=Le),Ot=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ot=void 0}if(!Oe&&Ze[0]==="enter"&&Ze[1].type==="listItemPrefix"||Oe===-1&&Ze[0]==="exit"&&(Ze[1].type==="listUnordered"||Ze[1].type==="listOrdered")){if(Fe){let Qt=Le;for(gt=void 0;Qt--;){const Et=he[Qt];if(Et[1].type==="lineEnding"||Et[1].type==="lineEndingBlank"){if(Et[0]==="exit")continue;gt&&(he[gt][1].type="lineEndingBlank",ut=!0),Et[1].type="lineEnding",gt=Qt}else if(!(Et[1].type==="linePrefix"||Et[1].type==="blockQuotePrefix"||Et[1].type==="blockQuotePrefixWhitespace"||Et[1].type==="blockQuoteMarker"||Et[1].type==="listItemIndent"))break}mt&&(!gt||mt<gt)&&(Fe._spread=!0),Fe.end=Object.assign({},gt?he[gt][1].start:Ze[1].end),he.splice(gt||Le,0,["exit",Fe,Ze[2]]),Le++,Ae++}if(Ze[1].type==="listItemPrefix"){const Qt={type:"listItem",_spread:!1,start:Object.assign({},Ze[1].start),end:void 0};Fe=Qt,he.splice(Le,0,["enter",Qt,Ze[2]]),Le++,Ae++,mt=void 0,Ot=!0}}}return he[Se][1]._spread=ut,Ae}function m(he,Se){return Ae;function Ae(Le){o.call(this,he(Le),Le),Se&&Se.call(this,Le)}}function f(){this.stack.push({type:"fragment",children:[]})}function o(he,Se,Ae){this.stack[this.stack.length-1].children.push(he),this.stack.push(he),this.tokenStack.push([Se,Ae||void 0]),he.position={start:pr(Se.start),end:void 0}}function c(he){return Se;function Se(Ae){he&&he.call(this,Ae),h.call(this,Ae)}}function h(he,Se){const Ae=this.stack.pop(),Le=this.tokenStack.pop();if(Le)Le[0].type!==he.type&&(Se?Se.call(this,he,Le[0]):(Le[1]||pg).call(this,he,Le[0]));else throw new Error("Cannot close `"+he.type+"` ("+Fa({start:he.start,end:he.end})+"): it’s not open");Ae.position.end=pr(he.end)}function p(){return zh(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function v(he){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(he),10),this.data.expectingFirstListItemValue=void 0}}function C(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=he}function T(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=he}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he.replace(/(\r?\n|\r)$/g,"")}function _(he){const Se=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=Se,Ae.identifier=ni(this.sliceSerialize(he)).toLowerCase()}function S(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.title=he}function A(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.url=he}function L(he){const Se=this.stack[this.stack.length-1];if(!Se.depth){const Ae=this.sliceSerialize(he).length;Se.depth=Ae}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function R(he){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(he).codePointAt(0)===61?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function M(he){const Ae=this.stack[this.stack.length-1].children;let Le=Ae[Ae.length-1];(!Le||Le.type!=="text")&&(Le=tt(),Le.position={start:pr(he.start),end:void 0},Ae.push(Le)),this.stack.push(Le)}function B(he){const Se=this.stack.pop();Se.value+=this.sliceSerialize(he),Se.position.end=pr(he.end)}function H(he){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ae=Se.children[Se.children.length-1];Ae.position.end=pr(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(Se.type)&&(M.call(this,he),B.call(this,he))}function U(){this.data.atHardBreak=!0}function P(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he}function K(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he}function Y(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he}function G(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Se,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function W(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Se,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function Z(he){const Se=this.sliceSerialize(he),Ae=this.stack[this.stack.length-2];Ae.label=yC(Se),Ae.identifier=ni(Se).toLowerCase()}function z(){const he=this.stack[this.stack.length-1],Se=this.resume(),Ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ae.type==="link"){const Le=he.children;Ae.children=Le}else Ae.alt=Se}function j(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.url=he}function N(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.title=he}function $(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function re(he){const Se=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=Se,Ae.identifier=ni(this.sliceSerialize(he)).toLowerCase(),this.data.referenceType="full"}function ve(he){this.data.characterReferenceType=he.type}function me(he){const Se=this.sliceSerialize(he),Ae=this.data.characterReferenceType;let Le;Ae?(Le=C_(Se,Ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Le=Ih(Se);const Oe=this.stack[this.stack.length-1];Oe.value+=Le}function Q(he){const Se=this.stack.pop();Se.position.end=pr(he.end)}function q(he){B.call(this,he);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(he)}function ee(he){B.call(this,he);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(he)}function ae(){return{type:"blockquote",children:[]}}function pe(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function we(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function je(){return{type:"emphasis",children:[]}}function ze(){return{type:"heading",depth:0,children:[]}}function Pe(){return{type:"break"}}function xe(){return{type:"html",value:""}}function xt(){return{type:"image",title:null,url:"",alt:null}}function yt(){return{type:"link",title:null,url:"",children:[]}}function Nt(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function Gt(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function Sn(){return{type:"paragraph",children:[]}}function St(){return{type:"strong",children:[]}}function tt(){return{type:"text",value:""}}function Lt(){return{type:"thematicBreak"}}}function pr(n){return{line:n.line,column:n.column,offset:n.offset}}function O_(n,r){let s=-1;for(;++s<r.length;){const l=r[s];Array.isArray(l)?O_(n,l):wC(n,l)}}function wC(n,r){let s;for(s in r)if(L_.call(r,s))switch(s){case"canContainEols":{const l=r[s];l&&n[s].push(...l);break}case"transforms":{const l=r[s];l&&n[s].push(...l);break}case"enter":case"exit":{const l=r[s];l&&Object.assign(n[s],l);break}}}function pg(n,r){throw n?new Error("Cannot close `"+n.type+"` ("+Fa({start:n.start,end:n.end})+"): a different token (`"+r.type+"`, "+Fa({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+Fa({start:r.start,end:r.end})+") is still open")}function xC(n){const r=this;r.parser=s;function s(l){return bC(l,{...r.data("settings"),...n,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function EC(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 kC(n,r){const s={type:"element",tagName:"br",properties:{},children:[]};return n.patch(r,s),[n.applyData(r,s),{type:"text",value:`
|
|
65
|
+
`;break}case-2:{f=r?" ":" ";break}case-1:{if(!r&&d)continue;f=" ";break}default:f=String.fromCharCode(p)}d=p===-2,l.push(f)}return l.join("")}function mC(n){const l={constructs:C_([hC,...(n||{}).extensions||[]]),content:d(DS),defined:[],document:d(LS),flow:d(Xb),lazy:{},string:d(Zb),text:d(eC)};return l;function d(p){return f;function f(o){return fC(l,p,o)}}}function gC(n){for(;!A_(n););return n}const pg=/[\0\t\n\r]/g;function _C(){let n=1,r="",s=!0,l;return d;function d(p,f,o){const c=[];let h,g,u,y,w;for(p=r+(typeof p=="string"?p.toString():new TextDecoder(f||void 0).decode(p)),u=0,r="",s&&(p.charCodeAt(0)===65279&&u++,s=void 0);u<p.length;){if(pg.lastIndex=u,h=pg.exec(p),y=h&&h.index!==void 0?h.index:p.length,w=p.charCodeAt(y),!h){r=p.slice(u);break}if(w===10&&u===y&&l)c.push(-3),l=void 0;else switch(l&&(c.push(-5),l=void 0),u<y&&(c.push(p.slice(u,y)),n+=y-u),w){case 0:{c.push(65533),n++;break}case 9:{for(g=Math.ceil(n/4)*4,c.push(-2);n++<g;)c.push(-1);break}case 10:{c.push(-4),n=1;break}default:l=!0,n=1}u=y+1}return o&&(l&&c.push(-5),r&&c.push(r),c.push(null)),c}}const vC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function yC(n){return n.replace(vC,SC)}function SC(n,r,s){if(r)return r;if(s.charCodeAt(0)===35){const d=s.charCodeAt(1),p=d===120||d===88;return w_(s.slice(p?2:1),p?16:10)}return Ih(s)||n}const O_={}.hasOwnProperty;function bC(n,r,s){return r&&typeof r=="object"&&(s=r,r=void 0),CC(s)(gC(mC(s).document().write(_C()(n,r,!0))))}function CC(n){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:p(yt),autolinkProtocol:M,autolinkEmail:M,atxHeading:p(ze),blockQuote:p(ae),characterEscape:M,characterReference:M,codeFenced:p(pe),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:p(pe,f),codeText:p(se,f),codeTextData:M,data:M,codeFlowValue:M,definition:p(we),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:p(je),hardBreakEscape:p(Pe),hardBreakTrailing:p(Pe),htmlFlow:p(xe,f),htmlFlowData:M,htmlText:p(xe,f),htmlTextData:M,image:p(xt),label:f,link:p(yt),listItem:p(Gt),listItemValue:y,listOrdered:p(Nt,u),listUnordered:p(Nt),paragraph:p(Sn),reference:I,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:p(ze),strong:p(St),thematicBreak:p(Lt)},exit:{atxHeading:c(),atxHeadingSequence:L,autolink:c(),autolinkEmail:te,autolinkProtocol:q,blockQuote:c(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:ve,characterReferenceMarkerNumeric:ve,characterReferenceValue:me,characterReference:Q,codeFenced:c(S),codeFencedFence:E,codeFencedFenceInfo:w,codeFencedFenceMeta:T,codeFlowValue:B,codeIndented:c(v),codeText:c(Y),codeTextData:B,data:B,definition:c(),definitionDestinationString:A,definitionLabelString:_,definitionTitleString:b,emphasis:c(),hardBreakEscape:c(U),hardBreakTrailing:c(U),htmlFlow:c(P),htmlFlowData:B,htmlText:c(K),htmlTextData:B,image:c(W),label:z,labelText:Z,lineEnding:H,link:c(G),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:re,resourceDestinationString:j,resourceTitleString:N,resource:$,setextHeading:c(k),setextHeadingLineSequence:R,setextHeadingText:D,strong:c(),thematicBreak:c()}};B_(r,(n||{}).mdastExtensions||[]);const s={};return l;function l(he){let Se={type:"root",children:[]};const Ae={stack:[Se],tokenStack:[],config:r,enter:o,exit:h,buffer:f,resume:g,data:s},Le=[];let Oe=-1;for(;++Oe<he.length;)if(he[Oe][1].type==="listOrdered"||he[Oe][1].type==="listUnordered")if(he[Oe][0]==="enter")Le.push(Oe);else{const ut=Le.pop();Oe=d(he,ut,Oe)}for(Oe=-1;++Oe<he.length;){const ut=r[he[Oe][0]];O_.call(ut,he[Oe][1].type)&&ut[he[Oe][1].type].call(Object.assign({sliceSerialize:he[Oe][2].sliceSerialize},Ae),he[Oe][1])}if(Ae.tokenStack.length>0){const ut=Ae.tokenStack[Ae.tokenStack.length-1];(ut[1]||mg).call(Ae,void 0,ut[0])}for(Se.position={start:pr(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:pr(he.length>0?he[he.length-2][1].end:{line:1,column:1,offset:0})},Oe=-1;++Oe<r.transforms.length;)Se=r.transforms[Oe](Se)||Se;return Se}function d(he,Se,Ae){let Le=Se-1,Oe=-1,ut=!1,Fe,gt,mt,Ot;for(;++Le<=Ae;){const Ze=he[Le];switch(Ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ze[0]==="enter"?Oe++:Oe--,Ot=void 0;break}case"lineEndingBlank":{Ze[0]==="enter"&&(Fe&&!Ot&&!Oe&&!mt&&(mt=Le),Ot=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ot=void 0}if(!Oe&&Ze[0]==="enter"&&Ze[1].type==="listItemPrefix"||Oe===-1&&Ze[0]==="exit"&&(Ze[1].type==="listUnordered"||Ze[1].type==="listOrdered")){if(Fe){let Qt=Le;for(gt=void 0;Qt--;){const Et=he[Qt];if(Et[1].type==="lineEnding"||Et[1].type==="lineEndingBlank"){if(Et[0]==="exit")continue;gt&&(he[gt][1].type="lineEndingBlank",ut=!0),Et[1].type="lineEnding",gt=Qt}else if(!(Et[1].type==="linePrefix"||Et[1].type==="blockQuotePrefix"||Et[1].type==="blockQuotePrefixWhitespace"||Et[1].type==="blockQuoteMarker"||Et[1].type==="listItemIndent"))break}mt&&(!gt||mt<gt)&&(Fe._spread=!0),Fe.end=Object.assign({},gt?he[gt][1].start:Ze[1].end),he.splice(gt||Le,0,["exit",Fe,Ze[2]]),Le++,Ae++}if(Ze[1].type==="listItemPrefix"){const Qt={type:"listItem",_spread:!1,start:Object.assign({},Ze[1].start),end:void 0};Fe=Qt,he.splice(Le,0,["enter",Qt,Ze[2]]),Le++,Ae++,mt=void 0,Ot=!0}}}return he[Se][1]._spread=ut,Ae}function p(he,Se){return Ae;function Ae(Le){o.call(this,he(Le),Le),Se&&Se.call(this,Le)}}function f(){this.stack.push({type:"fragment",children:[]})}function o(he,Se,Ae){this.stack[this.stack.length-1].children.push(he),this.stack.push(he),this.tokenStack.push([Se,Ae||void 0]),he.position={start:pr(Se.start),end:void 0}}function c(he){return Se;function Se(Ae){he&&he.call(this,Ae),h.call(this,Ae)}}function h(he,Se){const Ae=this.stack.pop(),Le=this.tokenStack.pop();if(Le)Le[0].type!==he.type&&(Se?Se.call(this,he,Le[0]):(Le[1]||mg).call(this,he,Le[0]));else throw new Error("Cannot close `"+he.type+"` ("+Fa({start:he.start,end:he.end})+"): it’s not open");Ae.position.end=pr(he.end)}function g(){return zh(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function y(he){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(he),10),this.data.expectingFirstListItemValue=void 0}}function w(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=he}function T(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=he}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he.replace(/(\r?\n|\r)$/g,"")}function _(he){const Se=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=Se,Ae.identifier=ni(this.sliceSerialize(he)).toLowerCase()}function b(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.title=he}function A(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.url=he}function L(he){const Se=this.stack[this.stack.length-1];if(!Se.depth){const Ae=this.sliceSerialize(he).length;Se.depth=Ae}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function R(he){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(he).codePointAt(0)===61?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function M(he){const Ae=this.stack[this.stack.length-1].children;let Le=Ae[Ae.length-1];(!Le||Le.type!=="text")&&(Le=tt(),Le.position={start:pr(he.start),end:void 0},Ae.push(Le)),this.stack.push(Le)}function B(he){const Se=this.stack.pop();Se.value+=this.sliceSerialize(he),Se.position.end=pr(he.end)}function H(he){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ae=Se.children[Se.children.length-1];Ae.position.end=pr(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(Se.type)&&(M.call(this,he),B.call(this,he))}function U(){this.data.atHardBreak=!0}function P(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he}function K(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he}function Y(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he}function G(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Se,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function W(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Se,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function Z(he){const Se=this.sliceSerialize(he),Ae=this.stack[this.stack.length-2];Ae.label=yC(Se),Ae.identifier=ni(Se).toLowerCase()}function z(){const he=this.stack[this.stack.length-1],Se=this.resume(),Ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ae.type==="link"){const Le=he.children;Ae.children=Le}else Ae.alt=Se}function j(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.url=he}function N(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.title=he}function $(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function re(he){const Se=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=Se,Ae.identifier=ni(this.sliceSerialize(he)).toLowerCase(),this.data.referenceType="full"}function ve(he){this.data.characterReferenceType=he.type}function me(he){const Se=this.sliceSerialize(he),Ae=this.data.characterReferenceType;let Le;Ae?(Le=w_(Se,Ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Le=Ih(Se);const Oe=this.stack[this.stack.length-1];Oe.value+=Le}function Q(he){const Se=this.stack.pop();Se.position.end=pr(he.end)}function q(he){B.call(this,he);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(he)}function te(he){B.call(this,he);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(he)}function ae(){return{type:"blockquote",children:[]}}function pe(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function we(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function je(){return{type:"emphasis",children:[]}}function ze(){return{type:"heading",depth:0,children:[]}}function Pe(){return{type:"break"}}function xe(){return{type:"html",value:""}}function xt(){return{type:"image",title:null,url:"",alt:null}}function yt(){return{type:"link",title:null,url:"",children:[]}}function Nt(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function Gt(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function Sn(){return{type:"paragraph",children:[]}}function St(){return{type:"strong",children:[]}}function tt(){return{type:"text",value:""}}function Lt(){return{type:"thematicBreak"}}}function pr(n){return{line:n.line,column:n.column,offset:n.offset}}function B_(n,r){let s=-1;for(;++s<r.length;){const l=r[s];Array.isArray(l)?B_(n,l):wC(n,l)}}function wC(n,r){let s;for(s in r)if(O_.call(r,s))switch(s){case"canContainEols":{const l=r[s];l&&n[s].push(...l);break}case"transforms":{const l=r[s];l&&n[s].push(...l);break}case"enter":case"exit":{const l=r[s];l&&Object.assign(n[s],l);break}}}function mg(n,r){throw n?new Error("Cannot close `"+n.type+"` ("+Fa({start:n.start,end:n.end})+"): a different token (`"+r.type+"`, "+Fa({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+Fa({start:r.start,end:r.end})+") is still open")}function xC(n){const r=this;r.parser=s;function s(l){return bC(l,{...r.data("settings"),...n,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function EC(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 kC(n,r){const s={type:"element",tagName:"br",properties:{},children:[]};return n.patch(r,s),[n.applyData(r,s),{type:"text",value:`
|
|
66
66
|
`}]}function AC(n,r){const s=r.value?r.value+`
|
|
67
|
-
`:"",l={},d=r.lang?r.lang.split(/\s+/):[];d.length>0&&(l.className=["language-"+d[0]]);let
|
|
68
|
-
`}),
|
|
69
|
-
`});const h={type:"element",tagName:"li",properties:
|
|
67
|
+
`:"",l={},d=r.lang?r.lang.split(/\s+/):[];d.length>0&&(l.className=["language-"+d[0]]);let p={type:"element",tagName:"code",properties:l,children:[{type:"text",value:s}]};return r.meta&&(p.data={meta:r.meta}),n.patch(r,p),p=n.applyData(r,p),p={type:"element",tagName:"pre",properties:{},children:[p]},n.patch(r,p),p}function TC(n,r){const s={type:"element",tagName:"del",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function RC(n,r){const s={type:"element",tagName:"em",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function DC(n,r){const s=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",l=String(r.identifier).toUpperCase(),d=Is(l.toLowerCase()),p=n.footnoteOrder.indexOf(l);let f,o=n.footnoteCounts.get(l);o===void 0?(o=0,n.footnoteOrder.push(l),f=n.footnoteOrder.length):f=p+1,o+=1,n.footnoteCounts.set(l,o);const c={type:"element",tagName:"a",properties:{href:"#"+s+"fn-"+d,id:s+"fnref-"+d+(o>1?"-"+o:""),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 MC(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 LC(n,r){if(n.options.allowDangerousHtml){const s={type:"raw",value:r.value};return n.patch(r,s),n.applyData(r,s)}}function j_(n,r){const s=r.referenceType;let l="]";if(s==="collapsed"?l+="[]":s==="full"&&(l+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+l}];const d=n.all(r),p=d[0];p&&p.type==="text"?p.value="["+p.value:d.unshift({type:"text",value:"["});const f=d[d.length-1];return f&&f.type==="text"?f.value+=l:d.push({type:"text",value:l}),d}function OC(n,r){const s=String(r.identifier).toUpperCase(),l=n.definitionById.get(s);if(!l)return j_(n,r);const d={src:Is(l.url||""),alt:r.alt};l.title!==null&&l.title!==void 0&&(d.title=l.title);const p={type:"element",tagName:"img",properties:d,children:[]};return n.patch(r,p),n.applyData(r,p)}function BC(n,r){const s={src:Is(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 l={type:"element",tagName:"img",properties:s,children:[]};return n.patch(r,l),n.applyData(r,l)}function jC(n,r){const s={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};n.patch(r,s);const l={type:"element",tagName:"code",properties:{},children:[s]};return n.patch(r,l),n.applyData(r,l)}function NC(n,r){const s=String(r.identifier).toUpperCase(),l=n.definitionById.get(s);if(!l)return j_(n,r);const d={href:Is(l.url||"")};l.title!==null&&l.title!==void 0&&(d.title=l.title);const p={type:"element",tagName:"a",properties:d,children:n.all(r)};return n.patch(r,p),n.applyData(r,p)}function HC(n,r){const s={href:Is(r.url)};r.title!==null&&r.title!==void 0&&(s.title=r.title);const l={type:"element",tagName:"a",properties:s,children:n.all(r)};return n.patch(r,l),n.applyData(r,l)}function zC(n,r,s){const l=n.all(r),d=s?IC(s):N_(r),p={},f=[];if(typeof r.checked=="boolean"){const g=l[0];let u;g&&g.type==="element"&&g.tagName==="p"?u=g:(u={type:"element",tagName:"p",properties:{},children:[]},l.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:[]}),p.className=["task-list-item"]}let o=-1;for(;++o<l.length;){const g=l[o];(d||o!==0||g.type!=="element"||g.tagName!=="p")&&f.push({type:"text",value:`
|
|
68
|
+
`}),g.type==="element"&&g.tagName==="p"&&!d?f.push(...g.children):f.push(g)}const c=l[l.length-1];c&&(d||c.type!=="element"||c.tagName!=="p")&&f.push({type:"text",value:`
|
|
69
|
+
`});const h={type:"element",tagName:"li",properties:p,children:f};return n.patch(r,h),n.applyData(r,h)}function IC(n){let r=!1;if(n.type==="list"){r=n.spread||!1;const s=n.children;let l=-1;for(;!r&&++l<s.length;)r=N_(s[l])}return r}function N_(n){const r=n.spread;return r??n.children.length>1}function UC(n,r){const s={},l=n.all(r);let d=-1;for(typeof r.start=="number"&&r.start!==1&&(s.start=r.start);++d<l.length;){const f=l[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 p={type:"element",tagName:r.ordered?"ol":"ul",properties:s,children:n.wrap(l,!0)};return n.patch(r,p),n.applyData(r,p)}function PC(n,r){const s={type:"element",tagName:"p",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function FC(n,r){const s={type:"root",children:n.wrap(n.all(r))};return n.patch(r,s),n.applyData(r,s)}function qC(n,r){const s={type:"element",tagName:"strong",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function $C(n,r){const s=n.all(r),l=s.shift(),d=[];if(l){const f={type:"element",tagName:"thead",properties:{},children:n.wrap([l],!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)},o=Bh(r.children[1]),c=m_(r.children[r.children.length-1]);o&&c&&(f.position={start:o,end:c}),d.push(f)}const p={type:"element",tagName:"table",properties:{},children:n.wrap(d,!0)};return n.patch(r,p),n.applyData(r,p)}function GC(n,r,s){const l=s?s.children:void 0,p=(l?l.indexOf(r):1)===0?"th":"td",f=s&&s.type==="table"?s.align:void 0,o=f?f.length:r.children.length;let c=-1;const h=[];for(;++c<o;){const u=r.children[c],y={},w=f?f[c]:void 0;w&&(y.align=w);let T={type:"element",tagName:p,properties:y,children:[]};u&&(T.children=n.all(u),n.patch(u,T),T=n.applyData(u,T)),h.push(T)}const g={type:"element",tagName:"tr",properties:{},children:n.wrap(h,!0)};return n.patch(r,g),n.applyData(r,g)}function VC(n,r){const s={type:"element",tagName:"td",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}const gg=9,_g=32;function WC(n){const r=String(n),s=/\r?\n|\r/g;let l=s.exec(r),d=0;const p=[];for(;l;)p.push(vg(r.slice(d,l.index),d>0,!0),l[0]),d=l.index+l[0].length,l=s.exec(r);return p.push(vg(r.slice(d),d>0,!1)),p.join("")}function vg(n,r,s){let l=0,d=n.length;if(r){let p=n.codePointAt(l);for(;p===gg||p===_g;)l++,p=n.codePointAt(l)}if(s){let p=n.codePointAt(d-1);for(;p===gg||p===_g;)d--,p=n.codePointAt(d-1)}return d>l?n.slice(l,d):""}function KC(n,r){const s={type:"text",value:WC(String(r.value))};return n.patch(r,s),n.applyData(r,s)}function YC(n,r){const s={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(r,s),n.applyData(r,s)}const XC={blockquote:EC,break:kC,code:AC,delete:TC,emphasis:RC,footnoteReference:DC,heading:MC,html:LC,imageReference:OC,image:BC,inlineCode:jC,linkReference:NC,link:HC,listItem:zC,list:UC,paragraph:PC,root:FC,strong:qC,table:$C,tableCell:VC,tableRow:GC,text:KC,thematicBreak:YC,toml:go,yaml:go,definition:go,footnoteDefinition:go};function go(){}const H_=-1,No=0,$a=1,ko=2,Ph=3,Fh=4,qh=5,$h=6,z_=7,I_=8,QC=typeof self=="object"?self:globalThis,yg=(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 QC[n](r)},JC=(n,r)=>{const s=(d,p)=>(n.set(p,d),d),l=d=>{if(n.has(d))return n.get(d);const[p,f]=r[d];switch(p){case No:case H_:return s(f,d);case $a:{const o=s([],d);for(const c of f)o.push(l(c));return o}case ko:{const o=s({},d);for(const[c,h]of f)o[l(c)]=l(h);return o}case Ph:return s(new Date(f),d);case Fh:{const{source:o,flags:c}=f;return s(new RegExp(o,c),d)}case qh:{const o=s(new Map,d);for(const[c,h]of f)o.set(l(c),l(h));return o}case $h:{const o=s(new Set,d);for(const c of f)o.add(l(c));return o}case z_:{const{name:o,message:c}=f;return s(yg(o,c),d)}case I_: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:o}=new Uint8Array(f);return s(new DataView(o),f)}}return s(yg(p,f),d)};return l},Sg=n=>JC(new Map,n)(0),Ms="",{toString:ZC}={},{keys:ew}=Object,Ua=n=>{const r=typeof n;if(r!=="object"||!n)return[No,r];const s=ZC.call(n).slice(8,-1);switch(s){case"Array":return[$a,Ms];case"Object":return[ko,Ms];case"Date":return[Ph,Ms];case"RegExp":return[Fh,Ms];case"Map":return[qh,Ms];case"Set":return[$h,Ms];case"DataView":return[$a,s]}return s.includes("Array")?[$a,s]:s.includes("Error")?[z_,s]:[ko,s]},_o=([n,r])=>n===No&&(r==="function"||r==="symbol"),tw=(n,r,s,l)=>{const d=(f,o)=>{const c=l.push(f)-1;return s.set(o,c),c},p=f=>{if(s.has(f))return s.get(f);let[o,c]=Ua(f);switch(o){case No:{let g=f;switch(c){case"bigint":o=I_,g=f.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+c);g=null;break;case"undefined":return d([H_],f)}return d([o,g],f)}case $a:{if(c){let y=f;return c==="DataView"?y=new Uint8Array(f.buffer):c==="ArrayBuffer"&&(y=new Uint8Array(f)),d([c,[...y]],f)}const g=[],u=d([o,g],f);for(const y of f)g.push(p(y));return u}case ko:{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 p(f.toJSON());const g=[],u=d([o,g],f);for(const y of ew(f))(n||!_o(Ua(f[y])))&&g.push([p(y),p(f[y])]);return u}case Ph:return d([o,f.toISOString()],f);case Fh:{const{source:g,flags:u}=f;return d([o,{source:g,flags:u}],f)}case qh:{const g=[],u=d([o,g],f);for(const[y,w]of f)(n||!(_o(Ua(y))||_o(Ua(w))))&&g.push([p(y),p(w)]);return u}case $h:{const g=[],u=d([o,g],f);for(const y of f)(n||!_o(Ua(y)))&&g.push(p(y));return u}}const{message:h}=f;return d([o,{name:c,message:h}],f)};return p},bg=(n,{json:r,lossy:s}={})=>{const l=[];return tw(!(r||s),!!r,new Map,l)(n),l},Ao=typeof structuredClone=="function"?(n,r)=>r&&("json"in r||"lossy"in r)?Sg(bg(n,r)):structuredClone(n):(n,r)=>Sg(bg(n,r));function nw(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 iw(n,r){return"Back to reference "+(n+1)+(r>1?"-"+r:"")}function rw(n){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",s=n.options.footnoteBackContent||nw,l=n.options.footnoteBackLabel||iw,d=n.options.footnoteLabel||"Footnotes",p=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c<n.footnoteOrder.length;){const h=n.footnoteById.get(n.footnoteOrder[c]);if(!h)continue;const g=n.all(h),u=String(h.identifier).toUpperCase(),y=Is(u.toLowerCase());let w=0;const T=[],E=n.footnoteCounts.get(u);for(;E!==void 0&&++w<=E;){T.length>0&&T.push({type:"text",value:" "});let _=typeof s=="string"?s:s(c,w);typeof _=="string"&&(_={type:"text",value:_}),T.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+y+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof l=="string"?l:l(c,w),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const S=g[g.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const _=S.children[S.children.length-1];_&&_.type==="text"?_.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...T)}else g.push(...T);const v={type:"element",tagName:"li",properties:{id:r+"fn-"+y},children:n.wrap(g,!0)};n.patch(h,v),o.push(v)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:p,properties:{...Ao(f),id:"footnote-label"},children:[{type:"text",value:d}]},{type:"text",value:`
|
|
70
70
|
`},{type:"element",tagName:"ol",properties:{},children:n.wrap(o,!0)},{type:"text",value:`
|
|
71
|
-
`}]}}const Ho=(function(n){if(n==null)return ow;if(typeof n=="function")return zo(n);if(typeof n=="object")return Array.isArray(n)?sw(n):aw(n);if(typeof n=="string")return lw(n);throw new Error("Expected function, string, or object as test")});function sw(n){const r=[];let s=-1;for(;++s<n.length;)r[s]=Ho(n[s]);return zo(l);function l(...d){let
|
|
71
|
+
`}]}}const Ho=(function(n){if(n==null)return ow;if(typeof n=="function")return zo(n);if(typeof n=="object")return Array.isArray(n)?sw(n):aw(n);if(typeof n=="string")return lw(n);throw new Error("Expected function, string, or object as test")});function sw(n){const r=[];let s=-1;for(;++s<n.length;)r[s]=Ho(n[s]);return zo(l);function l(...d){let p=-1;for(;++p<r.length;)if(r[p].apply(this,d))return!0;return!1}}function aw(n){const r=n;return zo(s);function s(l){const d=l;let p;for(p in n)if(d[p]!==r[p])return!1;return!0}}function lw(n){return zo(r);function r(s){return s&&s.type===n}}function zo(n){return r;function r(s,l,d){return!!(cw(s)&&n.call(this,s,typeof l=="number"?l:void 0,d||void 0))}}function ow(){return!0}function cw(n){return n!==null&&typeof n=="object"&&"type"in n}const U_=[],uw=!0,Ch=!1,hw="skip";function P_(n,r,s,l){let d;typeof r=="function"&&typeof s!="function"?(l=s,s=r):d=r;const p=Ho(d),f=l?-1:1;o(n,void 0,[])();function o(c,h,g){const u=c&&typeof c=="object"?c:{};if(typeof u.type=="string"){const w=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(c.type+(w?"<"+w+">":""))+")"})}return y;function y(){let w=U_,T,E,S;if((!r||p(c,h,g[g.length-1]||void 0))&&(w=fw(s(c,g)),w[0]===Ch))return w;if("children"in c&&c.children){const v=c;if(v.children&&w[0]!==hw)for(E=(l?v.children.length:-1)+f,S=g.concat(v);E>-1&&E<v.children.length;){const _=v.children[E];if(T=o(_,E,S)(),T[0]===Ch)return T;E=typeof T[1]=="number"?T[1]:E+f}}return w}}}function fw(n){return Array.isArray(n)?n:typeof n=="number"?[uw,n]:n==null?U_:[n]}function Gh(n,r,s,l){let d,p,f;typeof r=="function"&&typeof s!="function"?(p=void 0,f=r,d=s):(p=r,f=s,d=l),P_(n,p,o,d);function o(c,h){const g=h[h.length-1],u=g?g.children.indexOf(c):void 0;return f(c,u,g)}}const wh={}.hasOwnProperty,dw={};function pw(n,r){const s=r||dw,l=new Map,d=new Map,p=new Map,f={...XC,...s.handlers},o={all:h,applyData:gw,definitionById:l,footnoteById:d,footnoteCounts:p,footnoteOrder:[],handlers:f,one:c,options:s,patch:mw,wrap:vw};return Gh(n,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const u=g.type==="definition"?l:d,y=String(g.identifier).toUpperCase();u.has(y)||u.set(y,g)}}),o;function c(g,u){const y=g.type,w=o.handlers[y];if(wh.call(o.handlers,y)&&w)return w(o,g,u);if(o.options.passThrough&&o.options.passThrough.includes(y)){if("children"in g){const{children:E,...S}=g,v=Ao(S);return v.children=o.all(g),v}return Ao(g)}return(o.options.unknownHandler||_w)(o,g,u)}function h(g){const u=[];if("children"in g){const y=g.children;let w=-1;for(;++w<y.length;){const T=o.one(y[w],g);if(T){if(w&&y[w-1].type==="break"&&(!Array.isArray(T)&&T.type==="text"&&(T.value=Cg(T.value)),!Array.isArray(T)&&T.type==="element")){const E=T.children[0];E&&E.type==="text"&&(E.value=Cg(E.value))}Array.isArray(T)?u.push(...T):u.push(T)}}}return u}}function mw(n,r){n.position&&(r.position=nS(n))}function gw(n,r){let s=r;if(n&&n.data){const l=n.data.hName,d=n.data.hChildren,p=n.data.hProperties;if(typeof l=="string")if(s.type==="element")s.tagName=l;else{const f="children"in s?s.children:[s];s={type:"element",tagName:l,properties:{},children:f}}s.type==="element"&&p&&Object.assign(s.properties,Ao(p)),"children"in s&&s.children&&d!==null&&d!==void 0&&(s.children=d)}return s}function _w(n,r){const s=r.data||{},l="value"in r&&!(wh.call(s,"hProperties")||wh.call(s,"hChildren"))?{type:"text",value:r.value}:{type:"element",tagName:"div",properties:{},children:n.all(r)};return n.patch(r,l),n.applyData(r,l)}function vw(n,r){const s=[];let l=-1;for(r&&s.push({type:"text",value:`
|
|
72
72
|
`});++l<n.length;)l&&s.push({type:"text",value:`
|
|
73
73
|
`}),s.push(n[l]);return r&&n.length>0&&s.push({type:"text",value:`
|
|
74
|
-
`}),s}function
|
|
75
|
-
`},d),m}function yw(n,r){return n&&"run"in n?async function(s,l){const d=Cg(s,{file:l,...r});await n.run(d,l)}:function(s,l){return Cg(s,{file:l,...n||r})}}function wg(n){if(n)throw n}var Qu,xg;function Sw(){if(xg)return Qu;xg=1;var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d=function(h){return typeof Array.isArray=="function"?Array.isArray(h):r.call(h)==="[object Array]"},m=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 v;for(v in h);return typeof v>"u"||n.call(h,v)},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},o=function(h,p){if(p==="__proto__")if(n.call(h,p)){if(l)return l(h,p).value}else return;return h[p]};return Qu=function c(){var h,p,u,v,C,T,E=arguments[0],b=1,y=arguments.length,_=!1;for(typeof E=="boolean"&&(_=E,E=arguments[1]||{},b=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});b<y;++b)if(h=arguments[b],h!=null)for(p in h)u=o(E,p),v=o(h,p),E!==v&&(_&&v&&(m(v)||(C=d(v)))?(C?(C=!1,T=u&&d(u)?u:[]):T=u&&m(u)?u:{},f(E,{name:p,newValue:c(_,T,v)})):typeof v<"u"&&f(E,{name:p,newValue:v}));return E},Qu}var bw=Sw();const Ju=Xg(bw);function xh(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 Cw(){const n=[],r={run:s,use:l};return r;function s(...d){let m=-1;const f=d.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);o(null,...d);function o(c,...h){const p=n[++m];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?ww(p,o)(...h):f(null,...h)}}function l(d){if(typeof d!="function")throw new TypeError("Expected `middelware` to be a function, not "+d);return n.push(d),r}}function ww(n,r){let s;return l;function l(...f){const o=n.length>f.length;let c;o&&f.push(d);try{c=n.apply(this,f)}catch(h){const p=h;if(o&&s)throw p;return d(p)}o||(c&&c.then&&typeof c.then=="function"?c.then(m,d):c instanceof Error?d(c):m(c))}function d(f,...o){s||(s=!0,r(f,...o))}function m(f){d(null,f)}}const di={basename:xw,dirname:Ew,extname:kw,join:Aw,sep:"/"};function xw(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');Za(n);let s=0,l=-1,d=n.length,m;if(r===void 0||r.length===0||r.length>n.length){for(;d--;)if(n.codePointAt(d)===47){if(m){s=d+1;break}}else l<0&&(m=!0,l=d+1);return l<0?"":n.slice(s,l)}if(r===n)return"";let f=-1,o=r.length-1;for(;d--;)if(n.codePointAt(d)===47){if(m){s=d+1;break}}else f<0&&(m=!0,f=d+1),o>-1&&(n.codePointAt(d)===r.codePointAt(o--)?o<0&&(l=d):(o=-1,l=f));return s===l?l=f:l<0&&(l=n.length),n.slice(s,l)}function Ew(n){if(Za(n),n.length===0)return".";let r=-1,s=n.length,l;for(;--s;)if(n.codePointAt(s)===47){if(l){r=s;break}}else l||(l=!0);return r<0?n.codePointAt(0)===47?"/":".":r===1&&n.codePointAt(0)===47?"//":n.slice(0,r)}function kw(n){Za(n);let r=n.length,s=-1,l=0,d=-1,m=0,f;for(;r--;){const o=n.codePointAt(r);if(o===47){if(f){l=r+1;break}continue}s<0&&(f=!0,s=r+1),o===46?d<0?d=r:m!==1&&(m=1):d>-1&&(m=-1)}return d<0||s<0||m===0||m===1&&d===s-1&&d===l+1?"":n.slice(d,s)}function Aw(...n){let r=-1,s;for(;++r<n.length;)Za(n[r]),n[r]&&(s=s===void 0?n[r]:s+"/"+n[r]);return s===void 0?".":Tw(s)}function Tw(n){Za(n);const r=n.codePointAt(0)===47;let s=Rw(n,!r);return s.length===0&&!r&&(s="."),s.length>0&&n.codePointAt(n.length-1)===47&&(s+="/"),r?"/"+s:s}function Rw(n,r){let s="",l=0,d=-1,m=0,f=-1,o,c;for(;++f<=n.length;){if(f<n.length)o=n.codePointAt(f);else{if(o===47)break;o=47}if(o===47){if(!(d===f-1||m===1))if(d!==f-1&&m===2){if(s.length<2||l!==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="",l=0):(s=s.slice(0,c),l=s.length-1-s.lastIndexOf("/")),d=f,m=0;continue}}else if(s.length>0){s="",l=0,d=f,m=0;continue}}r&&(s=s.length>0?s+"/..":"..",l=2)}else s.length>0?s+="/"+n.slice(d+1,f):s=n.slice(d+1,f),l=f-d-1;d=f,m=0}else o===46&&m>-1?m++:m=-1}return s}function Za(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const Dw={cwd:Mw};function Mw(){return"/"}function Eh(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function Lw(n){if(typeof n=="string")n=new URL(n);else if(!Eh(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 Ow(n)}function Ow(n){if(n.hostname!==""){const l=new TypeError('File URL host must be "localhost" or empty on darwin');throw l.code="ERR_INVALID_FILE_URL_HOST",l}const r=n.pathname;let s=-1;for(;++s<r.length;)if(r.codePointAt(s)===37&&r.codePointAt(s+1)===50){const l=r.codePointAt(s+2);if(l===70||l===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 Zu=["history","path","basename","stem","extname","dirname"];class P_{constructor(r){let s;r?Eh(r)?s={path:r}:typeof r=="string"||Bw(r)?s={value:r}:s=r:s={},this.cwd="cwd"in s?"":Dw.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<Zu.length;){const m=Zu[l];m in s&&s[m]!==void 0&&s[m]!==null&&(this[m]=m==="history"?[...s[m]]:s[m])}let d;for(d in s)Zu.includes(d)||(this[d]=s[d])}get basename(){return typeof this.path=="string"?di.basename(this.path):void 0}set basename(r){th(r,"basename"),eh(r,"basename"),this.path=di.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?di.dirname(this.path):void 0}set dirname(r){Eg(this.basename,"dirname"),this.path=di.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?di.extname(this.path):void 0}set extname(r){if(eh(r,"extname"),Eg(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=di.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){Eh(r)&&(r=Lw(r)),th(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?di.basename(this.path,this.extname):void 0}set stem(r){th(r,"stem"),eh(r,"stem"),this.path=di.join(this.dirname||"",r+(this.extname||""))}fail(r,s,l){const d=this.message(r,s,l);throw d.fatal=!0,d}info(r,s,l){const d=this.message(r,s,l);return d.fatal=void 0,d}message(r,s,l){const d=new Xt(r,s,l);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 eh(n,r){if(n&&n.includes(di.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+di.sep+"`")}function th(n,r){if(!n)throw new Error("`"+r+"` cannot be empty")}function Eg(n,r){if(!n)throw new Error("Setting `"+r+"` requires `path` to be set too")}function Bw(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const jw=(function(n){const l=this.constructor.prototype,d=l[n],m=function(){return d.apply(m,arguments)};return Object.setPrototypeOf(m,l),m}),Nw={}.hasOwnProperty;class Vh extends jw{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=Cw()}copy(){const r=new Vh;let s=-1;for(;++s<this.attachers.length;){const l=this.attachers[s];r.use(...l)}return r.data(Ju(!0,{},this.namespace)),r}data(r,s){return typeof r=="string"?arguments.length===2?(rh("data",this.frozen),this.namespace[r]=s,this):Nw.call(this.namespace,r)&&this.namespace[r]||void 0:r?(rh("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,...l]=this.attachers[this.freezeIndex];if(l[0]===!1)continue;l[0]===!0&&(l[0]=void 0);const d=s.call(r,...l);typeof d=="function"&&this.transformers.use(d)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const s=vo(r),l=this.parser||this.Parser;return nh("parse",l),l(String(s),s)}process(r,s){const l=this;return this.freeze(),nh("process",this.parser||this.Parser),ih("process",this.compiler||this.Compiler),s?d(void 0,s):new Promise(d);function d(m,f){const o=vo(r),c=l.parse(o);l.run(c,o,function(p,u,v){if(p||!u||!v)return h(p);const C=u,T=l.stringify(C,v);Iw(T)?v.value=T:v.result=T,h(p,v)});function h(p,u){p||!u?f(p):m?m(u):s(void 0,u)}}}processSync(r){let s=!1,l;return this.freeze(),nh("processSync",this.parser||this.Parser),ih("processSync",this.compiler||this.Compiler),this.process(r,d),Ag("processSync","process",s),l;function d(m,f){s=!0,wg(m),l=f}}run(r,s,l){kg(r),this.freeze();const d=this.transformers;return!l&&typeof s=="function"&&(l=s,s=void 0),l?m(void 0,l):new Promise(m);function m(f,o){const c=vo(s);d.run(r,c,h);function h(p,u,v){const C=u||r;p?o(p):f?f(C):l(void 0,C,v)}}}runSync(r,s){let l=!1,d;return this.run(r,s,m),Ag("runSync","run",l),d;function m(f,o){wg(f),d=o,l=!0}}stringify(r,s){this.freeze();const l=vo(s),d=this.compiler||this.Compiler;return ih("stringify",d),kg(r),d(r,l)}use(r,...s){const l=this.attachers,d=this.namespace;if(rh("use",this.frozen),r!=null)if(typeof r=="function")c(r,s);else if(typeof r=="object")Array.isArray(r)?o(r):f(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function m(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");o(h.plugins),h.settings&&(d.settings=Ju(!0,d.settings,h.settings))}function o(h){let p=-1;if(h!=null)if(Array.isArray(h))for(;++p<h.length;){const u=h[p];m(u)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function c(h,p){let u=-1,v=-1;for(;++u<l.length;)if(l[u][0]===h){v=u;break}if(v===-1)l.push([h,...p]);else if(p.length>0){let[C,...T]=p;const E=l[v][1];xh(E)&&xh(C)&&(C=Ju(!0,E,C)),l[v]=[h,C,...T]}}}}const Hw=new Vh().freeze();function nh(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function ih(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function rh(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 kg(n){if(!xh(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function Ag(n,r,s){if(!s)throw new Error("`"+n+"` finished async. Use `"+r+"` instead")}function vo(n){return zw(n)?n:new P_(n)}function zw(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function Iw(n){return typeof n=="string"||Uw(n)}function Uw(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const Pw="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Tg=[],Rg={allowDangerousHtml:!0},Fw=/^(https?|ircs?|mailto|xmpp)$/i,qw=[{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 F_(n){const r=$w(n),s=Gw(n);return Vw(r.runSync(r.parse(s),s),n)}function $w(n){const r=n.rehypePlugins||Tg,s=n.remarkPlugins||Tg,l=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...Rg}:Rg;return Hw().use(xC).use(s).use(yw,l).use(r)}function Gw(n){const r=n.children||"",s=new P_;return typeof r=="string"&&(s.value=r),s}function Vw(n,r){const s=r.allowedElements,l=r.allowElement,d=r.components,m=r.disallowedElements,f=r.skipHtml,o=r.unwrapDisallowed,c=r.urlTransform||Ww;for(const p of qw)Object.hasOwn(r,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Pw+p.id,void 0);return Gh(n,h),lS(n,{Fragment:x.Fragment,components:d,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function h(p,u,v){if(p.type==="raw"&&v&&typeof u=="number")return f?v.children.splice(u,1):v.children[u]={type:"text",value:p.value},u;if(p.type==="element"){let C;for(C in Ku)if(Object.hasOwn(Ku,C)&&Object.hasOwn(p.properties,C)){const T=p.properties[C],E=Ku[C];(E===null||E.includes(p.tagName))&&(p.properties[C]=c(String(T||""),C,p))}}if(p.type==="element"){let C=s?!s.includes(p.tagName):m?m.includes(p.tagName):!1;if(!C&&l&&typeof u=="number"&&(C=!l(p,u,v)),C&&v&&typeof u=="number")return o&&p.children?v.children.splice(u,1,...p.children):v.children.splice(u,1),u}}}function Ww(n){const r=n.indexOf(":"),s=n.indexOf("?"),l=n.indexOf("#"),d=n.indexOf("/");return r===-1||d!==-1&&r>d||s!==-1&&r>s||l!==-1&&r>l||Fw.test(n.slice(0,r))?n:""}function Dg(n,r){const s=String(n);if(typeof r!="string")throw new TypeError("Expected character");let l=0,d=s.indexOf(r);for(;d!==-1;)l++,d=s.indexOf(r,d+r.length);return l}function Kw(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Yw(n,r,s){const d=Ho((s||{}).ignore||[]),m=Xw(r);let f=-1;for(;++f<m.length;)U_(n,"text",o);function o(h,p){let u=-1,v;for(;++u<p.length;){const C=p[u],T=v?v.children:void 0;if(d(C,T?T.indexOf(C):void 0,v))return;v=C}if(v)return c(h,p)}function c(h,p){const u=p[p.length-1],v=m[f][0],C=m[f][1];let T=0;const b=u.children.indexOf(h);let y=!1,_=[];v.lastIndex=0;let S=v.exec(h.value);for(;S;){const A=S.index,L={index:S.index,input:S.input,stack:[...p,h]};let D=C(...S,L);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?v.lastIndex=A+1:(T!==A&&_.push({type:"text",value:h.value.slice(T,A)}),Array.isArray(D)?_.push(...D):D&&_.push(D),T=A+S[0].length,y=!0),!v.global)break;S=v.exec(h.value)}return y?(T<h.value.length&&_.push({type:"text",value:h.value.slice(T)}),u.children.splice(b,1,..._)):_=[h],b+_.length}}function Xw(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 l=-1;for(;++l<s.length;){const d=s[l];r.push([Qw(d[0]),Jw(d[1])])}return r}function Qw(n){return typeof n=="string"?new RegExp(Kw(n),"g"):n}function Jw(n){return typeof n=="function"?n:function(){return n}}const sh="phrasing",ah=["autolink","link","image","label"];function Zw(){return{transforms:[ax],enter:{literalAutolink:tx,literalAutolinkEmail:lh,literalAutolinkHttp:lh,literalAutolinkWww:lh},exit:{literalAutolink:sx,literalAutolinkEmail:rx,literalAutolinkHttp:nx,literalAutolinkWww:ix}}}function ex(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:sh,notInConstruct:ah},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:sh,notInConstruct:ah},{character:":",before:"[ps]",after:"\\/",inConstruct:sh,notInConstruct:ah}]}}function tx(n){this.enter({type:"link",title:null,url:"",children:[]},n)}function lh(n){this.config.enter.autolinkProtocol.call(this,n)}function nx(n){this.config.exit.autolinkProtocol.call(this,n)}function ix(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 rx(n){this.config.exit.autolinkEmail.call(this,n)}function sx(n){this.exit(n)}function ax(n){Yw(n,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,lx],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),ox]],{ignore:["link","linkReference"]})}function lx(n,r,s,l,d){let m="";if(!q_(d)||(/^w/i.test(r)&&(s=r+s,r="",m="http://"),!cx(s)))return!1;const f=ux(s+l);if(!f[0])return!1;const o={type:"link",title:null,url:m+r+f[0],children:[{type:"text",value:r+f[0]}]};return f[1]?[o,{type:"text",value:f[1]}]:o}function ox(n,r,s,l){return!q_(l,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+s,children:[{type:"text",value:r+"@"+s}]}}function cx(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 ux(n){const r=/[!"&'),.:;<>?\]}]+$/.exec(n);if(!r)return[n,void 0];n=n.slice(0,r.index);let s=r[0],l=s.indexOf(")");const d=Dg(n,"(");let m=Dg(n,")");for(;l!==-1&&d>m;)n+=s.slice(0,l+1),s=s.slice(l+1),l=s.indexOf(")"),m++;return[n,s]}function q_(n,r){const s=n.input.charCodeAt(n.index-1);return(n.index===0||Ur(s)||Bo(s))&&(!r||s!==47)}$_.peek=yx;function hx(){this.buffer()}function fx(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function dx(){this.buffer()}function px(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function mx(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=ni(this.sliceSerialize(n)).toLowerCase(),s.label=r}function gx(n){this.exit(n)}function _x(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=ni(this.sliceSerialize(n)).toLowerCase(),s.label=r}function vx(n){this.exit(n)}function yx(){return"["}function $_(n,r,s,l){const d=s.createTracker(l);let m=d.move("[^");const f=s.enter("footnoteReference"),o=s.enter("reference");return m+=d.move(s.safe(s.associationId(n),{after:"]",before:m})),o(),f(),m+=d.move("]"),m}function Sx(){return{enter:{gfmFootnoteCallString:hx,gfmFootnoteCall:fx,gfmFootnoteDefinitionLabelString:dx,gfmFootnoteDefinition:px},exit:{gfmFootnoteCallString:mx,gfmFootnoteCall:gx,gfmFootnoteDefinitionLabelString:_x,gfmFootnoteDefinition:vx}}}function bx(n){let r=!1;return n&&n.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:s,footnoteReference:$_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(l,d,m,f){const o=m.createTracker(f);let c=o.move("[^");const h=m.enter("footnoteDefinition"),p=m.enter("label");return c+=o.move(m.safe(m.associationId(l),{before:c,after:"]"})),p(),c+=o.move("]:"),l.children&&l.children.length>0&&(o.shift(4),c+=o.move((r?`
|
|
76
|
-
`:" ")+
|
|
77
|
-
`)}function Mx(n){return n==null?"":String(n)}function
|
|
74
|
+
`}),s}function Cg(n){let r=0,s=n.charCodeAt(r);for(;s===9||s===32;)r++,s=n.charCodeAt(r);return n.slice(r)}function wg(n,r){const s=pw(n,r),l=s.one(n,void 0),d=rw(s),p=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return d&&p.children.push({type:"text",value:`
|
|
75
|
+
`},d),p}function yw(n,r){return n&&"run"in n?async function(s,l){const d=wg(s,{file:l,...r});await n.run(d,l)}:function(s,l){return wg(s,{file:l,...n||r})}}function xg(n){if(n)throw n}var Qu,Eg;function Sw(){if(Eg)return Qu;Eg=1;var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d=function(h){return typeof Array.isArray=="function"?Array.isArray(h):r.call(h)==="[object Array]"},p=function(h){if(!h||r.call(h)!=="[object Object]")return!1;var g=n.call(h,"constructor"),u=h.constructor&&h.constructor.prototype&&n.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!g&&!u)return!1;var y;for(y in h);return typeof y>"u"||n.call(h,y)},f=function(h,g){s&&g.name==="__proto__"?s(h,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):h[g.name]=g.newValue},o=function(h,g){if(g==="__proto__")if(n.call(h,g)){if(l)return l(h,g).value}else return;return h[g]};return Qu=function c(){var h,g,u,y,w,T,E=arguments[0],S=1,v=arguments.length,_=!1;for(typeof E=="boolean"&&(_=E,E=arguments[1]||{},S=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});S<v;++S)if(h=arguments[S],h!=null)for(g in h)u=o(E,g),y=o(h,g),E!==y&&(_&&y&&(p(y)||(w=d(y)))?(w?(w=!1,T=u&&d(u)?u:[]):T=u&&p(u)?u:{},f(E,{name:g,newValue:c(_,T,y)})):typeof y<"u"&&f(E,{name:g,newValue:y}));return E},Qu}var bw=Sw();const Ju=Qg(bw);function xh(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 Cw(){const n=[],r={run:s,use:l};return r;function s(...d){let p=-1;const f=d.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);o(null,...d);function o(c,...h){const g=n[++p];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,g?ww(g,o)(...h):f(null,...h)}}function l(d){if(typeof d!="function")throw new TypeError("Expected `middelware` to be a function, not "+d);return n.push(d),r}}function ww(n,r){let s;return l;function l(...f){const o=n.length>f.length;let c;o&&f.push(d);try{c=n.apply(this,f)}catch(h){const g=h;if(o&&s)throw g;return d(g)}o||(c&&c.then&&typeof c.then=="function"?c.then(p,d):c instanceof Error?d(c):p(c))}function d(f,...o){s||(s=!0,r(f,...o))}function p(f){d(null,f)}}const di={basename:xw,dirname:Ew,extname:kw,join:Aw,sep:"/"};function xw(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');Za(n);let s=0,l=-1,d=n.length,p;if(r===void 0||r.length===0||r.length>n.length){for(;d--;)if(n.codePointAt(d)===47){if(p){s=d+1;break}}else l<0&&(p=!0,l=d+1);return l<0?"":n.slice(s,l)}if(r===n)return"";let f=-1,o=r.length-1;for(;d--;)if(n.codePointAt(d)===47){if(p){s=d+1;break}}else f<0&&(p=!0,f=d+1),o>-1&&(n.codePointAt(d)===r.codePointAt(o--)?o<0&&(l=d):(o=-1,l=f));return s===l?l=f:l<0&&(l=n.length),n.slice(s,l)}function Ew(n){if(Za(n),n.length===0)return".";let r=-1,s=n.length,l;for(;--s;)if(n.codePointAt(s)===47){if(l){r=s;break}}else l||(l=!0);return r<0?n.codePointAt(0)===47?"/":".":r===1&&n.codePointAt(0)===47?"//":n.slice(0,r)}function kw(n){Za(n);let r=n.length,s=-1,l=0,d=-1,p=0,f;for(;r--;){const o=n.codePointAt(r);if(o===47){if(f){l=r+1;break}continue}s<0&&(f=!0,s=r+1),o===46?d<0?d=r:p!==1&&(p=1):d>-1&&(p=-1)}return d<0||s<0||p===0||p===1&&d===s-1&&d===l+1?"":n.slice(d,s)}function Aw(...n){let r=-1,s;for(;++r<n.length;)Za(n[r]),n[r]&&(s=s===void 0?n[r]:s+"/"+n[r]);return s===void 0?".":Tw(s)}function Tw(n){Za(n);const r=n.codePointAt(0)===47;let s=Rw(n,!r);return s.length===0&&!r&&(s="."),s.length>0&&n.codePointAt(n.length-1)===47&&(s+="/"),r?"/"+s:s}function Rw(n,r){let s="",l=0,d=-1,p=0,f=-1,o,c;for(;++f<=n.length;){if(f<n.length)o=n.codePointAt(f);else{if(o===47)break;o=47}if(o===47){if(!(d===f-1||p===1))if(d!==f-1&&p===2){if(s.length<2||l!==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="",l=0):(s=s.slice(0,c),l=s.length-1-s.lastIndexOf("/")),d=f,p=0;continue}}else if(s.length>0){s="",l=0,d=f,p=0;continue}}r&&(s=s.length>0?s+"/..":"..",l=2)}else s.length>0?s+="/"+n.slice(d+1,f):s=n.slice(d+1,f),l=f-d-1;d=f,p=0}else o===46&&p>-1?p++:p=-1}return s}function Za(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const Dw={cwd:Mw};function Mw(){return"/"}function Eh(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function Lw(n){if(typeof n=="string")n=new URL(n);else if(!Eh(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 Ow(n)}function Ow(n){if(n.hostname!==""){const l=new TypeError('File URL host must be "localhost" or empty on darwin');throw l.code="ERR_INVALID_FILE_URL_HOST",l}const r=n.pathname;let s=-1;for(;++s<r.length;)if(r.codePointAt(s)===37&&r.codePointAt(s+1)===50){const l=r.codePointAt(s+2);if(l===70||l===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 Zu=["history","path","basename","stem","extname","dirname"];class F_{constructor(r){let s;r?Eh(r)?s={path:r}:typeof r=="string"||Bw(r)?s={value:r}:s=r:s={},this.cwd="cwd"in s?"":Dw.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<Zu.length;){const p=Zu[l];p in s&&s[p]!==void 0&&s[p]!==null&&(this[p]=p==="history"?[...s[p]]:s[p])}let d;for(d in s)Zu.includes(d)||(this[d]=s[d])}get basename(){return typeof this.path=="string"?di.basename(this.path):void 0}set basename(r){th(r,"basename"),eh(r,"basename"),this.path=di.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?di.dirname(this.path):void 0}set dirname(r){kg(this.basename,"dirname"),this.path=di.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?di.extname(this.path):void 0}set extname(r){if(eh(r,"extname"),kg(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=di.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){Eh(r)&&(r=Lw(r)),th(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?di.basename(this.path,this.extname):void 0}set stem(r){th(r,"stem"),eh(r,"stem"),this.path=di.join(this.dirname||"",r+(this.extname||""))}fail(r,s,l){const d=this.message(r,s,l);throw d.fatal=!0,d}info(r,s,l){const d=this.message(r,s,l);return d.fatal=void 0,d}message(r,s,l){const d=new Xt(r,s,l);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 eh(n,r){if(n&&n.includes(di.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+di.sep+"`")}function th(n,r){if(!n)throw new Error("`"+r+"` cannot be empty")}function kg(n,r){if(!n)throw new Error("Setting `"+r+"` requires `path` to be set too")}function Bw(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const jw=(function(n){const l=this.constructor.prototype,d=l[n],p=function(){return d.apply(p,arguments)};return Object.setPrototypeOf(p,l),p}),Nw={}.hasOwnProperty;class Vh extends jw{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=Cw()}copy(){const r=new Vh;let s=-1;for(;++s<this.attachers.length;){const l=this.attachers[s];r.use(...l)}return r.data(Ju(!0,{},this.namespace)),r}data(r,s){return typeof r=="string"?arguments.length===2?(rh("data",this.frozen),this.namespace[r]=s,this):Nw.call(this.namespace,r)&&this.namespace[r]||void 0:r?(rh("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,...l]=this.attachers[this.freezeIndex];if(l[0]===!1)continue;l[0]===!0&&(l[0]=void 0);const d=s.call(r,...l);typeof d=="function"&&this.transformers.use(d)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const s=vo(r),l=this.parser||this.Parser;return nh("parse",l),l(String(s),s)}process(r,s){const l=this;return this.freeze(),nh("process",this.parser||this.Parser),ih("process",this.compiler||this.Compiler),s?d(void 0,s):new Promise(d);function d(p,f){const o=vo(r),c=l.parse(o);l.run(c,o,function(g,u,y){if(g||!u||!y)return h(g);const w=u,T=l.stringify(w,y);Iw(T)?y.value=T:y.result=T,h(g,y)});function h(g,u){g||!u?f(g):p?p(u):s(void 0,u)}}}processSync(r){let s=!1,l;return this.freeze(),nh("processSync",this.parser||this.Parser),ih("processSync",this.compiler||this.Compiler),this.process(r,d),Tg("processSync","process",s),l;function d(p,f){s=!0,xg(p),l=f}}run(r,s,l){Ag(r),this.freeze();const d=this.transformers;return!l&&typeof s=="function"&&(l=s,s=void 0),l?p(void 0,l):new Promise(p);function p(f,o){const c=vo(s);d.run(r,c,h);function h(g,u,y){const w=u||r;g?o(g):f?f(w):l(void 0,w,y)}}}runSync(r,s){let l=!1,d;return this.run(r,s,p),Tg("runSync","run",l),d;function p(f,o){xg(f),d=o,l=!0}}stringify(r,s){this.freeze();const l=vo(s),d=this.compiler||this.Compiler;return ih("stringify",d),Ag(r),d(r,l)}use(r,...s){const l=this.attachers,d=this.namespace;if(rh("use",this.frozen),r!=null)if(typeof r=="function")c(r,s);else if(typeof r=="object")Array.isArray(r)?o(r):f(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function p(h){if(typeof h=="function")c(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[g,...u]=h;c(g,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");o(h.plugins),h.settings&&(d.settings=Ju(!0,d.settings,h.settings))}function o(h){let g=-1;if(h!=null)if(Array.isArray(h))for(;++g<h.length;){const u=h[g];p(u)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function c(h,g){let u=-1,y=-1;for(;++u<l.length;)if(l[u][0]===h){y=u;break}if(y===-1)l.push([h,...g]);else if(g.length>0){let[w,...T]=g;const E=l[y][1];xh(E)&&xh(w)&&(w=Ju(!0,E,w)),l[y]=[h,w,...T]}}}}const Hw=new Vh().freeze();function nh(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function ih(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function rh(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 Ag(n){if(!xh(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function Tg(n,r,s){if(!s)throw new Error("`"+n+"` finished async. Use `"+r+"` instead")}function vo(n){return zw(n)?n:new F_(n)}function zw(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function Iw(n){return typeof n=="string"||Uw(n)}function Uw(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const Pw="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Rg=[],Dg={allowDangerousHtml:!0},Fw=/^(https?|ircs?|mailto|xmpp)$/i,qw=[{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 q_(n){const r=$w(n),s=Gw(n);return Vw(r.runSync(r.parse(s),s),n)}function $w(n){const r=n.rehypePlugins||Rg,s=n.remarkPlugins||Rg,l=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...Dg}:Dg;return Hw().use(xC).use(s).use(yw,l).use(r)}function Gw(n){const r=n.children||"",s=new F_;return typeof r=="string"&&(s.value=r),s}function Vw(n,r){const s=r.allowedElements,l=r.allowElement,d=r.components,p=r.disallowedElements,f=r.skipHtml,o=r.unwrapDisallowed,c=r.urlTransform||Ww;for(const g of qw)Object.hasOwn(r,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+Pw+g.id,void 0);return Gh(n,h),lS(n,{Fragment:x.Fragment,components:d,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function h(g,u,y){if(g.type==="raw"&&y&&typeof u=="number")return f?y.children.splice(u,1):y.children[u]={type:"text",value:g.value},u;if(g.type==="element"){let w;for(w in Ku)if(Object.hasOwn(Ku,w)&&Object.hasOwn(g.properties,w)){const T=g.properties[w],E=Ku[w];(E===null||E.includes(g.tagName))&&(g.properties[w]=c(String(T||""),w,g))}}if(g.type==="element"){let w=s?!s.includes(g.tagName):p?p.includes(g.tagName):!1;if(!w&&l&&typeof u=="number"&&(w=!l(g,u,y)),w&&y&&typeof u=="number")return o&&g.children?y.children.splice(u,1,...g.children):y.children.splice(u,1),u}}}function Ww(n){const r=n.indexOf(":"),s=n.indexOf("?"),l=n.indexOf("#"),d=n.indexOf("/");return r===-1||d!==-1&&r>d||s!==-1&&r>s||l!==-1&&r>l||Fw.test(n.slice(0,r))?n:""}function Mg(n,r){const s=String(n);if(typeof r!="string")throw new TypeError("Expected character");let l=0,d=s.indexOf(r);for(;d!==-1;)l++,d=s.indexOf(r,d+r.length);return l}function Kw(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Yw(n,r,s){const d=Ho((s||{}).ignore||[]),p=Xw(r);let f=-1;for(;++f<p.length;)P_(n,"text",o);function o(h,g){let u=-1,y;for(;++u<g.length;){const w=g[u],T=y?y.children:void 0;if(d(w,T?T.indexOf(w):void 0,y))return;y=w}if(y)return c(h,g)}function c(h,g){const u=g[g.length-1],y=p[f][0],w=p[f][1];let T=0;const S=u.children.indexOf(h);let v=!1,_=[];y.lastIndex=0;let b=y.exec(h.value);for(;b;){const A=b.index,L={index:b.index,input:b.input,stack:[...g,h]};let D=w(...b,L);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?y.lastIndex=A+1:(T!==A&&_.push({type:"text",value:h.value.slice(T,A)}),Array.isArray(D)?_.push(...D):D&&_.push(D),T=A+b[0].length,v=!0),!y.global)break;b=y.exec(h.value)}return v?(T<h.value.length&&_.push({type:"text",value:h.value.slice(T)}),u.children.splice(S,1,..._)):_=[h],S+_.length}}function Xw(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 l=-1;for(;++l<s.length;){const d=s[l];r.push([Qw(d[0]),Jw(d[1])])}return r}function Qw(n){return typeof n=="string"?new RegExp(Kw(n),"g"):n}function Jw(n){return typeof n=="function"?n:function(){return n}}const sh="phrasing",ah=["autolink","link","image","label"];function Zw(){return{transforms:[ax],enter:{literalAutolink:tx,literalAutolinkEmail:lh,literalAutolinkHttp:lh,literalAutolinkWww:lh},exit:{literalAutolink:sx,literalAutolinkEmail:rx,literalAutolinkHttp:nx,literalAutolinkWww:ix}}}function ex(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:sh,notInConstruct:ah},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:sh,notInConstruct:ah},{character:":",before:"[ps]",after:"\\/",inConstruct:sh,notInConstruct:ah}]}}function tx(n){this.enter({type:"link",title:null,url:"",children:[]},n)}function lh(n){this.config.enter.autolinkProtocol.call(this,n)}function nx(n){this.config.exit.autolinkProtocol.call(this,n)}function ix(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 rx(n){this.config.exit.autolinkEmail.call(this,n)}function sx(n){this.exit(n)}function ax(n){Yw(n,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,lx],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),ox]],{ignore:["link","linkReference"]})}function lx(n,r,s,l,d){let p="";if(!$_(d)||(/^w/i.test(r)&&(s=r+s,r="",p="http://"),!cx(s)))return!1;const f=ux(s+l);if(!f[0])return!1;const o={type:"link",title:null,url:p+r+f[0],children:[{type:"text",value:r+f[0]}]};return f[1]?[o,{type:"text",value:f[1]}]:o}function ox(n,r,s,l){return!$_(l,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+s,children:[{type:"text",value:r+"@"+s}]}}function cx(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 ux(n){const r=/[!"&'),.:;<>?\]}]+$/.exec(n);if(!r)return[n,void 0];n=n.slice(0,r.index);let s=r[0],l=s.indexOf(")");const d=Mg(n,"(");let p=Mg(n,")");for(;l!==-1&&d>p;)n+=s.slice(0,l+1),s=s.slice(l+1),l=s.indexOf(")"),p++;return[n,s]}function $_(n,r){const s=n.input.charCodeAt(n.index-1);return(n.index===0||Ur(s)||Bo(s))&&(!r||s!==47)}G_.peek=yx;function hx(){this.buffer()}function fx(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function dx(){this.buffer()}function px(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function mx(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=ni(this.sliceSerialize(n)).toLowerCase(),s.label=r}function gx(n){this.exit(n)}function _x(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=ni(this.sliceSerialize(n)).toLowerCase(),s.label=r}function vx(n){this.exit(n)}function yx(){return"["}function G_(n,r,s,l){const d=s.createTracker(l);let p=d.move("[^");const f=s.enter("footnoteReference"),o=s.enter("reference");return p+=d.move(s.safe(s.associationId(n),{after:"]",before:p})),o(),f(),p+=d.move("]"),p}function Sx(){return{enter:{gfmFootnoteCallString:hx,gfmFootnoteCall:fx,gfmFootnoteDefinitionLabelString:dx,gfmFootnoteDefinition:px},exit:{gfmFootnoteCallString:mx,gfmFootnoteCall:gx,gfmFootnoteDefinitionLabelString:_x,gfmFootnoteDefinition:vx}}}function bx(n){let r=!1;return n&&n.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:s,footnoteReference:G_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(l,d,p,f){const o=p.createTracker(f);let c=o.move("[^");const h=p.enter("footnoteDefinition"),g=p.enter("label");return c+=o.move(p.safe(p.associationId(l),{before:c,after:"]"})),g(),c+=o.move("]:"),l.children&&l.children.length>0&&(o.shift(4),c+=o.move((r?`
|
|
76
|
+
`:" ")+p.indentLines(p.containerFlow(l,o.current()),r?V_:Cx))),h(),c}}function Cx(n,r,s){return r===0?n:V_(n,r,s)}function V_(n,r,s){return(s?"":" ")+n}const wx=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];W_.peek=Tx;function xx(){return{canContainEols:["delete"],enter:{strikethrough:kx},exit:{strikethrough:Ax}}}function Ex(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:wx}],handlers:{delete:W_}}}function kx(n){this.enter({type:"delete",children:[]},n)}function Ax(n){this.exit(n)}function W_(n,r,s,l){const d=s.createTracker(l),p=s.enter("strikethrough");let f=d.move("~~");return f+=s.containerPhrasing(n,{...d.current(),before:f,after:"~"}),f+=d.move("~~"),p(),f}function Tx(){return"~"}function Rx(n){return n.length}function Dx(n,r){const s=r||{},l=(s.align||[]).concat(),d=s.stringLength||Rx,p=[],f=[],o=[],c=[];let h=0,g=-1;for(;++g<n.length;){const E=[],S=[];let v=-1;for(n[g].length>h&&(h=n[g].length);++v<n[g].length;){const _=Mx(n[g][v]);if(s.alignDelimiters!==!1){const b=d(_);S[v]=b,(c[v]===void 0||b>c[v])&&(c[v]=b)}E.push(_)}f[g]=E,o[g]=S}let u=-1;if(typeof l=="object"&&"length"in l)for(;++u<h;)p[u]=Lg(l[u]);else{const E=Lg(l);for(;++u<h;)p[u]=E}u=-1;const y=[],w=[];for(;++u<h;){const E=p[u];let S="",v="";E===99?(S=":",v=":"):E===108?S=":":E===114&&(v=":");let _=s.alignDelimiters===!1?1:Math.max(1,c[u]-S.length-v.length);const b=S+"-".repeat(_)+v;s.alignDelimiters!==!1&&(_=S.length+_+v.length,_>c[u]&&(c[u]=_),w[u]=_),y[u]=b}f.splice(1,0,y),o.splice(1,0,w),g=-1;const T=[];for(;++g<f.length;){const E=f[g],S=o[g];u=-1;const v=[];for(;++u<h;){const _=E[u]||"";let b="",A="";if(s.alignDelimiters!==!1){const L=c[u]-(S[u]||0),D=p[u];D===114?b=" ".repeat(L):D===99?L%2?(b=" ".repeat(L/2+.5),A=" ".repeat(L/2-.5)):(b=" ".repeat(L/2),A=b):A=" ".repeat(L)}s.delimiterStart!==!1&&!u&&v.push("|"),s.padding!==!1&&!(s.alignDelimiters===!1&&_==="")&&(s.delimiterStart!==!1||u)&&v.push(" "),s.alignDelimiters!==!1&&v.push(b),v.push(_),s.alignDelimiters!==!1&&v.push(A),s.padding!==!1&&v.push(" "),(s.delimiterEnd!==!1||u!==h-1)&&v.push("|")}T.push(s.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return T.join(`
|
|
77
|
+
`)}function Mx(n){return n==null?"":String(n)}function Lg(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 Lx(n,r,s,l){const d=s.enter("blockquote"),p=s.createTracker(l);p.move("> "),p.shift(2);const f=s.indentLines(s.containerFlow(n,p.current()),Ox);return d(),f}function Ox(n,r,s){return">"+(s?"":" ")+n}function Bx(n,r){return Og(n,r.inConstruct,!0)&&!Og(n,r.notInConstruct,!1)}function Og(n,r,s){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return s;let l=-1;for(;++l<r.length;)if(n.includes(r[l]))return!0;return!1}function Bg(n,r,s,l){let d=-1;for(;++d<s.unsafe.length;)if(s.unsafe[d].character===`
|
|
78
78
|
`&&Bx(s.stack,s.unsafe[d]))return/[ \t]/.test(l.before)?"":" ";return`\\
|
|
79
|
-
`}function jx(n,r){const s=String(n);let l=s.indexOf(r),d=l,
|
|
80
|
-
`,encode:["`"],...o.current()})),u()}return
|
|
81
|
-
`),
|
|
82
|
-
`)),
|
|
83
|
-
`,...c.current()}))),o(),n.title&&(o=s.enter(`title${
|
|
79
|
+
`}function jx(n,r){const s=String(n);let l=s.indexOf(r),d=l,p=0,f=0;if(typeof r!="string")throw new TypeError("Expected substring");for(;l!==-1;)l===d?++p>f&&(f=p):p=1,d=l+r.length,l=s.indexOf(r,d);return f}function Nx(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 Hx(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 zx(n,r,s,l){const d=Hx(s),p=n.value||"",f=d==="`"?"GraveAccent":"Tilde";if(Nx(n,s)){const u=s.enter("codeIndented"),y=s.indentLines(p,Ix);return u(),y}const o=s.createTracker(l),c=d.repeat(Math.max(jx(p,d)+1,3)),h=s.enter("codeFenced");let g=o.move(c);if(n.lang){const u=s.enter(`codeFencedLang${f}`);g+=o.move(s.safe(n.lang,{before:g,after:" ",encode:["`"],...o.current()})),u()}if(n.lang&&n.meta){const u=s.enter(`codeFencedMeta${f}`);g+=o.move(" "),g+=o.move(s.safe(n.meta,{before:g,after:`
|
|
80
|
+
`,encode:["`"],...o.current()})),u()}return g+=o.move(`
|
|
81
|
+
`),p&&(g+=o.move(p+`
|
|
82
|
+
`)),g+=o.move(c),h(),g}function Ix(n,r,s){return(s?"":" ")+n}function Wh(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 Ux(n,r,s,l){const d=Wh(s),p=d==='"'?"Quote":"Apostrophe",f=s.enter("definition");let o=s.enter("label");const c=s.createTracker(l);let h=c.move("[");return h+=c.move(s.safe(s.associationId(n),{before:h,after:"]",...c.current()})),h+=c.move("]: "),o(),!n.url||/[\0- \u007F]/.test(n.url)?(o=s.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(s.safe(n.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(o=s.enter("destinationRaw"),h+=c.move(s.safe(n.url,{before:h,after:n.title?" ":`
|
|
83
|
+
`,...c.current()}))),o(),n.title&&(o=s.enter(`title${p}`),h+=c.move(" "+d),h+=c.move(s.safe(n.title,{before:h,after:d,...c.current()})),h+=c.move(d),o()),f(),h}function Px(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 Ya(n){return"&#x"+n.toString(16).toUpperCase()+";"}function To(n,r,s){const l=js(n),d=js(r);return l===void 0?d===void 0?s==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:d===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:l===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}}K_.peek=Fx;function K_(n,r,s,l){const d=Px(s),p=s.enter("emphasis"),f=s.createTracker(l),o=f.move(d);let c=f.move(s.containerPhrasing(n,{after:d,before:o,...f.current()}));const h=c.charCodeAt(0),g=To(l.before.charCodeAt(l.before.length-1),h,d);g.inside&&(c=Ya(h)+c.slice(1));const u=c.charCodeAt(c.length-1),y=To(l.after.charCodeAt(0),u,d);y.inside&&(c=c.slice(0,-1)+Ya(u));const w=f.move(d);return p(),s.attentionEncodeSurroundingInfo={after:y.outside,before:g.outside},o+c+w}function Fx(n,r,s){return s.options.emphasis||"*"}function qx(n,r){let s=!1;return Gh(n,function(l){if("value"in l&&/\r?\n|\r/.test(l.value)||l.type==="break")return s=!0,Ch}),!!((!n.depth||n.depth<3)&&zh(n)&&(r.options.setext||s))}function $x(n,r,s,l){const d=Math.max(Math.min(6,n.depth||1),1),p=s.createTracker(l);if(qx(n,s)){const g=s.enter("headingSetext"),u=s.enter("phrasing"),y=s.containerPhrasing(n,{...p.current(),before:`
|
|
84
84
|
`,after:`
|
|
85
|
-
`});return u(),
|
|
86
|
-
`+(d===1?"=":"-").repeat(
|
|
87
|
-
`))+1))}const f="#".repeat(d),o=s.enter("headingAtx"),c=s.enter("phrasing");
|
|
88
|
-
`,...
|
|
89
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:
|
|
90
|
-
`))}function c(C,T,E,b){const y=E.enter("tableCell"),_=E.enter("phrasing"),S=E.containerPhrasing(C,{...b,before:m,after:m});return _(),y(),S}function h(C,T){return Dx(C,{align:T,alignDelimiters:l,padding:s,stringLength:d})}function p(C,T,E){const b=C.children;let y=-1;const _=[],S=T.enter("table");for(;++y<b.length;)_[y]=u(b[y],T,E);return S(),_}function u(C,T,E){const b=C.children;let y=-1;const _=[],S=T.enter("tableRow");for(;++y<b.length;)_[y]=c(b[y],C,T,E);return S(),_}function v(C,T,E){let b=iv.inlineCode(C,T,E);return E.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function _E(){return{exit:{taskListCheckValueChecked:jg,taskListCheckValueUnchecked:jg,paragraph:yE}}}function vE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:SE}}}function jg(n){const r=this.stack[this.stack.length-2];r.type,r.checked=n.type==="taskListCheckValueChecked"}function yE(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 l=s.children[0];if(l&&l.type==="text"){const d=r.children;let m=-1,f;for(;++m<d.length;){const o=d[m];if(o.type==="paragraph"){f=o;break}}f===s&&(l.value=l.value.slice(1),l.value.length===0?s.children.shift():s.position&&l.position&&typeof l.position.start.offset=="number"&&(l.position.start.column++,l.position.start.offset++,s.position.start=Object.assign({},l.position.start)))}}this.exit(n)}function SE(n,r,s,l){const d=n.children[0],m=typeof n.checked=="boolean"&&d&&d.type==="paragraph",f="["+(n.checked?"x":" ")+"] ",o=s.createTracker(l);m&&o.move(f);let c=iv.listItem(n,r,s,{...l,...o.current()});return m&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),c;function h(p){return p+f}}function bE(){return[Zw(),Sx(),xx(),uE(),_E()]}function CE(n){return{extensions:[ex(),bx(n),Ex(),gE(n),vE()]}}const wE={tokenize:RE,partial:!0},rv={tokenize:DE,partial:!0},sv={tokenize:ME,partial:!0},av={tokenize:LE,partial:!0},xE={tokenize:OE,partial:!0},lv={name:"wwwAutolink",tokenize:AE,previous:cv},ov={name:"protocolAutolink",tokenize:TE,previous:uv},Ii={name:"emailAutolink",tokenize:kE,previous:hv},pi={};function EE(){return{text:pi}}let Hr=48;for(;Hr<123;)pi[Hr]=Ii,Hr++,Hr===58?Hr=65:Hr===91&&(Hr=97);pi[43]=Ii;pi[45]=Ii;pi[46]=Ii;pi[95]=Ii;pi[72]=[Ii,ov];pi[104]=[Ii,ov];pi[87]=[Ii,lv];pi[119]=[Ii,lv];function kE(n,r,s){const l=this;let d,m;return f;function f(u){return!kh(u)||!hv.call(l,l.previous)||Yh(l.events)?s(u):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),o(u))}function o(u){return kh(u)?(n.consume(u),o):u===64?(n.consume(u),c):s(u)}function c(u){return u===46?n.check(xE,p,h)(u):u===45||u===95||Yt(u)?(m=!0,n.consume(u),c):p(u)}function h(u){return n.consume(u),d=!0,c}function p(u){return m&&d&&nn(l.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),r(u)):s(u)}}function AE(n,r,s){const l=this;return d;function d(f){return f!==87&&f!==119||!cv.call(l,l.previous)||Yh(l.events)?s(f):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(wE,n.attempt(rv,n.attempt(sv,m),s),s)(f))}function m(f){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),r(f)}}function TE(n,r,s){const l=this;let d="",m=!1;return f;function f(u){return(u===72||u===104)&&uv.call(l,l.previous)&&!Yh(l.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),d+=String.fromCodePoint(u),n.consume(u),o):s(u)}function o(u){if(nn(u)&&d.length<5)return d+=String.fromCodePoint(u),n.consume(u),o;if(u===58){const v=d.toLowerCase();if(v==="http"||v==="https")return n.consume(u),c}return s(u)}function c(u){return u===47?(n.consume(u),m?h:(m=!0,c)):s(u)}function h(u){return u===null||Eo(u)||ot(u)||Ur(u)||Bo(u)?s(u):n.attempt(rv,n.attempt(sv,p),s)(u)}function p(u){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),r(u)}}function RE(n,r,s){let l=0;return d;function d(f){return(f===87||f===119)&&l<3?(l++,n.consume(f),d):f===46&&l===3?(n.consume(f),m):s(f)}function m(f){return f===null?s(f):r(f)}}function DE(n,r,s){let l,d,m;return f;function f(h){return h===46||h===95?n.check(av,c,o)(h):h===null||ot(h)||Ur(h)||h!==45&&Bo(h)?c(h):(m=!0,n.consume(h),f)}function o(h){return h===95?l=!0:(d=l,l=void 0),n.consume(h),f}function c(h){return d||l||!m?s(h):r(h)}}function ME(n,r){let s=0,l=0;return d;function d(f){return f===40?(s++,n.consume(f),d):f===41&&l<s?m(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(av,r,m)(f):f===null||ot(f)||Ur(f)?r(f):(n.consume(f),d)}function m(f){return f===41&&l++,n.consume(f),d}}function LE(n,r,s){return l;function l(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(n.consume(o),l):o===38?(n.consume(o),m):o===93?(n.consume(o),d):o===60||o===null||ot(o)||Ur(o)?r(o):s(o)}function d(o){return o===null||o===40||o===91||ot(o)||Ur(o)?r(o):l(o)}function m(o){return nn(o)?f(o):s(o)}function f(o){return o===59?(n.consume(o),l):nn(o)?(n.consume(o),f):s(o)}}function OE(n,r,s){return l;function l(m){return n.consume(m),d}function d(m){return Yt(m)?s(m):r(m)}}function cv(n){return n===null||n===40||n===42||n===95||n===91||n===93||n===126||ot(n)}function uv(n){return!nn(n)}function hv(n){return!(n===47||kh(n))}function kh(n){return n===43||n===45||n===46||n===95||Yt(n)}function Yh(n){let r=n.length,s=!1;for(;r--;){const l=n[r][1];if((l.type==="labelLink"||l.type==="labelImage")&&!l._balanced){s=!0;break}if(l._gfmAutolinkLiteralWalkedInto){s=!1;break}}return n.length>0&&!s&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}const BE={tokenize:FE,partial:!0};function jE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:IE,continuation:{tokenize:UE},exit:PE}},text:{91:{name:"gfmFootnoteCall",tokenize:zE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:NE,resolveTo:HE}}}}function NE(n,r,s){const l=this;let d=l.events.length;const m=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let f;for(;d--;){const c=l.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 o;function o(c){if(!f||!f._balanced)return s(c);const h=ni(l.sliceSerialize({start:f.end,end:l.now()}));return h.codePointAt(0)!==94||!m.includes(h.slice(1))?s(c):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(c),n.exit("gfmFootnoteCallLabelMarker"),r(c))}}function HE(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 l={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 m={type:"gfmFootnoteCallString",start:Object.assign({},d.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},m.start),end:Object.assign({},m.end)},o=[n[s+1],n[s+2],["enter",l,r],n[s+3],n[s+4],["enter",d,r],["exit",d,r],["enter",m,r],["enter",f,r],["exit",f,r],["exit",m,r],n[n.length-2],n[n.length-1],["exit",l,r]];return n.splice(s,n.length-s+1,...o),n}function zE(n,r,s){const l=this,d=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let m=0,f;return o;function o(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(m>999||u===93&&!f||u===null||u===91||ot(u))return s(u);if(u===93){n.exit("chunkString");const v=n.exit("gfmFootnoteCallString");return d.includes(ni(l.sliceSerialize(v)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),r):s(u)}return ot(u)||(f=!0),m++,n.consume(u),u===92?p:h}function p(u){return u===91||u===92||u===93?(n.consume(u),m++,h):h(u)}}function IE(n,r,s){const l=this,d=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let m,f=0,o;return c;function c(T){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(T),n.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(T){return T===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(T),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",p):s(T)}function p(T){if(f>999||T===93&&!o||T===null||T===91||ot(T))return s(T);if(T===93){n.exit("chunkString");const E=n.exit("gfmFootnoteDefinitionLabelString");return m=ni(l.sliceSerialize(E)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(T),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),v}return ot(T)||(o=!0),f++,n.consume(T),T===92?u:p}function u(T){return T===91||T===92||T===93?(n.consume(T),f++,p):p(T)}function v(T){return T===58?(n.enter("definitionMarker"),n.consume(T),n.exit("definitionMarker"),d.includes(m)||d.push(m),Xe(n,C,"gfmFootnoteDefinitionWhitespace")):s(T)}function C(T){return r(T)}}function UE(n,r,s){return n.check(Ja,r,n.attempt(BE,r,s))}function PE(n){n.exit("gfmFootnoteDefinition")}function FE(n,r,s){const l=this;return Xe(n,d,"gfmFootnoteDefinitionIndent",5);function d(m){const f=l.events[l.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(m):s(m)}}function qE(n){let s=(n||{}).singleTilde;const l={name:"strikethrough",tokenize:m,resolveAll:d};return s==null&&(s=!0),{text:{126:l},insideSpan:{null:[l]},attentionMarkers:{null:[126]}};function d(f,o){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)},v=[["enter",p,o],["enter",f[h][1],o],["exit",f[h][1],o],["enter",u,o]],C=o.parser.constructs.insideSpan.null;C&&Mn(v,v.length,0,jo(C,f.slice(h+1,c),o)),Mn(v,v.length,0,[["exit",u,o],["enter",f[c][1],o],["exit",f[c][1],o],["exit",p,o]]),Mn(f,h-1,c-h+3,v),c=h+v.length-2;break}}for(c=-1;++c<f.length;)f[c][1].type==="strikethroughSequenceTemporary"&&(f[c][1].type="data");return f}function m(f,o,c){const h=this.previous,p=this.events;let u=0;return v;function v(T){return h===126&&p[p.length-1][1].type!=="characterEscape"?c(T):(f.enter("strikethroughSequenceTemporary"),C(T))}function C(T){const E=js(h);if(T===126)return u>1?c(T):(f.consume(T),u++,C);if(u<2&&!s)return c(T);const b=f.exit("strikethroughSequenceTemporary"),y=js(T);return b._open=!y||y===2&&!!E,b._close=!E||E===2&&!!y,o(T)}}}class $E{constructor(){this.map=[]}add(r,s,l){GE(this,r,s,l)}consume(r){if(this.map.sort(function(m,f){return m[0]-f[0]}),this.map.length===0)return;let s=this.map.length;const l=[];for(;s>0;)s-=1,l.push(r.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),r.length=this.map[s][0];l.push(r.slice()),r.length=0;let d=l.pop();for(;d;){for(const m of d)r.push(m);d=l.pop()}this.map.length=0}}function GE(n,r,s,l){let d=0;if(!(s===0&&l.length===0)){for(;d<n.map.length;){if(n.map[d][0]===r){n.map[d][1]+=s,n.map[d][2].push(...l);return}d+=1}n.map.push([r,s,l])}}function VE(n,r){let s=!1;const l=[];for(;r<n.length;){const d=n[r];if(s){if(d[0]==="enter")d[1].type==="tableContent"&&l.push(n[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(d[1].type==="tableContent"){if(n[r-1][1].type==="tableDelimiterMarker"){const m=l.length-1;l[m]=l[m]==="left"?"center":"right"}}else if(d[1].type==="tableDelimiterRow")break}else d[0]==="enter"&&d[1].type==="tableDelimiterRow"&&(s=!0);r+=1}return l}function WE(){return{flow:{null:{name:"table",tokenize:KE,resolveAll:YE}}}}function KE(n,r,s){const l=this;let d=0,m=0,f;return o;function o(B){let H=l.events.length-1;for(;H>-1;){const K=l.events[H][1].type;if(K==="lineEnding"||K==="linePrefix")H--;else break}const U=H>-1?l.events[H][1].type:null,P=U==="tableHead"||U==="tableRow"?D:c;return P===D&&l.parser.lazy[l.now().line]?s(B):P(B)}function c(B){return n.enter("tableHead"),n.enter("tableRow"),h(B)}function h(B){return B===124||(f=!0,m+=1),p(B)}function p(B){return B===null?s(B):De(B)?m>1?(m=0,l.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(B),n.exit("lineEnding"),C):s(B):Ve(B)?Xe(n,p,"whitespace")(B):(m+=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||ot(B)?(n.exit("data"),p(B)):(n.consume(B),B===92?v:u)}function v(B){return B===92||B===124?(n.consume(B),u):u(B)}function C(B){return l.interrupt=!1,l.parser.lazy[l.now().line]?s(B):(n.enter("tableDelimiterRow"),f=!1,Ve(B)?Xe(n,T,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):T(B))}function T(B){return B===45||B===58?b(B):B===124?(f=!0,n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),E):L(B)}function E(B){return Ve(B)?Xe(n,b,"whitespace")(B):b(B)}function b(B){return B===58?(m+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),y):B===45?(m+=1,y(B)):B===null||De(B)?A(B):L(B)}function y(B){return B===45?(n.enter("tableDelimiterFiller"),_(B)):L(B)}function _(B){return B===45?(n.consume(B),_):B===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),S):(n.exit("tableDelimiterFiller"),S(B))}function S(B){return Ve(B)?Xe(n,A,"whitespace")(B):A(B)}function A(B){return B===124?T(B):B===null||De(B)?!f||d!==m?L(B):(n.exit("tableDelimiterRow"),n.exit("tableHead"),r(B)):L(B)}function L(B){return s(B)}function D(B){return n.enter("tableRow"),R(B)}function R(B){return B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),R):B===null||De(B)?(n.exit("tableRow"),r(B)):Ve(B)?Xe(n,R,"whitespace")(B):(n.enter("data"),k(B))}function k(B){return B===null||B===124||ot(B)?(n.exit("data"),R(B)):(n.consume(B),B===92?M:k)}function M(B){return B===92||B===124?(n.consume(B),k):k(B)}}function YE(n,r){let s=-1,l=!0,d=0,m=[0,0,0,0],f=[0,0,0,0],o=!1,c=0,h,p,u;const v=new $E;for(;++s<n.length;){const C=n[s],T=C[1];C[0]==="enter"?T.type==="tableHead"?(o=!1,c!==0&&(Ng(v,r,c,h,p),p=void 0,c=0),h={type:"table",start:Object.assign({},T.start),end:Object.assign({},T.end)},v.add(s,0,[["enter",h,r]])):T.type==="tableRow"||T.type==="tableDelimiterRow"?(l=!0,u=void 0,m=[0,0,0,0],f=[0,s+1,0,0],o&&(o=!1,p={type:"tableBody",start:Object.assign({},T.start),end:Object.assign({},T.end)},v.add(s,0,[["enter",p,r]])),d=T.type==="tableDelimiterRow"?2:p?3:1):d&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")?(l=!1,f[2]===0&&(m[1]!==0&&(f[0]=f[1],u=yo(v,r,m,d,void 0,u),m=[0,0,0,0]),f[2]=s)):T.type==="tableCellDivider"&&(l?l=!1:(m[1]!==0&&(f[0]=f[1],u=yo(v,r,m,d,void 0,u)),m=f,f=[m[1],s,0,0])):T.type==="tableHead"?(o=!0,c=s):T.type==="tableRow"||T.type==="tableDelimiterRow"?(c=s,m[1]!==0?(f[0]=f[1],u=yo(v,r,m,d,s,u)):f[1]!==0&&(u=yo(v,r,f,d,s,u)),d=0):d&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")&&(f[3]=s)}for(c!==0&&Ng(v,r,c,h,p),v.consume(r.events),s=-1;++s<r.events.length;){const C=r.events[s];C[0]==="enter"&&C[1].type==="table"&&(C[1]._align=VE(r.events,s))}return n}function yo(n,r,s,l,d,m){const f=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",o="tableContent";s[0]!==0&&(m.end=Object.assign({},Ls(r.events,s[0])),n.add(s[0],0,[["exit",m,r]]));const c=Ls(r.events,s[1]);if(m={type:f,start:Object.assign({},c),end:Object.assign({},c)},n.add(s[1],0,[["enter",m,r]]),s[2]!==0){const h=Ls(r.events,s[2]),p=Ls(r.events,s[3]),u={type:o,start:Object.assign({},h),end:Object.assign({},p)};if(n.add(s[2],0,[["enter",u,r]]),l!==2){const v=r.events[s[2]],C=r.events[s[3]];if(v[1].end=Object.assign({},C[1].end),v[1].type="chunkText",v[1].contentType="text",s[3]>s[2]+1){const T=s[2]+1,E=s[3]-s[2]-1;n.add(T,E,[])}}n.add(s[3]+1,0,[["exit",u,r]])}return d!==void 0&&(m.end=Object.assign({},Ls(r.events,d)),n.add(d,0,[["exit",m,r]]),m=void 0),m}function Ng(n,r,s,l,d){const m=[],f=Ls(r.events,s);d&&(d.end=Object.assign({},f),m.push(["exit",d,r])),l.end=Object.assign({},f),m.push(["exit",l,r]),n.add(s+1,0,m)}function Ls(n,r){const s=n[r],l=s[0]==="enter"?"start":"end";return s[1][l]}const XE={name:"tasklistCheck",tokenize:JE};function QE(){return{text:{91:XE}}}function JE(n,r,s){const l=this;return d;function d(c){return l.previous!==null||!l._gfmTasklistFirstContentOfListItem?s(c):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(c),n.exit("taskListCheckMarker"),m)}function m(c){return ot(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"),o):s(c)}function o(c){return De(c)?r(c):Ve(c)?n.check({tokenize:ZE},r,s)(c):s(c)}}function ZE(n,r,s){return Xe(n,l,"whitespace");function l(d){return d===null?s(d):r(d)}}function e2(n){return b_([EE(),jE(),qE(n),WE(),QE()])}const t2={};function fv(n){const r=this,s=n||t2,l=r.data(),d=l.micromarkExtensions||(l.micromarkExtensions=[]),m=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),f=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);d.push(e2(s)),m.push(bE()),f.push(CE(s))}const dv=1e3,Os=new Map;let Ga;function n2(n,r,s){const l=Symbol(n),d=Math.max(dv,s.intervalMs),m=Date.now();return Os.set(n,{id:n,intervalMs:d,nextRunAt:s.runImmediately===!1?m+d:m,inFlight:!1,run:r,token:l}),i2(),pv(),()=>{const f=Os.get(n);(f==null?void 0:f.token)===l&&(Os.delete(n),Os.size===0&&Ga!==void 0&&(window.clearInterval(Ga),Ga=void 0))}}function i2(){Ga!==void 0||typeof window>"u"||(Ga=window.setInterval(()=>{pv()},dv))}async function pv(){const n=Date.now();for(const r of Os.values())r.inFlight||r.nextRunAt>n||r2(r)}async function r2(n){n.inFlight=!0;try{await n.run()}catch{}finally{const r=Os.get(n.id);(r==null?void 0:r.token)===n.token&&(r.inFlight=!1,r.nextRunAt=Date.now()+r.intervalMs)}}function Xa(n,r,s){const l=te.useRef(r);te.useEffect(()=>{l.current=r},[r]),te.useEffect(()=>{if(!(!n||s.enabled===!1))return n2(n,()=>l.current(),{intervalMs:s.intervalMs,runImmediately:s.runImmediately})},[n,s.enabled,s.intervalMs,s.runImmediately])}const Ro=`
|
|
85
|
+
`});return u(),g(),y+`
|
|
86
|
+
`+(d===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
|
|
87
|
+
`))+1))}const f="#".repeat(d),o=s.enter("headingAtx"),c=s.enter("phrasing");p.move(f+" ");let h=s.containerPhrasing(n,{before:"# ",after:`
|
|
88
|
+
`,...p.current()});return/^[\t ]/.test(h)&&(h=Ya(h.charCodeAt(0))+h.slice(1)),h=h?f+" "+h:f,s.options.closeAtx&&(h+=" "+f),c(),o(),h}Y_.peek=Gx;function Y_(n){return n.value||""}function Gx(){return"<"}X_.peek=Vx;function X_(n,r,s,l){const d=Wh(s),p=d==='"'?"Quote":"Apostrophe",f=s.enter("image");let o=s.enter("label");const c=s.createTracker(l);let h=c.move("![");return h+=c.move(s.safe(n.alt,{before:h,after:"]",...c.current()})),h+=c.move("]("),o(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(o=s.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(s.safe(n.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(o=s.enter("destinationRaw"),h+=c.move(s.safe(n.url,{before:h,after:n.title?" ":")",...c.current()}))),o(),n.title&&(o=s.enter(`title${p}`),h+=c.move(" "+d),h+=c.move(s.safe(n.title,{before:h,after:d,...c.current()})),h+=c.move(d),o()),h+=c.move(")"),f(),h}function Vx(){return"!"}Q_.peek=Wx;function Q_(n,r,s,l){const d=n.referenceType,p=s.enter("imageReference");let f=s.enter("label");const o=s.createTracker(l);let c=o.move("![");const h=s.safe(n.alt,{before:c,after:"]",...o.current()});c+=o.move(h+"]["),f();const g=s.stack;s.stack=[],f=s.enter("reference");const u=s.safe(s.associationId(n),{before:c,after:"]",...o.current()});return f(),s.stack=g,p(),d==="full"||!h||h!==u?c+=o.move(u+"]"):d==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function Wx(){return"!"}J_.peek=Kx;function J_(n,r,s){let l=n.value||"",d="`",p=-1;for(;new RegExp("(^|[^`])"+d+"([^`]|$)").test(l);)d+="`";for(/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^`|`$/.test(l))&&(l=" "+l+" ");++p<s.unsafe.length;){const f=s.unsafe[p],o=s.compilePattern(f);let c;if(f.atBreak)for(;c=o.exec(l);){let h=c.index;l.charCodeAt(h)===10&&l.charCodeAt(h-1)===13&&h--,l=l.slice(0,h)+" "+l.slice(c.index+1)}}return d+l+d}function Kx(){return"`"}function Z_(n,r){const s=zh(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))}ev.peek=Yx;function ev(n,r,s,l){const d=Wh(s),p=d==='"'?"Quote":"Apostrophe",f=s.createTracker(l);let o,c;if(Z_(n,s)){const g=s.stack;s.stack=[],o=s.enter("autolink");let u=f.move("<");return u+=f.move(s.containerPhrasing(n,{before:u,after:">",...f.current()})),u+=f.move(">"),o(),s.stack=g,u}o=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${p}`),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(")"),o(),h}function Yx(n,r,s){return Z_(n,s)?"<":"["}tv.peek=Xx;function tv(n,r,s,l){const d=n.referenceType,p=s.enter("linkReference");let f=s.enter("label");const o=s.createTracker(l);let c=o.move("[");const h=s.containerPhrasing(n,{before:c,after:"]",...o.current()});c+=o.move(h+"]["),f();const g=s.stack;s.stack=[],f=s.enter("reference");const u=s.safe(s.associationId(n),{before:c,after:"]",...o.current()});return f(),s.stack=g,p(),d==="full"||!h||h!==u?c+=o.move(u+"]"):d==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function Xx(){return"["}function Kh(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 Qx(n){const r=Kh(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 Jx(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 nv(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 Zx(n,r,s,l){const d=s.enter("list"),p=s.bulletCurrent;let f=n.ordered?Jx(s):Kh(s);const o=n.ordered?f==="."?")":".":Qx(s);let c=r&&s.bulletLastUsed?f===s.bulletLastUsed:!1;if(!n.ordered){const g=n.children?n.children[0]:void 0;if((f==="*"||f==="-")&&g&&(!g.children||!g.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),nv(s)===f&&g){let u=-1;for(;++u<n.children.length;){const y=n.children[u];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(f=o),s.bulletCurrent=f;const h=s.containerFlow(n,l);return s.bulletLastUsed=f,s.bulletCurrent=p,d(),h}function eE(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 tE(n,r,s,l){const d=eE(s);let p=s.bulletCurrent||Kh(s);r&&r.type==="list"&&r.ordered&&(p=(typeof r.start=="number"&&r.start>-1?r.start:1)+(s.options.incrementListMarker===!1?0:r.children.indexOf(n))+p);let f=p.length+1;(d==="tab"||d==="mixed"&&(r&&r.type==="list"&&r.spread||n.spread))&&(f=Math.ceil(f/4)*4);const o=s.createTracker(l);o.move(p+" ".repeat(f-p.length)),o.shift(f);const c=s.enter("listItem"),h=s.indentLines(s.containerFlow(n,o.current()),g);return c(),h;function g(u,y,w){return y?(w?"":" ".repeat(f))+u:(w?p:p+" ".repeat(f-p.length))+u}}function nE(n,r,s,l){const d=s.enter("paragraph"),p=s.enter("phrasing"),f=s.containerPhrasing(n,l);return p(),d(),f}const iE=Ho(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function rE(n,r,s,l){return(n.children.some(function(f){return iE(f)})?s.containerPhrasing:s.containerFlow).call(s,n,l)}function sE(n){const r=n.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}iv.peek=aE;function iv(n,r,s,l){const d=sE(s),p=s.enter("strong"),f=s.createTracker(l),o=f.move(d+d);let c=f.move(s.containerPhrasing(n,{after:d,before:o,...f.current()}));const h=c.charCodeAt(0),g=To(l.before.charCodeAt(l.before.length-1),h,d);g.inside&&(c=Ya(h)+c.slice(1));const u=c.charCodeAt(c.length-1),y=To(l.after.charCodeAt(0),u,d);y.inside&&(c=c.slice(0,-1)+Ya(u));const w=f.move(d+d);return p(),s.attentionEncodeSurroundingInfo={after:y.outside,before:g.outside},o+c+w}function aE(n,r,s){return s.options.strong||"*"}function lE(n,r,s,l){return s.safe(n.value,l)}function oE(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 cE(n,r,s){const l=(nv(s)+(s.options.ruleSpaces?" ":"")).repeat(oE(s));return s.options.ruleSpaces?l.slice(0,-1):l}const rv={blockquote:Lx,break:Bg,code:zx,definition:Ux,emphasis:K_,hardBreak:Bg,heading:$x,html:Y_,image:X_,imageReference:Q_,inlineCode:J_,link:ev,linkReference:tv,list:Zx,listItem:tE,paragraph:nE,root:rE,strong:iv,text:lE,thematicBreak:cE};function uE(){return{enter:{table:hE,tableData:jg,tableHeader:jg,tableRow:dE},exit:{codeText:pE,table:fE,tableData:oh,tableHeader:oh,tableRow:oh}}}function hE(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 fE(n){this.exit(n),this.data.inTable=void 0}function dE(n){this.enter({type:"tableRow",children:[]},n)}function oh(n){this.exit(n)}function jg(n){this.enter({type:"tableCell",children:[]},n)}function pE(n){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,mE));const s=this.stack[this.stack.length-1];s.type,s.value=r,this.exit(n)}function mE(n,r){return r==="|"?r:n}function gE(n){const r=n||{},s=r.tableCellPadding,l=r.tablePipeAlign,d=r.stringLength,p=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:y,table:f,tableCell:c,tableRow:o}};function f(w,T,E,S){return h(g(w,E,S),w.align)}function o(w,T,E,S){const v=u(w,E,S),_=h([v]);return _.slice(0,_.indexOf(`
|
|
90
|
+
`))}function c(w,T,E,S){const v=E.enter("tableCell"),_=E.enter("phrasing"),b=E.containerPhrasing(w,{...S,before:p,after:p});return _(),v(),b}function h(w,T){return Dx(w,{align:T,alignDelimiters:l,padding:s,stringLength:d})}function g(w,T,E){const S=w.children;let v=-1;const _=[],b=T.enter("table");for(;++v<S.length;)_[v]=u(S[v],T,E);return b(),_}function u(w,T,E){const S=w.children;let v=-1;const _=[],b=T.enter("tableRow");for(;++v<S.length;)_[v]=c(S[v],w,T,E);return b(),_}function y(w,T,E){let S=rv.inlineCode(w,T,E);return E.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function _E(){return{exit:{taskListCheckValueChecked:Ng,taskListCheckValueUnchecked:Ng,paragraph:yE}}}function vE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:SE}}}function Ng(n){const r=this.stack[this.stack.length-2];r.type,r.checked=n.type==="taskListCheckValueChecked"}function yE(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 l=s.children[0];if(l&&l.type==="text"){const d=r.children;let p=-1,f;for(;++p<d.length;){const o=d[p];if(o.type==="paragraph"){f=o;break}}f===s&&(l.value=l.value.slice(1),l.value.length===0?s.children.shift():s.position&&l.position&&typeof l.position.start.offset=="number"&&(l.position.start.column++,l.position.start.offset++,s.position.start=Object.assign({},l.position.start)))}}this.exit(n)}function SE(n,r,s,l){const d=n.children[0],p=typeof n.checked=="boolean"&&d&&d.type==="paragraph",f="["+(n.checked?"x":" ")+"] ",o=s.createTracker(l);p&&o.move(f);let c=rv.listItem(n,r,s,{...l,...o.current()});return p&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),c;function h(g){return g+f}}function bE(){return[Zw(),Sx(),xx(),uE(),_E()]}function CE(n){return{extensions:[ex(),bx(n),Ex(),gE(n),vE()]}}const wE={tokenize:RE,partial:!0},sv={tokenize:DE,partial:!0},av={tokenize:ME,partial:!0},lv={tokenize:LE,partial:!0},xE={tokenize:OE,partial:!0},ov={name:"wwwAutolink",tokenize:AE,previous:uv},cv={name:"protocolAutolink",tokenize:TE,previous:hv},Ii={name:"emailAutolink",tokenize:kE,previous:fv},pi={};function EE(){return{text:pi}}let Hr=48;for(;Hr<123;)pi[Hr]=Ii,Hr++,Hr===58?Hr=65:Hr===91&&(Hr=97);pi[43]=Ii;pi[45]=Ii;pi[46]=Ii;pi[95]=Ii;pi[72]=[Ii,cv];pi[104]=[Ii,cv];pi[87]=[Ii,ov];pi[119]=[Ii,ov];function kE(n,r,s){const l=this;let d,p;return f;function f(u){return!kh(u)||!fv.call(l,l.previous)||Yh(l.events)?s(u):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),o(u))}function o(u){return kh(u)?(n.consume(u),o):u===64?(n.consume(u),c):s(u)}function c(u){return u===46?n.check(xE,g,h)(u):u===45||u===95||Yt(u)?(p=!0,n.consume(u),c):g(u)}function h(u){return n.consume(u),d=!0,c}function g(u){return p&&d&&nn(l.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),r(u)):s(u)}}function AE(n,r,s){const l=this;return d;function d(f){return f!==87&&f!==119||!uv.call(l,l.previous)||Yh(l.events)?s(f):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(wE,n.attempt(sv,n.attempt(av,p),s),s)(f))}function p(f){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),r(f)}}function TE(n,r,s){const l=this;let d="",p=!1;return f;function f(u){return(u===72||u===104)&&hv.call(l,l.previous)&&!Yh(l.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),d+=String.fromCodePoint(u),n.consume(u),o):s(u)}function o(u){if(nn(u)&&d.length<5)return d+=String.fromCodePoint(u),n.consume(u),o;if(u===58){const y=d.toLowerCase();if(y==="http"||y==="https")return n.consume(u),c}return s(u)}function c(u){return u===47?(n.consume(u),p?h:(p=!0,c)):s(u)}function h(u){return u===null||Eo(u)||ot(u)||Ur(u)||Bo(u)?s(u):n.attempt(sv,n.attempt(av,g),s)(u)}function g(u){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),r(u)}}function RE(n,r,s){let l=0;return d;function d(f){return(f===87||f===119)&&l<3?(l++,n.consume(f),d):f===46&&l===3?(n.consume(f),p):s(f)}function p(f){return f===null?s(f):r(f)}}function DE(n,r,s){let l,d,p;return f;function f(h){return h===46||h===95?n.check(lv,c,o)(h):h===null||ot(h)||Ur(h)||h!==45&&Bo(h)?c(h):(p=!0,n.consume(h),f)}function o(h){return h===95?l=!0:(d=l,l=void 0),n.consume(h),f}function c(h){return d||l||!p?s(h):r(h)}}function ME(n,r){let s=0,l=0;return d;function d(f){return f===40?(s++,n.consume(f),d):f===41&&l<s?p(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(lv,r,p)(f):f===null||ot(f)||Ur(f)?r(f):(n.consume(f),d)}function p(f){return f===41&&l++,n.consume(f),d}}function LE(n,r,s){return l;function l(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(n.consume(o),l):o===38?(n.consume(o),p):o===93?(n.consume(o),d):o===60||o===null||ot(o)||Ur(o)?r(o):s(o)}function d(o){return o===null||o===40||o===91||ot(o)||Ur(o)?r(o):l(o)}function p(o){return nn(o)?f(o):s(o)}function f(o){return o===59?(n.consume(o),l):nn(o)?(n.consume(o),f):s(o)}}function OE(n,r,s){return l;function l(p){return n.consume(p),d}function d(p){return Yt(p)?s(p):r(p)}}function uv(n){return n===null||n===40||n===42||n===95||n===91||n===93||n===126||ot(n)}function hv(n){return!nn(n)}function fv(n){return!(n===47||kh(n))}function kh(n){return n===43||n===45||n===46||n===95||Yt(n)}function Yh(n){let r=n.length,s=!1;for(;r--;){const l=n[r][1];if((l.type==="labelLink"||l.type==="labelImage")&&!l._balanced){s=!0;break}if(l._gfmAutolinkLiteralWalkedInto){s=!1;break}}return n.length>0&&!s&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}const BE={tokenize:FE,partial:!0};function jE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:IE,continuation:{tokenize:UE},exit:PE}},text:{91:{name:"gfmFootnoteCall",tokenize:zE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:NE,resolveTo:HE}}}}function NE(n,r,s){const l=this;let d=l.events.length;const p=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let f;for(;d--;){const c=l.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 o;function o(c){if(!f||!f._balanced)return s(c);const h=ni(l.sliceSerialize({start:f.end,end:l.now()}));return h.codePointAt(0)!==94||!p.includes(h.slice(1))?s(c):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(c),n.exit("gfmFootnoteCallLabelMarker"),r(c))}}function HE(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 l={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 p={type:"gfmFootnoteCallString",start:Object.assign({},d.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},p.start),end:Object.assign({},p.end)},o=[n[s+1],n[s+2],["enter",l,r],n[s+3],n[s+4],["enter",d,r],["exit",d,r],["enter",p,r],["enter",f,r],["exit",f,r],["exit",p,r],n[n.length-2],n[n.length-1],["exit",l,r]];return n.splice(s,n.length-s+1,...o),n}function zE(n,r,s){const l=this,d=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let p=0,f;return o;function o(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(p>999||u===93&&!f||u===null||u===91||ot(u))return s(u);if(u===93){n.exit("chunkString");const y=n.exit("gfmFootnoteCallString");return d.includes(ni(l.sliceSerialize(y)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),r):s(u)}return ot(u)||(f=!0),p++,n.consume(u),u===92?g:h}function g(u){return u===91||u===92||u===93?(n.consume(u),p++,h):h(u)}}function IE(n,r,s){const l=this,d=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let p,f=0,o;return c;function c(T){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(T),n.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(T){return T===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(T),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",g):s(T)}function g(T){if(f>999||T===93&&!o||T===null||T===91||ot(T))return s(T);if(T===93){n.exit("chunkString");const E=n.exit("gfmFootnoteDefinitionLabelString");return p=ni(l.sliceSerialize(E)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(T),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),y}return ot(T)||(o=!0),f++,n.consume(T),T===92?u:g}function u(T){return T===91||T===92||T===93?(n.consume(T),f++,g):g(T)}function y(T){return T===58?(n.enter("definitionMarker"),n.consume(T),n.exit("definitionMarker"),d.includes(p)||d.push(p),Xe(n,w,"gfmFootnoteDefinitionWhitespace")):s(T)}function w(T){return r(T)}}function UE(n,r,s){return n.check(Ja,r,n.attempt(BE,r,s))}function PE(n){n.exit("gfmFootnoteDefinition")}function FE(n,r,s){const l=this;return Xe(n,d,"gfmFootnoteDefinitionIndent",5);function d(p){const f=l.events[l.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(p):s(p)}}function qE(n){let s=(n||{}).singleTilde;const l={name:"strikethrough",tokenize:p,resolveAll:d};return s==null&&(s=!0),{text:{126:l},insideSpan:{null:[l]},attentionMarkers:{null:[126]}};function d(f,o){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 g={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)},y=[["enter",g,o],["enter",f[h][1],o],["exit",f[h][1],o],["enter",u,o]],w=o.parser.constructs.insideSpan.null;w&&Mn(y,y.length,0,jo(w,f.slice(h+1,c),o)),Mn(y,y.length,0,[["exit",u,o],["enter",f[c][1],o],["exit",f[c][1],o],["exit",g,o]]),Mn(f,h-1,c-h+3,y),c=h+y.length-2;break}}for(c=-1;++c<f.length;)f[c][1].type==="strikethroughSequenceTemporary"&&(f[c][1].type="data");return f}function p(f,o,c){const h=this.previous,g=this.events;let u=0;return y;function y(T){return h===126&&g[g.length-1][1].type!=="characterEscape"?c(T):(f.enter("strikethroughSequenceTemporary"),w(T))}function w(T){const E=js(h);if(T===126)return u>1?c(T):(f.consume(T),u++,w);if(u<2&&!s)return c(T);const S=f.exit("strikethroughSequenceTemporary"),v=js(T);return S._open=!v||v===2&&!!E,S._close=!E||E===2&&!!v,o(T)}}}class $E{constructor(){this.map=[]}add(r,s,l){GE(this,r,s,l)}consume(r){if(this.map.sort(function(p,f){return p[0]-f[0]}),this.map.length===0)return;let s=this.map.length;const l=[];for(;s>0;)s-=1,l.push(r.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),r.length=this.map[s][0];l.push(r.slice()),r.length=0;let d=l.pop();for(;d;){for(const p of d)r.push(p);d=l.pop()}this.map.length=0}}function GE(n,r,s,l){let d=0;if(!(s===0&&l.length===0)){for(;d<n.map.length;){if(n.map[d][0]===r){n.map[d][1]+=s,n.map[d][2].push(...l);return}d+=1}n.map.push([r,s,l])}}function VE(n,r){let s=!1;const l=[];for(;r<n.length;){const d=n[r];if(s){if(d[0]==="enter")d[1].type==="tableContent"&&l.push(n[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(d[1].type==="tableContent"){if(n[r-1][1].type==="tableDelimiterMarker"){const p=l.length-1;l[p]=l[p]==="left"?"center":"right"}}else if(d[1].type==="tableDelimiterRow")break}else d[0]==="enter"&&d[1].type==="tableDelimiterRow"&&(s=!0);r+=1}return l}function WE(){return{flow:{null:{name:"table",tokenize:KE,resolveAll:YE}}}}function KE(n,r,s){const l=this;let d=0,p=0,f;return o;function o(B){let H=l.events.length-1;for(;H>-1;){const K=l.events[H][1].type;if(K==="lineEnding"||K==="linePrefix")H--;else break}const U=H>-1?l.events[H][1].type:null,P=U==="tableHead"||U==="tableRow"?D:c;return P===D&&l.parser.lazy[l.now().line]?s(B):P(B)}function c(B){return n.enter("tableHead"),n.enter("tableRow"),h(B)}function h(B){return B===124||(f=!0,p+=1),g(B)}function g(B){return B===null?s(B):De(B)?p>1?(p=0,l.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(B),n.exit("lineEnding"),w):s(B):Ve(B)?Xe(n,g,"whitespace")(B):(p+=1,f&&(f=!1,d+=1),B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),f=!0,g):(n.enter("data"),u(B)))}function u(B){return B===null||B===124||ot(B)?(n.exit("data"),g(B)):(n.consume(B),B===92?y:u)}function y(B){return B===92||B===124?(n.consume(B),u):u(B)}function w(B){return l.interrupt=!1,l.parser.lazy[l.now().line]?s(B):(n.enter("tableDelimiterRow"),f=!1,Ve(B)?Xe(n,T,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):T(B))}function T(B){return B===45||B===58?S(B):B===124?(f=!0,n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),E):L(B)}function E(B){return Ve(B)?Xe(n,S,"whitespace")(B):S(B)}function S(B){return B===58?(p+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),v):B===45?(p+=1,v(B)):B===null||De(B)?A(B):L(B)}function v(B){return B===45?(n.enter("tableDelimiterFiller"),_(B)):L(B)}function _(B){return B===45?(n.consume(B),_):B===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),b):(n.exit("tableDelimiterFiller"),b(B))}function b(B){return Ve(B)?Xe(n,A,"whitespace")(B):A(B)}function A(B){return B===124?T(B):B===null||De(B)?!f||d!==p?L(B):(n.exit("tableDelimiterRow"),n.exit("tableHead"),r(B)):L(B)}function L(B){return s(B)}function D(B){return n.enter("tableRow"),R(B)}function R(B){return B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),R):B===null||De(B)?(n.exit("tableRow"),r(B)):Ve(B)?Xe(n,R,"whitespace")(B):(n.enter("data"),k(B))}function k(B){return B===null||B===124||ot(B)?(n.exit("data"),R(B)):(n.consume(B),B===92?M:k)}function M(B){return B===92||B===124?(n.consume(B),k):k(B)}}function YE(n,r){let s=-1,l=!0,d=0,p=[0,0,0,0],f=[0,0,0,0],o=!1,c=0,h,g,u;const y=new $E;for(;++s<n.length;){const w=n[s],T=w[1];w[0]==="enter"?T.type==="tableHead"?(o=!1,c!==0&&(Hg(y,r,c,h,g),g=void 0,c=0),h={type:"table",start:Object.assign({},T.start),end:Object.assign({},T.end)},y.add(s,0,[["enter",h,r]])):T.type==="tableRow"||T.type==="tableDelimiterRow"?(l=!0,u=void 0,p=[0,0,0,0],f=[0,s+1,0,0],o&&(o=!1,g={type:"tableBody",start:Object.assign({},T.start),end:Object.assign({},T.end)},y.add(s,0,[["enter",g,r]])),d=T.type==="tableDelimiterRow"?2:g?3:1):d&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")?(l=!1,f[2]===0&&(p[1]!==0&&(f[0]=f[1],u=yo(y,r,p,d,void 0,u),p=[0,0,0,0]),f[2]=s)):T.type==="tableCellDivider"&&(l?l=!1:(p[1]!==0&&(f[0]=f[1],u=yo(y,r,p,d,void 0,u)),p=f,f=[p[1],s,0,0])):T.type==="tableHead"?(o=!0,c=s):T.type==="tableRow"||T.type==="tableDelimiterRow"?(c=s,p[1]!==0?(f[0]=f[1],u=yo(y,r,p,d,s,u)):f[1]!==0&&(u=yo(y,r,f,d,s,u)),d=0):d&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")&&(f[3]=s)}for(c!==0&&Hg(y,r,c,h,g),y.consume(r.events),s=-1;++s<r.events.length;){const w=r.events[s];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=VE(r.events,s))}return n}function yo(n,r,s,l,d,p){const f=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",o="tableContent";s[0]!==0&&(p.end=Object.assign({},Ls(r.events,s[0])),n.add(s[0],0,[["exit",p,r]]));const c=Ls(r.events,s[1]);if(p={type:f,start:Object.assign({},c),end:Object.assign({},c)},n.add(s[1],0,[["enter",p,r]]),s[2]!==0){const h=Ls(r.events,s[2]),g=Ls(r.events,s[3]),u={type:o,start:Object.assign({},h),end:Object.assign({},g)};if(n.add(s[2],0,[["enter",u,r]]),l!==2){const y=r.events[s[2]],w=r.events[s[3]];if(y[1].end=Object.assign({},w[1].end),y[1].type="chunkText",y[1].contentType="text",s[3]>s[2]+1){const T=s[2]+1,E=s[3]-s[2]-1;n.add(T,E,[])}}n.add(s[3]+1,0,[["exit",u,r]])}return d!==void 0&&(p.end=Object.assign({},Ls(r.events,d)),n.add(d,0,[["exit",p,r]]),p=void 0),p}function Hg(n,r,s,l,d){const p=[],f=Ls(r.events,s);d&&(d.end=Object.assign({},f),p.push(["exit",d,r])),l.end=Object.assign({},f),p.push(["exit",l,r]),n.add(s+1,0,p)}function Ls(n,r){const s=n[r],l=s[0]==="enter"?"start":"end";return s[1][l]}const XE={name:"tasklistCheck",tokenize:JE};function QE(){return{text:{91:XE}}}function JE(n,r,s){const l=this;return d;function d(c){return l.previous!==null||!l._gfmTasklistFirstContentOfListItem?s(c):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(c),n.exit("taskListCheckMarker"),p)}function p(c){return ot(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"),o):s(c)}function o(c){return De(c)?r(c):Ve(c)?n.check({tokenize:ZE},r,s)(c):s(c)}}function ZE(n,r,s){return Xe(n,l,"whitespace");function l(d){return d===null?s(d):r(d)}}function e2(n){return C_([EE(),jE(),qE(n),WE(),QE()])}const t2={};function dv(n){const r=this,s=n||t2,l=r.data(),d=l.micromarkExtensions||(l.micromarkExtensions=[]),p=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),f=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);d.push(e2(s)),p.push(bE()),f.push(CE(s))}const pv=1e3,Os=new Map;let Ga;function n2(n,r,s){const l=Symbol(n),d=Math.max(pv,s.intervalMs),p=Date.now();return Os.set(n,{id:n,intervalMs:d,nextRunAt:s.runImmediately===!1?p+d:p,inFlight:!1,run:r,token:l}),i2(),mv(),()=>{const f=Os.get(n);(f==null?void 0:f.token)===l&&(Os.delete(n),Os.size===0&&Ga!==void 0&&(window.clearInterval(Ga),Ga=void 0))}}function i2(){Ga!==void 0||typeof window>"u"||(Ga=window.setInterval(()=>{mv()},pv))}async function mv(){const n=Date.now();for(const r of Os.values())r.inFlight||r.nextRunAt>n||r2(r)}async function r2(n){n.inFlight=!0;try{await n.run()}catch{}finally{const r=Os.get(n.id);(r==null?void 0:r.token)===n.token&&(r.inFlight=!1,r.nextRunAt=Date.now()+r.intervalMs)}}function Xa(n,r,s){const l=ee.useRef(r);ee.useEffect(()=>{l.current=r},[r]),ee.useEffect(()=>{if(!(!n||s.enabled===!1))return n2(n,()=>l.current(),{intervalMs:s.intervalMs,runImmediately:s.runImmediately})},[n,s.enabled,s.intervalMs,s.runImmediately])}const Ro=`
|
|
91
91
|
|
|
92
92
|
--- Translation ---
|
|
93
|
-
`;function s2({active:n=!0,autoSendEnabled:r,targetLanguage:s,taskSlug:l,role:d,sessionId:m,panelState:f,onClearSession:o,onEntry:c,onFailures:h}){const[p,u]=te.useState(""),[v,C]=te.useState(""),[T,E]=te.useState(!1),[b,y]=te.useState(Date.now()),[_,S]=te.useState(!1),[,A]=zi(""),L=te.useRef(null),D=f.entries,R=f.failures,k=f.status;te.useEffect(()=>{if(!n)return;const N=L.current;if(!N)return;const $=window.requestAnimationFrame(()=>{N.scrollTop=N.scrollHeight});return()=>window.cancelAnimationFrame($)},[n,D]);const M=d2(D);te.useEffect(()=>{if(!M)return;y(Date.now());const N=window.setInterval(()=>y(Date.now()),250);return()=>window.clearInterval(N)},[M]);async function B(N=!1){const $=p;S(!0),A(""),E(!1);try{const I=await ye.translateUserInput(l,d,{text:$,mode:N?"auto-send":"review-before-send",useContext:!1,send:N});I.sent?(u(""),E(!1)):(u(gv($,I.englishPreview)),E(!0))}catch(I){A(dt("Translate composer input",I))}finally{S(!1)}}async function H(){const N=v.trim();if(N){S(!0),A("");try{const $=await ye.translateManualOutput(l,d,{text:N});c(m,d,$),C("")}catch($){A(dt("Translate pasted English output",$))}finally{S(!1)}}}async function U(){S(!0),A("");try{const N=await ye.translateLatestReply(l,d);c(m,d,N)}catch(N){A(dt("Translate final reply",N))}finally{S(!1)}}async function P(){const N=T?zg(p):p;if(N.trim()){S(!0),A("");try{await ye.sendTranslatedInput(l,d,{englishText:N}),u(""),E(!1)}catch($){A(dt("Send translated English input to role",$))}finally{S(!1)}}}function K(N){N.key!=="Enter"||N.shiftKey||N.nativeEvent.isComposing||(N.preventDefault(),!_&&p.trim()&&(T?P():B(r)))}async function Y(){o(m,d),await ye.clearTranslationSession(m).catch(N=>A(dt("Clear conversation translation panel",N)))}async function G(){S(!0),A("");try{const N=await ye.ignoreTranslationFailures(m);h(m,d,N.failures)}catch(N){A(dt("Ignore failed conversation translations",N))}finally{S(!1)}}async function W(N){S(!0),A("");try{const $=await ye.retryTranslation(m,N.translationId);c(m,d,$)}catch($){A(dt("Retry latest failed conversation translation",$))}finally{S(!1)}}const Z=p2(D,k,b),z=R.length,j=l2(R);return x.jsxs("aside",{className:"translation-panel",children:[x.jsxs("header",{className:"translation-panel-header",children:[x.jsxs("div",{className:"translation-panel-titlebar",children:[x.jsx("h2",{children:"Translation"}),x.jsxs("div",{className:"translation-panel-actions",children:[z>0?x.jsxs(x.Fragment,{children:[x.jsxs("button",{type:"button",disabled:_,onClick:()=>void G(),children:["Ignore ",z]}),j?x.jsx("button",{type:"button",disabled:_,onClick:()=>void W(j),children:"Retry latest"}):null]}):null,x.jsx("button",{type:"button",disabled:_,onClick:()=>void U(),children:"Translate final reply"}),x.jsx("button",{type:"button",onClick:()=>void Y(),children:"Clear"})]})]}),x.jsx("div",{className:"translation-status-row",children:x.jsxs("p",{children:["Claude Code · target ",a2(s)," · ",Z]})})]}),x.jsx("div",{className:"translation-manual-panel",children:x.jsxs("div",{className:"translation-composer-row translation-manual-row",children:[x.jsx("textarea",{value:v,onChange:N=>C(N.target.value),placeholder:"Paste English to translate on demand..."}),x.jsx("div",{className:"translation-composer-actions",children:x.jsx("button",{type:"button",disabled:_||!v.trim(),onClick:()=>void H(),children:"Translate"})})]})}),x.jsxs("div",{className:"translation-entry-list",ref:L,children:[D.length===0?x.jsx("p",{className:"muted",children:"Translated Claude Code output will appear here."}):null,D.map(N=>x.jsx(h2,{entry:N},N.id))]}),x.jsx("div",{className:"translation-composer",children:x.jsxs("div",{className:"translation-composer-row",children:[x.jsx("textarea",{value:p,onChange:N=>{u(N.target.value),(!N.target.value.trim()||T&&!_2(N.target.value))&&E(!1)},onKeyDown:K,placeholder:"输入中文,先翻译成英文工程指令..."}),x.jsx("div",{className:"translation-composer-actions",children:x.jsx("button",{type:"button",disabled:_||!T||!zg(p).trim(),onClick:()=>void P(),children:"Send English"})})]})})]})}function a2(n){var r;return((r=t_.find(s=>s.value===n))==null?void 0:r.label)??n}function l2(n){let r,s=Number.NEGATIVE_INFINITY;for(const l of n){const d=Date.parse(l.failedAt),m=Number.isFinite(d)?d:Number.NEGATIVE_INFINITY;(!r||m>=s)&&(r=l,s=m)}return r}function o2({open:n,taskSlug:r,targetLanguage:s,onClose:l}){const[d,m]=te.useState(!1),[,f]=zi(""),[o,c]=te.useState(null),[h,p]=te.useState(""),[u,v]=te.useState(""),[C,T]=te.useState(""),[E,b]=te.useState(!1),[y,_]=te.useState(null),[S,A]=te.useState(""),[L,D]=te.useState(""),[R,k]=te.useState(""),[M,B]=te.useState(!1);Xa(n?`file-translation:${h||"none"}`:null,()=>H(!0),{intervalMs:2e3,runImmediately:!0});async function H(G=!1){try{const W=await ye.getTranslationState();c(W);const Z=h?W.fileIndex.jobs.some(z=>z.id===h):!1;if((!h||!Z)&&W.fileIndex.jobs[0])U(W.fileIndex.jobs[0].id);else if(!W.fileIndex.jobs[0])p(""),v(""),T("");else if(G&&h){const z=await ye.readFileTranslation(h);v(z.output),T(z.report)}}catch(W){f(dt("Load file translation list",W))}}async function U(G){p(G),v(""),T("");try{const W=await ye.readFileTranslation(G);v(W.output),T(W.report)}catch(W){f(dt(`Read translated file ${G}`,W))}}async function P(){b(!0),await K(S,L)}async function K(G="",W=""){B(!0),f("");try{const Z=await ye.browseTranslationSourceFiles({path:G,query:W,limit:250});_(Z),A(Z.currentPath),D(W)}catch(Z){f(dt("Browse translation source files",Z))}finally{B(!1)}}async function Y(G=R){const W=G.trim();if(W){m(!0),f("");try{if(!r)throw new Error("Create or select a task before translating files.");const Z=await ye.createFileTranslation({taskSlug:r,sourcePath:W,targetLanguage:s});b(!1),await H(),await U(Z.id)}catch(Z){f(dt(`Create file translation for ${W}`,Z))}finally{m(!1)}}}return n?x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"modal-backdrop file-translation-backdrop",children:x.jsx(u2,{busy:d,state:o,selectedJobId:h,output:u,report:C,onClose:()=>{b(!1),l()},onRefresh:()=>void H(),onSelectJob:G=>void U(G),onTranslate:()=>void P()})}),E?x.jsx(c2,{busy:d||M,state:y,currentPath:S,query:L,selectedPath:R,onBrowse:(G,W)=>void K(G,W),onClose:()=>b(!1),onQueryChange:D,onSelectPath:k,onTranslate:()=>void Y()}):null]}):null}function c2({busy:n,state:r,currentPath:s,query:l,selectedPath:d,onBrowse:m,onClose:f,onQueryChange:o,onSelectPath:c,onTranslate:h}){const p=(r==null?void 0:r.entries)??[],u=p.filter(C=>C.type==="directory"),v=p.filter(C=>C.type==="file");return x.jsx("div",{className:"modal-backdrop translation-file-browser-backdrop",children:x.jsxs("section",{className:"translation-file-browser-modal",role:"dialog","aria-modal":"true","aria-label":"Select Source File",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Select Source File"}),x.jsx("p",{children:s||"."})]}),x.jsx("button",{type:"button",onClick:f,children:"Close"})]}),x.jsxs("div",{className:"translation-file-browser-controls",children:[x.jsxs("div",{className:"translation-file-browser-nav",children:[x.jsx("button",{type:"button",disabled:n||!s,onClick:()=>m((r==null?void 0:r.parentPath)??"",""),children:"Up"}),x.jsx("button",{type:"button",disabled:n||!s,onClick:()=>m("",""),children:"Root"})]}),x.jsxs("form",{className:"translation-file-browser-search",onSubmit:C=>{C.preventDefault(),m(s,l)},children:[x.jsx("input",{value:l,onChange:C=>o(C.target.value),placeholder:"Search files"}),x.jsx("button",{type:"submit",disabled:n,children:"Search"}),x.jsx("button",{type:"button",disabled:n||!l,onClick:()=>m(s,""),children:"Clear"})]})]}),x.jsxs("div",{className:"translation-file-browser-layout",children:[x.jsxs("div",{className:"translation-file-browser-list",children:[n&&!r?x.jsx("p",{className:"muted",children:"Loading files..."}):null,!n&&p.length===0?x.jsx("p",{className:"muted",children:"No source files found."}):null,u.length>0?x.jsxs("div",{className:"translation-file-browser-group",children:[x.jsx("h3",{children:"Folders"}),u.map(C=>x.jsx(Hg,{entry:C,selected:d===C.path,onBrowse:m,onSelectPath:c},C.path))]}):null,v.length>0?x.jsxs("div",{className:"translation-file-browser-group",children:[x.jsx("h3",{children:"Files"}),v.map(C=>x.jsx(Hg,{entry:C,selected:d===C.path,onBrowse:m,onSelectPath:c},C.path))]}):null,r!=null&&r.truncated?x.jsx("p",{className:"translation-entry-note",children:"Result limit reached."}):null]}),x.jsxs("aside",{className:"translation-file-browser-selection",children:[x.jsxs("label",{children:[x.jsx("span",{children:"Source path"}),x.jsx("input",{value:d,onChange:C=>c(C.target.value)})]}),x.jsx("button",{type:"button",disabled:n||!d.trim(),onClick:h,children:"Translate File"})]})]})]})})}function Hg({entry:n,selected:r,onBrowse:s,onSelectPath:l}){const d=n.type==="directory";return x.jsxs("button",{className:r?"translation-file-browser-entry is-selected":"translation-file-browser-entry",type:"button",onClick:()=>d?s(n.path,""):l(n.path),onDoubleClick:()=>d?s(n.path,""):void 0,children:[x.jsx("span",{children:d?"DIR":"FILE"}),x.jsx("strong",{children:n.name}),x.jsx("small",{children:n.path})]})}function u2({busy:n,state:r,selectedJobId:s,output:l,report:d,onClose:m,onRefresh:f,onSelectJob:o,onTranslate:c}){const h=(r==null?void 0:r.fileIndex.jobs)??[],p=h.find(u=>u.id===s);return x.jsxs("section",{className:"file-translation-modal",role:"dialog","aria-modal":"true","aria-label":"File Translation",children:[x.jsxs("header",{className:"file-translation-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"File Translation"}),x.jsx("p",{children:"Claude Code · 中英互译"})]}),x.jsxs("div",{className:"file-translation-toolbar",children:[x.jsx("button",{type:"button",disabled:n,onClick:c,children:"Translate"}),x.jsx("button",{type:"button",disabled:n,onClick:f,children:"Refresh"}),x.jsx("button",{type:"button",onClick:m,children:"Close"})]})]}),r!=null&&r.memoryInitialized?null:x.jsx("p",{className:"translation-entry-note",children:"Translation memory is not initialized. Run Bootstrap from the sidebar before important file translations."}),x.jsxs("div",{className:"file-translation-layout",children:[x.jsxs("div",{className:"file-translation-list",children:[h.length===0?x.jsx("p",{className:"muted",children:"No translated files yet."}):null,h.map(u=>x.jsxs("button",{className:u.id===s?"file-translation-item is-active":"file-translation-item",type:"button",onClick:()=>o(u.id),children:[x.jsx("strong",{children:u.sourcePath}),x.jsxs("span",{children:[u.status," · ",u.targetLanguage]})]},u.id))]}),x.jsx("div",{className:"file-translation-preview",children:p?x.jsxs(x.Fragment,{children:[x.jsxs("header",{children:[x.jsx("strong",{children:p.sourcePath}),x.jsx("span",{children:p.status})]}),x.jsx("div",{className:"translation-markdown",children:x.jsx(F_,{remarkPlugins:[fv],children:l||d||"Translation output is not available yet."})})]}):x.jsx("p",{className:"muted",children:"Select a translated file to preview it."})})]})]})}function h2({entry:n}){if(n.sourceKind==="conversation-boundary")return x.jsx(f2,{entry:n});const r=g2(n),s=n.sourceKind==="tool-output",l=n.direction==="user-input-to-english",d=["translation-entry",`is-${n.sourceKind}`,l?"is-user-input":""].filter(Boolean).join(" ");return x.jsxs("article",{className:d,children:[s?x.jsx("pre",{children:r}):x.jsx("div",{className:"translation-markdown",children:x.jsx(F_,{remarkPlugins:[fv],children:r})}),n.warning?x.jsx("p",{className:"translation-entry-note",children:n.warning}):null,n.error?x.jsx("p",{className:"translation-entry-note is-error",children:n.error}):null]})}function f2({entry:n}){const r=n.boundaryKind==="end"?"结束":"开始",s=n.conversationTurn??0,l=y2(n.occurredAt??n.createdAt);return x.jsxs("div",{className:"translation-conversation-boundary","aria-label":`${r} 第 ${s} 轮 ${l}`,children:[x.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"}),x.jsx("span",{children:r}),x.jsxs("span",{children:["第 ",s," 轮"]}),x.jsx("time",{children:l}),x.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"})]})}function d2(n){const r=n.find(mv);return(r==null?void 0:r.translationStartedAt)??(r==null?void 0:r.createdAt)}function p2(n,r,s){const l=n.find(mv);if(l)return`translating ${v2(Math.max(0,s-m2(l)))}`;const d=n.at(-1);return(d==null?void 0:d.status)==="failed"||r==="failed"?"error":r}function mv(n){return n.status==="queued"||n.status==="translating"}function m2(n){const r=Date.parse(n.translationStartedAt??n.createdAt);return Number.isFinite(r)?r:Date.now()}function g2(n){return n.status==="queued"||n.status==="translating"?n.sourceText:n.status==="translated"?n.direction==="user-input-to-english"?gv(n.sourceText,n.translatedText):n.translatedText:n.translatedText||n.sourceText}function gv(n,r){return`${n.trimEnd()}${Ro}${r.trimStart()}`}function _2(n){return n.includes(Ro)}function zg(n){const r=n.indexOf(Ro);return r===-1?n:n.slice(r+Ro.length)}function v2(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),l=Math.floor(r%60).toString().padStart(2,"0");return`${s}:${l}`}function y2(n){const r=new Date(n);return Number.isNaN(r.getTime())?n:r.toLocaleTimeString()}const S2=8;function b2(){const[n,r]=te.useState([]);return te.useEffect(()=>{const s=m=>{var c,h;const f=(h=(c=m.detail)==null?void 0:c.message)==null?void 0:h.trim();if(!f)return;const o=new Date().toISOString();r(p=>{const u=p.find(v=>v.message===f);return u?[{...u,count:u.count+1,updatedAt:o},...p.filter(v=>v.id!==u.id)]:[{id:`ui_error_${Date.now()}_${Math.random().toString(16).slice(2)}`,message:f,count:1,createdAt:o,updatedAt:o},...p].slice(0,S2)})},l=m=>{var o;const f=((o=m.detail)==null?void 0:o.actions)??[];f.length!==0&&r(c=>c.filter(h=>!f.some(p=>h.message.startsWith(`${p} failed.`))))},d=m=>{var o,c;const f=(c=(o=m.detail)==null?void 0:o.message)==null?void 0:c.trim();f&&r(h=>h.filter(p=>p.message!==f))};return window.addEventListener(uh,s),window.addEventListener(hh,l),window.addEventListener(fh,d),()=>{window.removeEventListener(uh,s),window.removeEventListener(hh,l),window.removeEventListener(fh,d)}},[]),n.length===0?null:x.jsxs("aside",{className:"ui-error-center",role:"alert","aria-live":"polite","aria-label":"Application errors",children:[x.jsxs("header",{className:"ui-error-center-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Errors"}),x.jsxs("p",{children:[n.length," active"]})]}),x.jsx("button",{type:"button",onClick:()=>r([]),children:"Clear"})]}),x.jsx("ol",{className:"ui-error-list",children:n.map(s=>x.jsxs("li",{children:[x.jsxs("div",{children:[x.jsx("p",{children:s.message}),x.jsxs("span",{children:[C2(s.updatedAt),s.count>1?` · repeated ${s.count} times`:""]})]}),x.jsx("button",{type:"button","aria-label":"Dismiss error",onClick:()=>r(l=>l.filter(d=>d.id!==s.id)),children:"Close"})]},s.id))})]})}function C2(n){return new Date(n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function w2(n,r){return n.find(s=>s.taskSlug===r)??n[0]??null}function x2(n){if(!(n.mode!=="auto"||n.status!=="running")&&!(!n.activeRole||n.activeRole===n.lastFollowedRole))return n.activeRole}function E2(n,r){var d;if(!((d=n.flowPause)!=null&&d.paused))return null;const s=n.flowPause.role??n.activeRole??"role",l=n.roleRecovery;return n.flowPause.reason==="role-recovery-failed"&&l?r(l,s):`No new turn started after ${s} stopped.`}function k2(n){const r=n.flowPause;if((r==null?void 0:r.reason)==="awaiting-user")return`awaiting-user:${r.since??n.taskSlug}`;const s=n.roundId??n.startedAt??n.taskSlug,l=n.stoppedAt??n.lastTurnEndedAt??"stopped";return`${s}:${l}`}const A2=3,T2=3e4,wo=new Map;function _v(n,r){const s=dt(n,r);if(!R2(r))return wo.set(n,{consecutiveFailures:1,lastMessage:s,lastReportedAt:Date.now()}),s;const l=wo.get(n),d=((l==null?void 0:l.consecutiveFailures)??0)+1,m=Date.now(),f=d>=A2&&(!l||l.lastMessage!==s||m-l.lastReportedAt>=T2);return wo.set(n,{consecutiveFailures:d,lastMessage:s,lastReportedAt:f?m:(l==null?void 0:l.lastReportedAt)??0}),f?s:null}function Do(n){wo.delete(n),u1([n])}function R2(n){const r=Lo(n);return r.includes("could not reach the VCM backend")||r.includes("Failed to fetch")||r.includes("NetworkError")||r.includes("Load failed")||r.includes("ERR_CONNECTION")}const D2=["architecture-plan","validation-adequacy","final-diff"];function M2({events:n,maxEvents:r=8,showHeader:s=!0}){const l=r===null?n:n.slice(-r);return x.jsxs("section",{className:"event-log",children:[s?x.jsx("h2",{children:"Events"}):null,n.length===0?x.jsx("p",{className:"muted",children:"No terminal events yet."}):x.jsx("ol",{children:l.map((d,m)=>x.jsx("li",{children:d},`${d}-${m}`))})]})}function ii({checked:n,className:r,disabled:s,label:l,stateLabel:d,title:m,onChange:f}){const o=["switch-control",n?"is-on":"is-off",r].filter(Boolean).join(" "),c=d??(n?"on":"off");return x.jsxs("button",{type:"button",role:"switch","aria-checked":n,"aria-label":`${l}: ${c}`,className:o,disabled:s,title:m,onClick:()=>f(!n),children:[x.jsx("span",{className:"switch-control-label",children:l}),x.jsx("span",{className:"switch-control-track","aria-hidden":"true",children:x.jsx("span",{className:"switch-control-thumb"})})]})}function L2({status:n,bootstrapStatus:r,applyResult:s,hasActiveTask:l=!1,autoTaskHarnessReviewEnabled:d,busy:m=!1,onRefresh:f,onApply:o,onOpenStudio:c,onOpenRepositoryDiff:h,onAutoTaskHarnessReviewChange:p,onStartBootstrap:u,onRestartBootstrap:v,onStopBootstrap:C,onRunBootstrap:T}){const[E,b]=te.useState(!1),[y,_]=te.useState("bypassPermissions"),[S,A]=te.useState("default"),[L,D]=te.useState("default"),R=r==null?void 0:r.session,k=(r==null?void 0:r.status)==="running",M=(R==null?void 0:R.status)==="running",B=(r==null?void 0:r.status)!=="complete",H={permissionMode:y,model:S,effort:L};return l?n?x.jsxs("section",{className:"harness-panel",children:[x.jsxs("div",{className:"harness-stage",children:[x.jsxs("div",{className:"harness-panel-header",children:[x.jsxs("div",{children:[x.jsx("strong",{children:"Fixed install"}),x.jsx("p",{className:"muted",children:n.initialized?n.needsApply?`${n.plannedChanges.length} pending updates`:"Up to date":"Not initialized"})]}),x.jsx("div",{className:"harness-actions",children:n.initialized?x.jsxs(x.Fragment,{children:[x.jsx("button",{type:"button",disabled:m,onClick:()=>void f(),children:"Refresh"}),n.needsApply?x.jsx("button",{type:"button",disabled:m,onClick:()=>void o(),children:"Update"}):null]}):x.jsx("button",{type:"button",disabled:m,onClick:()=>void o(),children:"Initialize"})})]}),n.initialized&&n.needsApply?x.jsxs(x.Fragment,{children:[x.jsx("h3",{className:"harness-file-list-title",children:"Files to update"}),x.jsx("ol",{className:"harness-file-list",children:n.plannedChanges.map(U=>x.jsxs("li",{children:[x.jsx("span",{children:U.path}),x.jsx(Hi,{status:U.action})]},`${U.path}:${U.action}`))})]}):null]}),x.jsxs("div",{className:"harness-stage",children:[x.jsxs("div",{className:"harness-panel-header",children:[x.jsx("div",{children:x.jsx("strong",{children:"Harness Studio"})}),x.jsx("div",{className:"harness-actions",children:x.jsx("button",{type:"button",disabled:m,onClick:c,children:"Open Studio"})})]}),x.jsx("button",{className:"harness-review-diff-button",type:"button",disabled:m,onClick:h,children:"Review Diff"}),x.jsx(ii,{checked:d,className:"sidebar-switch",disabled:m,label:"Auto task harness review",title:"Automatically ask Harness Engineer to review task harness after final acceptance completes",onChange:p})]}),B?x.jsx("div",{className:"harness-stage",children:x.jsxs("div",{className:"harness-panel-header",children:[x.jsxs("div",{children:[x.jsx("strong",{children:"Bootstrap"}),x.jsx("p",{className:"muted",children:r?O2(r.status):"not loaded"})]}),x.jsx("div",{className:"harness-actions",children:x.jsx("button",{type:"button",disabled:m||!(r!=null&&r.canStart),onClick:()=>{b(!0)},children:"Open Bootstrap"})})]})}):null,s!=null&&s.changedFiles.length?x.jsx("div",{className:"harness-result",children:x.jsx("p",{className:"muted",children:s.message})}):null,n.warnings.length>0?x.jsx("ul",{className:"warnings",children:n.warnings.map(U=>x.jsx("li",{children:U},U))}):null,r!=null&&r.warnings.length?x.jsx("ul",{className:"warnings",children:r.warnings.map(U=>x.jsx("li",{children:U},U))}):null,B&&E?x.jsx("div",{className:"harness-bootstrap-modal",role:"dialog","aria-modal":"true","aria-label":"Harness Engineer bootstrap session",children:x.jsxs("div",{className:"harness-bootstrap-modal-surface",children:[x.jsxs("header",{className:"harness-bootstrap-modal-header",children:[x.jsxs("div",{children:[x.jsx("strong",{children:"Harness Engineer Bootstrap"}),x.jsx("p",{className:"muted",children:(R==null?void 0:R.command)??"Start Harness Engineer, then run bootstrap when ready."})]}),x.jsxs("div",{className:"harness-bootstrap-modal-actions",children:[R?x.jsx(Hi,{status:R.status}):null,x.jsx("button",{type:"button",onClick:()=>b(!1),children:"Close"})]})]}),x.jsxs("div",{className:"harness-bootstrap-controls",children:[x.jsxs("label",{children:[x.jsx("span",{children:"Permission"}),x.jsx("select",{value:y,disabled:m||k||M,onChange:U=>_(U.target.value),children:i_.map(U=>x.jsx("option",{value:U.value,children:U.label},U.value))})]}),x.jsxs("label",{children:[x.jsx("span",{children:"Model"}),x.jsx("select",{value:S,disabled:m||k||M,onChange:U=>A(U.target.value),children:r_.map(U=>x.jsx("option",{value:U.value,children:U.label},U.value))})]}),x.jsxs("label",{children:[x.jsx("span",{children:"Effort"}),x.jsx("select",{value:L,disabled:m||k||M,onChange:U=>D(U.target.value),children:s_.map(U=>x.jsx("option",{value:U.value,children:U.label},U.value))})]}),x.jsxs("div",{className:"harness-bootstrap-control-actions",children:[x.jsx("button",{type:"button",disabled:m||k||!(r!=null&&r.canStart),onClick:()=>void u(H),children:"Start"}),x.jsx("button",{type:"button",disabled:m||k||!(r!=null&&r.canStart),onClick:()=>void v(H),children:"Restart"}),x.jsx("button",{type:"button",disabled:m||!R,onClick:()=>void C(),children:"Stop"}),x.jsx("button",{type:"button",disabled:m||k||!M,onClick:()=>void T(),children:"Run bootstrap"})]})]}),x.jsx("div",{className:"harness-bootstrap-terminal",children:M?x.jsx(Oo,{sessionId:R.id,active:E}):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:"Harness Bootstrap"}),x.jsx("span",{children:"Start Harness Engineer first. When it is ready, click Run bootstrap to send the prompt."})]})})]})}):null]}):null:x.jsx("section",{className:"harness-panel",children:x.jsxs("div",{className:"harness-result",children:[x.jsx("strong",{children:"Task required"}),x.jsx("p",{className:"muted",children:"Create or select a task before changing VCM Harness. Harness changes are committed in the active task worktree."})]})})}function O2(n){return n.replaceAll("_"," ")}function Xh(n){return{total:n.length,accepted:n.filter(r=>r.acceptedAt).length,delivered:n.filter(r=>r.deliveredAt).length}}function B2(n,r=6){const s=[...n].sort(H2).map((d,m)=>({message:d,sequence:m+1}));return[...r===null?s:s.slice(-r)].sort((d,m)=>m.sequence-d.sequence)}function j2({messages:n,orchestration:r,busy:s,maxMessages:l=6,showControls:d=!0,showHeader:m=!0,onModeChange:f,onMarkAllDone:o}){const[c,h]=te.useState(null),p=Xh(n),u=(r==null?void 0:r.mode)??"auto",v=B2(n,l);async function C(T){await z2(T.body),h(T.id),window.setTimeout(()=>h(E=>E===T.id?null:E),1200)}return x.jsxs("section",{className:"message-panel",children:[m?x.jsxs("div",{className:"message-panel-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Messages"}),x.jsxs("p",{className:"muted",children:[p.total," total / ",p.accepted," accepted"]})]}),d&&f?x.jsx("div",{className:"message-controls",children:x.jsx(ii,{checked:u==="auto",className:"message-mode-toggle",disabled:s,label:"Auto orchestration",onChange:T=>f(T?"auto":"manual")})}):null,d&&o?x.jsx("button",{type:"button",disabled:s,onClick:o,children:"Mark All Done"}):null]}):null,n.length===0?x.jsx("p",{className:"muted",children:"No role messages yet."}):x.jsx("ol",{className:"message-list",children:v.map(({message:T,sequence:E})=>x.jsxs("li",{className:"message-item",children:[x.jsxs("div",{className:"message-item-main",children:[x.jsxs("div",{className:"message-meta",children:[x.jsxs("span",{className:"message-sequence",children:["#",E]}),x.jsx("time",{dateTime:Mo(T),children:N2(Mo(T))}),x.jsxs("strong",{children:[T.fromRole," ","->"," ",T.toRole]}),x.jsx("span",{children:T.type})]}),x.jsx("p",{children:T.body}),T.failureReason?x.jsx("span",{className:"message-reason",children:T.failureReason}):null,T.bodyPath?x.jsx("span",{className:"message-path",children:T.bodyPath}):null]}),x.jsx("div",{className:"message-actions",children:x.jsx("button",{type:"button",disabled:s,onClick:()=>void C(T),children:c===T.id?"Copied":"Copy"})})]},T.id))})]})}function N2(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 Mo(n){return n.acceptedAt??n.deliveredAt??n.dispatchingAt??n.createdAt}function H2(n,r){const s=Mo(n).localeCompare(Mo(r));if(s!==0)return s;const l=n.createdAt.localeCompare(r.createdAt);return l!==0?l:n.id.localeCompare(r.id)}async function z2(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 I2({defaultPath:n="",recentPaths:r=[],busy:s=!1,onConnect:l}){const[d,m]=te.useState(n);te.useEffect(()=>{n&&m(n)},[n]);async function f(o){o.preventDefault(),await l(d)}return x.jsx("form",{className:"repo-connect",onSubmit:f,children:x.jsxs("div",{className:r.length>0?"inline-form has-recent-paths":"inline-form",children:[x.jsx("input",{"aria-label":"Repository path",id:"repo-path",value:d,onChange:o=>m(o.target.value),placeholder:"/path/to/repo"}),r.length>0?x.jsxs("select",{"aria-label":"Recent repositories",className:"repo-recent-select",value:"",onChange:o=>{o.target.value&&m(o.target.value)},children:[x.jsx("option",{value:"",children:"Recent"}),r.map(o=>x.jsx("option",{value:o,children:o},o))]}):null,x.jsx("button",{type:"submit",disabled:s||!d.trim(),children:"Connect"})]})})}function U2({tasks:n,activeTaskSlug:r,onSelect:s}){return x.jsx("nav",{className:"task-nav","aria-label":"Tasks",children:n.map(l=>x.jsxs("button",{className:l.taskSlug===r?"task-nav-item is-active":"task-nav-item",type:"button",onClick:()=>s(l.taskSlug),children:[x.jsx("span",{children:l.title||l.taskSlug}),x.jsx(Hi,{status:l.status})]},l.taskSlug))})}function P2({project:n,recentRepositoryPaths:r,tasks:s,activeTaskSlug:l,messages:d,orchestration:m,events:f,roundState:o,gateReview:c,translationEnabled:h,translationAutoSendEnabled:p,translationTargetLanguage:u,translationOutputMode:v,translationMemoryInitialized:C,translatorSession:T,harnessStatus:E,harnessBootstrapStatus:b,harnessApplyResult:y,autoTaskHarnessReviewEnabled:_,gatewayStatus:S,gatewayQrLogin:A,gatewayQrCheck:L,gatewayLarkRegistration:D,gatewayLarkRegistrationCheck:R,busy:k,onConnect:M,onRefreshConnectedRepository:B,onPullConnectedRepository:H,onRefreshHarness:U,onApplyHarness:P,onStartHarnessBootstrap:K,onRestartHarnessBootstrap:Y,onStopHarnessBootstrap:G,onRunHarnessBootstrap:W,onOpenHarnessStudio:Z,onOpenRepositoryDiff:z,onAutoTaskHarnessReviewChange:j,onRefreshGateway:N,onGatewayEnabledChange:$,onGatewaySettingsChange:I,onGatewayTranslationChange:re,onGatewayConnectionChange:ve,onStartGatewayQrLogin:me,onStartGatewayLarkRegistration:Q,onResetGatewayBinding:q,onGateReviewGateEnabledChange:ee,onTranslationEnabledChange:ae,onTranslationAutoSendChange:pe,onTranslationTargetLanguageChange:se,onTranslationOutputModeChange:we,onOpenFileTranslation:je,onOpenTranslatorSession:ze,onCreateTranslationBootstrap:Pe,onUpdateTranslationMemory:xe,onCreateTask:xt,onCloseTask:yt,onSelectTask:Nt,themeMode:Gt,onAutoOrchestrationChange:Sn,onThemeModeChange:St,pauseAlertSound:tt,onPauseAlertSoundChange:Lt,roleRetryEnabled:he,onRoleRetryEnabledChange:Se,permissionRequestMode:Ae,onPermissionRequestModeChange:Le,launchTemplate:Oe,canSaveLaunchTemplate:ut,canOneClickStart:Fe,onSaveLaunchTemplate:gt,onOneClickStart:mt,onMarkAllMessagesDone:Ot,onDeleteMessageHistory:Ze}){const[Qt,Et]=te.useState(""),[bn,Ln]=te.useState(!1),[ri,On]=te.useState(!1),[Bt,Bn]=te.useState(()=>l?null:"repository"),Wn=Xh(d),si=Qt.trim(),rn=G2(n,l,E),jn=s.filter(Ne=>Ne.cleanupStatus!=="cleaned"),sn=jn.find(Ne=>Ne.taskSlug===l)??null;te.useEffect(()=>{Bn(Ne=>!l&&Ne===null?n?"task":"repository":Ne)},[l,n]);function an(Ne,Pi){Bn(Pi?Ne:null)}async function Ui(Ne){Ne.preventDefault(),await xt({taskSlug:si}),Et("")}return x.jsxs("div",{className:"project-dashboard",children:[x.jsx("header",{className:"brand-header",children:x.jsx("strong",{children:"VibeCodingMaster"})}),x.jsx(zr,{title:"Repository",open:Bt==="repository",onOpenChange:Ne=>{an("repository",Ne),Ne&&n&&B()},children:x.jsxs("div",{className:"repository-panel",children:[x.jsx(I2,{defaultPath:(n==null?void 0:n.repoRoot)??"",recentPaths:r,busy:k,onConnect:M}),n?x.jsx(Y2,{busy:k,project:n,onPull:H}):null]})}),x.jsx(zr,{title:"Settings",open:Bt==="settings",onOpenChange:Ne=>an("settings",Ne),children:x.jsxs("div",{className:"sidebar-settings",children:[x.jsxs("button",{"aria-label":`Theme mode: ${Ug(Gt)}`,className:"settings-toggle theme-mode-toggle",disabled:k,title:"Cycle theme: system, light, dark",type:"button",onClick:()=>St(ek(Gt)),children:[x.jsx("span",{children:"Theme"}),x.jsx("span",{children:Ug(Gt)})]}),x.jsx(ii,{checked:((m==null?void 0:m.mode)??"auto")==="auto",className:"sidebar-switch",disabled:k||!l,label:"Auto orchestration",title:l?"Automatically dispatch role messages during the active task":"Create or select a task first",onChange:Sn}),x.jsx(ii,{checked:tt,className:"sidebar-switch",disabled:k,label:"Pause alert sound",title:"Play a sound when VCM shows the fixed flow pause dialog",onChange:Ne=>Lt(Ne)}),x.jsx(ii,{checked:he,className:"sidebar-switch",disabled:k,label:"CC auto retry",title:"Retry temporary Claude Code turn failures before showing the flow pause alert",onChange:Ne=>Se(Ne)}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Permission requests"}),x.jsxs("select",{value:Ae,disabled:k,onChange:Ne=>Le(Ne.target.value),children:[x.jsx("option",{value:"off",children:"off"}),x.jsx("option",{value:"allowAll",children:"allow all"})]})]}),x.jsxs("button",{className:"settings-toggle",disabled:k||!ut,title:"Save the current core role launch settings and optional Gate Reviewer settings",type:"button",onClick:gt,children:[x.jsx("span",{children:"Save launch template"}),x.jsx("span",{children:ut?"ready":"open task"})]}),Fe?x.jsxs("button",{className:"settings-toggle is-active",disabled:k,title:F2(Oe),type:"button",onClick:mt,children:[x.jsx("span",{children:"One-click start"}),x.jsx("span",{children:vv(Oe)})]}):null,l?x.jsxs(x.Fragment,{children:[x.jsxs("button",{type:"button",onClick:()=>Ln(!0),children:[x.jsx("span",{children:"Messages"}),x.jsxs("span",{className:"muted",children:[Wn.total," total"]})]}),x.jsxs("button",{type:"button",onClick:()=>On(!0),children:[x.jsx("span",{children:"Events"}),x.jsxs("span",{className:"muted",children:[f.length," total"]})]})]}):null]})}),x.jsx(zr,{title:"Translation",open:Bt==="translation",onOpenChange:Ne=>an("translation",Ne),children:x.jsx(q2,{busy:k,enabled:h,autoSendEnabled:p,targetLanguage:u,outputMode:v,memoryInitialized:C,baseUnavailableReason:rn,translatorSession:T,onAutoSendChange:pe,onCreateBootstrap:Pe,onEnabledChange:ae,onUpdateMemory:xe,onTargetLanguageChange:se,onOutputModeChange:we,onOpenFileTranslation:je,onOpenTranslatorSession:ze})}),n&&l?x.jsx(zr,{title:"Gate Review Gates",open:Bt==="gate-review-gates",onOpenChange:Ne=>an("gate-review-gates",Ne),children:x.jsx(V2,{busy:k,state:c,onGateEnabledChange:ee})}):null,x.jsx(zr,{title:"Gateway",open:Bt==="gateway",onOpenChange:Ne=>{an("gateway",Ne),Ne&&N()},children:x.jsx(K2,{busy:k,qrCheck:L,qrLogin:A,larkRegistration:D,larkRegistrationCheck:R,status:S,onEnabledChange:$,onSettingsChange:I,onResetBinding:q,onStartLarkRegistration:Q,onStartQrLogin:me,onTranslationChange:re,onConnectionChange:ve})}),n?x.jsx(zr,{title:"VCM Harness",open:Bt==="vcm-harness",onOpenChange:Ne=>an("vcm-harness",Ne),children:x.jsx(L2,{status:E,bootstrapStatus:b,applyResult:y,hasActiveTask:!!sn,autoTaskHarnessReviewEnabled:_,busy:k,onRefresh:U,onApply:P,onOpenStudio:Z,onOpenRepositoryDiff:z,onAutoTaskHarnessReviewChange:j,onStartBootstrap:K,onRestartBootstrap:Y,onStopBootstrap:G,onRunBootstrap:W})}):null,n?x.jsx(zr,{title:"Task",open:Bt==="task",onOpenChange:Ne=>an("task",Ne),children:jn.length>0?x.jsxs("div",{className:"task-panel",children:[x.jsx(U2,{tasks:jn,activeTaskSlug:l,onSelect:Nt}),sn?x.jsx("div",{className:"task-panel-actions",children:x.jsx("button",{className:"danger-button",disabled:k,type:"button",onClick:yt,children:"Close Task"})}):null]}):x.jsx("div",{className:"task-create",children:x.jsxs("form",{onSubmit:Ui,children:[x.jsx("input",{value:Qt,onChange:Ne=>Et(Ne.target.value),placeholder:"task name"}),x.jsxs("div",{className:"task-create-preview",children:[x.jsxs("small",{children:["branch: ",si?`feature/${si}`:"feature/<task>"]}),x.jsxs("small",{children:["worktree: ",si?`.claude/worktrees/${si}`:".claude/worktrees/<task>"]})]}),x.jsx("button",{type:"submit",disabled:k||!si,children:"Create"})]})})}):null,n&&sn?x.jsx(J2,{task:sn,roundState:o}):null,bn?x.jsx(nk,{busy:k,messages:d,orchestration:m,onClose:()=>Ln(!1),onMarkAllDone:()=>{l&&Ot(l)},onDeleteMessageHistory:()=>{l&&Ze(l)}}):null,ri?x.jsx(tk,{events:f,onClose:()=>On(!1)}):null]})}function vv(n){return[n.autoOrchestration?"auto":"manual"].join(" + ")}function F2(n){const r=Object.entries(n.roles).map(([s,l])=>`${s}: ${l.permissionMode} / ${l.model} / ${l.effort}`).join("; ");return`Launch template: ${vv(n)}; ${r}`}function q2({autoSendEnabled:n,baseUnavailableReason:r,busy:s,enabled:l,memoryInitialized:d,outputMode:m,targetLanguage:f,translatorSession:o,onAutoSendChange:c,onCreateBootstrap:h,onEnabledChange:p,onUpdateMemory:u,onOutputModeChange:v,onTargetLanguageChange:C,onOpenFileTranslation:T,onOpenTranslatorSession:E}){const b=!!(s||r),y=(o==null?void 0:o.status)==="running",_=!!(l&&!r&&y),S=r??(y?null:"Start Translator session first."),A=!!(s||S),D=r??"Open Translator session",R=S??"Translation tools are ready";return x.jsxs("div",{className:"sidebar-settings",children:[x.jsx(ii,{checked:_,className:"sidebar-switch",disabled:b||!y,label:"Conversation translation",title:R,onChange:p}),x.jsx(ii,{checked:n,className:"sidebar-switch",disabled:b,label:"Auto-send",onChange:c}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Language"}),x.jsx("select",{value:f,disabled:b,onChange:k=>C(k.target.value),children:t_.map(k=>x.jsx("option",{value:k.value,children:k.label},k.value))})]}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Reply scope"}),x.jsx("select",{value:m,disabled:b,onChange:k=>v(k.target.value),children:e1.map(k=>x.jsx("option",{value:k.value,children:k.label},k.value))})]}),x.jsxs("button",{className:"settings-toggle",disabled:A,title:R,type:"button",onClick:T,children:[x.jsx("span",{children:"File translation"}),x.jsx("span",{children:"open"})]}),d?null:x.jsxs("button",{className:"settings-toggle",disabled:A,title:R,type:"button",onClick:h,children:[x.jsx("span",{children:"Bootstrap"}),x.jsx("span",{children:"run"})]}),x.jsxs("button",{className:"settings-toggle",disabled:A,title:R,type:"button",onClick:u,children:[x.jsx("span",{children:"Update memory"}),x.jsx("span",{children:"run"})]}),S?x.jsx("p",{className:"settings-help-text",children:S}):null,x.jsxs("div",{className:"settings-status-row",children:[x.jsx("span",{children:"Session status"}),x.jsx("strong",{children:$2(o)})]}),x.jsxs("button",{className:"settings-toggle",disabled:b,title:D,type:"button",onClick:E,children:[x.jsx("span",{children:"Open Session"}),x.jsx("span",{children:"open"})]})]})}function $2(n){return n?n.status==="running"?n.activityStatus??"idle":n.status:"not started"}function G2(n,r,s){return n?r?s?s.initialized?null:"Initialize VCM Harness first.":"Load VCM Harness status first.":"Create or select a task first.":"Connect a repository first."}function V2({busy:n,onGateEnabledChange:r,state:s}){return x.jsx("div",{className:"sidebar-settings",children:D2.map(l=>{const d=s==null?void 0:s.gates[l],m=!!(d!=null&&d.required);return x.jsx(ii,{checked:m,className:"sidebar-switch",disabled:n||!s,label:W2(l),title:d!=null&&d.status?`status: ${d.status}`:void 0,onChange:f=>r(l,f)},l)})})}function W2(n){switch(n){case"architecture-plan":return"Architecture plan";case"validation-adequacy":return"Validation adequacy";case"final-diff":return"Final diff"}return n}function K2({busy:n,larkRegistration:r,larkRegistrationCheck:s,onEnabledChange:l,onResetBinding:d,onSettingsChange:m,onStartLarkRegistration:f,onStartQrLogin:o,onTranslationChange:c,onConnectionChange:h,qrCheck:p,qrLogin:u,status:v}){const C=(v==null?void 0:v.channel)==="lark",T=(v==null?void 0:v.channel)==="lark"?!!(v.binding.appIdConfigured&&v.binding.appSecretConfigured):!!(v!=null&&v.binding.tokenConfigured),E=(v==null?void 0:v.channel)==="lark"?!!(v.binding.appIdConfigured&&v.binding.appSecretConfigured):!!(v!=null&&v.binding.tokenConfigured);return x.jsxs("div",{className:"gateway-panel",children:[x.jsxs("label",{className:"compact-field",children:[x.jsx("span",{children:"Channel"}),x.jsxs("select",{disabled:n||!v,value:(v==null?void 0:v.channel)??"weixin-ilink",onChange:b=>{m({channel:b.currentTarget.value==="lark"?"lark":"weixin-ilink"})},children:[x.jsx("option",{value:"weixin-ilink",children:"Weixin iLink"}),x.jsx("option",{value:"lark",children:"Lark"})]})]}),x.jsxs("div",{className:"gateway-actions",children:[x.jsx(ii,{checked:!!(v!=null&&v.connectionEnabled),className:"sidebar-switch",disabled:n||!v||!v.connectionEnabled&&!T,label:"Connection",stateLabel:v!=null&&v.connectionEnabled?"connected":"off",title:T?"Connect or disconnect the channel for this session. Off by default; the phone can drive the gateway only while Connection is on. Separate from the Gateway command switch.":"Configure the selected Gateway channel first",onChange:b=>h(b)}),x.jsx(ii,{checked:!!(v!=null&&v.enabled),className:"sidebar-switch",disabled:n||!v||!v.enabled&&!T,label:"Gateway",title:T?"Enable or disable PM messages and task-changing Gateway commands":"Configure the selected Gateway channel first",onChange:b=>l(b)}),x.jsx(ii,{checked:!!(v!=null&&v.translationEnabled),className:"sidebar-switch",disabled:n||!v,label:"Translation",onChange:b=>c(b)}),C?x.jsx("button",{type:"button",disabled:n,onClick:f,children:"Start QR Setup"}):E?x.jsx("button",{className:"danger-button",type:"button",disabled:n,onClick:d,children:"Reset Binding"}):x.jsx("button",{type:"button",disabled:n,onClick:o,children:"Start QR Login"})]}),C?x.jsxs("div",{className:"gateway-lark-settings",children:[x.jsx("p",{className:"muted",children:v!=null&&v.binding.appIdConfigured&&v.binding.appSecretConfigured?`Lark app configured${v.binding.larkBotName?` · ${v.binding.larkBotName}`:""}.`:"Use QR setup to create and configure the Lark bot automatically."}),r?x.jsxs("p",{className:"muted",children:["QR setup: ",(s==null?void 0:s.status)??r.status,s!=null&&s.message?` · ${s.message}`:""]}):null]}):u?x.jsx("p",{className:"muted",children:"QR login started. Use the login dialog to confirm binding."}):null,!C&&p?x.jsxs("p",{className:"muted",children:["QR status: ",p.status,p.message?` · ${p.message}`:""]}):null]})}function Y2({busy:n,onPull:r,project:s}){const l=s.pullDisabledReason,d=!!s.canPull;return x.jsxs("div",{className:"project-summary",children:[x.jsxs("dl",{children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Base path"}),x.jsx("dd",{children:s.repoRoot})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Branch"}),x.jsx("dd",{children:X2(s)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Remote"}),x.jsx("dd",{children:s.upstreamBranch??"no upstream"})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Status"}),x.jsx("dd",{children:Q2(s)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Commit"}),x.jsx("dd",{children:s.shortHeadCommit??s.headCommit??"unknown"})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Working tree"}),x.jsx("dd",{children:s.isDirty?"uncommitted changes":"clean"})]})]}),x.jsxs("div",{className:"connected-repo-actions",children:[x.jsx("button",{type:"button",disabled:n||!d,title:l??"Pull latest changes with git pull --ff-only",onClick:()=>void r(),children:"Pull"}),x.jsx("span",{className:"muted",children:s.checkedAt?`checked ${Ah(s.checkedAt)}`:"status not refreshed"})]}),l?x.jsx("p",{className:"muted",children:l}):null,s.warnings.length>0?x.jsx("ul",{className:"warnings",children:s.warnings.map(m=>x.jsx("li",{children:m},m))}):null]})}function X2(n){return n.branch||"unknown"}function Q2(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 J2({roundState:n,task:r}){var p;const[s,l]=te.useState(()=>Date.now()),d=!!(n!=null&&n.startedAt),m=yv(r.createdAt,s),f=Ig(n,(n==null?void 0:n.totalCcActiveMs)??0,s),o=d&&n?Ig(n,n.currentRoundCcActiveMs,s):0,c=d&&n?Z2(n,s):0,h=((p=r.title)==null?void 0:p.trim())||r.taskSlug;return te.useEffect(()=>{const u=window.setInterval(()=>l(Date.now()),1e3);return()=>window.clearInterval(u)},[]),x.jsxs("section",{className:"task-status-dock","aria-label":"VCM Session status",children:[x.jsxs("div",{className:"task-status-dock-title",children:[x.jsx("strong",{title:h,children:h}),x.jsx("span",{className:`status-badge status-${r.status}`,children:r.status})]}),x.jsxs("dl",{className:"task-status-stats",children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Session start"}),x.jsx("dd",{children:Ah(r.createdAt)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Session total"}),x.jsx("dd",{children:So(m)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Rounds"}),x.jsx("dd",{children:(n==null?void 0:n.totalRoundCount)??0})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Role runtime"}),x.jsx("dd",{children:So(f)})]})]}),d&&n?x.jsxs("div",{className:"current-round-status",children:[x.jsxs("div",{className:"current-round-title",children:[x.jsx("span",{children:n.status==="running"?"Current Round":"Last Round"}),x.jsx("span",{className:`status-badge status-${n.status}`,children:n.status})]}),x.jsxs("dl",{className:"task-status-stats",children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Started"}),x.jsx("dd",{children:Ah(n.startedAt)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Total"}),x.jsx("dd",{children:So(c)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Role runtime"}),x.jsx("dd",{children:So(o)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Turn count"}),x.jsx("dd",{children:n.turnCount})]})]})]}):null]})}function Ig(n,r,s){if(!(n!=null&&n.activeTurnStartedAt)||n.status!=="running")return r;const l=Date.parse(n.updatedAt);return Number.isFinite(l)?r+Math.max(0,s-l):r}function Z2(n,r){const s=n.status==="running"?r:Date.parse(n.stoppedAt??n.lastTurnEndedAt??"");return yv(n.startedAt??"",Number.isFinite(s)?s:r)}function yv(n,r){const s=Date.parse(n);return Number.isFinite(s)?Math.max(0,r-s):0}function Ah(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 So(n){const r=Math.max(0,Math.floor(n/1e3)),s=Math.floor(r/3600),l=Math.floor(r%3600/60),d=r%60;return s>0?l>0?`${s}h ${l}m`:`${s}h`:l>0?d>0?`${l}m ${d}s`:`${l}m`:`${d}s`}function ek(n){return n==="system"?"light":n==="light"?"dark":"system"}function Ug(n){return n==="system"?"System":n==="light"?"Light":"Dark"}function tk({events:n,onClose:r}){return x.jsx("div",{className:"modal-backdrop",children:x.jsxs("section",{className:"event-modal",role:"dialog","aria-modal":"true","aria-label":"Events",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Events"}),x.jsxs("p",{className:"muted",children:[n.length," total"]})]}),x.jsx("button",{type:"button",onClick:r,children:"Close"})]}),x.jsx(M2,{events:n,maxEvents:null,showHeader:!1})]})})}function nk({busy:n,messages:r,orchestration:s,onClose:l,onMarkAllDone:d,onDeleteMessageHistory:m}){const f=Xh(r);function o(){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(`
|
|
93
|
+
`;function s2({active:n=!0,autoSendEnabled:r,targetLanguage:s,taskSlug:l,role:d,sessionId:p,panelState:f,onClearSession:o,onEntry:c,onFailures:h}){const[g,u]=ee.useState(""),[y,w]=ee.useState(""),[T,E]=ee.useState(!1),[S,v]=ee.useState(Date.now()),[_,b]=ee.useState(!1),[,A]=zi(""),L=ee.useRef(null),D=f.entries,R=f.failures,k=f.status;ee.useEffect(()=>{if(!n)return;const N=L.current;if(!N)return;const $=window.requestAnimationFrame(()=>{N.scrollTop=N.scrollHeight});return()=>window.cancelAnimationFrame($)},[n,D]);const M=d2(D);ee.useEffect(()=>{if(!M)return;v(Date.now());const N=window.setInterval(()=>v(Date.now()),250);return()=>window.clearInterval(N)},[M]);async function B(N=!1){const $=g;b(!0),A(""),E(!1);try{const I=await ye.translateUserInput(l,d,{text:$,mode:N?"auto-send":"review-before-send",useContext:!1,send:N});I.sent?(u(""),E(!1)):(u(_v($,I.englishPreview)),E(!0))}catch(I){A(dt("Translate composer input",I))}finally{b(!1)}}async function H(){const N=y.trim();if(N){b(!0),A("");try{const $=await ye.translateManualOutput(l,d,{text:N});c(p,d,$),w("")}catch($){A(dt("Translate pasted English output",$))}finally{b(!1)}}}async function U(){b(!0),A("");try{const N=await ye.translateLatestReply(l,d);c(p,d,N)}catch(N){A(dt("Translate final reply",N))}finally{b(!1)}}async function P(){const N=T?Ig(g):g;if(N.trim()){b(!0),A("");try{await ye.sendTranslatedInput(l,d,{englishText:N}),u(""),E(!1)}catch($){A(dt("Send translated English input to role",$))}finally{b(!1)}}}function K(N){N.key!=="Enter"||N.shiftKey||N.nativeEvent.isComposing||(N.preventDefault(),!_&&g.trim()&&(T?P():B(r)))}async function Y(){o(p,d),await ye.clearTranslationSession(p).catch(N=>A(dt("Clear conversation translation panel",N)))}async function G(){b(!0),A("");try{const N=await ye.ignoreTranslationFailures(p);h(p,d,N.failures)}catch(N){A(dt("Ignore failed conversation translations",N))}finally{b(!1)}}async function W(N){b(!0),A("");try{const $=await ye.retryTranslation(p,N.translationId);c(p,d,$)}catch($){A(dt("Retry latest failed conversation translation",$))}finally{b(!1)}}const Z=p2(D,k,S),z=R.length,j=l2(R);return x.jsxs("aside",{className:"translation-panel",children:[x.jsxs("header",{className:"translation-panel-header",children:[x.jsxs("div",{className:"translation-panel-titlebar",children:[x.jsx("h2",{children:"Translation"}),x.jsxs("div",{className:"translation-panel-actions",children:[z>0?x.jsxs(x.Fragment,{children:[x.jsxs("button",{type:"button",disabled:_,onClick:()=>void G(),children:["Ignore ",z]}),j?x.jsx("button",{type:"button",disabled:_,onClick:()=>void W(j),children:"Retry latest"}):null]}):null,x.jsx("button",{type:"button",disabled:_,onClick:()=>void U(),children:"Translate final reply"}),x.jsx("button",{type:"button",onClick:()=>void Y(),children:"Clear"})]})]}),x.jsx("div",{className:"translation-status-row",children:x.jsxs("p",{children:["Claude Code · target ",a2(s)," · ",Z]})})]}),x.jsx("div",{className:"translation-manual-panel",children:x.jsxs("div",{className:"translation-composer-row translation-manual-row",children:[x.jsx("textarea",{value:y,onChange:N=>w(N.target.value),placeholder:"Paste English to translate on demand..."}),x.jsx("div",{className:"translation-composer-actions",children:x.jsx("button",{type:"button",disabled:_||!y.trim(),onClick:()=>void H(),children:"Translate"})})]})}),x.jsxs("div",{className:"translation-entry-list",ref:L,children:[D.length===0?x.jsx("p",{className:"muted",children:"Translated Claude Code output will appear here."}):null,D.map(N=>x.jsx(h2,{entry:N},N.id))]}),x.jsx("div",{className:"translation-composer",children:x.jsxs("div",{className:"translation-composer-row",children:[x.jsx("textarea",{value:g,onChange:N=>{u(N.target.value),(!N.target.value.trim()||T&&!_2(N.target.value))&&E(!1)},onKeyDown:K,placeholder:"输入中文,先翻译成英文工程指令..."}),x.jsx("div",{className:"translation-composer-actions",children:x.jsx("button",{type:"button",disabled:_||!T||!Ig(g).trim(),onClick:()=>void P(),children:"Send English"})})]})})]})}function a2(n){var r;return((r=n_.find(s=>s.value===n))==null?void 0:r.label)??n}function l2(n){let r,s=Number.NEGATIVE_INFINITY;for(const l of n){const d=Date.parse(l.failedAt),p=Number.isFinite(d)?d:Number.NEGATIVE_INFINITY;(!r||p>=s)&&(r=l,s=p)}return r}function o2({open:n,taskSlug:r,targetLanguage:s,onClose:l}){const[d,p]=ee.useState(!1),[,f]=zi(""),[o,c]=ee.useState(null),[h,g]=ee.useState(""),[u,y]=ee.useState(""),[w,T]=ee.useState(""),[E,S]=ee.useState(!1),[v,_]=ee.useState(null),[b,A]=ee.useState(""),[L,D]=ee.useState(""),[R,k]=ee.useState(""),[M,B]=ee.useState(!1);Xa(n?`file-translation:${h||"none"}`:null,()=>H(!0),{intervalMs:2e3,runImmediately:!0});async function H(G=!1){try{const W=await ye.getTranslationState();c(W);const Z=h?W.fileIndex.jobs.some(z=>z.id===h):!1;if((!h||!Z)&&W.fileIndex.jobs[0])U(W.fileIndex.jobs[0].id);else if(!W.fileIndex.jobs[0])g(""),y(""),T("");else if(G&&h){const z=await ye.readFileTranslation(h);y(z.output),T(z.report)}}catch(W){f(dt("Load file translation list",W))}}async function U(G){g(G),y(""),T("");try{const W=await ye.readFileTranslation(G);y(W.output),T(W.report)}catch(W){f(dt(`Read translated file ${G}`,W))}}async function P(){S(!0),await K(b,L)}async function K(G="",W=""){B(!0),f("");try{const Z=await ye.browseTranslationSourceFiles({path:G,query:W,limit:250});_(Z),A(Z.currentPath),D(W)}catch(Z){f(dt("Browse translation source files",Z))}finally{B(!1)}}async function Y(G=R){const W=G.trim();if(W){p(!0),f("");try{if(!r)throw new Error("Create or select a task before translating files.");const Z=await ye.createFileTranslation({taskSlug:r,sourcePath:W,targetLanguage:s});S(!1),await H(),await U(Z.id)}catch(Z){f(dt(`Create file translation for ${W}`,Z))}finally{p(!1)}}}return n?x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"modal-backdrop file-translation-backdrop",children:x.jsx(u2,{busy:d,state:o,selectedJobId:h,output:u,report:w,onClose:()=>{S(!1),l()},onRefresh:()=>void H(),onSelectJob:G=>void U(G),onTranslate:()=>void P()})}),E?x.jsx(c2,{busy:d||M,state:v,currentPath:b,query:L,selectedPath:R,onBrowse:(G,W)=>void K(G,W),onClose:()=>S(!1),onQueryChange:D,onSelectPath:k,onTranslate:()=>void Y()}):null]}):null}function c2({busy:n,state:r,currentPath:s,query:l,selectedPath:d,onBrowse:p,onClose:f,onQueryChange:o,onSelectPath:c,onTranslate:h}){const g=(r==null?void 0:r.entries)??[],u=g.filter(w=>w.type==="directory"),y=g.filter(w=>w.type==="file");return x.jsx("div",{className:"modal-backdrop translation-file-browser-backdrop",children:x.jsxs("section",{className:"translation-file-browser-modal",role:"dialog","aria-modal":"true","aria-label":"Select Source File",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Select Source File"}),x.jsx("p",{children:s||"."})]}),x.jsx("button",{type:"button",onClick:f,children:"Close"})]}),x.jsxs("div",{className:"translation-file-browser-controls",children:[x.jsxs("div",{className:"translation-file-browser-nav",children:[x.jsx("button",{type:"button",disabled:n||!s,onClick:()=>p((r==null?void 0:r.parentPath)??"",""),children:"Up"}),x.jsx("button",{type:"button",disabled:n||!s,onClick:()=>p("",""),children:"Root"})]}),x.jsxs("form",{className:"translation-file-browser-search",onSubmit:w=>{w.preventDefault(),p(s,l)},children:[x.jsx("input",{value:l,onChange:w=>o(w.target.value),placeholder:"Search files"}),x.jsx("button",{type:"submit",disabled:n,children:"Search"}),x.jsx("button",{type:"button",disabled:n||!l,onClick:()=>p(s,""),children:"Clear"})]})]}),x.jsxs("div",{className:"translation-file-browser-layout",children:[x.jsxs("div",{className:"translation-file-browser-list",children:[n&&!r?x.jsx("p",{className:"muted",children:"Loading files..."}):null,!n&&g.length===0?x.jsx("p",{className:"muted",children:"No source files found."}):null,u.length>0?x.jsxs("div",{className:"translation-file-browser-group",children:[x.jsx("h3",{children:"Folders"}),u.map(w=>x.jsx(zg,{entry:w,selected:d===w.path,onBrowse:p,onSelectPath:c},w.path))]}):null,y.length>0?x.jsxs("div",{className:"translation-file-browser-group",children:[x.jsx("h3",{children:"Files"}),y.map(w=>x.jsx(zg,{entry:w,selected:d===w.path,onBrowse:p,onSelectPath:c},w.path))]}):null,r!=null&&r.truncated?x.jsx("p",{className:"translation-entry-note",children:"Result limit reached."}):null]}),x.jsxs("aside",{className:"translation-file-browser-selection",children:[x.jsxs("label",{children:[x.jsx("span",{children:"Source path"}),x.jsx("input",{value:d,onChange:w=>c(w.target.value)})]}),x.jsx("button",{type:"button",disabled:n||!d.trim(),onClick:h,children:"Translate File"})]})]})]})})}function zg({entry:n,selected:r,onBrowse:s,onSelectPath:l}){const d=n.type==="directory";return x.jsxs("button",{className:r?"translation-file-browser-entry is-selected":"translation-file-browser-entry",type:"button",onClick:()=>d?s(n.path,""):l(n.path),onDoubleClick:()=>d?s(n.path,""):void 0,children:[x.jsx("span",{children:d?"DIR":"FILE"}),x.jsx("strong",{children:n.name}),x.jsx("small",{children:n.path})]})}function u2({busy:n,state:r,selectedJobId:s,output:l,report:d,onClose:p,onRefresh:f,onSelectJob:o,onTranslate:c}){const h=(r==null?void 0:r.fileIndex.jobs)??[],g=h.find(u=>u.id===s);return x.jsxs("section",{className:"file-translation-modal",role:"dialog","aria-modal":"true","aria-label":"File Translation",children:[x.jsxs("header",{className:"file-translation-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"File Translation"}),x.jsx("p",{children:"Claude Code · 中英互译"})]}),x.jsxs("div",{className:"file-translation-toolbar",children:[x.jsx("button",{type:"button",disabled:n,onClick:c,children:"Translate"}),x.jsx("button",{type:"button",disabled:n,onClick:f,children:"Refresh"}),x.jsx("button",{type:"button",onClick:p,children:"Close"})]})]}),r!=null&&r.memoryInitialized?null:x.jsx("p",{className:"translation-entry-note",children:"Translation memory is not initialized. Run Bootstrap from the sidebar before important file translations."}),x.jsxs("div",{className:"file-translation-layout",children:[x.jsxs("div",{className:"file-translation-list",children:[h.length===0?x.jsx("p",{className:"muted",children:"No translated files yet."}):null,h.map(u=>x.jsxs("button",{className:u.id===s?"file-translation-item is-active":"file-translation-item",type:"button",onClick:()=>o(u.id),children:[x.jsx("strong",{children:u.sourcePath}),x.jsxs("span",{children:[u.status," · ",u.targetLanguage]})]},u.id))]}),x.jsx("div",{className:"file-translation-preview",children:g?x.jsxs(x.Fragment,{children:[x.jsxs("header",{children:[x.jsx("strong",{children:g.sourcePath}),x.jsx("span",{children:g.status})]}),x.jsx("div",{className:"translation-markdown",children:x.jsx(q_,{remarkPlugins:[dv],children:l||d||"Translation output is not available yet."})})]}):x.jsx("p",{className:"muted",children:"Select a translated file to preview it."})})]})]})}function h2({entry:n}){if(n.sourceKind==="conversation-boundary")return x.jsx(f2,{entry:n});const r=g2(n),s=n.sourceKind==="tool-output",l=n.direction==="user-input-to-english",d=["translation-entry",`is-${n.sourceKind}`,l?"is-user-input":""].filter(Boolean).join(" ");return x.jsxs("article",{className:d,children:[s?x.jsx("pre",{children:r}):x.jsx("div",{className:"translation-markdown",children:x.jsx(q_,{remarkPlugins:[dv],children:r})}),n.warning?x.jsx("p",{className:"translation-entry-note",children:n.warning}):null,n.error?x.jsx("p",{className:"translation-entry-note is-error",children:n.error}):null]})}function f2({entry:n}){const r=n.boundaryKind==="end"?"结束":"开始",s=n.conversationTurn??0,l=y2(n.occurredAt??n.createdAt);return x.jsxs("div",{className:"translation-conversation-boundary","aria-label":`${r} 第 ${s} 轮 ${l}`,children:[x.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"}),x.jsx("span",{children:r}),x.jsxs("span",{children:["第 ",s," 轮"]}),x.jsx("time",{children:l}),x.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"})]})}function d2(n){const r=n.find(gv);return(r==null?void 0:r.translationStartedAt)??(r==null?void 0:r.createdAt)}function p2(n,r,s){const l=n.find(gv);if(l)return`translating ${v2(Math.max(0,s-m2(l)))}`;const d=n.at(-1);return(d==null?void 0:d.status)==="failed"||r==="failed"?"error":r}function gv(n){return n.status==="queued"||n.status==="translating"}function m2(n){const r=Date.parse(n.translationStartedAt??n.createdAt);return Number.isFinite(r)?r:Date.now()}function g2(n){return n.status==="queued"||n.status==="translating"?n.sourceText:n.status==="translated"?n.direction==="user-input-to-english"?_v(n.sourceText,n.translatedText):n.translatedText:n.translatedText||n.sourceText}function _v(n,r){return`${n.trimEnd()}${Ro}${r.trimStart()}`}function _2(n){return n.includes(Ro)}function Ig(n){const r=n.indexOf(Ro);return r===-1?n:n.slice(r+Ro.length)}function v2(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),l=Math.floor(r%60).toString().padStart(2,"0");return`${s}:${l}`}function y2(n){const r=new Date(n);return Number.isNaN(r.getTime())?n:r.toLocaleTimeString()}const S2=8;function b2(){const[n,r]=ee.useState([]);return ee.useEffect(()=>{const s=p=>{var c,h;const f=(h=(c=p.detail)==null?void 0:c.message)==null?void 0:h.trim();if(!f)return;const o=new Date().toISOString();r(g=>{const u=g.find(y=>y.message===f);return u?[{...u,count:u.count+1,updatedAt:o},...g.filter(y=>y.id!==u.id)]:[{id:`ui_error_${Date.now()}_${Math.random().toString(16).slice(2)}`,message:f,count:1,createdAt:o,updatedAt:o},...g].slice(0,S2)})},l=p=>{var o;const f=((o=p.detail)==null?void 0:o.actions)??[];f.length!==0&&r(c=>c.filter(h=>!f.some(g=>h.message.startsWith(`${g} failed.`))))},d=p=>{var o,c;const f=(c=(o=p.detail)==null?void 0:o.message)==null?void 0:c.trim();f&&r(h=>h.filter(g=>g.message!==f))};return window.addEventListener(uh,s),window.addEventListener(hh,l),window.addEventListener(fh,d),()=>{window.removeEventListener(uh,s),window.removeEventListener(hh,l),window.removeEventListener(fh,d)}},[]),n.length===0?null:x.jsxs("aside",{className:"ui-error-center",role:"alert","aria-live":"polite","aria-label":"Application errors",children:[x.jsxs("header",{className:"ui-error-center-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Errors"}),x.jsxs("p",{children:[n.length," active"]})]}),x.jsx("button",{type:"button",onClick:()=>r([]),children:"Clear"})]}),x.jsx("ol",{className:"ui-error-list",children:n.map(s=>x.jsxs("li",{children:[x.jsxs("div",{children:[x.jsx("p",{children:s.message}),x.jsxs("span",{children:[C2(s.updatedAt),s.count>1?` · repeated ${s.count} times`:""]})]}),x.jsx("button",{type:"button","aria-label":"Dismiss error",onClick:()=>r(l=>l.filter(d=>d.id!==s.id)),children:"Close"})]},s.id))})]})}function C2(n){return new Date(n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function w2(n,r){return n.find(s=>s.taskSlug===r)??n[0]??null}function x2(n){if(!(n.mode!=="auto"||n.status!=="running")&&!(!n.activeRole||n.activeRole===n.lastFollowedRole))return n.activeRole}function E2(n,r){var d;if(!((d=n.flowPause)!=null&&d.paused))return null;const s=n.flowPause.role??n.activeRole??"role",l=n.roleRecovery;return n.flowPause.reason==="role-recovery-failed"&&l?r(l,s):`No new turn started after ${s} stopped.`}function k2(n){const r=n.flowPause;if((r==null?void 0:r.reason)==="awaiting-user")return`awaiting-user:${r.since??n.taskSlug}`;const s=n.roundId??n.startedAt??n.taskSlug,l=n.stoppedAt??n.lastTurnEndedAt??"stopped";return`${s}:${l}`}const A2=3,T2=3e4,wo=new Map;function vv(n,r){const s=dt(n,r);if(!R2(r))return wo.set(n,{consecutiveFailures:1,lastMessage:s,lastReportedAt:Date.now()}),s;const l=wo.get(n),d=((l==null?void 0:l.consecutiveFailures)??0)+1,p=Date.now(),f=d>=A2&&(!l||l.lastMessage!==s||p-l.lastReportedAt>=T2);return wo.set(n,{consecutiveFailures:d,lastMessage:s,lastReportedAt:f?p:(l==null?void 0:l.lastReportedAt)??0}),f?s:null}function Do(n){wo.delete(n),h1([n])}function R2(n){const r=Lo(n);return r.includes("could not reach the VCM backend")||r.includes("Failed to fetch")||r.includes("NetworkError")||r.includes("Load failed")||r.includes("ERR_CONNECTION")}const D2=["architecture-plan","validation-adequacy","final-diff"];function M2({events:n,maxEvents:r=8,showHeader:s=!0}){const l=r===null?n:n.slice(-r);return x.jsxs("section",{className:"event-log",children:[s?x.jsx("h2",{children:"Events"}):null,n.length===0?x.jsx("p",{className:"muted",children:"No terminal events yet."}):x.jsx("ol",{children:l.map((d,p)=>x.jsx("li",{children:d},`${d}-${p}`))})]})}function ii({checked:n,className:r,disabled:s,label:l,stateLabel:d,title:p,onChange:f}){const o=["switch-control",n?"is-on":"is-off",r].filter(Boolean).join(" "),c=d??(n?"on":"off");return x.jsxs("button",{type:"button",role:"switch","aria-checked":n,"aria-label":`${l}: ${c}`,className:o,disabled:s,title:p,onClick:()=>f(!n),children:[x.jsx("span",{className:"switch-control-label",children:l}),x.jsx("span",{className:"switch-control-track","aria-hidden":"true",children:x.jsx("span",{className:"switch-control-thumb"})})]})}function L2({status:n,bootstrapStatus:r,applyResult:s,hasActiveTask:l=!1,autoTaskHarnessReviewEnabled:d,busy:p=!1,onRefresh:f,onApply:o,onOpenStudio:c,onOpenRepositoryDiff:h,onAutoTaskHarnessReviewChange:g,onStartBootstrap:u,onRestartBootstrap:y,onStopBootstrap:w,onRunBootstrap:T}){const[E,S]=ee.useState(!1),[v,_]=ee.useState("bypassPermissions"),[b,A]=ee.useState("default"),[L,D]=ee.useState("default"),R=r==null?void 0:r.session,k=(r==null?void 0:r.status)==="running",M=(R==null?void 0:R.status)==="running",B=(r==null?void 0:r.status)!=="complete",H={permissionMode:v,model:b,effort:L};return l?n?x.jsxs("section",{className:"harness-panel",children:[x.jsxs("div",{className:"harness-stage",children:[x.jsxs("div",{className:"harness-panel-header",children:[x.jsxs("div",{children:[x.jsx("strong",{children:"Fixed install"}),x.jsx("p",{className:"muted",children:n.initialized?n.needsApply?`${n.plannedChanges.length} pending updates`:"Up to date":"Not initialized"})]}),x.jsx("div",{className:"harness-actions",children:n.initialized?x.jsxs(x.Fragment,{children:[x.jsx("button",{type:"button",disabled:p,onClick:()=>void f(),children:"Refresh"}),n.needsApply?x.jsx("button",{type:"button",disabled:p,onClick:()=>void o(),children:"Update"}):null]}):x.jsx("button",{type:"button",disabled:p,onClick:()=>void o(),children:"Initialize"})})]}),n.initialized&&n.needsApply?x.jsxs(x.Fragment,{children:[x.jsx("h3",{className:"harness-file-list-title",children:"Files to update"}),x.jsx("ol",{className:"harness-file-list",children:n.plannedChanges.map(U=>x.jsxs("li",{children:[x.jsx("span",{children:U.path}),x.jsx(Hi,{status:U.action})]},`${U.path}:${U.action}`))})]}):null]}),x.jsxs("div",{className:"harness-stage",children:[x.jsxs("div",{className:"harness-panel-header",children:[x.jsx("div",{children:x.jsx("strong",{children:"Harness Studio"})}),x.jsx("div",{className:"harness-actions",children:x.jsx("button",{type:"button",disabled:p,onClick:c,children:"Open Studio"})})]}),x.jsx("button",{className:"harness-review-diff-button",type:"button",disabled:p,onClick:h,children:"Review Diff"}),x.jsx(ii,{checked:d,className:"sidebar-switch",disabled:p,label:"Auto task harness review",title:"Automatically ask Harness Engineer to review task harness after final acceptance completes",onChange:g})]}),B?x.jsx("div",{className:"harness-stage",children:x.jsxs("div",{className:"harness-panel-header",children:[x.jsxs("div",{children:[x.jsx("strong",{children:"Bootstrap"}),x.jsx("p",{className:"muted",children:r?O2(r.status):"not loaded"})]}),x.jsx("div",{className:"harness-actions",children:x.jsx("button",{type:"button",disabled:p||!(r!=null&&r.canStart),onClick:()=>{S(!0)},children:"Open Bootstrap"})})]})}):null,s!=null&&s.changedFiles.length?x.jsx("div",{className:"harness-result",children:x.jsx("p",{className:"muted",children:s.message})}):null,n.warnings.length>0?x.jsx("ul",{className:"warnings",children:n.warnings.map(U=>x.jsx("li",{children:U},U))}):null,r!=null&&r.warnings.length?x.jsx("ul",{className:"warnings",children:r.warnings.map(U=>x.jsx("li",{children:U},U))}):null,B&&E?x.jsx("div",{className:"harness-bootstrap-modal",role:"dialog","aria-modal":"true","aria-label":"Harness Engineer bootstrap session",children:x.jsxs("div",{className:"harness-bootstrap-modal-surface",children:[x.jsxs("header",{className:"harness-bootstrap-modal-header",children:[x.jsxs("div",{children:[x.jsx("strong",{children:"Harness Engineer Bootstrap"}),x.jsx("p",{className:"muted",children:(R==null?void 0:R.command)??"Start Harness Engineer, then run bootstrap when ready."})]}),x.jsxs("div",{className:"harness-bootstrap-modal-actions",children:[R?x.jsx(Hi,{status:R.status}):null,x.jsx("button",{type:"button",onClick:()=>S(!1),children:"Close"})]})]}),x.jsxs("div",{className:"harness-bootstrap-controls",children:[x.jsxs("label",{children:[x.jsx("span",{children:"Permission"}),x.jsx("select",{value:v,disabled:p||k||M,onChange:U=>_(U.target.value),children:r_.map(U=>x.jsx("option",{value:U.value,children:U.label},U.value))})]}),x.jsxs("label",{children:[x.jsx("span",{children:"Model"}),x.jsx("select",{value:b,disabled:p||k||M,onChange:U=>A(U.target.value),children:s_.map(U=>x.jsx("option",{value:U.value,children:U.label},U.value))})]}),x.jsxs("label",{children:[x.jsx("span",{children:"Effort"}),x.jsx("select",{value:L,disabled:p||k||M,onChange:U=>D(U.target.value),children:a_.map(U=>x.jsx("option",{value:U.value,children:U.label},U.value))})]}),x.jsxs("div",{className:"harness-bootstrap-control-actions",children:[x.jsx("button",{type:"button",disabled:p||k||!(r!=null&&r.canStart),onClick:()=>void u(H),children:"Start"}),x.jsx("button",{type:"button",disabled:p||k||!(r!=null&&r.canStart),onClick:()=>void y(H),children:"Restart"}),x.jsx("button",{type:"button",disabled:p||!R,onClick:()=>void w(),children:"Stop"}),x.jsx("button",{type:"button",disabled:p||k||!M,onClick:()=>void T(),children:"Run bootstrap"})]})]}),x.jsx("div",{className:"harness-bootstrap-terminal",children:M?x.jsx(Oo,{sessionId:R.id,active:E}):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:"Harness Bootstrap"}),x.jsx("span",{children:"Start Harness Engineer first. When it is ready, click Run bootstrap to send the prompt."})]})})]})}):null]}):null:x.jsx("section",{className:"harness-panel",children:x.jsxs("div",{className:"harness-result",children:[x.jsx("strong",{children:"Task required"}),x.jsx("p",{className:"muted",children:"Create or select a task before changing VCM Harness. Harness changes are committed in the active task worktree."})]})})}function O2(n){return n.replaceAll("_"," ")}function Xh(n){return{total:n.length,accepted:n.filter(r=>r.acceptedAt).length,delivered:n.filter(r=>r.deliveredAt).length}}function B2(n,r=6){const s=[...n].sort(H2).map((d,p)=>({message:d,sequence:p+1}));return[...r===null?s:s.slice(-r)].sort((d,p)=>p.sequence-d.sequence)}function j2({messages:n,orchestration:r,busy:s,maxMessages:l=6,showControls:d=!0,showHeader:p=!0,onModeChange:f,onMarkAllDone:o}){const[c,h]=ee.useState(null),g=Xh(n),u=(r==null?void 0:r.mode)??"auto",y=B2(n,l);async function w(T){await z2(T.body),h(T.id),window.setTimeout(()=>h(E=>E===T.id?null:E),1200)}return x.jsxs("section",{className:"message-panel",children:[p?x.jsxs("div",{className:"message-panel-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Messages"}),x.jsxs("p",{className:"muted",children:[g.total," total / ",g.accepted," accepted"]})]}),d&&f?x.jsx("div",{className:"message-controls",children:x.jsx(ii,{checked:u==="auto",className:"message-mode-toggle",disabled:s,label:"Auto orchestration",onChange:T=>f(T?"auto":"manual")})}):null,d&&o?x.jsx("button",{type:"button",disabled:s,onClick:o,children:"Mark All Done"}):null]}):null,n.length===0?x.jsx("p",{className:"muted",children:"No role messages yet."}):x.jsx("ol",{className:"message-list",children:y.map(({message:T,sequence:E})=>x.jsxs("li",{className:"message-item",children:[x.jsxs("div",{className:"message-item-main",children:[x.jsxs("div",{className:"message-meta",children:[x.jsxs("span",{className:"message-sequence",children:["#",E]}),x.jsx("time",{dateTime:Mo(T),children:N2(Mo(T))}),x.jsxs("strong",{children:[T.fromRole," ","->"," ",T.toRole]}),x.jsx("span",{children:T.type})]}),x.jsx("p",{children:T.body}),T.failureReason?x.jsx("span",{className:"message-reason",children:T.failureReason}):null,T.bodyPath?x.jsx("span",{className:"message-path",children:T.bodyPath}):null]}),x.jsx("div",{className:"message-actions",children:x.jsx("button",{type:"button",disabled:s,onClick:()=>void w(T),children:c===T.id?"Copied":"Copy"})})]},T.id))})]})}function N2(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 Mo(n){return n.acceptedAt??n.deliveredAt??n.dispatchingAt??n.createdAt}function H2(n,r){const s=Mo(n).localeCompare(Mo(r));if(s!==0)return s;const l=n.createdAt.localeCompare(r.createdAt);return l!==0?l:n.id.localeCompare(r.id)}async function z2(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 I2({defaultPath:n="",recentPaths:r=[],busy:s=!1,onConnect:l}){const[d,p]=ee.useState(n);ee.useEffect(()=>{n&&p(n)},[n]);async function f(o){o.preventDefault(),await l(d)}return x.jsx("form",{className:"repo-connect",onSubmit:f,children:x.jsxs("div",{className:r.length>0?"inline-form has-recent-paths":"inline-form",children:[x.jsx("input",{"aria-label":"Repository path",id:"repo-path",value:d,onChange:o=>p(o.target.value),placeholder:"/path/to/repo"}),r.length>0?x.jsxs("select",{"aria-label":"Recent repositories",className:"repo-recent-select",value:"",onChange:o=>{o.target.value&&p(o.target.value)},children:[x.jsx("option",{value:"",children:"Recent"}),r.map(o=>x.jsx("option",{value:o,children:o},o))]}):null,x.jsx("button",{type:"submit",disabled:s||!d.trim(),children:"Connect"})]})})}function U2({tasks:n,activeTaskSlug:r,onSelect:s}){return x.jsx("nav",{className:"task-nav","aria-label":"Tasks",children:n.map(l=>x.jsxs("button",{className:l.taskSlug===r?"task-nav-item is-active":"task-nav-item",type:"button",onClick:()=>s(l.taskSlug),children:[x.jsx("span",{children:l.title||l.taskSlug}),x.jsx(Hi,{status:l.status})]},l.taskSlug))})}function P2({project:n,recentRepositoryPaths:r,tasks:s,activeTaskSlug:l,messages:d,orchestration:p,events:f,roundState:o,gateReview:c,translationEnabled:h,translationAutoSendEnabled:g,translationTargetLanguage:u,translationOutputMode:y,translationMemoryInitialized:w,translatorSession:T,harnessStatus:E,harnessBootstrapStatus:S,harnessApplyResult:v,autoTaskHarnessReviewEnabled:_,gatewayStatus:b,gatewayQrLogin:A,gatewayQrCheck:L,gatewayLarkRegistration:D,gatewayLarkRegistrationCheck:R,busy:k,onConnect:M,onRefreshConnectedRepository:B,onPullConnectedRepository:H,onRefreshHarness:U,onApplyHarness:P,onStartHarnessBootstrap:K,onRestartHarnessBootstrap:Y,onStopHarnessBootstrap:G,onRunHarnessBootstrap:W,onOpenHarnessStudio:Z,onOpenRepositoryDiff:z,onAutoTaskHarnessReviewChange:j,onRefreshGateway:N,onGatewayEnabledChange:$,onGatewaySettingsChange:I,onGatewayTranslationChange:re,onGatewayConnectionChange:ve,onStartGatewayQrLogin:me,onStartGatewayLarkRegistration:Q,onResetGatewayBinding:q,onGateReviewGateEnabledChange:te,onTranslationEnabledChange:ae,onTranslationAutoSendChange:pe,onTranslationTargetLanguageChange:se,onTranslationOutputModeChange:we,onOpenFileTranslation:je,onOpenTranslatorSession:ze,onCreateTranslationBootstrap:Pe,onUpdateTranslationMemory:xe,onCreateTask:xt,onCloseTask:yt,onSelectTask:Nt,themeMode:Gt,onAutoOrchestrationChange:Sn,onThemeModeChange:St,pauseAlertSound:tt,onPauseAlertSoundChange:Lt,roleRetryEnabled:he,onRoleRetryEnabledChange:Se,permissionRequestMode:Ae,onPermissionRequestModeChange:Le,launchTemplate:Oe,canSaveLaunchTemplate:ut,canOneClickStart:Fe,onSaveLaunchTemplate:gt,onOneClickStart:mt,onMarkAllMessagesDone:Ot,onDeleteMessageHistory:Ze}){const[Qt,Et]=ee.useState(""),[bn,Ln]=ee.useState(!1),[ri,On]=ee.useState(!1),[Bt,Bn]=ee.useState(()=>l?null:"repository"),Wn=Xh(d),si=Qt.trim(),rn=G2(n,l,E),jn=s.filter(Ne=>Ne.cleanupStatus!=="cleaned"),sn=jn.find(Ne=>Ne.taskSlug===l)??null;ee.useEffect(()=>{Bn(Ne=>!l&&Ne===null?n?"task":"repository":Ne)},[l,n]);function an(Ne,Pi){Bn(Pi?Ne:null)}async function Ui(Ne){Ne.preventDefault(),await xt({taskSlug:si}),Et("")}return x.jsxs("div",{className:"project-dashboard",children:[x.jsx("header",{className:"brand-header",children:x.jsx("strong",{children:"VibeCodingMaster"})}),x.jsx(zr,{title:"Repository",open:Bt==="repository",onOpenChange:Ne=>{an("repository",Ne),Ne&&n&&B()},children:x.jsxs("div",{className:"repository-panel",children:[x.jsx(I2,{defaultPath:(n==null?void 0:n.repoRoot)??"",recentPaths:r,busy:k,onConnect:M}),n?x.jsx(Y2,{busy:k,project:n,onPull:H}):null]})}),x.jsx(zr,{title:"Settings",open:Bt==="settings",onOpenChange:Ne=>an("settings",Ne),children:x.jsxs("div",{className:"sidebar-settings",children:[x.jsxs("button",{"aria-label":`Theme mode: ${Pg(Gt)}`,className:"settings-toggle theme-mode-toggle",disabled:k,title:"Cycle theme: system, light, dark",type:"button",onClick:()=>St(ek(Gt)),children:[x.jsx("span",{children:"Theme"}),x.jsx("span",{children:Pg(Gt)})]}),x.jsx(ii,{checked:((p==null?void 0:p.mode)??"auto")==="auto",className:"sidebar-switch",disabled:k||!l,label:"Auto orchestration",title:l?"Automatically dispatch role messages during the active task":"Create or select a task first",onChange:Sn}),x.jsx(ii,{checked:tt,className:"sidebar-switch",disabled:k,label:"Pause alert sound",title:"Play a sound when VCM shows the fixed flow pause dialog",onChange:Ne=>Lt(Ne)}),x.jsx(ii,{checked:he,className:"sidebar-switch",disabled:k,label:"CC auto retry",title:"Retry temporary Claude Code turn failures before showing the flow pause alert",onChange:Ne=>Se(Ne)}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Permission requests"}),x.jsxs("select",{value:Ae,disabled:k,onChange:Ne=>Le(Ne.target.value),children:[x.jsx("option",{value:"off",children:"off"}),x.jsx("option",{value:"allowAll",children:"allow all"})]})]}),x.jsxs("button",{className:"settings-toggle",disabled:k||!ut,title:"Save the current core role launch settings and optional Gate Reviewer settings",type:"button",onClick:gt,children:[x.jsx("span",{children:"Save launch template"}),x.jsx("span",{children:ut?"ready":"open task"})]}),Fe?x.jsxs("button",{className:"settings-toggle is-active",disabled:k,title:F2(Oe),type:"button",onClick:mt,children:[x.jsx("span",{children:"One-click start"}),x.jsx("span",{children:yv(Oe)})]}):null,l?x.jsxs(x.Fragment,{children:[x.jsxs("button",{type:"button",onClick:()=>Ln(!0),children:[x.jsx("span",{children:"Messages"}),x.jsxs("span",{className:"muted",children:[Wn.total," total"]})]}),x.jsxs("button",{type:"button",onClick:()=>On(!0),children:[x.jsx("span",{children:"Events"}),x.jsxs("span",{className:"muted",children:[f.length," total"]})]})]}):null]})}),x.jsx(zr,{title:"Translation",open:Bt==="translation",onOpenChange:Ne=>an("translation",Ne),children:x.jsx(q2,{busy:k,enabled:h,autoSendEnabled:g,targetLanguage:u,outputMode:y,memoryInitialized:w,baseUnavailableReason:rn,translatorSession:T,onAutoSendChange:pe,onCreateBootstrap:Pe,onEnabledChange:ae,onUpdateMemory:xe,onTargetLanguageChange:se,onOutputModeChange:we,onOpenFileTranslation:je,onOpenTranslatorSession:ze})}),n&&l?x.jsx(zr,{title:"Gate Review Gates",open:Bt==="gate-review-gates",onOpenChange:Ne=>an("gate-review-gates",Ne),children:x.jsx(V2,{busy:k,state:c,onGateEnabledChange:te})}):null,x.jsx(zr,{title:"Gateway",open:Bt==="gateway",onOpenChange:Ne=>{an("gateway",Ne),Ne&&N()},children:x.jsx(K2,{busy:k,qrCheck:L,qrLogin:A,larkRegistration:D,larkRegistrationCheck:R,status:b,onEnabledChange:$,onSettingsChange:I,onResetBinding:q,onStartLarkRegistration:Q,onStartQrLogin:me,onTranslationChange:re,onConnectionChange:ve})}),n?x.jsx(zr,{title:"VCM Harness",open:Bt==="vcm-harness",onOpenChange:Ne=>an("vcm-harness",Ne),children:x.jsx(L2,{status:E,bootstrapStatus:S,applyResult:v,hasActiveTask:!!sn,autoTaskHarnessReviewEnabled:_,busy:k,onRefresh:U,onApply:P,onOpenStudio:Z,onOpenRepositoryDiff:z,onAutoTaskHarnessReviewChange:j,onStartBootstrap:K,onRestartBootstrap:Y,onStopBootstrap:G,onRunBootstrap:W})}):null,n?x.jsx(zr,{title:"Task",open:Bt==="task",onOpenChange:Ne=>an("task",Ne),children:jn.length>0?x.jsxs("div",{className:"task-panel",children:[x.jsx(U2,{tasks:jn,activeTaskSlug:l,onSelect:Nt}),sn?x.jsx("div",{className:"task-panel-actions",children:x.jsx("button",{className:"danger-button",disabled:k,type:"button",onClick:yt,children:"Close Task"})}):null]}):x.jsx("div",{className:"task-create",children:x.jsxs("form",{onSubmit:Ui,children:[x.jsx("input",{value:Qt,onChange:Ne=>Et(Ne.target.value),placeholder:"task name"}),x.jsxs("div",{className:"task-create-preview",children:[x.jsxs("small",{children:["branch: ",si?`feature/${si}`:"feature/<task>"]}),x.jsxs("small",{children:["worktree: ",si?`.claude/worktrees/${si}`:".claude/worktrees/<task>"]})]}),x.jsx("button",{type:"submit",disabled:k||!si,children:"Create"})]})})}):null,n&&sn?x.jsx(J2,{task:sn,roundState:o}):null,bn?x.jsx(nk,{busy:k,messages:d,orchestration:p,onClose:()=>Ln(!1),onMarkAllDone:()=>{l&&Ot(l)},onDeleteMessageHistory:()=>{l&&Ze(l)}}):null,ri?x.jsx(tk,{events:f,onClose:()=>On(!1)}):null]})}function yv(n){return[n.autoOrchestration?"auto":"manual"].join(" + ")}function F2(n){const r=Object.entries(n.roles).map(([s,l])=>`${s}: ${l.permissionMode} / ${l.model} / ${l.effort}`).join("; ");return`Launch template: ${yv(n)}; ${r}`}function q2({autoSendEnabled:n,baseUnavailableReason:r,busy:s,enabled:l,memoryInitialized:d,outputMode:p,targetLanguage:f,translatorSession:o,onAutoSendChange:c,onCreateBootstrap:h,onEnabledChange:g,onUpdateMemory:u,onOutputModeChange:y,onTargetLanguageChange:w,onOpenFileTranslation:T,onOpenTranslatorSession:E}){const S=!!(s||r),v=(o==null?void 0:o.status)==="running",_=!!(l&&!r&&v),b=r??(v?null:"Start Translator session first."),A=!!(s||b),D=r??"Open Translator session",R=b??"Translation tools are ready";return x.jsxs("div",{className:"sidebar-settings",children:[x.jsx(ii,{checked:_,className:"sidebar-switch",disabled:S||!v,label:"Conversation translation",title:R,onChange:g}),x.jsx(ii,{checked:n,className:"sidebar-switch",disabled:S,label:"Auto-send",onChange:c}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Language"}),x.jsx("select",{value:f,disabled:S,onChange:k=>w(k.target.value),children:n_.map(k=>x.jsx("option",{value:k.value,children:k.label},k.value))})]}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Reply scope"}),x.jsx("select",{value:p,disabled:S,onChange:k=>y(k.target.value),children:t1.map(k=>x.jsx("option",{value:k.value,children:k.label},k.value))})]}),x.jsxs("button",{className:"settings-toggle",disabled:A,title:R,type:"button",onClick:T,children:[x.jsx("span",{children:"File translation"}),x.jsx("span",{children:"open"})]}),d?null:x.jsxs("button",{className:"settings-toggle",disabled:A,title:R,type:"button",onClick:h,children:[x.jsx("span",{children:"Bootstrap"}),x.jsx("span",{children:"run"})]}),x.jsxs("button",{className:"settings-toggle",disabled:A,title:R,type:"button",onClick:u,children:[x.jsx("span",{children:"Update memory"}),x.jsx("span",{children:"run"})]}),b?x.jsx("p",{className:"settings-help-text",children:b}):null,x.jsxs("div",{className:"settings-status-row",children:[x.jsx("span",{children:"Session status"}),x.jsx("strong",{children:$2(o)})]}),x.jsxs("button",{className:"settings-toggle",disabled:S,title:D,type:"button",onClick:E,children:[x.jsx("span",{children:"Open Session"}),x.jsx("span",{children:"open"})]})]})}function $2(n){return n?n.status==="running"?n.activityStatus??"idle":n.status:"not started"}function G2(n,r,s){return n?r?s?s.initialized?null:"Initialize VCM Harness first.":"Load VCM Harness status first.":"Create or select a task first.":"Connect a repository first."}function V2({busy:n,onGateEnabledChange:r,state:s}){return x.jsx("div",{className:"sidebar-settings",children:D2.map(l=>{const d=s==null?void 0:s.gates[l],p=!!(d!=null&&d.required);return x.jsx(ii,{checked:p,className:"sidebar-switch",disabled:n||!s,label:W2(l),title:d!=null&&d.status?`status: ${d.status}`:void 0,onChange:f=>r(l,f)},l)})})}function W2(n){switch(n){case"architecture-plan":return"Architecture plan";case"validation-adequacy":return"Validation adequacy";case"final-diff":return"Final diff"}return n}function K2({busy:n,larkRegistration:r,larkRegistrationCheck:s,onEnabledChange:l,onResetBinding:d,onSettingsChange:p,onStartLarkRegistration:f,onStartQrLogin:o,onTranslationChange:c,onConnectionChange:h,qrCheck:g,qrLogin:u,status:y}){const w=(y==null?void 0:y.channel)==="lark",T=(y==null?void 0:y.channel)==="lark"?!!(y.binding.appIdConfigured&&y.binding.appSecretConfigured):!!(y!=null&&y.binding.tokenConfigured),E=(y==null?void 0:y.channel)==="lark"?!!(y.binding.appIdConfigured&&y.binding.appSecretConfigured):!!(y!=null&&y.binding.tokenConfigured);return x.jsxs("div",{className:"gateway-panel",children:[x.jsxs("label",{className:"compact-field",children:[x.jsx("span",{children:"Channel"}),x.jsxs("select",{disabled:n||!y,value:(y==null?void 0:y.channel)??"weixin-ilink",onChange:S=>{p({channel:S.currentTarget.value==="lark"?"lark":"weixin-ilink"})},children:[x.jsx("option",{value:"weixin-ilink",children:"Weixin iLink"}),x.jsx("option",{value:"lark",children:"Lark"})]})]}),x.jsxs("div",{className:"gateway-actions",children:[x.jsx(ii,{checked:!!(y!=null&&y.connectionEnabled),className:"sidebar-switch",disabled:n||!y||!y.connectionEnabled&&!T,label:"Connection",stateLabel:y!=null&&y.connectionEnabled?"connected":"off",title:T?"Connect or disconnect the channel for this session. Off by default; the phone can drive the gateway only while Connection is on. Separate from the Gateway command switch.":"Configure the selected Gateway channel first",onChange:S=>h(S)}),x.jsx(ii,{checked:!!(y!=null&&y.enabled),className:"sidebar-switch",disabled:n||!y||!y.enabled&&!T,label:"Gateway",title:T?"Enable or disable PM messages and task-changing Gateway commands":"Configure the selected Gateway channel first",onChange:S=>l(S)}),x.jsx(ii,{checked:!!(y!=null&&y.translationEnabled),className:"sidebar-switch",disabled:n||!y,label:"Translation",onChange:S=>c(S)}),w?x.jsx("button",{type:"button",disabled:n,onClick:f,children:"Start QR Setup"}):E?x.jsx("button",{className:"danger-button",type:"button",disabled:n,onClick:d,children:"Reset Binding"}):x.jsx("button",{type:"button",disabled:n,onClick:o,children:"Start QR Login"})]}),w?x.jsxs("div",{className:"gateway-lark-settings",children:[x.jsx("p",{className:"muted",children:y!=null&&y.binding.appIdConfigured&&y.binding.appSecretConfigured?`Lark app configured${y.binding.larkBotName?` · ${y.binding.larkBotName}`:""}.`:"Use QR setup to create and configure the Lark bot automatically."}),r?x.jsxs("p",{className:"muted",children:["QR setup: ",(s==null?void 0:s.status)??r.status,s!=null&&s.message?` · ${s.message}`:""]}):null]}):u?x.jsx("p",{className:"muted",children:"QR login started. Use the login dialog to confirm binding."}):null,!w&&g?x.jsxs("p",{className:"muted",children:["QR status: ",g.status,g.message?` · ${g.message}`:""]}):null]})}function Y2({busy:n,onPull:r,project:s}){const l=s.pullDisabledReason,d=!!s.canPull;return x.jsxs("div",{className:"project-summary",children:[x.jsxs("dl",{children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Base path"}),x.jsx("dd",{children:s.repoRoot})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Branch"}),x.jsx("dd",{children:X2(s)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Remote"}),x.jsx("dd",{children:s.upstreamBranch??"no upstream"})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Status"}),x.jsx("dd",{children:Q2(s)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Commit"}),x.jsx("dd",{children:s.shortHeadCommit??s.headCommit??"unknown"})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Working tree"}),x.jsx("dd",{children:s.isDirty?"uncommitted changes":"clean"})]})]}),x.jsxs("div",{className:"connected-repo-actions",children:[x.jsx("button",{type:"button",disabled:n||!d,title:l??"Pull latest changes with git pull --ff-only",onClick:()=>void r(),children:"Pull"}),x.jsx("span",{className:"muted",children:s.checkedAt?`checked ${Ah(s.checkedAt)}`:"status not refreshed"})]}),l?x.jsx("p",{className:"muted",children:l}):null,s.warnings.length>0?x.jsx("ul",{className:"warnings",children:s.warnings.map(p=>x.jsx("li",{children:p},p))}):null]})}function X2(n){return n.branch||"unknown"}function Q2(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 J2({roundState:n,task:r}){var g;const[s,l]=ee.useState(()=>Date.now()),d=!!(n!=null&&n.startedAt),p=Sv(r.createdAt,s),f=Ug(n,(n==null?void 0:n.totalCcActiveMs)??0,s),o=d&&n?Ug(n,n.currentRoundCcActiveMs,s):0,c=d&&n?Z2(n,s):0,h=((g=r.title)==null?void 0:g.trim())||r.taskSlug;return ee.useEffect(()=>{const u=window.setInterval(()=>l(Date.now()),1e3);return()=>window.clearInterval(u)},[]),x.jsxs("section",{className:"task-status-dock","aria-label":"VCM Session status",children:[x.jsxs("div",{className:"task-status-dock-title",children:[x.jsx("strong",{title:h,children:h}),x.jsx("span",{className:`status-badge status-${r.status}`,children:r.status})]}),x.jsxs("dl",{className:"task-status-stats",children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Session start"}),x.jsx("dd",{children:Ah(r.createdAt)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Session total"}),x.jsx("dd",{children:So(p)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Rounds"}),x.jsx("dd",{children:(n==null?void 0:n.totalRoundCount)??0})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Role runtime"}),x.jsx("dd",{children:So(f)})]})]}),d&&n?x.jsxs("div",{className:"current-round-status",children:[x.jsxs("div",{className:"current-round-title",children:[x.jsx("span",{children:n.status==="running"?"Current Round":"Last Round"}),x.jsx("span",{className:`status-badge status-${n.status}`,children:n.status})]}),x.jsxs("dl",{className:"task-status-stats",children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Started"}),x.jsx("dd",{children:Ah(n.startedAt)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Total"}),x.jsx("dd",{children:So(c)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Role runtime"}),x.jsx("dd",{children:So(o)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Turn count"}),x.jsx("dd",{children:n.turnCount})]})]})]}):null]})}function Ug(n,r,s){if(!(n!=null&&n.activeTurnStartedAt)||n.status!=="running")return r;const l=Date.parse(n.updatedAt);return Number.isFinite(l)?r+Math.max(0,s-l):r}function Z2(n,r){const s=n.status==="running"?r:Date.parse(n.stoppedAt??n.lastTurnEndedAt??"");return Sv(n.startedAt??"",Number.isFinite(s)?s:r)}function Sv(n,r){const s=Date.parse(n);return Number.isFinite(s)?Math.max(0,r-s):0}function Ah(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 So(n){const r=Math.max(0,Math.floor(n/1e3)),s=Math.floor(r/3600),l=Math.floor(r%3600/60),d=r%60;return s>0?l>0?`${s}h ${l}m`:`${s}h`:l>0?d>0?`${l}m ${d}s`:`${l}m`:`${d}s`}function ek(n){return n==="system"?"light":n==="light"?"dark":"system"}function Pg(n){return n==="system"?"System":n==="light"?"Light":"Dark"}function tk({events:n,onClose:r}){return x.jsx("div",{className:"modal-backdrop",children:x.jsxs("section",{className:"event-modal",role:"dialog","aria-modal":"true","aria-label":"Events",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Events"}),x.jsxs("p",{className:"muted",children:[n.length," total"]})]}),x.jsx("button",{type:"button",onClick:r,children:"Close"})]}),x.jsx(M2,{events:n,maxEvents:null,showHeader:!1})]})})}function nk({busy:n,messages:r,orchestration:s,onClose:l,onMarkAllDone:d,onDeleteMessageHistory:p}){const f=Xh(r);function o(){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(`
|
|
94
94
|
`))&&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(`
|
|
95
|
-
`))&&m()}return x.jsx("div",{className:"modal-backdrop",children:x.jsxs("section",{className:"message-modal",role:"dialog","aria-modal":"true","aria-label":"Messages",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Messages"}),x.jsxs("p",{className:"muted",children:[f.total," total / ",f.accepted," accepted",s?` · ${s.mode}`:""]})]}),x.jsxs("div",{className:"modal-actions",children:[x.jsx("button",{type:"button",disabled:n,onClick:o,children:"Mark All Done"}),x.jsx("button",{type:"button",disabled:n||f.total===0,onClick:c,children:"Delete All"}),x.jsx("button",{type:"button",onClick:l,children:"Close"})]})]}),x.jsx(j2,{busy:n,maxMessages:null,messages:r,orchestration:s,showControls:!1,showHeader:!1})]})})}function zr({children:n,onOpenChange:r,open:s,title:l}){return x.jsxs("section",{className:"sidebar-section",children:[x.jsxs("button",{"aria-expanded":s,className:"sidebar-section-toggle",type:"button",onClick:()=>{r==null||r(!s)},children:[x.jsx("span",{children:l}),x.jsx("span",{"aria-hidden":"true",className:"sidebar-section-chevron"})]}),s?x.jsx("div",{className:"sidebar-section-content",children:n}):null]})}function Sv(n,r){return n.find(s=>s.role===r)}function ik({activeRole:n,roles:r=Dh,sessions:s,onSelect:l}){return x.jsx("div",{className:"role-tabs",role:"tablist","aria-label":"Role sessions",children:r.map(d=>{const m=Sv(s,d.name),f=(m==null?void 0:m.status)==="running"?m.activityStatus??"idle":(m==null?void 0:m.status)??"not_started";return x.jsxs("button",{className:d.name===n?"role-tab is-active":"role-tab",type:"button",role:"tab","aria-selected":d.name===n,onClick:()=>l(d.name),children:[x.jsx("span",{children:d.label}),x.jsx(Hi,{status:f})]},d.name)})})}function rk({role:n,session:r,permissionMode:s,model:l,effort:d,active:m=!0,busy:f,translationEnabled:o,translationAutoSendEnabled:c,translationTargetLanguage:h,translationPanelState:p,onClearTranslationSession:u,onTranslationEntry:v,onTranslationFailures:C,onPermissionModeChange:T,onModelChange:E,onEffortChange:b,onStart:y,onResume:_,onStop:S,onRestart:A,onNotifyHarnessUpdated:L,onTerminalEvent:D}){const R=m&&Q0(n)&&o&&(r==null?void 0:r.status)==="running";return x.jsx("section",{className:"session-console",children:x.jsxs("div",{className:R?"session-console-body has-translation":"session-console-body",children:[x.jsxs("div",{className:"terminal-pane",children:[x.jsx(Mh,{role:n,session:r,permissionMode:s,model:l,effort:d,busy:f,onPermissionModeChange:T,onModelChange:E,onEffortChange:b,onStart:y,onResume:_,onStop:S,onRestart:A,onNotifyHarnessUpdated:L}),(r==null?void 0:r.status)==="running"?x.jsx(Oo,{sessionId:r.id,active:m,onEvent:D},r.id):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:n}),x.jsx("span",{children:r!=null&&r.claudeSessionId?"Resume this role to reconnect its Claude Code conversation.":"Start this role to open an embedded Claude Code terminal."})]})]}),R?x.jsx("div",{className:"translation-pane",children:x.jsx(s2,{active:m,autoSendEnabled:c,targetLanguage:h,taskSlug:r.taskSlug,role:n,sessionId:r.id,panelState:p??{role:n,status:"ready",entries:[],failures:[]},onClearSession:u??(()=>{}),onEntry:v??(()=>{}),onFailures:C??(()=>{})},`${n}:${r.id}`)}):null]})})}const ch=500;function Th(n){return{taskSlug:n,cursor:1,sessions:{}}}function sk(n,r,s){return n.sessions[r]??Ns(s)}function ak(n,r){const l={...uk(n,r.taskSlug).sessions};for(const d of r.sessions)l[d.sessionId]={...Ns(d.role),...l[d.sessionId],role:d.role,status:d.status};for(const d of r.events){const m=l[d.sessionId]??Ns(d.role);if(d.event.type==="status")l[d.sessionId]={...m,role:d.role,status:d.event.status};else if(d.event.type==="failures")l[d.sessionId]={...m,role:d.role,failures:d.event.failures};else if(d.event.type==="entry"){const f=Cv(bv(m.entries,d.event.entry));l[d.sessionId]={...m,role:d.role,entries:f.entries,failures:f.removedIds.size>0?m.failures.filter(o=>!f.removedIds.has(o.translationId)):m.failures}}}return{taskSlug:r.taskSlug,cursor:r.nextCursor,sessions:l}}function lk(n,r,s){return{...n,sessions:{...n.sessions,[r]:Ns(s)}}}function ok(n,r,s,l){const d=n.sessions[r]??Ns(s),m=Cv(bv(d.entries,l));return{...n,sessions:{...n.sessions,[r]:{...d,role:s,entries:m.entries,failures:m.removedIds.size>0?d.failures.filter(f=>!m.removedIds.has(f.translationId)):d.failures}}}}function ck(n,r,s,l){const d=n.sessions[r]??Ns(s);return{...n,sessions:{...n.sessions,[r]:{...d,role:s,failures:l}}}}function uk(n,r){return n.taskSlug===r?n:Th(r)}function Ns(n){return{role:n,status:"ready",entries:[],failures:[]}}function bv(n,r){return n.findIndex(l=>l.id===r.id)===-1?[...n,r]:n.map(l=>l.id===r.id?r:l)}function Cv(n){if(n.length<=ch)return{entries:n,removedIds:new Set};const r=n.slice(0,n.length-ch);return{entries:n.slice(-ch),removedIds:new Set(r.map(s=>s.id))}}const hk={"project-manager":"bypassPermissions",architect:"bypassPermissions",coder:"bypassPermissions",reviewer:"bypassPermissions","gate-reviewer":"bypassPermissions",translator:"bypassPermissions","harness-engineer":"bypassPermissions"},fk={"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"default","harness-engineer":"default"},dk={"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"medium","harness-engineer":"medium"};function pk({task:n,activeRole:r,gateReviewerEnabled:s,translationEnabled:l,translationAutoSendEnabled:d,translationTargetLanguage:m,launchTemplate:f,refreshNonce:o=0,onTaskChanged:c,onActiveRoleChange:h,onMessagesChanged:p,onOrchestrationChanged:u,onRoundStateChanged:v,onEventsChanged:C,onLaunchStateChanged:T}){const[E,b]=te.useState(null),[y,_]=te.useState(()=>Fg(f)),[S,A]=te.useState(()=>qg(f)),[L,D]=te.useState(()=>$g(f)),[R,k]=te.useState(!1),[,M]=zi(""),[B,H]=te.useState([]),[U,P]=te.useState(null),[K,Y]=te.useState(()=>Th(n.taskSlug)),G=te.useRef(""),W=te.useRef(1),Z=te.useMemo(()=>JSON.stringify(f),[f]),z=!!(E!=null&&E.sessions.some(pe=>pe.role==="gate-reviewer")),j=s||z,N=[...Wa,...j?[Jg]:[]],$=te.useCallback((pe,se)=>{P(se),p==null||p(pe),u==null||u(se)},[p,u]),I=te.useCallback((pe,se,we,je)=>{b(pe),$(se,we),v==null||v(je)},[$,v]),re=te.useCallback(async()=>{const pe=await ye.getTaskWorkspaceState(n.taskSlug);I(pe.taskStatus,pe.messages,pe.orchestration,pe.roundState),Do("Poll task workspace state"),M(se=>xo(se,["Load task workspace state","Poll task workspace state"]))},[I,n.taskSlug]),ve=te.useCallback((pe,se)=>{const we=_v(pe,se);we&&M(we)},[]);Xa(`task-workspace:${n.taskSlug}:${o}`,()=>re().catch(pe=>{ve("Poll task workspace state",pe)}),{intervalMs:3e3,runImmediately:!0}),Xa(l?`task-translation-feed:${n.taskSlug}`:null,async()=>{try{const pe=await ye.pollTranslationTaskFeed(n.taskSlug,W.current);W.current=pe.nextCursor,Y(se=>ak(se,pe)),Do("Poll task translation feed"),M(se=>xo(se,["Poll task translation feed"]))}catch(pe){ve("Poll task translation feed",pe)}},{intervalMs:1e3,runImmediately:!0}),te.useEffect(()=>{H([]),C==null||C([])},[C,n.taskSlug]),te.useEffect(()=>{W.current=1,Y(Th(n.taskSlug))},[n.taskSlug]),te.useEffect(()=>{_(Fg(f)),A(qg(f)),D($g(f))},[Z,n.taskSlug]),te.useEffect(()=>{E&&!j&&r==="gate-reviewer"&&h("project-manager"),E&&r==="translator"&&h("project-manager")},[r,j,h,E]),te.useEffect(()=>{const pe=E==null?void 0:E.task;if(!pe||pe.taskSlug!==n.taskSlug)return;const se=Pg(pe);if(se===Pg(n)){G.current="";return}G.current!==se&&(G.current=se,c().catch(we=>{G.current="",M(dt("Refresh task list after task status changed",we))}))},[c,E==null?void 0:E.task,n]),te.useEffect(()=>{const pe=(E==null?void 0:E.sessions)??[],se=pe.filter(Pe=>mk(Pe.role)),we=new Set(se.map(Pe=>Pe.role)),je=pe.some(Pe=>Pe.role==="gate-reviewer"),ze={};for(const Pe of Hs)ze[Pe.name]={permissionMode:y[Pe.name],model:S[Pe.name],effort:L[Pe.name]};T==null||T({taskSlug:n.taskSlug,roles:ze,autoOrchestration:((U==null?void 0:U.mode)??"auto")==="auto",statusLoaded:!!E,sessionCount:se.length,hasAnySession:se.length>0,hasGateReviewerSession:je,allRolesHaveSession:Wa.every(Pe=>we.has(Pe.name))})},[S,L,T,U==null?void 0:U.mode,y,E,n.taskSlug]);async function me(pe,se="Run role session action"){k(!0),M("");try{await pe(),await re(),await c()}catch(we){M(dt(se,we))}finally{k(!1)}}function Q(pe){H(se=>{const we=[...se,`${new Date().toLocaleTimeString()} ${pe}`];return C==null||C(we),we})}function q(pe,se){_(we=>({...we,[pe]:se}))}function ee(pe,se){A(we=>({...we,[pe]:se}))}function ae(pe,se){D(we=>({...we,[pe]:se}))}return x.jsxs("div",{className:"task-workspace",children:[x.jsxs("header",{className:"workspace-header",children:[x.jsx("div",{className:"workspace-title-line",children:x.jsx("h1",{children:n.title||n.taskSlug})}),x.jsx(ik,{activeRole:r,roles:N,sessions:(E==null?void 0:E.sessions)??[],onSelect:h})]}),x.jsx("div",{className:"workspace-grid",children:x.jsx("div",{className:"workspace-main",children:x.jsx("div",{className:"role-console-stack",children:N.map(pe=>{const se=pe.name,we=se===r,je=(E==null?void 0:E.sessions)??[],ze=Sv(je,se),Pe=ze?sk(K,ze.id,se):void 0;return x.jsx("div",{className:we?"role-console-panel is-active":"role-console-panel","aria-hidden":!we,children:x.jsx(rk,{role:se,session:ze,permissionMode:y[se],model:S[se],effort:L[se],active:we,busy:R,translationEnabled:l,translationAutoSendEnabled:d,translationTargetLanguage:m,translationPanelState:Pe,onClearTranslationSession:(xe,xt)=>{Y(yt=>lk(yt,xe,xt))},onTranslationEntry:(xe,xt,yt)=>{Y(Nt=>ok(Nt,xe,xt,yt))},onTranslationFailures:(xe,xt,yt)=>{Y(Nt=>ck(Nt,xe,xt,yt))},onPermissionModeChange:xe=>q(se,xe),onModelChange:xe=>ee(se,xe),onEffortChange:xe=>ae(se,xe),onStart:()=>void me(async()=>{await ye.startRoleSession(n.taskSlug,se,{cols:100,rows:28,permissionMode:y[se],model:S[se],effort:L[se]}),Q(`started ${se} with ${y[se]} / ${S[se]} / ${L[se]}`)},`Start ${se} session`),onResume:()=>void me(async()=>{await ye.resumeRoleSession(n.taskSlug,se,{cols:100,rows:28,permissionMode:y[se],model:S[se],effort:L[se]}),Q(`resumed ${se} with ${y[se]} / ${S[se]} / ${L[se]}`)},`Resume ${se} session`),onStop:()=>void me(async()=>{await ye.stopRoleSession(n.taskSlug,se),Q(`stopped ${se}`)},`Stop ${se} session`),onRestart:()=>void me(async()=>{await ye.restartRoleSession(n.taskSlug,se,{cols:100,rows:28,permissionMode:y[se],model:S[se],effort:L[se]}),Q(`restarted ${se} with ${y[se]} / ${S[se]} / ${L[se]}`)},`Restart ${se} session`),onNotifyHarnessUpdated:()=>void me(async()=>{await ye.notifyRoleHarnessUpdated(n.taskSlug,se),Q(`notified ${se} to reload latest harness`)},`Notify ${se} to reload harness`),onTerminalEvent:xe=>Q(`${pe.label}: ${xe}`)})},se)})})})})]})}function mk(n){return Wa.some(r=>r.name===n)}function Pg(n){return[n.status,n.updatedAt,n.cleanupStatus??"",n.cleanedAt??""].join(":")}function Fg(n){var s;const r={...hk};for(const l of Hs)r[l.name]=((s=n.roles[l.name])==null?void 0:s.permissionMode)??r[l.name];return r}function qg(n){var s;const r={...fk};for(const l of Hs)r[l.name]=((s=n.roles[l.name])==null?void 0:s.model)??r[l.name];return r}function $g(n){var s;const r={...dk};for(const l of Hs)r[l.name]=((s=n.roles[l.name])==null?void 0:s.effort)??r[l.name];return r}const gk=120*1e3,Gg=1400,_k=3;function vk(n){return!!(n!=null&&n.initialized)}function yk(){const[n,r]=te.useState(null),[s,l]=te.useState([]),[d,m]=te.useState(null),[f,o]=te.useState(null),[c,h]=te.useState(null),[p,u]=te.useState(null),[v,C]=te.useState(null),[T,E]=te.useState(null),[b,y]=te.useState(null),[_,S]=te.useState(null),[A,L]=te.useState(null),[D,R]=te.useState(!1),[k,M]=te.useState(null),[B,H]=te.useState(null),[U,P]=te.useState(!1),[K,Y]=te.useState([]),[G,W]=te.useState(null),[Z,z]=te.useState(null),[j,N]=te.useState(null),[$,I]=te.useState(null),[re,ve]=te.useState(null),[me,Q]=te.useState(null),[q,ee]=te.useState("project-manager"),[ae,pe]=te.useState("system"),[se,we]=te.useState(!0),[je,ze]=te.useState(!0),[Pe,xe]=te.useState("off"),[xt,yt]=te.useState(!1),[Nt,Gt]=te.useState(!1),[Sn,St]=te.useState(!1),[tt,Lt]=te.useState(J0),[he,Se]=te.useState(Z0),[Ae,Le]=te.useState(!1),[Oe,ut]=te.useState(!1),[Fe,gt]=te.useState(!1),[mt,Ot]=te.useState(!1),[Ze,Qt]=te.useState(!1),[Et,bn]=te.useState(null),[Ln,ri]=te.useState("bypassPermissions"),[On,Bt]=te.useState("default"),[Bn,Wn]=te.useState("medium"),[si,rn]=te.useState(null),[jn,sn]=te.useState("bypassPermissions"),[an,Ui]=te.useState("default"),[Ne,Pi]=te.useState("medium"),[qr,Us]=te.useState(()=>t1()),[Kn,el]=te.useState(null),[ai,kt]=te.useState(0),[It,Yn]=te.useState(null),[Ps,Io]=te.useState(null),[tl,nl]=te.useState(!1),[Nn,$r]=te.useState(!1),[,ln]=zi(""),mi=te.useRef({}),gi=te.useRef({}),_i=te.useRef({}),bt=te.useRef({}),Fs=te.useRef({}),Xn=te.useRef(null),Qn=te.useRef(""),ie=te.useMemo(()=>w2(K,G),[K,G]),on=(Kn==null?void 0:Kn.taskSlug)===(ie==null?void 0:ie.taskSlug)?Kn:null,Gr=c===(ie==null?void 0:ie.taskSlug)?d:null,qs=p===(ie==null?void 0:ie.taskSlug)?f:null,Uo=!!(n&&ie&&vk(Gr)),Vr=(Et==null?void 0:Et.status)==="running",vi=!!(b!=null&&b.enabled),Hn=!!(Nt&&Uo&&Vr),cn=!!(on!=null&&on.statusLoaded),il=!!(ie&&(on!=null&&on.statusLoaded)&&!on.hasAnySession),Jt=te.useCallback(V=>{pe(V.themeMode),we(V.flowPauseAlerts),ze(V.roleRetryEnabled),xe(V.permissionRequestMode),yt(V.autoTaskHarnessReviewEnabled),Gt(V.translationEnabled),St(V.translationAutoSendEnabled),Lt(V.translationTargetLanguage),Se(V.translationOutputMode),Us(V.launchTemplate)},[]);te.useEffect(()=>{if(!se)return;let V=!1;const fe=()=>{V||(V=!0,Vg(),window.removeEventListener("pointerdown",fe),window.removeEventListener("keydown",fe))};return window.addEventListener("pointerdown",fe),window.addEventListener("keydown",fe),()=>{window.removeEventListener("pointerdown",fe),window.removeEventListener("keydown",fe)}},[se]);const Ht=te.useCallback(()=>{Xn.current!==null&&(window.clearInterval(Xn.current),Xn.current=null)},[]),$s=te.useCallback(()=>{Ht(),bo(),Xn.current=window.setInterval(()=>{bo()},Gg)},[Ht]),_r=te.useCallback(()=>{Ht();let V=1;bo(),Xn.current=window.setInterval(()=>{V+=1,bo(),V>=_k&&Xn.current!==null&&(window.clearInterval(Xn.current),Xn.current=null)},Gg)},[Ht]),rl=te.useCallback((V,fe=`manual-${Date.now()}`,qe={})=>{Yn({id:fe,text:V}),qe.sound==="strong"?$s():qe.sound==="weak"?_r():Ht()},[_r,$s,Ht]),un=te.useCallback(()=>{Ht(),Yn(null)},[Ht]);te.useEffect(()=>{ie!=null&&ie.taskSlug&&(Fs.current[ie.taskSlug]=Date.now())},[ie==null?void 0:ie.taskSlug]);const Gs=te.useCallback(V=>{ie!=null&&ie.taskSlug&&z({taskSlug:ie.taskSlug,messages:V})},[ie==null?void 0:ie.taskSlug]),sl=te.useCallback(V=>{_i.current[V.taskSlug]=V.mode,ie!=null&&ie.taskSlug&&N({taskSlug:ie.taskSlug,orchestration:V})},[ie==null?void 0:ie.taskSlug]),Vs=te.useCallback(V=>{ie!=null&&ie.taskSlug&&I({taskSlug:ie.taskSlug,events:V})},[ie==null?void 0:ie.taskSlug]),Fi=te.useCallback(V=>{if(!(ie!=null&&ie.taskSlug)||V.taskSlug!==ie.taskSlug)return;ve({taskSlug:V.taskSlug,roundState:V});const fe=x2({mode:_i.current[V.taskSlug],status:V.status,activeRole:V.activeRole,lastFollowedRole:bt.current[V.taskSlug]});fe&&(bt.current[V.taskSlug]=fe,ee(fe));const qe=E2(V,kk);if(qe===null){gi.current[V.taskSlug]={status:V.status};return}const fn=k2(V),br=mi.current[V.taskSlug],Zr=gi.current[V.taskSlug];if(gi.current[V.taskSlug]={status:V.status},br===fn||(mi.current[V.taskSlug]=fn,!wk(V,Zr,Fs.current[V.taskSlug])))return;if(vi){Ht(),Yn(null);return}const hl=se?Ck(V)>=gk?"strong":"weak":"none";rl(qe,fn,{sound:hl})},[ie==null?void 0:ie.taskSlug,vi,se,rl,Ht]),al=te.useCallback(V=>{el(fe=>(fe==null?void 0:fe.taskSlug)===V.taskSlug&&fe.statusLoaded===V.statusLoaded&&fe.sessionCount===V.sessionCount&&fe.hasAnySession===V.hasAnySession&&fe.hasGateReviewerSession===V.hasGateReviewerSession&&fe.allRolesHaveSession===V.allRolesHaveSession&&fe.autoOrchestration===V.autoOrchestration&&JSON.stringify(fe.roles)===JSON.stringify(V.roles)?fe:V)},[]);async function yi(){const V=await ye.listTasks();return Y(V),W(fe=>{var qe;return fe&&V.some(fn=>fn.taskSlug===fe)?fe:((qe=V[0])==null?void 0:qe.taskSlug)??null}),V}async function li(V=ie==null?void 0:ie.taskSlug){if(!V)return m(null),h(null),null;const fe=await ye.getHarnessStatus(V);return m(fe),h(V),fe}async function Ws(V=ie==null?void 0:ie.taskSlug){if(!V)return o(null),u(null),null;const fe=await ye.getHarnessBootstrapStatus(V);return o(fe),u(V),fe}async function Si(){const V=await ye.getGatewayStatus();return y(V),V}async function ll(){const V=await ye.getRecentRepositoryPaths();return l(V),V}async function Wr(){if(!n)return Le(!1),!1;const V=await ye.getTranslationState();return Le(V.memoryInitialized),V.memoryInitialized}async function Ks(V){const[fe,qe]=await Promise.all([ye.listMessages(V),ye.getOrchestrationState(V)]);z({taskSlug:V,messages:fe}),N({taskSlug:V,orchestration:qe})}async function ol(V){const fe=await ye.getGateReviewState(V);return Q({taskSlug:V,state:fe}),Do("Poll Gate Review state"),ln(qe=>xo(qe,["Refresh Gate Review state","Poll Gate Review state"])),fe}function vr(V,fe){const qe=_v(V,fe);qe&&ln(qe)}function Vt(V){V&&(ri(V.permissionMode),V.model&&Bt(V.model),V.effort&&Wn(V.effort))}async function Kr(V={}){const fe=await ye.getTranslatorSession();return bn(fe),V.syncLaunchOptions&&Vt(fe),fe}function oi(V){V&&(sn(V.permissionMode),V.model&&Ui(V.model),V.effort&&Pi(V.effort))}async function Zt(V={}){const fe=await ye.getHarnessEngineerSession();return rn(fe),V.syncLaunchOptions&&oi(fe),fe}function qi(V,fe,qe={}){var fn;bn(V.translatorSession),Le(!!((fn=V.translationState)!=null&&fn.memoryInitialized)),rn(V.harnessEngineerSession),E(V.harnessFeedbackState),y(V.gatewayStatus),fe&&V.harnessStatus?(m(V.harnessStatus),h(fe)):(m(null),h(null)),fe&&V.harnessBootstrapStatus?(o(V.harnessBootstrapStatus),u(fe)):(o(null),u(null)),qe.syncLaunchOptions&&(Vt(V.translatorSession),oi(V.harnessEngineerSession))}async function cl(V={}){if(!n)return bn(null),Le(!1),rn(null),m(null),o(null),h(null),u(null),E(null),null;const fe=(ie==null?void 0:ie.taskSlug)??null,qe=await ye.getProjectRuntimeState(fe);return qi(qe,fe,V),qe}function Ys(){const V=["Poll project runtime state","Load project runtime state","Refresh Harness feedback state","Poll Harness feedback state","Load Translator session","Poll Translator session","Poll translation memory status","Load Harness Engineer session","Poll Harness Engineer session","Load VCM Harness status","Poll VCM Harness status"];for(const fe of V)Do(fe);ln(fe=>xo(fe,V))}te.useEffect(()=>{Promise.all([ye.getCurrentProject(),ye.getRecentRepositoryPaths(),ye.getAppPreferences(),ye.getGatewayStatus()]).then(async([V,fe,qe,fn])=>{r(V),l(fe),y(fn),Jt(qe),V&&await yi()}).catch(V=>ln(dt("Load initial app data",V)))},[Jt]),te.useEffect(()=>{const V=window.matchMedia("(prefers-color-scheme: dark)"),fe=()=>nl(V.matches);return fe(),V.addEventListener("change",fe),()=>V.removeEventListener("change",fe)},[]),te.useEffect(()=>()=>Ht(),[Ht]),te.useEffect(()=>{vi&&(Ht(),Yn(null))},[vi,Ht]),te.useEffect(()=>{const V=ae==="system"?tl?"dark":"light":ae;document.documentElement.dataset.theme=V,document.documentElement.dataset.themeMode=ae},[tl,ae]),te.useEffect(()=>{if(!(ie!=null&&ie.taskSlug)){Q(null);return}ol(ie.taskSlug).catch(V=>ln(dt("Refresh Gate Review state",V)))},[ie==null?void 0:ie.taskSlug]),te.useEffect(()=>{Qn.current="",bn(null),ri("bypassPermissions"),Bt("default"),Wn("medium"),Le(!1),rn(null),sn("bypassPermissions"),Ui("default"),Pi("medium"),m(null),o(null),h(null),u(null),E(null)},[n==null?void 0:n.repoRoot]),Xa(n?`project-runtime:${n.repoRoot}:${(ie==null?void 0:ie.taskSlug)??"no-task"}`:null,async()=>{try{const V=(n==null?void 0:n.repoRoot)??"",fe=!!(n&&Qn.current!==V);await cl({syncLaunchOptions:fe}),fe&&(Qn.current=V),Ys()}catch(V){vr("Poll project runtime state",V)}},{intervalMs:3e3,runImmediately:!0});const hn=(ie==null?void 0:ie.taskSlug)??null,bi=hn&&(me==null?void 0:me.taskSlug)===hn?me.state:null,Cn=hn&&(re==null?void 0:re.taskSlug)===hn?re.roundState:null,yr=hn&&(Kn==null?void 0:Kn.taskSlug)===hn?Kn:null,Sr=!!(hn&&(bi!=null&&bi.activeGate||(Cn==null?void 0:Cn.activeRole)==="gate-reviewer"||yr!=null&&yr.hasGateReviewerSession));Xa(Sr&&hn?`gate-review:${hn}`:null,async()=>{if(hn)try{await ol(hn)}catch(V){vr("Poll Gate Review state",V)}},{intervalMs:3e3,runImmediately:!1});async function ke(V,fe="Run UI action"){$r(!0),ln("");try{await V()}catch(qe){ln(dt(fe,qe))}finally{$r(!1)}}async function Xs(){if(!ie)throw new Error("Create or select a task before closing it.");const V=[`Close task "${ie.taskSlug}"?`,"","This is destructive:","- stops VCM-managed running role sessions for this task","- moves project-scoped Translator and Harness Engineer sessions to the base repository cwd",`- deletes the task worktree: ${ie.worktreePath}`,`- deletes the Git branch: ${ie.branch}`,"- deletes VCM task/session/message/orchestration state","","VCM will not check running sessions or uncommitted changes before closing."].join(`
|
|
96
|
-
`);window.confirm(V)&&(await ye.cleanupTask(ie.taskSlug,{force:!0,forceDeleteBranch:!0}),W(null),z(null),N(null),I(null),ve(null),Q(null),kt(qe=>qe+1),await yi())}const Yr=Z&&Z.taskSlug===(ie==null?void 0:ie.taskSlug)?Z.messages:[],ul=j&&j.taskSlug===(ie==null?void 0:ie.taskSlug)?j.orchestration:null,Xr=$&&$.taskSlug===(ie==null?void 0:ie.taskSlug)?$.events:[],en=re&&re.taskSlug===(ie==null?void 0:ie.taskSlug)?re.roundState:null,Qr=ie!=null&&ie.taskSlug&&(en!=null&&en.roleRecovery)?xk(ie.taskSlug,en.roleRecovery):null,Ut=en!=null&&en.roleRecovery&&en.roleRecovery.status!=="failed"&&Qr!==Ps?Ek(en.roleRecovery):null,Jn=me&&me.taskSlug===(ie==null?void 0:ie.taskSlug)?me.state:null,Jr=!!(Jn&&Object.values(Jn.gates).some(V=>V.required));return x.jsxs(n1,{sidebar:x.jsx(P2,{project:n,recentRepositoryPaths:s,tasks:K,activeTaskSlug:(ie==null?void 0:ie.taskSlug)??null,messages:Yr,orchestration:ul,events:Xr,roundState:en,gateReview:Jn,translationEnabled:Hn,translationAutoSendEnabled:Sn,translationTargetLanguage:tt,translationOutputMode:he,translationMemoryInitialized:Ae,translatorSession:Et,harnessStatus:Gr,harnessBootstrapStatus:qs,harnessApplyResult:v,autoTaskHarnessReviewEnabled:xt,gatewayStatus:b,gatewayQrLogin:_,gatewayQrCheck:A,gatewayLarkRegistration:k,gatewayLarkRegistrationCheck:B,busy:Nn,onConnect:V=>ke(async()=>{const fe=await ye.connectProject({repoPath:V});r(fe),C(null),await Promise.all([yi(),ll()])},"Connect repository"),onRefreshConnectedRepository:()=>ke(async()=>{const V=await ye.getCurrentProject();r(V)},"Refresh connected repository"),onPullConnectedRepository:()=>ke(async()=>{const V=await ye.pullCurrentProject();r(V)},"Pull connected repository"),onRefreshHarness:()=>ke(async()=>{if(!ie)throw new Error("Create or select a task before refreshing VCM Harness.");C(null),await Promise.all([li(ie.taskSlug),Ws(ie.taskSlug)])},"Refresh VCM Harness"),onApplyHarness:()=>ke(async()=>{if(!ie)throw new Error("Create or select a task before applying VCM Harness.");const V=await ye.applyHarness({taskSlug:ie.taskSlug});C(V),await Promise.all([li(ie.taskSlug),Ws(ie.taskSlug)])},"Apply VCM Harness"),onStartHarnessBootstrap:V=>ke(async()=>{if(!ie)throw new Error("Create or select a task before starting Harness Bootstrap.");const fe=await ye.startHarnessBootstrap({taskSlug:ie.taskSlug,cols:120,rows:32,...V});o(fe.status),u(ie.taskSlug),await Zt({syncLaunchOptions:!0})},"Start Harness Bootstrap"),onRestartHarnessBootstrap:V=>ke(async()=>{if(!ie)throw new Error("Create or select a task before restarting Harness Bootstrap.");const fe=await ye.restartHarnessBootstrap({taskSlug:ie.taskSlug,cols:120,rows:32,...V});o(fe.status),u(ie.taskSlug),await Zt({syncLaunchOptions:!0})},"Restart Harness Bootstrap"),onStopHarnessBootstrap:()=>ke(async()=>{const V=await ye.stopHarnessBootstrap();o(V),u((ie==null?void 0:ie.taskSlug)??null),await Zt()},"Stop Harness Bootstrap"),onRunHarnessBootstrap:()=>ke(async()=>{if(!ie)throw new Error("Create or select a task before running Harness Bootstrap.");const V=await ye.runHarnessBootstrap({taskSlug:ie.taskSlug});o(V.status),u(ie.taskSlug),await Zt()},"Run Harness Bootstrap"),onOpenHarnessStudio:()=>Ot(!0),onOpenRepositoryDiff:()=>Qt(!0),onAutoTaskHarnessReviewChange:V=>{yt(V),ke(async()=>{const fe=await ye.updateAppPreferences({autoTaskHarnessReviewEnabled:V});Jt(fe)},"Update auto task harness review setting")},onRefreshGateway:()=>ke(async()=>{await Si()},"Refresh Gateway status"),onGatewayEnabledChange:V=>{ke(async()=>{const fe=await ye.updateGatewaySettings({enabled:V,...V&&n?{currentProjectId:n.repoRoot,currentTaskSlug:(ie==null?void 0:ie.taskSlug)??null}:{}});y(fe),V&&Jt(await ye.getAppPreferences())},"Update Gateway enabled setting")},onGatewaySettingsChange:V=>ke(async()=>{const fe=await ye.updateGatewaySettings(V);y(fe)},"Update Gateway settings"),onGatewayTranslationChange:V=>{ke(async()=>{const fe=await ye.updateGatewaySettings({translationEnabled:V});y(fe)},"Update Gateway translation setting")},onGatewayConnectionChange:V=>{ke(async()=>{const fe=await ye.setGatewayConnection(V);y(fe)},"Update Gateway connection setting")},onStartGatewayQrLogin:()=>{ke(async()=>{const V=await ye.startGatewayQrLogin();S(V),L(null),R(!0),await Si()},"Start Gateway QR login")},onStartGatewayLarkRegistration:()=>{ke(async()=>{const V=await ye.startGatewayLarkRegistration();M(V),H(null),P(!0),await Si()},"Start Lark Gateway QR setup")},onResetGatewayBinding:()=>{ke(async()=>{const V=await ye.resetGatewayBinding();y(V),S(null),L(null),R(!1),M(null),H(null),P(!1)},"Reset Gateway binding")},onGateReviewGateEnabledChange:(V,fe)=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before changing Gate Review Gates.");const qe=await ye.updateGateReviewSettings(ie.taskSlug,{gates:{[V]:fe}});Q({taskSlug:ie.taskSlug,state:qe})},`Update ${V} Gate Review setting`)},onTranslationEnabledChange:V=>{Gt(V),ke(async()=>{const fe=await ye.updateAppPreferences({translationEnabled:V});Jt(fe)},"Update conversation translation setting")},onTranslationAutoSendChange:V=>{St(V),ke(async()=>{const fe=await ye.updateAppPreferences({translationAutoSendEnabled:V});Jt(fe)},"Update translation auto-send setting")},onTranslationTargetLanguageChange:V=>{Lt(V),ke(async()=>{const fe=await ye.updateAppPreferences({translationTargetLanguage:V});Jt(fe)},"Update translation target language")},onTranslationOutputModeChange:V=>{Se(V),ke(async()=>{const fe=await ye.updateAppPreferences({translationOutputMode:V});Jt(fe)},"Update translation output mode")},onOpenFileTranslation:()=>ut(!0),onOpenTranslatorSession:()=>gt(!0),onCreateTranslationBootstrap:()=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before running Translation Bootstrap.");await ye.createTranslationBootstrap({taskSlug:ie.taskSlug,targetLanguage:tt}),await Wr(),await Kr()},"Create Translation Bootstrap task")},onUpdateTranslationMemory:()=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before updating translation memory.");await ye.createTranslationMemoryUpdate({taskSlug:ie.taskSlug,targetLanguage:tt}),await Wr(),await Kr()},"Create translation memory update task")},onCreateTask:V=>ke(async()=>{const fe=await ye.createTask(V);await yi(),W(fe.taskSlug)},"Create task"),onCloseTask:()=>{ke(Xs,"Close task")},onSelectTask:W,themeMode:ae,onAutoOrchestrationChange:V=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before changing auto orchestration.");const fe=await ye.updateOrchestrationState(ie.taskSlug,{mode:V?"auto":"manual"});N({taskSlug:ie.taskSlug,orchestration:fe})},"Update auto orchestration mode")},onThemeModeChange:V=>{pe(V),ke(async()=>{const fe=await ye.updateAppPreferences({themeMode:V});Jt(fe)},"Update theme setting")},pauseAlertSound:se,onPauseAlertSoundChange:V=>{we(V),V&&Vg(),ke(async()=>{const fe=await ye.updateAppPreferences({flowPauseAlerts:V});Jt(fe)},"Update pause alert sound setting")},roleRetryEnabled:je,onRoleRetryEnabledChange:V=>{ze(V),ke(async()=>{const fe=await ye.updateAppPreferences({roleRetryEnabled:V});Jt(fe)},"Update CC retry setting")},permissionRequestMode:Pe,onPermissionRequestModeChange:V=>{xe(V),ke(async()=>{const fe=await ye.updateAppPreferences({permissionRequestMode:V});Jt(fe)},"Update permission request setting")},launchTemplate:qr,canSaveLaunchTemplate:cn,canOneClickStart:il,onSaveLaunchTemplate:()=>{ke(async()=>{if(!(on!=null&&on.statusLoaded))throw new Error("Open a task workspace before saving a launch template.");const V=await ye.updateAppPreferences({launchTemplate:{version:1,roles:on.roles,autoOrchestration:on.autoOrchestration}});Jt(V)},"Save launch template")},onOneClickStart:()=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before one-click start.");const V=await ye.oneClickStart(ie.taskSlug);N({taskSlug:ie.taskSlug,orchestration:V.orchestration}),ee("project-manager"),await Ks(ie.taskSlug),await yi(),kt(fe=>fe+1)},"One-click start role sessions")},onMarkAllMessagesDone:V=>{ke(async()=>{const fe=await ye.markAllMessagesDone(V);z({taskSlug:V,messages:fe.messages}),await Ks(V)},"Mark all role messages done")},onDeleteMessageHistory:V=>{ke(async()=>{const fe=await ye.deleteMessageHistory(V);z({taskSlug:V,messages:fe.messages}),await Ks(V)},"Delete role message history")}}),children:[x.jsx(b2,{}),It?x.jsx("div",{className:"flow-pause-alert-backdrop",children:x.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:[x.jsx("p",{className:"flow-pause-alert-kicker",children:"VCM needs attention"}),x.jsx("h2",{id:"flow-pause-alert-title",children:"Flow needs attention"}),x.jsx("p",{id:"flow-pause-alert-body",children:It.text}),x.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."}),x.jsx("button",{type:"button",autoFocus:!0,onClick:un,children:"Confirm"})]})}):null,Ut&&Qr?x.jsxs("div",{className:"role-recovery-toast",role:"status",children:[x.jsx("span",{children:Ut}),x.jsx("button",{type:"button",onClick:()=>Io(Qr),children:"Close"})]}):null,D&&_?x.jsx(Sk,{busy:Nn,qrCheck:A,qrLogin:_,onCheck:()=>{ke(async()=>{const V=await ye.checkGatewayQrLogin();L(V),(V.status==="confirmed"||V.status==="binded_redirect")&&R(!1),await Si()})},onClose:()=>R(!1)}):null,U&&k?x.jsx(bk,{busy:Nn,registration:k,registrationCheck:B,onCheck:()=>{ke(async()=>{const V=await ye.checkGatewayLarkRegistration();H(V),V.gatewayStatus&&y(V.gatewayStatus),V.status==="confirmed"&&(P(!1),await Si())},"Check Lark Gateway QR setup")},onManualBind:(V,fe)=>{ke(async()=>{const qe=await ye.bindGatewayLarkApp({appId:V,appSecret:fe,larkDomain:"lark"});H(qe),qe.gatewayStatus&&y(qe.gatewayStatus),qe.status==="confirmed"&&(P(!1),await Si())},"Bind Lark Gateway app")},onClose:()=>P(!1)}):null,n&&ie?x.jsx(pk,{task:ie,activeRole:q,gateReviewerEnabled:Jr,translationEnabled:Hn,translationAutoSendEnabled:Sn,translationTargetLanguage:tt,launchTemplate:qr,refreshNonce:ai,onTaskChanged:async()=>{await yi()},onActiveRoleChange:ee,onMessagesChanged:Gs,onOrchestrationChanged:sl,onRoundStateChanged:Fi,onEventsChanged:Vs,onLaunchStateChanged:al}):x.jsxs("section",{className:"empty-workspace",children:[x.jsx("h1",{children:n?"Create a task to open the workspace":"Connect a repository to begin"}),x.jsx("p",{children:n?"Tasks create local role commands and handoff artifacts for the selected repository.":"VibeCodingMaster will create a local task workspace, role sessions, and handoff artifacts."})]}),x.jsx(o2,{open:Oe,taskSlug:(ie==null?void 0:ie.taskSlug)??null,targetLanguage:tt,onClose:()=>ut(!1)}),x.jsx(x1,{open:mt,busy:Nn,status:Gr,bootstrapStatus:qs,engineerSession:si,permissionMode:jn,model:an,effort:Ne,taskSlug:(ie==null?void 0:ie.taskSlug)??null,onClose:()=>Ot(!1),onRefresh:()=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before refreshing Harness Studio.");await Promise.all([li(ie.taskSlug),Ws(ie.taskSlug),Zt()])},"Refresh Harness Studio")},onPermissionModeChange:sn,onModelChange:Ui,onEffortChange:Pi,onEngineerStart:()=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before starting Harness Engineer.");const V=await ye.startHarnessEngineerSession({taskSlug:ie.taskSlug,cols:120,rows:32,permissionMode:jn,model:an,effort:Ne});rn(V),oi(V)},"Start Harness Engineer")},onEngineerResume:()=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before resuming Harness Engineer.");const V=await ye.resumeHarnessEngineerSession({taskSlug:ie.taskSlug,cols:120,rows:32,permissionMode:jn,model:an,effort:Ne});rn(V),oi(V)},"Resume Harness Engineer")},onEngineerRestart:()=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before restarting Harness Engineer.");const V=await ye.restartHarnessEngineerSession({taskSlug:ie.taskSlug,cols:120,rows:32,permissionMode:jn,model:an,effort:Ne});rn(V),oi(V)},"Restart Harness Engineer")},onEngineerStop:()=>{ke(async()=>{const V=await ye.stopHarnessEngineerSession();rn(V)},"Stop Harness Engineer")},onEngineerNotifyHarnessUpdated:()=>{ke(async()=>{const V=await ye.notifyHarnessEngineerHarnessUpdated();rn(V),oi(V)},"Notify Harness Engineer to reload harness")},onOpenRepositoryDiff:()=>Qt(!0),onReviewTaskHarness:()=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before reviewing task harness.");const V=await ye.startTaskHarnessRetrospective({taskSlug:ie.taskSlug,trigger:"manual"});E(V),await Zt({syncLaunchOptions:!0})},"Review task harness")}}),x.jsx(k1,{open:Ze,taskSlug:(ie==null?void 0:ie.taskSlug)??null,onClose:()=>Qt(!1)}),x.jsx(M1,{open:Fe,busy:Nn,session:Et,permissionMode:Ln,model:On,effort:Bn,onClose:()=>gt(!1),onPermissionModeChange:ri,onModelChange:Bt,onEffortChange:Wn,onStart:()=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before starting Translator.");const V=await ye.startTranslatorSession({taskSlug:ie.taskSlug,cols:100,rows:28,permissionMode:Ln,model:On,effort:Bn});bn(V),Vt(V)},"Start Translator session")},onResume:()=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before resuming Translator.");const V=await ye.resumeTranslatorSession({taskSlug:ie.taskSlug,cols:100,rows:28,permissionMode:Ln,model:On,effort:Bn});bn(V),Vt(V)},"Resume Translator session")},onRestart:()=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before restarting Translator.");const V=await ye.restartTranslatorSession({taskSlug:ie.taskSlug,cols:100,rows:28,permissionMode:Ln,model:On,effort:Bn});bn(V),Vt(V)},"Restart Translator session")},onStop:()=>{ke(async()=>{const V=await ye.stopTranslatorSession();bn(V)},"Stop Translator session")},onNotifyHarnessUpdated:()=>{ke(async()=>{const V=await ye.notifyTranslatorHarnessUpdated();bn(V),Vt(V)},"Notify Translator to reload harness")}}),x.jsx(i1,{busy:Nn,state:T,onCancel:V=>{ke(async()=>{const fe=await ye.decideHarnessFeedback({action:"cancel",taskSlug:ie==null?void 0:ie.taskSlug,comment:V});E(fe)},"Cancel Harness feedback")},onApprove:V=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before approving Harness feedback.");const fe=await ye.decideHarnessFeedback({action:"approve",taskSlug:ie.taskSlug,comment:V});E(fe),await Zt()},"Approve Harness feedback")},onComment:V=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before sending Harness feedback comments.");const fe=await ye.decideHarnessFeedback({action:"comment",taskSlug:ie.taskSlug,comment:V});E(fe),await Zt()},"Send Harness feedback comment")},onReject:V=>{ke(async()=>{const fe=await ye.decideHarnessFeedback({action:"reject",taskSlug:ie==null?void 0:ie.taskSlug,comment:V});E(fe)},"Reject Harness feedback")}})]})}function Sk({busy:n,onCheck:r,onClose:s,qrCheck:l,qrLogin:d}){const[m,f]=te.useState(""),[o,c]=zi("");return te.useEffect(()=>{let h=!1;if(c(""),f(""),d.qrcodeUrl.startsWith("data:image/")){f(d.qrcodeUrl);return}try{const p=Pr(0,"M");p.addData(d.qrcodeUrl),p.make(),h||f(p.createDataURL(8,2))}catch(p){h||c(dt("Render Gateway QR login code",p))}return()=>{h=!0}},[d.qrcodeUrl]),x.jsx("div",{className:"modal-backdrop",children:x.jsxs("section",{"aria-labelledby":"gateway-qr-title","aria-modal":"true",className:"gateway-qr-modal",role:"dialog",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{id:"gateway-qr-title",children:"Weixin Gateway Login"}),x.jsx("p",{className:"muted",children:"Scan with Weixin, confirm on the phone, then click Confirm."})]}),x.jsx("button",{type:"button",onClick:s,children:"Close"})]}),x.jsxs("div",{className:"gateway-qr-modal-body",children:[x.jsx("div",{className:"gateway-qr-code-frame",children:m?x.jsx("img",{alt:"Weixin Gateway QR login",src:m}):x.jsx("div",{className:"gateway-qr-placeholder",children:o?"QR code could not be rendered.":"Rendering QR code..."})}),x.jsxs("dl",{className:"gateway-qr-meta",children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Status"}),x.jsx("dd",{children:(l==null?void 0:l.status)??d.status})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Expires"}),x.jsx("dd",{children:wv(d.expiresAt)})]}),l!=null&&l.message?x.jsxs("div",{children:[x.jsx("dt",{children:"Message"}),x.jsx("dd",{children:l.message})]}):null]})]}),x.jsx("footer",{children:x.jsx("button",{type:"button",disabled:n,onClick:r,children:"Confirm"})})]})})}function bk({busy:n,onCheck:r,onClose:s,onManualBind:l,registration:d,registrationCheck:m}){const[f,o]=te.useState(""),[c,h]=zi(""),[p,u]=te.useState(""),[v,C]=te.useState(""),[T,E]=zi("");return te.useEffect(()=>{let b=!1;h(""),o("");try{const y=Pr(0,"M");y.addData(d.qrUrl),y.make(),b||o(y.createDataURL(8,2))}catch(y){b||h(dt("Render Lark Gateway setup QR code",y))}return()=>{b=!0}},[d.qrUrl]),x.jsx("div",{className:"modal-backdrop",children:x.jsxs("section",{"aria-labelledby":"gateway-lark-registration-title","aria-modal":"true",className:"gateway-qr-modal",role:"dialog",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{id:"gateway-lark-registration-title",children:"Lark Gateway Setup"}),x.jsx("p",{className:"muted",children:"Scan with Lark, approve bot creation, then click Confirm."})]}),x.jsx("button",{type:"button",onClick:s,children:"Close"})]}),x.jsxs("div",{className:"gateway-qr-modal-body",children:[x.jsx("div",{className:"gateway-qr-code-frame",children:f?x.jsx("img",{alt:"Lark Gateway setup QR code",src:f}):x.jsx("div",{className:"gateway-qr-placeholder",children:c?"QR code could not be rendered.":"Rendering QR code..."})}),x.jsx("div",{className:"gateway-qr-actions",children:x.jsx("button",{type:"button",disabled:n,onClick:r,children:"Confirm"})}),x.jsxs("dl",{className:"gateway-qr-meta",children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Status"}),x.jsx("dd",{children:(m==null?void 0:m.status)??d.status})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Expires"}),x.jsx("dd",{children:wv(d.expiresAt)})]}),d.userCode?x.jsxs("div",{children:[x.jsx("dt",{children:"User Code"}),x.jsx("dd",{children:d.userCode})]}):null,m!=null&&m.larkBotName?x.jsxs("div",{children:[x.jsx("dt",{children:"Bot"}),x.jsx("dd",{children:m.larkBotName})]}):null,m!=null&&m.message?x.jsxs("div",{children:[x.jsx("dt",{children:"Message"}),x.jsx("dd",{children:m.message})]}):null]}),x.jsxs("form",{className:"gateway-manual-bind",onSubmit:b=>{b.preventDefault();const y=p.trim(),_=v.trim();if(!y||!_){E("Enter both App ID and App Secret.");return}E(""),C(""),l(y,_)},children:[x.jsxs("div",{children:[x.jsx("label",{htmlFor:"gateway-lark-app-id",children:"App ID"}),x.jsx("input",{id:"gateway-lark-app-id",autoComplete:"off",disabled:n,value:p,onChange:b=>u(b.currentTarget.value),placeholder:"cli_xxx"})]}),x.jsxs("div",{children:[x.jsx("label",{htmlFor:"gateway-lark-app-secret",children:"App Secret"}),x.jsx("input",{id:"gateway-lark-app-secret",autoComplete:"off",disabled:n,type:"password",value:v,onChange:b=>C(b.currentTarget.value),placeholder:"Enter App Secret"})]}),T?x.jsx("p",{className:"form-error",children:T}):null,x.jsx("button",{type:"submit",disabled:n,children:"Bind manually"})]})]})]})})}function wv(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 Ir=null;function Ck(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 wk(n,r,s){if((r==null?void 0:r.status)==="running")return!0;const l=Date.parse(n.stoppedAt??n.lastTurnEndedAt??"");return!!(s&&Number.isFinite(l)&&l>s)}function xk(n,r){return`${n}:${r.role}:${r.lastFailureAt}`}function Ek(n){const r=Tk(n.role),s=xv(n);return n.status==="retrying"?`CC 出错,正在重试 ${r}${s} · 第 ${n.attempt}/${n.maxAttempts} 次`:`CC 出错,重试中 ${r}${s} · 第 ${n.attempt}/${n.maxAttempts} 次 · ${Rk(n.nextRetryAt)}`}function kk(n,r){const s=xv(n);return n.retryable===!1?`CC stopped for ${r}: ${Ak(n)} cannot be fixed by retrying.`:`CC retry failed after ${n.maxAttempts} attempts for ${r}${s}.`}function xv(n){return!n.error||n.error==="unknown"?"":` · ${n.error}`}function Ak(n){return n.error&&n.error!=="unknown"?n.error:"this error"}function Tk(n){return n.split("-").filter(Boolean).map(r=>`${r.slice(0,1).toUpperCase()}${r.slice(1)}`).join(" ")}function Rk(n){if(!n)return"即将重试";const r=Date.parse(n)-Date.now();return!Number.isFinite(r)||r<=0?"即将重试":`${Math.ceil(r/6e4)} 分钟后`}async function Vg(){const n=Ev();return n?kv(n):!1}async function bo(){const n=Ev();if(!n||!await kv(n))return!1;try{const s=n.createGain(),l=n.currentTime+.025;return s.gain.setValueAtTime(.85,n.currentTime),s.connect(n.destination),Yg(n,s,{frequency:587.33,startAt:l,duration:.18,peakGain:.045}),Yg(n,s,{frequency:783.99,startAt:l+.11,duration:.28,peakGain:.055}),window.setTimeout(()=>{s.disconnect()},800),!0}catch{return!1}}function Ev(){const n=window.AudioContext??window.webkitAudioContext;if(!n)return null;try{return(!Ir||Ir.state==="closed")&&(Ir=new n),Ir}catch{return null}}function Wg(n){Ir=null,n&&n.state!=="closed"&&n.close().catch(()=>{})}async function kv(n){if(Kg(n))return!0;try{await n.resume();const r=Kg(n);return!r&&n===Ir&&Wg(n),r}catch{return n===Ir&&Wg(n),!1}}function Kg(n){return n.state==="running"}function Yg(n,r,s){const l=n.createGain(),d=n.createOscillator(),m=n.createOscillator(),f=s.startAt+s.duration;l.gain.setValueAtTime(1e-4,s.startAt),l.gain.exponentialRampToValueAtTime(s.peakGain,s.startAt+.018),l.gain.exponentialRampToValueAtTime(1e-4,f),d.type="sine",d.frequency.setValueAtTime(s.frequency,s.startAt),m.type="triangle",m.frequency.setValueAtTime(s.frequency*2.01,s.startAt),d.connect(l),m.connect(l),l.connect(r),d.start(s.startAt),m.start(s.startAt),d.stop(f+.02),m.stop(f+.02)}const Av=document.getElementById("root");if(!Av)throw new Error("Missing #root element.");U0.createRoot(Av).render(x.jsx(te.StrictMode,{children:x.jsx(yk,{})}));
|
|
95
|
+
`))&&p()}return x.jsx("div",{className:"modal-backdrop",children:x.jsxs("section",{className:"message-modal",role:"dialog","aria-modal":"true","aria-label":"Messages",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Messages"}),x.jsxs("p",{className:"muted",children:[f.total," total / ",f.accepted," accepted",s?` · ${s.mode}`:""]})]}),x.jsxs("div",{className:"modal-actions",children:[x.jsx("button",{type:"button",disabled:n,onClick:o,children:"Mark All Done"}),x.jsx("button",{type:"button",disabled:n||f.total===0,onClick:c,children:"Delete All"}),x.jsx("button",{type:"button",onClick:l,children:"Close"})]})]}),x.jsx(j2,{busy:n,maxMessages:null,messages:r,orchestration:s,showControls:!1,showHeader:!1})]})})}function zr({children:n,onOpenChange:r,open:s,title:l}){return x.jsxs("section",{className:"sidebar-section",children:[x.jsxs("button",{"aria-expanded":s,className:"sidebar-section-toggle",type:"button",onClick:()=>{r==null||r(!s)},children:[x.jsx("span",{children:l}),x.jsx("span",{"aria-hidden":"true",className:"sidebar-section-chevron"})]}),s?x.jsx("div",{className:"sidebar-section-content",children:n}):null]})}function bv(n,r){return n.find(s=>s.role===r)}function ik({activeRole:n,roles:r=Dh,sessions:s,onSelect:l}){return x.jsx("div",{className:"role-tabs",role:"tablist","aria-label":"Role sessions",children:r.map(d=>{const p=bv(s,d.name),f=(p==null?void 0:p.status)==="running"?p.activityStatus??"idle":(p==null?void 0:p.status)??"not_started";return x.jsxs("button",{className:d.name===n?"role-tab is-active":"role-tab",type:"button",role:"tab","aria-selected":d.name===n,onClick:()=>l(d.name),children:[x.jsx("span",{children:d.label}),x.jsx(Hi,{status:f})]},d.name)})})}function rk({role:n,session:r,permissionMode:s,model:l,effort:d,active:p=!0,busy:f,translationEnabled:o,translationAutoSendEnabled:c,translationTargetLanguage:h,translationPanelState:g,onClearTranslationSession:u,onTranslationEntry:y,onTranslationFailures:w,onPermissionModeChange:T,onModelChange:E,onEffortChange:S,onStart:v,onResume:_,onStop:b,onRestart:A,onNotifyHarnessUpdated:L,onTerminalEvent:D}){const R=p&&J0(n)&&o&&(r==null?void 0:r.status)==="running";return x.jsx("section",{className:"session-console",children:x.jsxs("div",{className:R?"session-console-body has-translation":"session-console-body",children:[x.jsxs("div",{className:"terminal-pane",children:[x.jsx(Mh,{role:n,session:r,permissionMode:s,model:l,effort:d,busy:f,onPermissionModeChange:T,onModelChange:E,onEffortChange:S,onStart:v,onResume:_,onStop:b,onRestart:A,onNotifyHarnessUpdated:L}),(r==null?void 0:r.status)==="running"?x.jsx(Oo,{sessionId:r.id,active:p,onEvent:D},r.id):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:n}),x.jsx("span",{children:r!=null&&r.claudeSessionId?"Resume this role to reconnect its Claude Code conversation.":"Start this role to open an embedded Claude Code terminal."})]})]}),R?x.jsx("div",{className:"translation-pane",children:x.jsx(s2,{active:p,autoSendEnabled:c,targetLanguage:h,taskSlug:r.taskSlug,role:n,sessionId:r.id,panelState:g??{role:n,status:"ready",entries:[],failures:[]},onClearSession:u??(()=>{}),onEntry:y??(()=>{}),onFailures:w??(()=>{})},`${n}:${r.id}`)}):null]})})}const ch=500;function Th(n){return{taskSlug:n,cursor:1,sessions:{}}}function sk(n,r,s){return n.sessions[r]??Ns(s)}function ak(n,r){const l={...uk(n,r.taskSlug).sessions};for(const d of r.sessions)l[d.sessionId]={...Ns(d.role),...l[d.sessionId],role:d.role,status:d.status};for(const d of r.events){const p=l[d.sessionId]??Ns(d.role);if(d.event.type==="status")l[d.sessionId]={...p,role:d.role,status:d.event.status};else if(d.event.type==="failures")l[d.sessionId]={...p,role:d.role,failures:d.event.failures};else if(d.event.type==="entry"){const f=wv(Cv(p.entries,d.event.entry));l[d.sessionId]={...p,role:d.role,entries:f.entries,failures:f.removedIds.size>0?p.failures.filter(o=>!f.removedIds.has(o.translationId)):p.failures}}}return{taskSlug:r.taskSlug,cursor:r.nextCursor,sessions:l}}function lk(n,r,s){return{...n,sessions:{...n.sessions,[r]:Ns(s)}}}function ok(n,r,s,l){const d=n.sessions[r]??Ns(s),p=wv(Cv(d.entries,l));return{...n,sessions:{...n.sessions,[r]:{...d,role:s,entries:p.entries,failures:p.removedIds.size>0?d.failures.filter(f=>!p.removedIds.has(f.translationId)):d.failures}}}}function ck(n,r,s,l){const d=n.sessions[r]??Ns(s);return{...n,sessions:{...n.sessions,[r]:{...d,role:s,failures:l}}}}function uk(n,r){return n.taskSlug===r?n:Th(r)}function Ns(n){return{role:n,status:"ready",entries:[],failures:[]}}function Cv(n,r){return n.findIndex(l=>l.id===r.id)===-1?[...n,r]:n.map(l=>l.id===r.id?r:l)}function wv(n){if(n.length<=ch)return{entries:n,removedIds:new Set};const r=n.slice(0,n.length-ch);return{entries:n.slice(-ch),removedIds:new Set(r.map(s=>s.id))}}const hk={"project-manager":"bypassPermissions",architect:"bypassPermissions",coder:"bypassPermissions",reviewer:"bypassPermissions","gate-reviewer":"bypassPermissions",translator:"bypassPermissions","harness-engineer":"bypassPermissions"},fk={"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"default","harness-engineer":"default"},dk={"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"medium","harness-engineer":"medium"};function pk({task:n,activeRole:r,gateReviewerEnabled:s,translationEnabled:l,translationAutoSendEnabled:d,translationTargetLanguage:p,launchTemplate:f,refreshNonce:o=0,onTaskChanged:c,onActiveRoleChange:h,onMessagesChanged:g,onOrchestrationChanged:u,onRoundStateChanged:y,onEventsChanged:w,onLaunchStateChanged:T}){const[E,S]=ee.useState(null),[v,_]=ee.useState(()=>qg(f)),[b,A]=ee.useState(()=>$g(f)),[L,D]=ee.useState(()=>Gg(f)),[R,k]=ee.useState(!1),[,M]=zi(""),[B,H]=ee.useState([]),[U,P]=ee.useState(null),[K,Y]=ee.useState(()=>Th(n.taskSlug)),G=ee.useRef(""),W=ee.useRef(1),Z=ee.useMemo(()=>JSON.stringify(f),[f]),z=!!(E!=null&&E.sessions.some(pe=>pe.role==="gate-reviewer")),j=s||z,N=[...Wa,...j?[Zg]:[]],$=ee.useCallback((pe,se)=>{P(se),g==null||g(pe),u==null||u(se)},[g,u]),I=ee.useCallback((pe,se,we,je)=>{S(pe),$(se,we),y==null||y(je)},[$,y]),re=ee.useCallback(async()=>{const pe=await ye.getTaskWorkspaceState(n.taskSlug);I(pe.taskStatus,pe.messages,pe.orchestration,pe.roundState),Do("Poll task workspace state"),M(se=>xo(se,["Load task workspace state","Poll task workspace state"]))},[I,n.taskSlug]),ve=ee.useCallback((pe,se)=>{const we=vv(pe,se);we&&M(we)},[]);Xa(`task-workspace:${n.taskSlug}:${o}`,()=>re().catch(pe=>{ve("Poll task workspace state",pe)}),{intervalMs:3e3,runImmediately:!0}),Xa(l?`task-translation-feed:${n.taskSlug}`:null,async()=>{try{const pe=await ye.pollTranslationTaskFeed(n.taskSlug,W.current);W.current=pe.nextCursor,Y(se=>ak(se,pe)),Do("Poll task translation feed"),M(se=>xo(se,["Poll task translation feed"]))}catch(pe){ve("Poll task translation feed",pe)}},{intervalMs:1e3,runImmediately:!0}),ee.useEffect(()=>{H([]),w==null||w([])},[w,n.taskSlug]),ee.useEffect(()=>{W.current=1,Y(Th(n.taskSlug))},[n.taskSlug]),ee.useEffect(()=>{_(qg(f)),A($g(f)),D(Gg(f))},[Z,n.taskSlug]),ee.useEffect(()=>{E&&!j&&r==="gate-reviewer"&&h("project-manager"),E&&r==="translator"&&h("project-manager")},[r,j,h,E]),ee.useEffect(()=>{const pe=E==null?void 0:E.task;if(!pe||pe.taskSlug!==n.taskSlug)return;const se=Fg(pe);if(se===Fg(n)){G.current="";return}G.current!==se&&(G.current=se,c().catch(we=>{G.current="",M(dt("Refresh task list after task status changed",we))}))},[c,E==null?void 0:E.task,n]),ee.useEffect(()=>{const pe=(E==null?void 0:E.sessions)??[],se=pe.filter(Pe=>mk(Pe.role)),we=new Set(se.map(Pe=>Pe.role)),je=pe.some(Pe=>Pe.role==="gate-reviewer"),ze={};for(const Pe of Hs)ze[Pe.name]={permissionMode:v[Pe.name],model:b[Pe.name],effort:L[Pe.name]};T==null||T({taskSlug:n.taskSlug,roles:ze,autoOrchestration:((U==null?void 0:U.mode)??"auto")==="auto",statusLoaded:!!E,sessionCount:se.length,hasAnySession:se.length>0,hasGateReviewerSession:je,allRolesHaveSession:Wa.every(Pe=>we.has(Pe.name))})},[b,L,T,U==null?void 0:U.mode,v,E,n.taskSlug]);async function me(pe,se="Run role session action"){k(!0),M("");try{await pe(),await re(),await c()}catch(we){M(dt(se,we))}finally{k(!1)}}function Q(pe){H(se=>{const we=[...se,`${new Date().toLocaleTimeString()} ${pe}`];return w==null||w(we),we})}function q(pe,se){_(we=>({...we,[pe]:se}))}function te(pe,se){A(we=>({...we,[pe]:se}))}function ae(pe,se){D(we=>({...we,[pe]:se}))}return x.jsxs("div",{className:"task-workspace",children:[x.jsxs("header",{className:"workspace-header",children:[x.jsx("div",{className:"workspace-title-line",children:x.jsx("h1",{children:n.title||n.taskSlug})}),x.jsx(ik,{activeRole:r,roles:N,sessions:(E==null?void 0:E.sessions)??[],onSelect:h})]}),x.jsx("div",{className:"workspace-grid",children:x.jsx("div",{className:"workspace-main",children:x.jsx("div",{className:"role-console-stack",children:N.map(pe=>{const se=pe.name,we=se===r,je=(E==null?void 0:E.sessions)??[],ze=bv(je,se),Pe=ze?sk(K,ze.id,se):void 0;return x.jsx("div",{className:we?"role-console-panel is-active":"role-console-panel","aria-hidden":!we,children:x.jsx(rk,{role:se,session:ze,permissionMode:v[se],model:b[se],effort:L[se],active:we,busy:R,translationEnabled:l,translationAutoSendEnabled:d,translationTargetLanguage:p,translationPanelState:Pe,onClearTranslationSession:(xe,xt)=>{Y(yt=>lk(yt,xe,xt))},onTranslationEntry:(xe,xt,yt)=>{Y(Nt=>ok(Nt,xe,xt,yt))},onTranslationFailures:(xe,xt,yt)=>{Y(Nt=>ck(Nt,xe,xt,yt))},onPermissionModeChange:xe=>q(se,xe),onModelChange:xe=>te(se,xe),onEffortChange:xe=>ae(se,xe),onStart:()=>void me(async()=>{await ye.startRoleSession(n.taskSlug,se,{cols:100,rows:28,permissionMode:v[se],model:b[se],effort:L[se]}),Q(`started ${se} with ${v[se]} / ${b[se]} / ${L[se]}`)},`Start ${se} session`),onResume:()=>void me(async()=>{await ye.resumeRoleSession(n.taskSlug,se,{cols:100,rows:28,permissionMode:v[se],model:b[se],effort:L[se]}),Q(`resumed ${se} with ${v[se]} / ${b[se]} / ${L[se]}`)},`Resume ${se} session`),onStop:()=>void me(async()=>{await ye.stopRoleSession(n.taskSlug,se),Q(`stopped ${se}`)},`Stop ${se} session`),onRestart:()=>void me(async()=>{await ye.restartRoleSession(n.taskSlug,se,{cols:100,rows:28,permissionMode:v[se],model:b[se],effort:L[se]}),Q(`restarted ${se} with ${v[se]} / ${b[se]} / ${L[se]}`)},`Restart ${se} session`),onNotifyHarnessUpdated:()=>void me(async()=>{await ye.notifyRoleHarnessUpdated(n.taskSlug,se),Q(`notified ${se} to reload latest harness`)},`Notify ${se} to reload harness`),onTerminalEvent:xe=>Q(`${pe.label}: ${xe}`)})},se)})})})})]})}function mk(n){return Wa.some(r=>r.name===n)}function Fg(n){return[n.status,n.updatedAt,n.cleanupStatus??"",n.cleanedAt??""].join(":")}function qg(n){var s;const r={...hk};for(const l of Hs)r[l.name]=((s=n.roles[l.name])==null?void 0:s.permissionMode)??r[l.name];return r}function $g(n){var s;const r={...fk};for(const l of Hs)r[l.name]=((s=n.roles[l.name])==null?void 0:s.model)??r[l.name];return r}function Gg(n){var s;const r={...dk};for(const l of Hs)r[l.name]=((s=n.roles[l.name])==null?void 0:s.effort)??r[l.name];return r}const gk=120*1e3,Vg=1400,_k=3;function vk(n){return!!(n!=null&&n.initialized)}function yk(){const[n,r]=ee.useState(null),[s,l]=ee.useState([]),[d,p]=ee.useState(null),[f,o]=ee.useState(null),[c,h]=ee.useState(null),[g,u]=ee.useState(null),[y,w]=ee.useState(null),[T,E]=ee.useState(null),[S,v]=ee.useState(null),[_,b]=ee.useState(null),[A,L]=ee.useState(null),[D,R]=ee.useState(!1),[k,M]=ee.useState(null),[B,H]=ee.useState(null),[U,P]=ee.useState(!1),[K,Y]=ee.useState([]),[G,W]=ee.useState(null),[Z,z]=ee.useState(null),[j,N]=ee.useState(null),[$,I]=ee.useState(null),[re,ve]=ee.useState(null),[me,Q]=ee.useState(null),[q,te]=ee.useState("project-manager"),[ae,pe]=ee.useState("system"),[se,we]=ee.useState(!0),[je,ze]=ee.useState(!0),[Pe,xe]=ee.useState("off"),[xt,yt]=ee.useState(!1),[Nt,Gt]=ee.useState(!1),[Sn,St]=ee.useState(!1),[tt,Lt]=ee.useState(Z0),[he,Se]=ee.useState(e1),[Ae,Le]=ee.useState(!1),[Oe,ut]=ee.useState(!1),[Fe,gt]=ee.useState(!1),[mt,Ot]=ee.useState(!1),[Ze,Qt]=ee.useState(!1),[Et,bn]=ee.useState(null),[Ln,ri]=ee.useState("bypassPermissions"),[On,Bt]=ee.useState("default"),[Bn,Wn]=ee.useState("medium"),[si,rn]=ee.useState(null),[jn,sn]=ee.useState("bypassPermissions"),[an,Ui]=ee.useState("default"),[Ne,Pi]=ee.useState("medium"),[qr,Us]=ee.useState(()=>n1()),[Kn,el]=ee.useState(null),[ai,kt]=ee.useState(0),[It,Yn]=ee.useState(null),[Ps,Io]=ee.useState(null),[tl,nl]=ee.useState(!1),[Nn,$r]=ee.useState(!1),[,ln]=zi(""),mi=ee.useRef({}),gi=ee.useRef({}),_i=ee.useRef({}),bt=ee.useRef({}),Fs=ee.useRef({}),Xn=ee.useRef(null),Qn=ee.useRef(""),ie=ee.useMemo(()=>w2(K,G),[K,G]),on=(Kn==null?void 0:Kn.taskSlug)===(ie==null?void 0:ie.taskSlug)?Kn:null,Gr=c===(ie==null?void 0:ie.taskSlug)?d:null,qs=g===(ie==null?void 0:ie.taskSlug)?f:null,Uo=!!(n&&ie&&vk(Gr)),Vr=(Et==null?void 0:Et.status)==="running",vi=!!(S!=null&&S.enabled),Hn=!!(Nt&&Uo&&Vr),cn=!!(on!=null&&on.statusLoaded),il=!!(ie&&(on!=null&&on.statusLoaded)&&!on.hasAnySession),Jt=ee.useCallback(V=>{pe(V.themeMode),we(V.flowPauseAlerts),ze(V.roleRetryEnabled),xe(V.permissionRequestMode),yt(V.autoTaskHarnessReviewEnabled),Gt(V.translationEnabled),St(V.translationAutoSendEnabled),Lt(V.translationTargetLanguage),Se(V.translationOutputMode),Us(V.launchTemplate)},[]);ee.useEffect(()=>{if(!se)return;let V=!1;const fe=()=>{V||(V=!0,Wg(),window.removeEventListener("pointerdown",fe),window.removeEventListener("keydown",fe))};return window.addEventListener("pointerdown",fe),window.addEventListener("keydown",fe),()=>{window.removeEventListener("pointerdown",fe),window.removeEventListener("keydown",fe)}},[se]);const Ht=ee.useCallback(()=>{Xn.current!==null&&(window.clearInterval(Xn.current),Xn.current=null)},[]),$s=ee.useCallback(()=>{Ht(),bo(),Xn.current=window.setInterval(()=>{bo()},Vg)},[Ht]),_r=ee.useCallback(()=>{Ht();let V=1;bo(),Xn.current=window.setInterval(()=>{V+=1,bo(),V>=_k&&Xn.current!==null&&(window.clearInterval(Xn.current),Xn.current=null)},Vg)},[Ht]),rl=ee.useCallback((V,fe=`manual-${Date.now()}`,qe={})=>{Yn({id:fe,text:V}),qe.sound==="strong"?$s():qe.sound==="weak"?_r():Ht()},[_r,$s,Ht]),un=ee.useCallback(()=>{Ht(),Yn(null)},[Ht]);ee.useEffect(()=>{ie!=null&&ie.taskSlug&&(Fs.current[ie.taskSlug]=Date.now())},[ie==null?void 0:ie.taskSlug]);const Gs=ee.useCallback(V=>{ie!=null&&ie.taskSlug&&z({taskSlug:ie.taskSlug,messages:V})},[ie==null?void 0:ie.taskSlug]),sl=ee.useCallback(V=>{_i.current[V.taskSlug]=V.mode,ie!=null&&ie.taskSlug&&N({taskSlug:ie.taskSlug,orchestration:V})},[ie==null?void 0:ie.taskSlug]),Vs=ee.useCallback(V=>{ie!=null&&ie.taskSlug&&I({taskSlug:ie.taskSlug,events:V})},[ie==null?void 0:ie.taskSlug]),Fi=ee.useCallback(V=>{if(!(ie!=null&&ie.taskSlug)||V.taskSlug!==ie.taskSlug)return;ve({taskSlug:V.taskSlug,roundState:V});const fe=x2({mode:_i.current[V.taskSlug],status:V.status,activeRole:V.activeRole,lastFollowedRole:bt.current[V.taskSlug]});fe&&(bt.current[V.taskSlug]=fe,te(fe));const qe=E2(V,kk);if(qe===null){gi.current[V.taskSlug]={status:V.status};return}const fn=k2(V),br=mi.current[V.taskSlug],Zr=gi.current[V.taskSlug];if(gi.current[V.taskSlug]={status:V.status},br===fn||(mi.current[V.taskSlug]=fn,!wk(V,Zr,Fs.current[V.taskSlug])))return;if(vi){Ht(),Yn(null);return}const hl=se?Ck(V)>=gk?"strong":"weak":"none";rl(qe,fn,{sound:hl})},[ie==null?void 0:ie.taskSlug,vi,se,rl,Ht]),al=ee.useCallback(V=>{el(fe=>(fe==null?void 0:fe.taskSlug)===V.taskSlug&&fe.statusLoaded===V.statusLoaded&&fe.sessionCount===V.sessionCount&&fe.hasAnySession===V.hasAnySession&&fe.hasGateReviewerSession===V.hasGateReviewerSession&&fe.allRolesHaveSession===V.allRolesHaveSession&&fe.autoOrchestration===V.autoOrchestration&&JSON.stringify(fe.roles)===JSON.stringify(V.roles)?fe:V)},[]);async function yi(){const V=await ye.listTasks();return Y(V),W(fe=>{var qe;return fe&&V.some(fn=>fn.taskSlug===fe)?fe:((qe=V[0])==null?void 0:qe.taskSlug)??null}),V}async function li(V=ie==null?void 0:ie.taskSlug){if(!V)return p(null),h(null),null;const fe=await ye.getHarnessStatus(V);return p(fe),h(V),fe}async function Ws(V=ie==null?void 0:ie.taskSlug){if(!V)return o(null),u(null),null;const fe=await ye.getHarnessBootstrapStatus(V);return o(fe),u(V),fe}async function Si(){const V=await ye.getGatewayStatus();return v(V),V}async function ll(){const V=await ye.getRecentRepositoryPaths();return l(V),V}async function Wr(){if(!n)return Le(!1),!1;const V=await ye.getTranslationState();return Le(V.memoryInitialized),V.memoryInitialized}async function Ks(V){const[fe,qe]=await Promise.all([ye.listMessages(V),ye.getOrchestrationState(V)]);z({taskSlug:V,messages:fe}),N({taskSlug:V,orchestration:qe})}async function ol(V){const fe=await ye.getGateReviewState(V);return Q({taskSlug:V,state:fe}),Do("Poll Gate Review state"),ln(qe=>xo(qe,["Refresh Gate Review state","Poll Gate Review state"])),fe}function vr(V,fe){const qe=vv(V,fe);qe&&ln(qe)}function Vt(V){V&&(ri(V.permissionMode),V.model&&Bt(V.model),V.effort&&Wn(V.effort))}async function Kr(V={}){const fe=await ye.getTranslatorSession();return bn(fe),V.syncLaunchOptions&&Vt(fe),fe}function oi(V){V&&(sn(V.permissionMode),V.model&&Ui(V.model),V.effort&&Pi(V.effort))}async function Zt(V={}){const fe=await ye.getHarnessEngineerSession();return rn(fe),V.syncLaunchOptions&&oi(fe),fe}function qi(V,fe,qe={}){var fn;bn(V.translatorSession),Le(!!((fn=V.translationState)!=null&&fn.memoryInitialized)),rn(V.harnessEngineerSession),E(V.harnessFeedbackState),v(V.gatewayStatus),fe&&V.harnessStatus?(p(V.harnessStatus),h(fe)):(p(null),h(null)),fe&&V.harnessBootstrapStatus?(o(V.harnessBootstrapStatus),u(fe)):(o(null),u(null)),qe.syncLaunchOptions&&(Vt(V.translatorSession),oi(V.harnessEngineerSession))}async function cl(V={}){if(!n)return bn(null),Le(!1),rn(null),p(null),o(null),h(null),u(null),E(null),null;const fe=(ie==null?void 0:ie.taskSlug)??null,qe=await ye.getProjectRuntimeState(fe);return qi(qe,fe,V),qe}function Ys(){const V=["Poll project runtime state","Load project runtime state","Refresh Harness feedback state","Poll Harness feedback state","Load Translator session","Poll Translator session","Poll translation memory status","Load Harness Engineer session","Poll Harness Engineer session","Load VCM Harness status","Poll VCM Harness status"];for(const fe of V)Do(fe);ln(fe=>xo(fe,V))}ee.useEffect(()=>{Promise.all([ye.getCurrentProject(),ye.getRecentRepositoryPaths(),ye.getAppPreferences(),ye.getGatewayStatus()]).then(async([V,fe,qe,fn])=>{r(V),l(fe),v(fn),Jt(qe),V&&await yi()}).catch(V=>ln(dt("Load initial app data",V)))},[Jt]),ee.useEffect(()=>{const V=window.matchMedia("(prefers-color-scheme: dark)"),fe=()=>nl(V.matches);return fe(),V.addEventListener("change",fe),()=>V.removeEventListener("change",fe)},[]),ee.useEffect(()=>()=>Ht(),[Ht]),ee.useEffect(()=>{vi&&(Ht(),Yn(null))},[vi,Ht]),ee.useEffect(()=>{const V=ae==="system"?tl?"dark":"light":ae;document.documentElement.dataset.theme=V,document.documentElement.dataset.themeMode=ae},[tl,ae]),ee.useEffect(()=>{if(!(ie!=null&&ie.taskSlug)){Q(null);return}ol(ie.taskSlug).catch(V=>ln(dt("Refresh Gate Review state",V)))},[ie==null?void 0:ie.taskSlug]),ee.useEffect(()=>{Qn.current="",bn(null),ri("bypassPermissions"),Bt("default"),Wn("medium"),Le(!1),rn(null),sn("bypassPermissions"),Ui("default"),Pi("medium"),p(null),o(null),h(null),u(null),E(null)},[n==null?void 0:n.repoRoot]),Xa(n?`project-runtime:${n.repoRoot}:${(ie==null?void 0:ie.taskSlug)??"no-task"}`:null,async()=>{try{const V=(n==null?void 0:n.repoRoot)??"",fe=!!(n&&Qn.current!==V);await cl({syncLaunchOptions:fe}),fe&&(Qn.current=V),Ys()}catch(V){vr("Poll project runtime state",V)}},{intervalMs:3e3,runImmediately:!0});const hn=(ie==null?void 0:ie.taskSlug)??null,bi=hn&&(me==null?void 0:me.taskSlug)===hn?me.state:null,Cn=hn&&(re==null?void 0:re.taskSlug)===hn?re.roundState:null,yr=hn&&(Kn==null?void 0:Kn.taskSlug)===hn?Kn:null,Sr=!!(hn&&(bi!=null&&bi.activeGate||(Cn==null?void 0:Cn.activeRole)==="gate-reviewer"||yr!=null&&yr.hasGateReviewerSession));Xa(Sr&&hn?`gate-review:${hn}`:null,async()=>{if(hn)try{await ol(hn)}catch(V){vr("Poll Gate Review state",V)}},{intervalMs:3e3,runImmediately:!1});async function ke(V,fe="Run UI action"){$r(!0),ln("");try{await V()}catch(qe){ln(dt(fe,qe))}finally{$r(!1)}}async function Xs(){if(!ie)throw new Error("Create or select a task before closing it.");const V=[`Close task "${ie.taskSlug}"?`,"","This is destructive:","- stops VCM-managed running role sessions for this task","- moves project-scoped Translator and Harness Engineer sessions to the base repository cwd",`- deletes the task worktree: ${ie.worktreePath}`,`- deletes the Git branch: ${ie.branch}`,"- deletes VCM task/session/message/orchestration state","","VCM will not check running sessions or uncommitted changes before closing."].join(`
|
|
96
|
+
`);window.confirm(V)&&(await ye.cleanupTask(ie.taskSlug,{force:!0,forceDeleteBranch:!0}),W(null),z(null),N(null),I(null),ve(null),Q(null),kt(qe=>qe+1),await yi())}const Yr=Z&&Z.taskSlug===(ie==null?void 0:ie.taskSlug)?Z.messages:[],ul=j&&j.taskSlug===(ie==null?void 0:ie.taskSlug)?j.orchestration:null,Xr=$&&$.taskSlug===(ie==null?void 0:ie.taskSlug)?$.events:[],en=re&&re.taskSlug===(ie==null?void 0:ie.taskSlug)?re.roundState:null,Qr=ie!=null&&ie.taskSlug&&(en!=null&&en.roleRecovery)?xk(ie.taskSlug,en.roleRecovery):null,Ut=en!=null&&en.roleRecovery&&en.roleRecovery.status!=="failed"&&Qr!==Ps?Ek(en.roleRecovery):null,Jn=me&&me.taskSlug===(ie==null?void 0:ie.taskSlug)?me.state:null,Jr=!!(Jn&&Object.values(Jn.gates).some(V=>V.required));return x.jsxs(i1,{sidebar:x.jsx(P2,{project:n,recentRepositoryPaths:s,tasks:K,activeTaskSlug:(ie==null?void 0:ie.taskSlug)??null,messages:Yr,orchestration:ul,events:Xr,roundState:en,gateReview:Jn,translationEnabled:Hn,translationAutoSendEnabled:Sn,translationTargetLanguage:tt,translationOutputMode:he,translationMemoryInitialized:Ae,translatorSession:Et,harnessStatus:Gr,harnessBootstrapStatus:qs,harnessApplyResult:y,autoTaskHarnessReviewEnabled:xt,gatewayStatus:S,gatewayQrLogin:_,gatewayQrCheck:A,gatewayLarkRegistration:k,gatewayLarkRegistrationCheck:B,busy:Nn,onConnect:V=>ke(async()=>{const fe=await ye.connectProject({repoPath:V});r(fe),w(null),await Promise.all([yi(),ll()])},"Connect repository"),onRefreshConnectedRepository:()=>ke(async()=>{const V=await ye.getCurrentProject();r(V)},"Refresh connected repository"),onPullConnectedRepository:()=>ke(async()=>{const V=await ye.pullCurrentProject();r(V)},"Pull connected repository"),onRefreshHarness:()=>ke(async()=>{if(!ie)throw new Error("Create or select a task before refreshing VCM Harness.");w(null),await Promise.all([li(ie.taskSlug),Ws(ie.taskSlug)])},"Refresh VCM Harness"),onApplyHarness:()=>ke(async()=>{if(!ie)throw new Error("Create or select a task before applying VCM Harness.");const V=await ye.applyHarness({taskSlug:ie.taskSlug});w(V),await Promise.all([li(ie.taskSlug),Ws(ie.taskSlug)])},"Apply VCM Harness"),onStartHarnessBootstrap:V=>ke(async()=>{if(!ie)throw new Error("Create or select a task before starting Harness Bootstrap.");const fe=await ye.startHarnessBootstrap({taskSlug:ie.taskSlug,cols:120,rows:32,...V});o(fe.status),u(ie.taskSlug),await Zt({syncLaunchOptions:!0})},"Start Harness Bootstrap"),onRestartHarnessBootstrap:V=>ke(async()=>{if(!ie)throw new Error("Create or select a task before restarting Harness Bootstrap.");const fe=await ye.restartHarnessBootstrap({taskSlug:ie.taskSlug,cols:120,rows:32,...V});o(fe.status),u(ie.taskSlug),await Zt({syncLaunchOptions:!0})},"Restart Harness Bootstrap"),onStopHarnessBootstrap:()=>ke(async()=>{const V=await ye.stopHarnessBootstrap();o(V),u((ie==null?void 0:ie.taskSlug)??null),await Zt()},"Stop Harness Bootstrap"),onRunHarnessBootstrap:()=>ke(async()=>{if(!ie)throw new Error("Create or select a task before running Harness Bootstrap.");const V=await ye.runHarnessBootstrap({taskSlug:ie.taskSlug});o(V.status),u(ie.taskSlug),await Zt()},"Run Harness Bootstrap"),onOpenHarnessStudio:()=>Ot(!0),onOpenRepositoryDiff:()=>Qt(!0),onAutoTaskHarnessReviewChange:V=>{yt(V),ke(async()=>{const fe=await ye.updateAppPreferences({autoTaskHarnessReviewEnabled:V});Jt(fe)},"Update auto task harness review setting")},onRefreshGateway:()=>ke(async()=>{await Si()},"Refresh Gateway status"),onGatewayEnabledChange:V=>{ke(async()=>{const fe=await ye.updateGatewaySettings({enabled:V,...V&&n?{currentProjectId:n.repoRoot,currentTaskSlug:(ie==null?void 0:ie.taskSlug)??null}:{}});v(fe),V&&Jt(await ye.getAppPreferences())},"Update Gateway enabled setting")},onGatewaySettingsChange:V=>ke(async()=>{const fe=await ye.updateGatewaySettings(V);v(fe)},"Update Gateway settings"),onGatewayTranslationChange:V=>{ke(async()=>{const fe=await ye.updateGatewaySettings({translationEnabled:V});v(fe)},"Update Gateway translation setting")},onGatewayConnectionChange:V=>{ke(async()=>{const fe=await ye.setGatewayConnection(V);v(fe)},"Update Gateway connection setting")},onStartGatewayQrLogin:()=>{ke(async()=>{const V=await ye.startGatewayQrLogin();b(V),L(null),R(!0),await Si()},"Start Gateway QR login")},onStartGatewayLarkRegistration:()=>{ke(async()=>{const V=await ye.startGatewayLarkRegistration();M(V),H(null),P(!0),await Si()},"Start Lark Gateway QR setup")},onResetGatewayBinding:()=>{ke(async()=>{const V=await ye.resetGatewayBinding();v(V),b(null),L(null),R(!1),M(null),H(null),P(!1)},"Reset Gateway binding")},onGateReviewGateEnabledChange:(V,fe)=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before changing Gate Review Gates.");const qe=await ye.updateGateReviewSettings(ie.taskSlug,{gates:{[V]:fe}});Q({taskSlug:ie.taskSlug,state:qe})},`Update ${V} Gate Review setting`)},onTranslationEnabledChange:V=>{Gt(V),ke(async()=>{const fe=await ye.updateAppPreferences({translationEnabled:V});Jt(fe)},"Update conversation translation setting")},onTranslationAutoSendChange:V=>{St(V),ke(async()=>{const fe=await ye.updateAppPreferences({translationAutoSendEnabled:V});Jt(fe)},"Update translation auto-send setting")},onTranslationTargetLanguageChange:V=>{Lt(V),ke(async()=>{const fe=await ye.updateAppPreferences({translationTargetLanguage:V});Jt(fe)},"Update translation target language")},onTranslationOutputModeChange:V=>{Se(V),ke(async()=>{const fe=await ye.updateAppPreferences({translationOutputMode:V});Jt(fe)},"Update translation output mode")},onOpenFileTranslation:()=>ut(!0),onOpenTranslatorSession:()=>gt(!0),onCreateTranslationBootstrap:()=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before running Translation Bootstrap.");await ye.createTranslationBootstrap({taskSlug:ie.taskSlug,targetLanguage:tt}),await Wr(),await Kr()},"Create Translation Bootstrap task")},onUpdateTranslationMemory:()=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before updating translation memory.");await ye.createTranslationMemoryUpdate({taskSlug:ie.taskSlug,targetLanguage:tt}),await Wr(),await Kr()},"Create translation memory update task")},onCreateTask:V=>ke(async()=>{const fe=await ye.createTask(V);await yi(),W(fe.taskSlug)},"Create task"),onCloseTask:()=>{ke(Xs,"Close task")},onSelectTask:W,themeMode:ae,onAutoOrchestrationChange:V=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before changing auto orchestration.");const fe=await ye.updateOrchestrationState(ie.taskSlug,{mode:V?"auto":"manual"});N({taskSlug:ie.taskSlug,orchestration:fe})},"Update auto orchestration mode")},onThemeModeChange:V=>{pe(V),ke(async()=>{const fe=await ye.updateAppPreferences({themeMode:V});Jt(fe)},"Update theme setting")},pauseAlertSound:se,onPauseAlertSoundChange:V=>{we(V),V&&Wg(),ke(async()=>{const fe=await ye.updateAppPreferences({flowPauseAlerts:V});Jt(fe)},"Update pause alert sound setting")},roleRetryEnabled:je,onRoleRetryEnabledChange:V=>{ze(V),ke(async()=>{const fe=await ye.updateAppPreferences({roleRetryEnabled:V});Jt(fe)},"Update CC retry setting")},permissionRequestMode:Pe,onPermissionRequestModeChange:V=>{xe(V),ke(async()=>{const fe=await ye.updateAppPreferences({permissionRequestMode:V});Jt(fe)},"Update permission request setting")},launchTemplate:qr,canSaveLaunchTemplate:cn,canOneClickStart:il,onSaveLaunchTemplate:()=>{ke(async()=>{if(!(on!=null&&on.statusLoaded))throw new Error("Open a task workspace before saving a launch template.");const V=await ye.updateAppPreferences({launchTemplate:{version:1,roles:on.roles,autoOrchestration:on.autoOrchestration}});Jt(V)},"Save launch template")},onOneClickStart:()=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before one-click start.");const V=await ye.oneClickStart(ie.taskSlug);N({taskSlug:ie.taskSlug,orchestration:V.orchestration}),te("project-manager"),await Ks(ie.taskSlug),await yi(),kt(fe=>fe+1)},"One-click start role sessions")},onMarkAllMessagesDone:V=>{ke(async()=>{const fe=await ye.markAllMessagesDone(V);z({taskSlug:V,messages:fe.messages}),await Ks(V)},"Mark all role messages done")},onDeleteMessageHistory:V=>{ke(async()=>{const fe=await ye.deleteMessageHistory(V);z({taskSlug:V,messages:fe.messages}),await Ks(V)},"Delete role message history")}}),children:[x.jsx(b2,{}),It?x.jsx("div",{className:"flow-pause-alert-backdrop",children:x.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:[x.jsx("p",{className:"flow-pause-alert-kicker",children:"VCM needs attention"}),x.jsx("h2",{id:"flow-pause-alert-title",children:"Flow needs attention"}),x.jsx("p",{id:"flow-pause-alert-body",children:It.text}),x.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."}),x.jsx("button",{type:"button",autoFocus:!0,onClick:un,children:"Confirm"})]})}):null,Ut&&Qr?x.jsxs("div",{className:"role-recovery-toast",role:"status",children:[x.jsx("span",{children:Ut}),x.jsx("button",{type:"button",onClick:()=>Io(Qr),children:"Close"})]}):null,D&&_?x.jsx(Sk,{busy:Nn,qrCheck:A,qrLogin:_,onCheck:()=>{ke(async()=>{const V=await ye.checkGatewayQrLogin();L(V),(V.status==="confirmed"||V.status==="binded_redirect")&&R(!1),await Si()})},onClose:()=>R(!1)}):null,U&&k?x.jsx(bk,{busy:Nn,registration:k,registrationCheck:B,onCheck:()=>{ke(async()=>{const V=await ye.checkGatewayLarkRegistration();H(V),V.gatewayStatus&&v(V.gatewayStatus),V.status==="confirmed"&&(P(!1),await Si())},"Check Lark Gateway QR setup")},onManualBind:(V,fe)=>{ke(async()=>{const qe=await ye.bindGatewayLarkApp({appId:V,appSecret:fe,larkDomain:"lark"});H(qe),qe.gatewayStatus&&v(qe.gatewayStatus),qe.status==="confirmed"&&(P(!1),await Si())},"Bind Lark Gateway app")},onClose:()=>P(!1)}):null,n&&ie?x.jsx(pk,{task:ie,activeRole:q,gateReviewerEnabled:Jr,translationEnabled:Hn,translationAutoSendEnabled:Sn,translationTargetLanguage:tt,launchTemplate:qr,refreshNonce:ai,onTaskChanged:async()=>{await yi()},onActiveRoleChange:te,onMessagesChanged:Gs,onOrchestrationChanged:sl,onRoundStateChanged:Fi,onEventsChanged:Vs,onLaunchStateChanged:al}):x.jsxs("section",{className:"empty-workspace",children:[x.jsx("h1",{children:n?"Create a task to open the workspace":"Connect a repository to begin"}),x.jsx("p",{children:n?"Tasks create local role commands and handoff artifacts for the selected repository.":"VibeCodingMaster will create a local task workspace, role sessions, and handoff artifacts."})]}),x.jsx(o2,{open:Oe,taskSlug:(ie==null?void 0:ie.taskSlug)??null,targetLanguage:tt,onClose:()=>ut(!1)}),x.jsx(x1,{open:mt,busy:Nn,status:Gr,bootstrapStatus:qs,engineerSession:si,permissionMode:jn,model:an,effort:Ne,taskSlug:(ie==null?void 0:ie.taskSlug)??null,onClose:()=>Ot(!1),onRefresh:()=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before refreshing Harness Studio.");await Promise.all([li(ie.taskSlug),Ws(ie.taskSlug),Zt()])},"Refresh Harness Studio")},onPermissionModeChange:sn,onModelChange:Ui,onEffortChange:Pi,onEngineerStart:()=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before starting Harness Engineer.");const V=await ye.startHarnessEngineerSession({taskSlug:ie.taskSlug,cols:120,rows:32,permissionMode:jn,model:an,effort:Ne});rn(V),oi(V)},"Start Harness Engineer")},onEngineerResume:()=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before resuming Harness Engineer.");const V=await ye.resumeHarnessEngineerSession({taskSlug:ie.taskSlug,cols:120,rows:32,permissionMode:jn,model:an,effort:Ne});rn(V),oi(V)},"Resume Harness Engineer")},onEngineerRestart:()=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before restarting Harness Engineer.");const V=await ye.restartHarnessEngineerSession({taskSlug:ie.taskSlug,cols:120,rows:32,permissionMode:jn,model:an,effort:Ne});rn(V),oi(V)},"Restart Harness Engineer")},onEngineerStop:()=>{ke(async()=>{const V=await ye.stopHarnessEngineerSession();rn(V)},"Stop Harness Engineer")},onEngineerNotifyHarnessUpdated:()=>{ke(async()=>{const V=await ye.notifyHarnessEngineerHarnessUpdated();rn(V),oi(V)},"Notify Harness Engineer to reload harness")},onOpenRepositoryDiff:()=>Qt(!0),onReviewTaskHarness:()=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before reviewing task harness.");const V=await ye.startTaskHarnessRetrospective({taskSlug:ie.taskSlug,trigger:"manual"});E(V),await Zt({syncLaunchOptions:!0})},"Review task harness")}}),x.jsx(k1,{open:Ze,taskSlug:(ie==null?void 0:ie.taskSlug)??null,onClose:()=>Qt(!1)}),x.jsx(M1,{open:Fe,busy:Nn,session:Et,permissionMode:Ln,model:On,effort:Bn,onClose:()=>gt(!1),onPermissionModeChange:ri,onModelChange:Bt,onEffortChange:Wn,onStart:()=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before starting Translator.");const V=await ye.startTranslatorSession({taskSlug:ie.taskSlug,cols:100,rows:28,permissionMode:Ln,model:On,effort:Bn});bn(V),Vt(V)},"Start Translator session")},onResume:()=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before resuming Translator.");const V=await ye.resumeTranslatorSession({taskSlug:ie.taskSlug,cols:100,rows:28,permissionMode:Ln,model:On,effort:Bn});bn(V),Vt(V)},"Resume Translator session")},onRestart:()=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before restarting Translator.");const V=await ye.restartTranslatorSession({taskSlug:ie.taskSlug,cols:100,rows:28,permissionMode:Ln,model:On,effort:Bn});bn(V),Vt(V)},"Restart Translator session")},onStop:()=>{ke(async()=>{const V=await ye.stopTranslatorSession();bn(V)},"Stop Translator session")},onNotifyHarnessUpdated:()=>{ke(async()=>{const V=await ye.notifyTranslatorHarnessUpdated();bn(V),Vt(V)},"Notify Translator to reload harness")}}),x.jsx(r1,{busy:Nn,state:T,onCancel:V=>{ke(async()=>{const fe=await ye.decideHarnessFeedback({action:"cancel",taskSlug:ie==null?void 0:ie.taskSlug,comment:V});E(fe)},"Cancel Harness feedback")},onApprove:V=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before approving Harness feedback.");const fe=await ye.decideHarnessFeedback({action:"approve",taskSlug:ie.taskSlug,comment:V});E(fe),await Zt()},"Approve Harness feedback")},onComment:V=>{ke(async()=>{if(!ie)throw new Error("Create or select a task before sending Harness feedback comments.");const fe=await ye.decideHarnessFeedback({action:"comment",taskSlug:ie.taskSlug,comment:V});E(fe),await Zt()},"Send Harness feedback comment")},onReject:V=>{ke(async()=>{const fe=await ye.decideHarnessFeedback({action:"reject",taskSlug:ie==null?void 0:ie.taskSlug,comment:V});E(fe)},"Reject Harness feedback")}})]})}function Sk({busy:n,onCheck:r,onClose:s,qrCheck:l,qrLogin:d}){const[p,f]=ee.useState(""),[o,c]=zi("");return ee.useEffect(()=>{let h=!1;if(c(""),f(""),d.qrcodeUrl.startsWith("data:image/")){f(d.qrcodeUrl);return}try{const g=Pr(0,"M");g.addData(d.qrcodeUrl),g.make(),h||f(g.createDataURL(8,2))}catch(g){h||c(dt("Render Gateway QR login code",g))}return()=>{h=!0}},[d.qrcodeUrl]),x.jsx("div",{className:"modal-backdrop",children:x.jsxs("section",{"aria-labelledby":"gateway-qr-title","aria-modal":"true",className:"gateway-qr-modal",role:"dialog",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{id:"gateway-qr-title",children:"Weixin Gateway Login"}),x.jsx("p",{className:"muted",children:"Scan with Weixin, confirm on the phone, then click Confirm."})]}),x.jsx("button",{type:"button",onClick:s,children:"Close"})]}),x.jsxs("div",{className:"gateway-qr-modal-body",children:[x.jsx("div",{className:"gateway-qr-code-frame",children:p?x.jsx("img",{alt:"Weixin Gateway QR login",src:p}):x.jsx("div",{className:"gateway-qr-placeholder",children:o?"QR code could not be rendered.":"Rendering QR code..."})}),x.jsxs("dl",{className:"gateway-qr-meta",children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Status"}),x.jsx("dd",{children:(l==null?void 0:l.status)??d.status})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Expires"}),x.jsx("dd",{children:xv(d.expiresAt)})]}),l!=null&&l.message?x.jsxs("div",{children:[x.jsx("dt",{children:"Message"}),x.jsx("dd",{children:l.message})]}):null]})]}),x.jsx("footer",{children:x.jsx("button",{type:"button",disabled:n,onClick:r,children:"Confirm"})})]})})}function bk({busy:n,onCheck:r,onClose:s,onManualBind:l,registration:d,registrationCheck:p}){const[f,o]=ee.useState(""),[c,h]=zi(""),[g,u]=ee.useState(""),[y,w]=ee.useState(""),[T,E]=zi("");return ee.useEffect(()=>{let S=!1;h(""),o("");try{const v=Pr(0,"M");v.addData(d.qrUrl),v.make(),S||o(v.createDataURL(8,2))}catch(v){S||h(dt("Render Lark Gateway setup QR code",v))}return()=>{S=!0}},[d.qrUrl]),x.jsx("div",{className:"modal-backdrop",children:x.jsxs("section",{"aria-labelledby":"gateway-lark-registration-title","aria-modal":"true",className:"gateway-qr-modal",role:"dialog",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{id:"gateway-lark-registration-title",children:"Lark Gateway Setup"}),x.jsx("p",{className:"muted",children:"Scan with Lark, approve bot creation, then click Confirm."})]}),x.jsx("button",{type:"button",onClick:s,children:"Close"})]}),x.jsxs("div",{className:"gateway-qr-modal-body",children:[x.jsx("div",{className:"gateway-qr-code-frame",children:f?x.jsx("img",{alt:"Lark Gateway setup QR code",src:f}):x.jsx("div",{className:"gateway-qr-placeholder",children:c?"QR code could not be rendered.":"Rendering QR code..."})}),x.jsx("div",{className:"gateway-qr-actions",children:x.jsx("button",{type:"button",disabled:n,onClick:r,children:"Confirm"})}),x.jsxs("dl",{className:"gateway-qr-meta",children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Status"}),x.jsx("dd",{children:(p==null?void 0:p.status)??d.status})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Expires"}),x.jsx("dd",{children:xv(d.expiresAt)})]}),d.userCode?x.jsxs("div",{children:[x.jsx("dt",{children:"User Code"}),x.jsx("dd",{children:d.userCode})]}):null,p!=null&&p.larkBotName?x.jsxs("div",{children:[x.jsx("dt",{children:"Bot"}),x.jsx("dd",{children:p.larkBotName})]}):null,p!=null&&p.message?x.jsxs("div",{children:[x.jsx("dt",{children:"Message"}),x.jsx("dd",{children:p.message})]}):null]}),x.jsxs("form",{className:"gateway-manual-bind",onSubmit:S=>{S.preventDefault();const v=g.trim(),_=y.trim();if(!v||!_){E("Enter both App ID and App Secret.");return}E(""),w(""),l(v,_)},children:[x.jsxs("div",{children:[x.jsx("label",{htmlFor:"gateway-lark-app-id",children:"App ID"}),x.jsx("input",{id:"gateway-lark-app-id",autoComplete:"off",disabled:n,value:g,onChange:S=>u(S.currentTarget.value),placeholder:"cli_xxx"})]}),x.jsxs("div",{children:[x.jsx("label",{htmlFor:"gateway-lark-app-secret",children:"App Secret"}),x.jsx("input",{id:"gateway-lark-app-secret",autoComplete:"off",disabled:n,type:"password",value:y,onChange:S=>w(S.currentTarget.value),placeholder:"Enter App Secret"})]}),T?x.jsx("p",{className:"form-error",children:T}):null,x.jsx("button",{type:"submit",disabled:n,children:"Bind manually"})]})]})]})})}function xv(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 Ir=null;function Ck(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 wk(n,r,s){if((r==null?void 0:r.status)==="running")return!0;const l=Date.parse(n.stoppedAt??n.lastTurnEndedAt??"");return!!(s&&Number.isFinite(l)&&l>s)}function xk(n,r){return`${n}:${r.role}:${r.lastFailureAt}`}function Ek(n){const r=Tk(n.role),s=Ev(n);return n.status==="retrying"?`CC 出错,正在重试 ${r}${s} · 第 ${n.attempt}/${n.maxAttempts} 次`:`CC 出错,重试中 ${r}${s} · 第 ${n.attempt}/${n.maxAttempts} 次 · ${Rk(n.nextRetryAt)}`}function kk(n,r){const s=Ev(n);return n.retryable===!1?`CC stopped for ${r}: ${Ak(n)} cannot be fixed by retrying.`:`CC retry failed after ${n.maxAttempts} attempts for ${r}${s}.`}function Ev(n){return!n.error||n.error==="unknown"?"":` · ${n.error}`}function Ak(n){return n.error&&n.error!=="unknown"?n.error:"this error"}function Tk(n){return n.split("-").filter(Boolean).map(r=>`${r.slice(0,1).toUpperCase()}${r.slice(1)}`).join(" ")}function Rk(n){if(!n)return"即将重试";const r=Date.parse(n)-Date.now();return!Number.isFinite(r)||r<=0?"即将重试":`${Math.ceil(r/6e4)} 分钟后`}async function Wg(){const n=kv();return n?Av(n):!1}async function bo(){const n=kv();if(!n||!await Av(n))return!1;try{const s=n.createGain(),l=n.currentTime+.025;return s.gain.setValueAtTime(.85,n.currentTime),s.connect(n.destination),Xg(n,s,{frequency:587.33,startAt:l,duration:.18,peakGain:.045}),Xg(n,s,{frequency:783.99,startAt:l+.11,duration:.28,peakGain:.055}),window.setTimeout(()=>{s.disconnect()},800),!0}catch{return!1}}function kv(){const n=window.AudioContext??window.webkitAudioContext;if(!n)return null;try{return(!Ir||Ir.state==="closed")&&(Ir=new n),Ir}catch{return null}}function Kg(n){Ir=null,n&&n.state!=="closed"&&n.close().catch(()=>{})}async function Av(n){if(Yg(n))return!0;try{await n.resume();const r=Yg(n);return!r&&n===Ir&&Kg(n),r}catch{return n===Ir&&Kg(n),!1}}function Yg(n){return n.state==="running"}function Xg(n,r,s){const l=n.createGain(),d=n.createOscillator(),p=n.createOscillator(),f=s.startAt+s.duration;l.gain.setValueAtTime(1e-4,s.startAt),l.gain.exponentialRampToValueAtTime(s.peakGain,s.startAt+.018),l.gain.exponentialRampToValueAtTime(1e-4,f),d.type="sine",d.frequency.setValueAtTime(s.frequency,s.startAt),p.type="triangle",p.frequency.setValueAtTime(s.frequency*2.01,s.startAt),d.connect(l),p.connect(l),l.connect(r),d.start(s.startAt),p.start(s.startAt),d.stop(f+.02),p.stop(f+.02)}const Tv=document.getElementById("root");if(!Tv)throw new Error("Missing #root element.");P0.createRoot(Tv).render(x.jsx(ee.StrictMode,{children:x.jsx(yk,{})}));
|