zerogterm 0.7.0-alpha3 → 0.8.0-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/dist/main/main/main.js +72 -4
- package/dist/renderer/assets/index-BPS6JAQV.js +142 -0
- package/dist/renderer/assets/{index-Qi5a1Xc8.css → index-p0gJDyuE.css} +1 -1
- package/dist/renderer/index.html +2 -2
- package/package.json +32 -2
- package/dist/renderer/assets/index-C2vLQpCh.js +0 -85
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
(function(){const x=document.createElement("link").relList;if(x&&x.supports&&x.supports("modulepreload"))return;for(const N of document.querySelectorAll('link[rel="modulepreload"]'))T(N);new MutationObserver(N=>{for(const q of N)if(q.type==="childList")for(const W of q.addedNodes)W.tagName==="LINK"&&W.rel==="modulepreload"&&T(W)}).observe(document,{childList:!0,subtree:!0});function L(N){const q={};return N.integrity&&(q.integrity=N.integrity),N.referrerPolicy&&(q.referrerPolicy=N.referrerPolicy),N.crossOrigin==="use-credentials"?q.credentials="include":N.crossOrigin==="anonymous"?q.credentials="omit":q.credentials="same-origin",q}function T(N){if(N.ep)return;N.ep=!0;const q=L(N);fetch(N.href,q)}})();function pv(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var nu={exports:{}},dl={};var T_;function mv(){if(T_)return dl;T_=1;var l=Symbol.for("react.transitional.element"),x=Symbol.for("react.fragment");function L(T,N,q){var W=null;if(q!==void 0&&(W=""+q),N.key!==void 0&&(W=""+N.key),"key"in N){q={};for(var r in N)r!=="key"&&(q[r]=N[r])}else q=N;return N=q.ref,{$$typeof:l,type:T,key:W,ref:N!==void 0?N:null,props:q}}return dl.Fragment=x,dl.jsx=L,dl.jsxs=L,dl}var D_;function vv(){return D_||(D_=1,nu.exports=mv()),nu.exports}var m=vv(),au={exports:{}},Ue={};var k_;function gv(){if(k_)return Ue;k_=1;var l=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),q=Symbol.for("react.consumer"),W=Symbol.for("react.context"),r=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),_=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),o=Symbol.for("react.activity"),S=Symbol.iterator;function C(B){return B===null||typeof B!="object"?null:(B=S&&B[S]||B["@@iterator"],typeof B=="function"?B:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,n={};function h(B,P,J){this.props=B,this.context=P,this.refs=n,this.updater=J||E}h.prototype.isReactComponent={},h.prototype.setState=function(B,P){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,P,"setState")},h.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function u(){}u.prototype=h.prototype;function c(B,P,J){this.props=B,this.context=P,this.refs=n,this.updater=J||E}var g=c.prototype=new u;g.constructor=c,p(g,h.prototype),g.isPureReactComponent=!0;var R=Array.isArray;function y(){}var M={H:null,A:null,T:null,S:null},b=Object.prototype.hasOwnProperty;function A(B,P,J){var se=J.ref;return{$$typeof:l,type:B,key:P,ref:se!==void 0?se:null,props:J}}function O(B,P){return A(B.type,P,B.props)}function z(B){return typeof B=="object"&&B!==null&&B.$$typeof===l}function H(B){var P={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(J){return P[J]})}var k=/\/+/g;function K(B,P){return typeof B=="object"&&B!==null&&B.key!=null?H(""+B.key):P.toString(36)}function re(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(y,y):(B.status="pending",B.then(function(P){B.status==="pending"&&(B.status="fulfilled",B.value=P)},function(P){B.status==="pending"&&(B.status="rejected",B.reason=P)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function G(B,P,J,se,ue){var _e=typeof B;(_e==="undefined"||_e==="boolean")&&(B=null);var Z=!1;if(B===null)Z=!0;else switch(_e){case"bigint":case"string":case"number":Z=!0;break;case"object":switch(B.$$typeof){case l:case x:Z=!0;break;case v:return Z=B._init,G(Z(B._payload),P,J,se,ue)}}if(Z)return ue=ue(B),Z=se===""?"."+K(B,0):se,R(ue)?(J="",Z!=null&&(J=Z.replace(k,"$&/")+"/"),G(ue,P,J,"",function(me){return me})):ue!=null&&(z(ue)&&(ue=O(ue,J+(ue.key==null||B&&B.key===ue.key?"":(""+ue.key).replace(k,"$&/")+"/")+Z)),P.push(ue)),1;Z=0;var F=se===""?".":se+":";if(R(B))for(var ae=0;ae<B.length;ae++)se=B[ae],_e=F+K(se,ae),Z+=G(se,P,J,_e,ue);else if(ae=C(B),typeof ae=="function")for(B=ae.call(B),ae=0;!(se=B.next()).done;)se=se.value,_e=F+K(se,ae++),Z+=G(se,P,J,_e,ue);else if(_e==="object"){if(typeof B.then=="function")return G(re(B),P,J,se,ue);throw P=String(B),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return Z}function Y(B,P,J){if(B==null)return B;var se=[],ue=0;return G(B,se,"","",function(_e){return P.call(J,_e,ue++)}),se}function X(B){if(B._status===-1){var P=B._result;P=P(),P.then(function(J){(B._status===0||B._status===-1)&&(B._status=1,B._result=J)},function(J){(B._status===0||B._status===-1)&&(B._status=2,B._result=J)}),B._status===-1&&(B._status=0,B._result=P)}if(B._status===1)return B._result.default;throw B._result}var j=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},$={map:Y,forEach:function(B,P,J){Y(B,function(){P.apply(this,arguments)},J)},count:function(B){var P=0;return Y(B,function(){P++}),P},toArray:function(B){return Y(B,function(P){return P})||[]},only:function(B){if(!z(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return Ue.Activity=o,Ue.Children=$,Ue.Component=h,Ue.Fragment=L,Ue.Profiler=N,Ue.PureComponent=c,Ue.StrictMode=T,Ue.Suspense=d,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(B){return M.H.useMemoCache(B)}},Ue.cache=function(B){return function(){return B.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(B,P,J){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var se=p({},B.props),ue=B.key;if(P!=null)for(_e in P.key!==void 0&&(ue=""+P.key),P)!b.call(P,_e)||_e==="key"||_e==="__self"||_e==="__source"||_e==="ref"&&P.ref===void 0||(se[_e]=P[_e]);var _e=arguments.length-2;if(_e===1)se.children=J;else if(1<_e){for(var Z=Array(_e),F=0;F<_e;F++)Z[F]=arguments[F+2];se.children=Z}return A(B.type,ue,se)},Ue.createContext=function(B){return B={$$typeof:W,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:q,_context:B},B},Ue.createElement=function(B,P,J){var se,ue={},_e=null;if(P!=null)for(se in P.key!==void 0&&(_e=""+P.key),P)b.call(P,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(ue[se]=P[se]);var Z=arguments.length-2;if(Z===1)ue.children=J;else if(1<Z){for(var F=Array(Z),ae=0;ae<Z;ae++)F[ae]=arguments[ae+2];ue.children=F}if(B&&B.defaultProps)for(se in Z=B.defaultProps,Z)ue[se]===void 0&&(ue[se]=Z[se]);return A(B,_e,ue)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(B){return{$$typeof:r,render:B}},Ue.isValidElement=z,Ue.lazy=function(B){return{$$typeof:v,_payload:{_status:-1,_result:B},_init:X}},Ue.memo=function(B,P){return{$$typeof:_,type:B,compare:P===void 0?null:P}},Ue.startTransition=function(B){var P=M.T,J={};M.T=J;try{var se=B(),ue=M.S;ue!==null&&ue(J,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(y,j)}catch(_e){j(_e)}finally{P!==null&&J.types!==null&&(P.types=J.types),M.T=P}},Ue.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Ue.use=function(B){return M.H.use(B)},Ue.useActionState=function(B,P,J){return M.H.useActionState(B,P,J)},Ue.useCallback=function(B,P){return M.H.useCallback(B,P)},Ue.useContext=function(B){return M.H.useContext(B)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(B,P){return M.H.useDeferredValue(B,P)},Ue.useEffect=function(B,P){return M.H.useEffect(B,P)},Ue.useEffectEvent=function(B){return M.H.useEffectEvent(B)},Ue.useId=function(){return M.H.useId()},Ue.useImperativeHandle=function(B,P,J){return M.H.useImperativeHandle(B,P,J)},Ue.useInsertionEffect=function(B,P){return M.H.useInsertionEffect(B,P)},Ue.useLayoutEffect=function(B,P){return M.H.useLayoutEffect(B,P)},Ue.useMemo=function(B,P){return M.H.useMemo(B,P)},Ue.useOptimistic=function(B,P){return M.H.useOptimistic(B,P)},Ue.useReducer=function(B,P,J){return M.H.useReducer(B,P,J)},Ue.useRef=function(B){return M.H.useRef(B)},Ue.useState=function(B){return M.H.useState(B)},Ue.useSyncExternalStore=function(B,P,J){return M.H.useSyncExternalStore(B,P,J)},Ue.useTransition=function(){return M.H.useTransition()},Ue.version="19.2.8",Ue}var O_;function xu(){return O_||(O_=1,au.exports=gv()),au.exports}var ie=xu();const en=pv(ie);var lu={exports:{}},fl={},ou={exports:{}},cu={};var B_;function Sv(){return B_||(B_=1,(function(l){function x(G,Y){var X=G.length;G.push(Y);e:for(;0<X;){var j=X-1>>>1,$=G[j];if(0<N($,Y))G[j]=Y,G[X]=$,X=j;else break e}}function L(G){return G.length===0?null:G[0]}function T(G){if(G.length===0)return null;var Y=G[0],X=G.pop();if(X!==Y){G[0]=X;e:for(var j=0,$=G.length,B=$>>>1;j<B;){var P=2*(j+1)-1,J=G[P],se=P+1,ue=G[se];if(0>N(J,X))se<$&&0>N(ue,J)?(G[j]=ue,G[se]=X,j=se):(G[j]=J,G[P]=X,j=P);else if(se<$&&0>N(ue,X))G[j]=ue,G[se]=X,j=se;else break e}}return Y}function N(G,Y){var X=G.sortIndex-Y.sortIndex;return X!==0?X:G.id-Y.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var q=performance;l.unstable_now=function(){return q.now()}}else{var W=Date,r=W.now();l.unstable_now=function(){return W.now()-r}}var d=[],_=[],v=1,o=null,S=3,C=!1,E=!1,p=!1,n=!1,h=typeof setTimeout=="function"?setTimeout:null,u=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;function g(G){for(var Y=L(_);Y!==null;){if(Y.callback===null)T(_);else if(Y.startTime<=G)T(_),Y.sortIndex=Y.expirationTime,x(d,Y);else break;Y=L(_)}}function R(G){if(p=!1,g(G),!E)if(L(d)!==null)E=!0,y||(y=!0,H());else{var Y=L(_);Y!==null&&re(R,Y.startTime-G)}}var y=!1,M=-1,b=5,A=-1;function O(){return n?!0:!(l.unstable_now()-A<b)}function z(){if(n=!1,y){var G=l.unstable_now();A=G;var Y=!0;try{e:{E=!1,p&&(p=!1,u(M),M=-1),C=!0;var X=S;try{t:{for(g(G),o=L(d);o!==null&&!(o.expirationTime>G&&O());){var j=o.callback;if(typeof j=="function"){o.callback=null,S=o.priorityLevel;var $=j(o.expirationTime<=G);if(G=l.unstable_now(),typeof $=="function"){o.callback=$,g(G),Y=!0;break t}o===L(d)&&T(d),g(G)}else T(d);o=L(d)}if(o!==null)Y=!0;else{var B=L(_);B!==null&&re(R,B.startTime-G),Y=!1}}break e}finally{o=null,S=X,C=!1}Y=void 0}}finally{Y?H():y=!1}}}var H;if(typeof c=="function")H=function(){c(z)};else if(typeof MessageChannel<"u"){var k=new MessageChannel,K=k.port2;k.port1.onmessage=z,H=function(){K.postMessage(null)}}else H=function(){h(z,0)};function re(G,Y){M=h(function(){G(l.unstable_now())},Y)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(G){G.callback=null},l.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"):b=0<G?Math.floor(1e3/G):5},l.unstable_getCurrentPriorityLevel=function(){return S},l.unstable_next=function(G){switch(S){case 1:case 2:case 3:var Y=3;break;default:Y=S}var X=S;S=Y;try{return G()}finally{S=X}},l.unstable_requestPaint=function(){n=!0},l.unstable_runWithPriority=function(G,Y){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var X=S;S=G;try{return Y()}finally{S=X}},l.unstable_scheduleCallback=function(G,Y,X){var j=l.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?j+X:j):X=j,G){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=X+$,G={id:v++,callback:Y,priorityLevel:G,startTime:X,expirationTime:$,sortIndex:-1},X>j?(G.sortIndex=X,x(_,G),L(d)===null&&G===L(_)&&(p?(u(M),M=-1):p=!0,re(R,X-j))):(G.sortIndex=$,x(d,G),E||C||(E=!0,y||(y=!0,H()))),G},l.unstable_shouldYield=O,l.unstable_wrapCallback=function(G){var Y=S;return function(){var X=S;S=Y;try{return G.apply(this,arguments)}finally{S=X}}}})(cu)),cu}var j_;function bv(){return j_||(j_=1,ou.exports=Sv()),ou.exports}var hu={exports:{}},si={};var N_;function yv(){if(N_)return si;N_=1;var l=xu();function x(d){var _="https://react.dev/errors/"+d;if(1<arguments.length){_+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)_+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+d+"; visit "+_+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function L(){}var T={d:{f:L,r:function(){throw Error(x(522))},D:L,C:L,L,m:L,X:L,S:L,M:L},p:0,findDOMNode:null},N=Symbol.for("react.portal");function q(d,_,v){var o=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:N,key:o==null?null:""+o,children:d,containerInfo:_,implementation:v}}var W=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function r(d,_){if(d==="font")return"";if(typeof _=="string")return _==="use-credentials"?_:""}return si.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,si.createPortal=function(d,_){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_||_.nodeType!==1&&_.nodeType!==9&&_.nodeType!==11)throw Error(x(299));return q(d,_,null,v)},si.flushSync=function(d){var _=W.T,v=T.p;try{if(W.T=null,T.p=2,d)return d()}finally{W.T=_,T.p=v,T.d.f()}},si.preconnect=function(d,_){typeof d=="string"&&(_?(_=_.crossOrigin,_=typeof _=="string"?_==="use-credentials"?_:"":void 0):_=null,T.d.C(d,_))},si.prefetchDNS=function(d){typeof d=="string"&&T.d.D(d)},si.preinit=function(d,_){if(typeof d=="string"&&_&&typeof _.as=="string"){var v=_.as,o=r(v,_.crossOrigin),S=typeof _.integrity=="string"?_.integrity:void 0,C=typeof _.fetchPriority=="string"?_.fetchPriority:void 0;v==="style"?T.d.S(d,typeof _.precedence=="string"?_.precedence:void 0,{crossOrigin:o,integrity:S,fetchPriority:C}):v==="script"&&T.d.X(d,{crossOrigin:o,integrity:S,fetchPriority:C,nonce:typeof _.nonce=="string"?_.nonce:void 0})}},si.preinitModule=function(d,_){if(typeof d=="string")if(typeof _=="object"&&_!==null){if(_.as==null||_.as==="script"){var v=r(_.as,_.crossOrigin);T.d.M(d,{crossOrigin:v,integrity:typeof _.integrity=="string"?_.integrity:void 0,nonce:typeof _.nonce=="string"?_.nonce:void 0})}}else _==null&&T.d.M(d)},si.preload=function(d,_){if(typeof d=="string"&&typeof _=="object"&&_!==null&&typeof _.as=="string"){var v=_.as,o=r(v,_.crossOrigin);T.d.L(d,v,{crossOrigin:o,integrity:typeof _.integrity=="string"?_.integrity:void 0,nonce:typeof _.nonce=="string"?_.nonce:void 0,type:typeof _.type=="string"?_.type:void 0,fetchPriority:typeof _.fetchPriority=="string"?_.fetchPriority:void 0,referrerPolicy:typeof _.referrerPolicy=="string"?_.referrerPolicy:void 0,imageSrcSet:typeof _.imageSrcSet=="string"?_.imageSrcSet:void 0,imageSizes:typeof _.imageSizes=="string"?_.imageSizes:void 0,media:typeof _.media=="string"?_.media:void 0})}},si.preloadModule=function(d,_){if(typeof d=="string")if(_){var v=r(_.as,_.crossOrigin);T.d.m(d,{as:typeof _.as=="string"&&_.as!=="script"?_.as:void 0,crossOrigin:v,integrity:typeof _.integrity=="string"?_.integrity:void 0})}else T.d.m(d)},si.requestFormReset=function(d){T.d.r(d)},si.unstable_batchedUpdates=function(d,_){return d(_)},si.useFormState=function(d,_,v){return W.H.useFormState(d,_,v)},si.useFormStatus=function(){return W.H.useHostTransitionStatus()},si.version="19.2.8",si}var H_;function Cv(){if(H_)return hu.exports;H_=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(x){console.error(x)}}return l(),hu.exports=yv(),hu.exports}var z_;function wv(){if(z_)return fl;z_=1;var l=bv(),x=xu(),L=Cv();function T(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 N(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function q(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 W(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 r(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 d(e){if(q(e)!==e)throw Error(T(188))}function _(e){var t=e.alternate;if(!t){if(t=q(e),t===null)throw Error(T(188));return t!==e?null:e}for(var i=e,s=t;;){var a=i.return;if(a===null)break;var f=a.alternate;if(f===null){if(s=a.return,s!==null){i=s;continue}break}if(a.child===f.child){for(f=a.child;f;){if(f===i)return d(a),e;if(f===s)return d(a),t;f=f.sibling}throw Error(T(188))}if(i.return!==s.return)i=a,s=f;else{for(var D=!1,I=a.child;I;){if(I===i){D=!0,i=a,s=f;break}if(I===s){D=!0,s=a,i=f;break}I=I.sibling}if(!D){for(I=f.child;I;){if(I===i){D=!0,i=f,s=a;break}if(I===s){D=!0,s=f,i=a;break}I=I.sibling}if(!D)throw Error(T(189))}}if(i.alternate!==s)throw Error(T(190))}if(i.tag!==3)throw Error(T(188));return i.stateNode.current===i?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var o=Object.assign,S=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),A=Symbol.for("react.activity"),O=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function H(e){return e===null||typeof e!="object"?null:(e=z&&e[z]||e["@@iterator"],typeof e=="function"?e:null)}var k=Symbol.for("react.client.reference");function K(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===k?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case p:return"Fragment";case h:return"Profiler";case n:return"StrictMode";case R:return"Suspense";case y:return"SuspenseList";case A:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case c:return e.displayName||"Context";case u:return(e._context.displayName||"Context")+".Consumer";case g:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case M:return t=e.displayName||null,t!==null?t:K(e.type)||"Memo";case b:t=e._payload,e=e._init;try{return K(e(t))}catch{}}return null}var re=Array.isArray,G=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=L.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},j=[],$=-1;function B(e){return{current:e}}function P(e){0>$||(e.current=j[$],j[$]=null,$--)}function J(e,t){$++,j[$]=e.current,e.current=t}var se=B(null),ue=B(null),_e=B(null),Z=B(null);function F(e,t){switch(J(_e,t),J(ue,e),J(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Jf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Jf(t),e=e_(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}P(se),J(se,e)}function ae(){P(se),P(ue),P(_e)}function me(e){e.memoizedState!==null&&J(Z,e);var t=se.current,i=e_(t,e.type);t!==i&&(J(ue,e),J(se,i))}function xe(e){ue.current===e&&(P(se),P(ue)),Z.current===e&&(P(Z),ol._currentValue=X)}var Ce,je;function Ae(e){if(Ce===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);Ce=t&&t[1]||"",je=-1<i.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+Ce+e+je}var $e=!1;function Xe(e,t){if(!e||$e)return"";$e=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(he){var ce=he}Reflect.construct(e,[],ve)}else{try{ve.call()}catch(he){ce=he}e.call(ve.prototype)}}else{try{throw Error()}catch(he){ce=he}(ve=e())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(he){if(he&&ce&&typeof he.stack=="string")return[he.stack,ce.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=s.DetermineComponentFrameRoot(),D=f[0],I=f[1];if(D&&I){var Q=D.split(`
|
|
4
|
+
`),oe=I.split(`
|
|
5
|
+
`);for(a=s=0;s<Q.length&&!Q[s].includes("DetermineComponentFrameRoot");)s++;for(;a<oe.length&&!oe[a].includes("DetermineComponentFrameRoot");)a++;if(s===Q.length||a===oe.length)for(s=Q.length-1,a=oe.length-1;1<=s&&0<=a&&Q[s]!==oe[a];)a--;for(;1<=s&&0<=a;s--,a--)if(Q[s]!==oe[a]){if(s!==1||a!==1)do if(s--,a--,0>a||Q[s]!==oe[a]){var fe=`
|
|
6
|
+
`+Q[s].replace(" at new "," at ");return e.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",e.displayName)),fe}while(1<=s&&0<=a);break}}}finally{$e=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?Ae(i):""}function ke(e,t){switch(e.tag){case 26:case 27:case 5:return Ae(e.type);case 16:return Ae("Lazy");case 13:return e.child!==t&&t!==null?Ae("Suspense Fallback"):Ae("Suspense");case 19:return Ae("SuspenseList");case 0:case 15:return Xe(e.type,!1);case 11:return Xe(e.type.render,!1);case 1:return Xe(e.type,!0);case 31:return Ae("Activity");default:return""}}function Ht(e){try{var t="",i=null;do t+=ke(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
|
|
7
|
+
Error generating stack: `+s.message+`
|
|
8
|
+
`+s.stack}}var ge=Object.prototype.hasOwnProperty,de=l.unstable_scheduleCallback,Se=l.unstable_cancelCallback,Ee=l.unstable_shouldYield,ye=l.unstable_requestPaint,Re=l.unstable_now,Ke=l.unstable_getCurrentPriorityLevel,Be=l.unstable_ImmediatePriority,st=l.unstable_UserBlockingPriority,ht=l.unstable_NormalPriority,kt=l.unstable_LowPriority,tt=l.unstable_IdlePriority,Qe=l.log,He=l.unstable_setDisableYieldValue,Ci=null,Rt=null;function Qt(e){if(typeof Qe=="function"&&He(e),Rt&&typeof Rt.setStrictMode=="function")try{Rt.setStrictMode(Ci,e)}catch{}}var zt=Math.clz32?Math.clz32:rn,$s=Math.log,sn=Math.LN2;function rn(e){return e>>>=0,e===0?32:31-($s(e)/sn|0)|0}var Je=256,yt=262144,Ss=4194304;function Jt(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 nn(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var a=0,f=e.suspendedLanes,D=e.pingedLanes;e=e.warmLanes;var I=s&134217727;return I!==0?(s=I&~f,s!==0?a=Jt(s):(D&=I,D!==0?a=Jt(D):i||(i=I&~e,i!==0&&(a=Jt(i))))):(I=s&~f,I!==0?a=Jt(I):D!==0?a=Jt(D):i||(i=s&~e,i!==0&&(a=Jt(i)))),a===0?0:t!==0&&t!==a&&(t&f)===0&&(f=a&-a,i=t&-t,f>=i||f===32&&(i&4194048)!==0)?t:a}function Fs(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function sc(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 ea(){var e=Ss;return Ss<<=1,(Ss&62914560)===0&&(Ss=4194304),e}function hi(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Oi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function is(e,t,i,s,a,f){var D=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 I=e.entanglements,Q=e.expirationTimes,oe=e.hiddenUpdates;for(i=D&~i;0<i;){var fe=31-zt(i),ve=1<<fe;I[fe]=0,Q[fe]=-1;var ce=oe[fe];if(ce!==null)for(oe[fe]=null,fe=0;fe<ce.length;fe++){var he=ce[fe];he!==null&&(he.lane&=-536870913)}i&=~ve}s!==0&&ta(e,s,0),f!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=f&~(D&~t))}function ta(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-zt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function bs(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-zt(i),a=1<<s;a&t|e[s]&t&&(e[s]|=t),i&=~a}}function an(e,t){var i=t&-t;return i=(i&42)!==0?1:qi(i),(i&(e.suspendedLanes|t))!==0?0:i}function qi(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 ys(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Cs(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:w_(e.type))}function Gi(e,t){var i=Y.p;try{return Y.p=e,t()}finally{Y.p=i}}var ri=Math.random().toString(36).slice(2),Ct="__reactFiber$"+ri,Ut="__reactProps$"+ri,ni="__reactContainer$"+ri,Ws="__reactEvents$"+ri,ln="__reactListeners$"+ri,rc="__reactHandles$"+ri,ss="__reactResources$"+ri,rs="__reactMarker$"+ri;function qs(e){delete e[Ct],delete e[Ut],delete e[Ws],delete e[ln],delete e[rc]}function ws(e){var t=e[Ct];if(t)return t;for(var i=e.parentNode;i;){if(t=i[ni]||i[Ct]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=l_(e);e!==null;){if(i=e[Ct])return i;e=l_(e)}return t}e=i,i=e.parentNode}return null}function wi(e){if(e=e[Ct]||e[ni]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Gs(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(T(33))}function xs(e){var t=e[ss];return t||(t=e[ss]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function xt(e){e[rs]=!0}var ml=new Set,on={};function ns(e,t){Ki(e,t),Ki(e+"Capture",t)}function Ki(e,t){for(on[e]=t,e=0;e<t.length;e++)ml.add(t[e])}var Bi=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]*$"),ia={},sa={};function ra(e){return ge.call(sa,e)?!0:ge.call(ia,e)?!1:Bi.test(e)?sa[e]=!0:(ia[e]=!0,!1)}function na(e,t,i){if(ra(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function xr(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 xi(e,t,i,s){if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+s)}}function ui(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Er(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function nc(e,t,i){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var a=s.get,f=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(D){i=""+D,f.call(this,D)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(D){i=""+D},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ks(e){if(!e._valueTracker){var t=Er(e)?"checked":"value";e._valueTracker=nc(e,t,""+e[t])}}function vl(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=Er(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}function cn(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 hn=/[\n"\\]/g;function ei(e){return e.replace(hn,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function aa(e,t,i,s,a,f,D,I){e.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?e.type=D:e.removeAttribute("type"),t!=null?D==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ui(t)):e.value!==""+ui(t)&&(e.value=""+ui(t)):D!=="submit"&&D!=="reset"||e.removeAttribute("value"),t!=null?la(e,D,ui(t)):i!=null?la(e,D,ui(i)):s!=null&&e.removeAttribute("value"),a==null&&f!=null&&(e.defaultChecked=!!f),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?e.name=""+ui(I):e.removeAttribute("name")}function Ar(e,t,i,s,a,f,D,I){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||i!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){Ks(e);return}i=i!=null?""+ui(i):"",t=t!=null?""+ui(t):i,I||t===e.value||(e.value=t),e.defaultValue=t}s=s??a,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=I?e.checked:!!s,e.defaultChecked=!!s,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(e.name=D),Ks(e)}function la(e,t,i){t==="number"&&cn(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function as(e,t,i,s){if(e=e.options,t){t={};for(var a=0;a<i.length;a++)t["$"+i[a]]=!0;for(i=0;i<e.length;i++)a=t.hasOwnProperty("$"+e[i].value),e[i].selected!==a&&(e[i].selected=a),a&&s&&(e[i].defaultSelected=!0)}else{for(i=""+ui(i),t=null,a=0;a<e.length;a++){if(e[a].value===i){e[a].selected=!0,s&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function oa(e,t,i){if(t!=null&&(t=""+ui(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+ui(i):""}function gl(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(T(92));if(re(s)){if(1<s.length)throw Error(T(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=ui(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),Ks(e)}function Es(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var un=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 Sl(e,t,i){var s=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,i):typeof i!="number"||i===0||un.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function ca(e,t,i){if(t!=null&&typeof t!="object")throw Error(T(62));if(e=e.style,i!=null){for(var s in i)!i.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var a in t)s=t[a],t.hasOwnProperty(a)&&i[a]!==s&&Sl(e,a,s)}else for(var f in t)t.hasOwnProperty(f)&&Sl(e,f,t[f])}function dn(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 bl=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"]]),yl=/^[\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 ti(e){return yl.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Vi(){}var ha=null;function ua(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vs=null,Ys=null;function Cl(e){var t=wi(e);if(t&&(e=t.stateNode)){var i=e[Ut]||null;e:switch(e=t.stateNode,t.type){case"input":if(aa(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="'+ei(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var a=s[Ut]||null;if(!a)throw Error(T(90));aa(s,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&vl(s)}break e;case"textarea":oa(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&as(e,!!i.multiple,t,!1)}}}var da=!1;function wl(e,t,i){if(da)return e(t,i);da=!0;try{var s=e(t);return s}finally{if(da=!1,(Vs!==null||Ys!==null)&&(yo(),Vs&&(t=Vs,e=Ys,Ys=Vs=null,Cl(t),e)))for(t=0;t<e.length;t++)Cl(e[t])}}function ii(e,t){var i=e.stateNode;if(i===null)return null;var s=i[Ut]||null;if(s===null)return null;i=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(T(231,t,typeof i));return i}var ji=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fa=!1;if(ji)try{var it={};Object.defineProperty(it,"passive",{get:function(){fa=!0}}),window.addEventListener("test",it,it),window.removeEventListener("test",it,it)}catch{fa=!1}var $t=null,wt=null,qt=null;function _a(){if(qt)return qt;var e,t=wt,i=t.length,s,a="value"in $t?$t.value:$t.textContent,f=a.length;for(e=0;e<i&&t[e]===a[e];e++);var D=i-e;for(s=1;s<=D&&t[i-s]===a[f-s];s++);return qt=a.slice(e,1<s?1-s:void 0)}function et(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 Ft(){return!0}function As(){return!1}function It(e){function t(i,s,a,f,D){this._reactName=i,this._targetInst=a,this.type=s,this.nativeEvent=f,this.target=D,this.currentTarget=null;for(var I in e)e.hasOwnProperty(I)&&(i=e[I],this[I]=i?i(f):f[I]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Ft:As,this.isPropagationStopped=As,this}return o(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=Ft)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Ft)},persist:function(){},isPersistent:Ft}),t}var di={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ni=It(di),lt=o({},di,{view:0,detail:0}),xl=It(lt),ls,fn,Xs,Rs=o({},lt,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pn,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!==Xs&&(Xs&&e.type==="mousemove"?(ls=e.screenX-Xs.screenX,fn=e.screenY-Xs.screenY):fn=ls=0,Xs=e),ls)},movementY:function(e){return"movementY"in e?e.movementY:fn}}),pa=It(Rs),_n=o({},Rs,{dataTransfer:0}),El=It(_n),ma=o({},lt,{relatedTarget:0}),Yi=It(ma),ac=o({},di,{animationName:0,elapsedTime:0,pseudoElement:0}),Gt=It(ac),lc=o({},di,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),oc=It(lc),Xi=o({},di,{data:0}),os=It(Xi),cc={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hc={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"},va={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function uc(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=va[e])?!!t[e]:!1}function pn(){return uc}var dc=o({},lt,{key:function(e){if(e.key){var t=cc[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=et(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?hc[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pn,charCode:function(e){return e.type==="keypress"?et(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?et(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),fc=It(dc),_c=o({},Rs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mn=It(_c),pc=o({},lt,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pn}),mc=It(pc),vc=o({},di,{propertyName:0,elapsedTime:0,pseudoElement:0}),vn=It(vc),Al=o({},Rs,{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}),gc=It(Al),Rl=o({},di,{newState:0,oldState:0}),Sc=It(Rl),bc=[9,13,27,32],ga=ji&&"CompositionEvent"in window,Rr=null;ji&&"documentMode"in document&&(Rr=document.documentMode);var Ll=ji&&"TextEvent"in window&&!Rr,gn=ji&&(!ga||Rr&&8<Rr&&11>=Rr),Sa=" ",Ml=!1;function Tl(e,t){switch(e){case"keyup":return bc.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ba(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var cs=!1;function yc(e,t){switch(e){case"compositionend":return ba(t);case"keypress":return t.which!==32?null:(Ml=!0,Sa);case"textInput":return e=t.data,e===Sa&&Ml?null:e;default:return null}}function Dl(e,t){if(cs)return e==="compositionend"||!ga&&Tl(e,t)?(e=_a(),qt=wt=$t=null,cs=!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 gn&&t.locale!=="ko"?null:t.data;default:return null}}var kl={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 Ol(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!kl[e.type]:t==="textarea"}function Bl(e,t,i,s){Vs?Ys?Ys.push(s):Ys=[s]:Vs=s,t=Lo(t,"onChange"),0<t.length&&(i=new Ni("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var Lr=null,Mr=null;function ya(e){Kf(e,0)}function Hi(e){var t=Gs(e);if(vl(t))return e}function jl(e,t){if(e==="change")return t}var Sn=!1;if(ji){var Tr;if(ji){var bn="oninput"in document;if(!bn){var Nl=document.createElement("div");Nl.setAttribute("oninput","return;"),bn=typeof Nl.oninput=="function"}Tr=bn}else Tr=!1;Sn=Tr&&(!document.documentMode||9<document.documentMode)}function Ca(){Lr&&(Lr.detachEvent("onpropertychange",Dr),Mr=Lr=null)}function Dr(e){if(e.propertyName==="value"&&Hi(Mr)){var t=[];Bl(t,Mr,e,ua(e)),wl(ya,t)}}function Cc(e,t,i){e==="focusin"?(Ca(),Lr=t,Mr=i,Lr.attachEvent("onpropertychange",Dr)):e==="focusout"&&Ca()}function wc(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Hi(Mr)}function xc(e,t){if(e==="click")return Hi(t)}function Ec(e,t){if(e==="input"||e==="change")return Hi(t)}function wa(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ai=typeof Object.is=="function"?Object.is:wa;function kr(e,t){if(ai(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var a=i[s];if(!ge.call(t,a)||!ai(e[a],t[a]))return!1}return!0}function Hl(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function yn(e,t){var i=Hl(e);e=0;for(var s;i;){if(i.nodeType===3){if(s=e+i.textContent.length,e<=t&&s>=t)return{node:i,offset:t-e};e=s}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Hl(i)}}function xa(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xa(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ea(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=cn(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=cn(e.document)}return t}function Aa(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 zl=ji&&"documentMode"in document&&11>=document.documentMode,Ei=null,Zs=null,Or=null,Ra=!1;function Ul(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Ra||Ei==null||Ei!==cn(s)||(s=Ei,"selectionStart"in s&&Aa(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Or&&kr(Or,s)||(Or=s,s=Lo(Zs,"onSelect"),0<s.length&&(t=new Ni("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=Ei)))}function hs(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Ls={animationend:hs("Animation","AnimationEnd"),animationiteration:hs("Animation","AnimationIteration"),animationstart:hs("Animation","AnimationStart"),transitionrun:hs("Transition","TransitionRun"),transitionstart:hs("Transition","TransitionStart"),transitioncancel:hs("Transition","TransitionCancel"),transitionend:hs("Transition","TransitionEnd")},Zi={},us={};ji&&(us=document.createElement("div").style,"AnimationEvent"in window||(delete Ls.animationend.animation,delete Ls.animationiteration.animation,delete Ls.animationstart.animation),"TransitionEvent"in window||delete Ls.transitionend.transition);function ds(e){if(Zi[e])return Zi[e];if(!Ls[e])return e;var t=Ls[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in us)return Zi[e]=t[i];return e}var Il=ds("animationend"),La=ds("animationiteration"),Ma=ds("animationstart"),Pl=ds("transitionrun"),Cn=ds("transitionstart"),$l=ds("transitioncancel"),Fl=ds("transitionend"),Wl=new Map,wn="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(" ");wn.push("scrollEnd");function fi(e,t){Wl.set(e,t),ns(t,[e])}var Br=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)},_i=[],Qs=0,Ta=0;function xn(){for(var e=Qs,t=Ta=Qs=0;t<e;){var i=_i[t];_i[t++]=null;var s=_i[t];_i[t++]=null;var a=_i[t];_i[t++]=null;var f=_i[t];if(_i[t++]=null,s!==null&&a!==null){var D=s.pending;D===null?a.next=a:(a.next=D.next,D.next=a),s.pending=a}f!==0&&ka(i,a,f)}}function En(e,t,i,s){_i[Qs++]=e,_i[Qs++]=t,_i[Qs++]=i,_i[Qs++]=s,Ta|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Da(e,t,i,s){return En(e,t,i,s),An(e)}function Ai(e,t){return En(e,null,null,t),An(e)}function ka(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var a=!1,f=e.return;f!==null;)f.childLanes|=i,s=f.alternate,s!==null&&(s.childLanes|=i),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(a=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,a&&t!==null&&(a=31-zt(i),e=f.hiddenUpdates,s=e[a],s===null?e[a]=[t]:s.push(t),t.lane=i|536870912),f):null}function An(e){if(50<tl)throw tl=0,Mh=null,Error(T(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Js={};function ql(e,t,i,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function li(e,t,i,s){return new ql(e,t,i,s)}function Oa(e){return e=e.prototype,!(!e||!e.isReactComponent)}function w(e,t){var i=e.alternate;return i===null?(i=li(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 U(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 V(e,t,i,s,a,f){var D=0;if(s=e,typeof e=="function")Oa(e)&&(D=1);else if(typeof e=="string")D=sv(e,i,se.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case A:return e=li(31,i,t,a),e.elementType=A,e.lanes=f,e;case p:return ee(i.children,a,f,t);case n:D=8,a|=24;break;case h:return e=li(12,i,t,a|2),e.elementType=h,e.lanes=f,e;case R:return e=li(13,i,t,a),e.elementType=R,e.lanes=f,e;case y:return e=li(19,i,t,a),e.elementType=y,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case c:D=10;break e;case u:D=9;break e;case g:D=11;break e;case M:D=14;break e;case b:D=16,s=null;break e}D=29,i=Error(T(130,e===null?"null":typeof e,"")),s=null}return t=li(D,i,t,a),t.elementType=e,t.type=s,t.lanes=f,t}function ee(e,t,i,s){return e=li(7,e,s,t),e.lanes=i,e}function be(e,t,i){return e=li(6,e,null,t),e.lanes=i,e}function we(e){var t=li(18,null,null,0);return t.stateNode=e,t}function Me(e,t,i){return t=li(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Pe=new WeakMap;function pt(e,t){if(typeof e=="object"&&e!==null){var i=Pe.get(e);return i!==void 0?i:(t={value:e,source:t,stack:Ht(t)},Pe.set(e,t),t)}return{value:e,source:t,stack:Ht(t)}}var Lt=[],zi=0,Mt=null,Qi=0,mt=[],Kt=0,pi=null,oi=1,Ui="";function fs(e,t){Lt[zi++]=Qi,Lt[zi++]=Mt,Mt=e,Qi=t}function Ii(e,t,i){mt[Kt++]=oi,mt[Kt++]=Ui,mt[Kt++]=pi,pi=e;var s=oi;e=Ui;var a=32-zt(s)-1;s&=~(1<<a),i+=1;var f=32-zt(t)+a;if(30<f){var D=a-a%5;f=(s&(1<<D)-1).toString(32),s>>=D,a-=D,oi=1<<32-zt(t)+a|i<<a|s,Ui=f+e}else oi=1<<f|i<<a|s,Ui=e}function Ba(e){e.return!==null&&(fs(e,1),Ii(e,1,0))}function jr(e){for(;e===Mt;)Mt=Lt[--zi],Lt[zi]=null,Qi=Lt[--zi],Lt[zi]=null;for(;e===pi;)pi=mt[--Kt],mt[Kt]=null,Ui=mt[--Kt],mt[Kt]=null,oi=mt[--Kt],mt[Kt]=null}function Nr(e,t){mt[Kt++]=oi,mt[Kt++]=Ui,mt[Kt++]=pi,oi=t.id,Ui=t.overflow,pi=e}var Vt=null,vt=null,Ze=!1,er=null,Pi=!1,Ac=Error(T(519));function tr(e){var t=Error(T(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ja(pt(t,e)),Ac}function Ou(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[Ct]=e,t[Ut]=s,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<sl.length;i++)Ge(sl[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),Ar(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Ge("invalid",t);break;case"textarea":Ge("invalid",t),gl(t,s.value,s.defaultValue,s.children)}i=s.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||s.suppressHydrationWarning===!0||Zf(t.textContent,i)?(s.popover!=null&&(Ge("beforetoggle",t),Ge("toggle",t)),s.onScroll!=null&&Ge("scroll",t),s.onScrollEnd!=null&&Ge("scrollend",t),s.onClick!=null&&(t.onclick=Vi),t=!0):t=!1,t||tr(e,!0)}function Bu(e){for(Vt=e.return;Vt;)switch(Vt.tag){case 5:case 31:case 13:Pi=!1;return;case 27:case 3:Pi=!0;return;default:Vt=Vt.return}}function Rn(e){if(e!==Vt)return!1;if(!Ze)return Bu(e),Ze=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Wh(e.type,e.memoizedProps)),i=!i),i&&vt&&tr(e),Bu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(T(317));vt=a_(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(T(317));vt=a_(e)}else t===27?(t=vt,pr(e.type)?(e=Yh,Yh=null,vt=e):vt=t):vt=Vt?Fi(e.stateNode.nextSibling):null;return!0}function Hr(){vt=Vt=null,Ze=!1}function Rc(){var e=er;return e!==null&&(Si===null?Si=e:Si.push.apply(Si,e),er=null),e}function ja(e){er===null?er=[e]:er.push(e)}var Lc=B(null),zr=null,Ms=null;function ir(e,t,i){J(Lc,t._currentValue),t._currentValue=i}function Ts(e){e._currentValue=Lc.current,P(Lc)}function Mc(e,t,i){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===i)break;e=e.return}}function Tc(e,t,i,s){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var f=a.dependencies;if(f!==null){var D=a.child;f=f.firstContext;e:for(;f!==null;){var I=f;f=a;for(var Q=0;Q<t.length;Q++)if(I.context===t[Q]){f.lanes|=i,I=f.alternate,I!==null&&(I.lanes|=i),Mc(f.return,i,e),s||(D=null);break e}f=I.next}}else if(a.tag===18){if(D=a.return,D===null)throw Error(T(341));D.lanes|=i,f=D.alternate,f!==null&&(f.lanes|=i),Mc(D,i,e),D=null}else D=a.child;if(D!==null)D.return=a;else for(D=a;D!==null;){if(D===e){D=null;break}if(a=D.sibling,a!==null){a.return=D.return,D=a;break}D=D.return}a=D}}function Ln(e,t,i,s){e=null;for(var a=t,f=!1;a!==null;){if(!f){if((a.flags&524288)!==0)f=!0;else if((a.flags&262144)!==0)break}if(a.tag===10){var D=a.alternate;if(D===null)throw Error(T(387));if(D=D.memoizedProps,D!==null){var I=a.type;ai(a.pendingProps.value,D.value)||(e!==null?e.push(I):e=[I])}}else if(a===Z.current){if(D=a.alternate,D===null)throw Error(T(387));D.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(ol):e=[ol])}a=a.return}e!==null&&Tc(t,e,i,s),t.flags|=262144}function Gl(e){for(e=e.firstContext;e!==null;){if(!ai(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ur(e){zr=e,Ms=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yt(e){return ju(zr,e)}function Kl(e,t){return zr===null&&Ur(e),ju(e,t)}function ju(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Ms===null){if(e===null)throw Error(T(308));Ms=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ms=Ms.next=t;return i}var Jp=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},em=l.unstable_scheduleCallback,tm=l.unstable_NormalPriority,Ot={$$typeof:c,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Dc(){return{controller:new Jp,data:new Map,refCount:0}}function Na(e){e.refCount--,e.refCount===0&&em(tm,function(){e.controller.abort()})}var Ha=null,kc=0,Mn=0,Tn=null;function im(e,t){if(Ha===null){var i=Ha=[];kc=0,Mn=jh(),Tn={status:"pending",value:void 0,then:function(s){i.push(s)}}}return kc++,t.then(Nu,Nu),t}function Nu(){if(--kc===0&&Ha!==null){Tn!==null&&(Tn.status="fulfilled");var e=Ha;Ha=null,Mn=0,Tn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function sm(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(a){i.push(a)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var a=0;a<i.length;a++)(0,i[a])(t)},function(a){for(s.status="rejected",s.reason=a,a=0;a<i.length;a++)(0,i[a])(void 0)}),s}var Hu=G.S;G.S=function(e,t){yf=Re(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&im(e,t),Hu!==null&&Hu(e,t)};var Ir=B(null);function Oc(){var e=Ir.current;return e!==null?e:_t.pooledCache}function Vl(e,t){t===null?J(Ir,Ir.current):J(Ir,t.pool)}function zu(){var e=Oc();return e===null?null:{parent:Ot._currentValue,pool:e}}var Dn=Error(T(460)),Bc=Error(T(474)),Yl=Error(T(542)),Xl={then:function(){}};function Uu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Iu(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Vi,Vi),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,$u(e),e;default:if(typeof t.status=="string")t.then(Vi,Vi);else{if(e=_t,e!==null&&100<e.shellSuspendCounter)throw Error(T(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=s}},function(s){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,$u(e),e}throw $r=t,Dn}}function Pr(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?($r=i,Dn):i}}var $r=null;function Pu(){if($r===null)throw Error(T(459));var e=$r;return $r=null,e}function $u(e){if(e===Dn||e===Yl)throw Error(T(483))}var kn=null,za=0;function Zl(e){var t=za;return za+=1,kn===null&&(kn=[]),Iu(kn,e,t)}function Ua(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ql(e,t){throw t.$$typeof===S?Error(T(525)):(e=Object.prototype.toString.call(t),Error(T(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Fu(e){function t(ne,te){if(e){var le=ne.deletions;le===null?(ne.deletions=[te],ne.flags|=16):le.push(te)}}function i(ne,te){if(!e)return null;for(;te!==null;)t(ne,te),te=te.sibling;return null}function s(ne){for(var te=new Map;ne!==null;)ne.key!==null?te.set(ne.key,ne):te.set(ne.index,ne),ne=ne.sibling;return te}function a(ne,te){return ne=w(ne,te),ne.index=0,ne.sibling=null,ne}function f(ne,te,le){return ne.index=le,e?(le=ne.alternate,le!==null?(le=le.index,le<te?(ne.flags|=67108866,te):le):(ne.flags|=67108866,te)):(ne.flags|=1048576,te)}function D(ne){return e&&ne.alternate===null&&(ne.flags|=67108866),ne}function I(ne,te,le,pe){return te===null||te.tag!==6?(te=be(le,ne.mode,pe),te.return=ne,te):(te=a(te,le),te.return=ne,te)}function Q(ne,te,le,pe){var Oe=le.type;return Oe===p?fe(ne,te,le.props.children,pe,le.key):te!==null&&(te.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===b&&Pr(Oe)===te.type)?(te=a(te,le.props),Ua(te,le),te.return=ne,te):(te=V(le.type,le.key,le.props,null,ne.mode,pe),Ua(te,le),te.return=ne,te)}function oe(ne,te,le,pe){return te===null||te.tag!==4||te.stateNode.containerInfo!==le.containerInfo||te.stateNode.implementation!==le.implementation?(te=Me(le,ne.mode,pe),te.return=ne,te):(te=a(te,le.children||[]),te.return=ne,te)}function fe(ne,te,le,pe,Oe){return te===null||te.tag!==7?(te=ee(le,ne.mode,pe,Oe),te.return=ne,te):(te=a(te,le),te.return=ne,te)}function ve(ne,te,le){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=be(""+te,ne.mode,le),te.return=ne,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case C:return le=V(te.type,te.key,te.props,null,ne.mode,le),Ua(le,te),le.return=ne,le;case E:return te=Me(te,ne.mode,le),te.return=ne,te;case b:return te=Pr(te),ve(ne,te,le)}if(re(te)||H(te))return te=ee(te,ne.mode,le,null),te.return=ne,te;if(typeof te.then=="function")return ve(ne,Zl(te),le);if(te.$$typeof===c)return ve(ne,Kl(ne,te),le);Ql(ne,te)}return null}function ce(ne,te,le,pe){var Oe=te!==null?te.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Oe!==null?null:I(ne,te,""+le,pe);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case C:return le.key===Oe?Q(ne,te,le,pe):null;case E:return le.key===Oe?oe(ne,te,le,pe):null;case b:return le=Pr(le),ce(ne,te,le,pe)}if(re(le)||H(le))return Oe!==null?null:fe(ne,te,le,pe,null);if(typeof le.then=="function")return ce(ne,te,Zl(le),pe);if(le.$$typeof===c)return ce(ne,te,Kl(ne,le),pe);Ql(ne,le)}return null}function he(ne,te,le,pe,Oe){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return ne=ne.get(le)||null,I(te,ne,""+pe,Oe);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case C:return ne=ne.get(pe.key===null?le:pe.key)||null,Q(te,ne,pe,Oe);case E:return ne=ne.get(pe.key===null?le:pe.key)||null,oe(te,ne,pe,Oe);case b:return pe=Pr(pe),he(ne,te,le,pe,Oe)}if(re(pe)||H(pe))return ne=ne.get(le)||null,fe(te,ne,pe,Oe,null);if(typeof pe.then=="function")return he(ne,te,le,Zl(pe),Oe);if(pe.$$typeof===c)return he(ne,te,le,Kl(te,pe),Oe);Ql(te,pe)}return null}function Le(ne,te,le,pe){for(var Oe=null,rt=null,Te=te,We=te=0,Ye=null;Te!==null&&We<le.length;We++){Te.index>We?(Ye=Te,Te=null):Ye=Te.sibling;var nt=ce(ne,Te,le[We],pe);if(nt===null){Te===null&&(Te=Ye);break}e&&Te&&nt.alternate===null&&t(ne,Te),te=f(nt,te,We),rt===null?Oe=nt:rt.sibling=nt,rt=nt,Te=Ye}if(We===le.length)return i(ne,Te),Ze&&fs(ne,We),Oe;if(Te===null){for(;We<le.length;We++)Te=ve(ne,le[We],pe),Te!==null&&(te=f(Te,te,We),rt===null?Oe=Te:rt.sibling=Te,rt=Te);return Ze&&fs(ne,We),Oe}for(Te=s(Te);We<le.length;We++)Ye=he(Te,ne,We,le[We],pe),Ye!==null&&(e&&Ye.alternate!==null&&Te.delete(Ye.key===null?We:Ye.key),te=f(Ye,te,We),rt===null?Oe=Ye:rt.sibling=Ye,rt=Ye);return e&&Te.forEach(function(br){return t(ne,br)}),Ze&&fs(ne,We),Oe}function Ne(ne,te,le,pe){if(le==null)throw Error(T(151));for(var Oe=null,rt=null,Te=te,We=te=0,Ye=null,nt=le.next();Te!==null&&!nt.done;We++,nt=le.next()){Te.index>We?(Ye=Te,Te=null):Ye=Te.sibling;var br=ce(ne,Te,nt.value,pe);if(br===null){Te===null&&(Te=Ye);break}e&&Te&&br.alternate===null&&t(ne,Te),te=f(br,te,We),rt===null?Oe=br:rt.sibling=br,rt=br,Te=Ye}if(nt.done)return i(ne,Te),Ze&&fs(ne,We),Oe;if(Te===null){for(;!nt.done;We++,nt=le.next())nt=ve(ne,nt.value,pe),nt!==null&&(te=f(nt,te,We),rt===null?Oe=nt:rt.sibling=nt,rt=nt);return Ze&&fs(ne,We),Oe}for(Te=s(Te);!nt.done;We++,nt=le.next())nt=he(Te,ne,We,nt.value,pe),nt!==null&&(e&&nt.alternate!==null&&Te.delete(nt.key===null?We:nt.key),te=f(nt,te,We),rt===null?Oe=nt:rt.sibling=nt,rt=nt);return e&&Te.forEach(function(_v){return t(ne,_v)}),Ze&&fs(ne,We),Oe}function ft(ne,te,le,pe){if(typeof le=="object"&&le!==null&&le.type===p&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case C:e:{for(var Oe=le.key;te!==null;){if(te.key===Oe){if(Oe=le.type,Oe===p){if(te.tag===7){i(ne,te.sibling),pe=a(te,le.props.children),pe.return=ne,ne=pe;break e}}else if(te.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===b&&Pr(Oe)===te.type){i(ne,te.sibling),pe=a(te,le.props),Ua(pe,le),pe.return=ne,ne=pe;break e}i(ne,te);break}else t(ne,te);te=te.sibling}le.type===p?(pe=ee(le.props.children,ne.mode,pe,le.key),pe.return=ne,ne=pe):(pe=V(le.type,le.key,le.props,null,ne.mode,pe),Ua(pe,le),pe.return=ne,ne=pe)}return D(ne);case E:e:{for(Oe=le.key;te!==null;){if(te.key===Oe)if(te.tag===4&&te.stateNode.containerInfo===le.containerInfo&&te.stateNode.implementation===le.implementation){i(ne,te.sibling),pe=a(te,le.children||[]),pe.return=ne,ne=pe;break e}else{i(ne,te);break}else t(ne,te);te=te.sibling}pe=Me(le,ne.mode,pe),pe.return=ne,ne=pe}return D(ne);case b:return le=Pr(le),ft(ne,te,le,pe)}if(re(le))return Le(ne,te,le,pe);if(H(le)){if(Oe=H(le),typeof Oe!="function")throw Error(T(150));return le=Oe.call(le),Ne(ne,te,le,pe)}if(typeof le.then=="function")return ft(ne,te,Zl(le),pe);if(le.$$typeof===c)return ft(ne,te,Kl(ne,le),pe);Ql(ne,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,te!==null&&te.tag===6?(i(ne,te.sibling),pe=a(te,le),pe.return=ne,ne=pe):(i(ne,te),pe=be(le,ne.mode,pe),pe.return=ne,ne=pe),D(ne)):i(ne,te)}return function(ne,te,le,pe){try{za=0;var Oe=ft(ne,te,le,pe);return kn=null,Oe}catch(Te){if(Te===Dn||Te===Yl)throw Te;var rt=li(29,Te,null,ne.mode);return rt.lanes=pe,rt.return=ne,rt}}}var Fr=Fu(!0),Wu=Fu(!1),sr=!1;function jc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nc(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 rr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function nr(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(at&2)!==0){var a=s.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),s.pending=t,t=An(e),ka(e,null,i),t}return En(e,s,t,i),An(e)}function Ia(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,bs(e,i)}}function Hc(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var a=null,f=null;if(i=i.firstBaseUpdate,i!==null){do{var D={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};f===null?a=f=D:f=f.next=D,i=i.next}while(i!==null);f===null?a=f=t:f=f.next=t}else a=f=t;i={baseState:s.baseState,firstBaseUpdate:a,lastBaseUpdate:f,shared:s.shared,callbacks:s.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var zc=!1;function Pa(){if(zc){var e=Tn;if(e!==null)throw e}}function $a(e,t,i,s){zc=!1;var a=e.updateQueue;sr=!1;var f=a.firstBaseUpdate,D=a.lastBaseUpdate,I=a.shared.pending;if(I!==null){a.shared.pending=null;var Q=I,oe=Q.next;Q.next=null,D===null?f=oe:D.next=oe,D=Q;var fe=e.alternate;fe!==null&&(fe=fe.updateQueue,I=fe.lastBaseUpdate,I!==D&&(I===null?fe.firstBaseUpdate=oe:I.next=oe,fe.lastBaseUpdate=Q))}if(f!==null){var ve=a.baseState;D=0,fe=oe=Q=null,I=f;do{var ce=I.lane&-536870913,he=ce!==I.lane;if(he?(Ve&ce)===ce:(s&ce)===ce){ce!==0&&ce===Mn&&(zc=!0),fe!==null&&(fe=fe.next={lane:0,tag:I.tag,payload:I.payload,callback:null,next:null});e:{var Le=e,Ne=I;ce=t;var ft=i;switch(Ne.tag){case 1:if(Le=Ne.payload,typeof Le=="function"){ve=Le.call(ft,ve,ce);break e}ve=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=Ne.payload,ce=typeof Le=="function"?Le.call(ft,ve,ce):Le,ce==null)break e;ve=o({},ve,ce);break e;case 2:sr=!0}}ce=I.callback,ce!==null&&(e.flags|=64,he&&(e.flags|=8192),he=a.callbacks,he===null?a.callbacks=[ce]:he.push(ce))}else he={lane:ce,tag:I.tag,payload:I.payload,callback:I.callback,next:null},fe===null?(oe=fe=he,Q=ve):fe=fe.next=he,D|=ce;if(I=I.next,I===null){if(I=a.shared.pending,I===null)break;he=I,I=he.next,he.next=null,a.lastBaseUpdate=he,a.shared.pending=null}}while(!0);fe===null&&(Q=ve),a.baseState=Q,a.firstBaseUpdate=oe,a.lastBaseUpdate=fe,f===null&&(a.shared.lanes=0),hr|=D,e.lanes=D,e.memoizedState=ve}}function qu(e,t){if(typeof e!="function")throw Error(T(191,e));e.call(t)}function Gu(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)qu(i[e],t)}var On=B(null),Jl=B(0);function Ku(e,t){e=Us,J(Jl,e),J(On,t),Us=e|t.baseLanes}function Uc(){J(Jl,Us),J(On,On.current)}function Ic(){Us=Jl.current,P(On),P(Jl)}var Ri=B(null),$i=null;function ar(e){var t=e.alternate;J(Tt,Tt.current&1),J(Ri,e),$i===null&&(t===null||On.current!==null||t.memoizedState!==null)&&($i=e)}function Pc(e){J(Tt,Tt.current),J(Ri,e),$i===null&&($i=e)}function Vu(e){e.tag===22?(J(Tt,Tt.current),J(Ri,e),$i===null&&($i=e)):lr()}function lr(){J(Tt,Tt.current),J(Ri,Ri.current)}function Li(e){P(Ri),$i===e&&($i=null),P(Tt)}var Tt=B(0);function eo(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Kh(i)||Vh(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 Ds=0,Fe=null,ut=null,Bt=null,to=!1,Bn=!1,Wr=!1,io=0,Fa=0,jn=null,rm=0;function Et(){throw Error(T(321))}function $c(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!ai(e[i],t[i]))return!1;return!0}function Fc(e,t,i,s,a,f){return Ds=f,Fe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,G.H=e===null||e.memoizedState===null?Dd:rh,Wr=!1,f=i(s,a),Wr=!1,Bn&&(f=Xu(t,i,s,a)),Yu(e),f}function Yu(e){G.H=Ga;var t=ut!==null&&ut.next!==null;if(Ds=0,Bt=ut=Fe=null,to=!1,Fa=0,jn=null,t)throw Error(T(300));e===null||jt||(e=e.dependencies,e!==null&&Gl(e)&&(jt=!0))}function Xu(e,t,i,s){Fe=e;var a=0;do{if(Bn&&(jn=null),Fa=0,Bn=!1,25<=a)throw Error(T(301));if(a+=1,Bt=ut=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}G.H=kd,f=t(i,s)}while(Bn);return f}function nm(){var e=G.H,t=e.useState()[0];return t=typeof t.then=="function"?Wa(t):t,e=e.useState()[0],(ut!==null?ut.memoizedState:null)!==e&&(Fe.flags|=1024),t}function Wc(){var e=io!==0;return io=0,e}function qc(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function Gc(e){if(to){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}to=!1}Ds=0,Bt=ut=Fe=null,Bn=!1,Fa=io=0,jn=null}function ci(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?Fe.memoizedState=Bt=e:Bt=Bt.next=e,Bt}function Dt(){if(ut===null){var e=Fe.alternate;e=e!==null?e.memoizedState:null}else e=ut.next;var t=Bt===null?Fe.memoizedState:Bt.next;if(t!==null)Bt=t,ut=e;else{if(e===null)throw Fe.alternate===null?Error(T(467)):Error(T(310));ut=e,e={memoizedState:ut.memoizedState,baseState:ut.baseState,baseQueue:ut.baseQueue,queue:ut.queue,next:null},Bt===null?Fe.memoizedState=Bt=e:Bt=Bt.next=e}return Bt}function so(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Wa(e){var t=Fa;return Fa+=1,jn===null&&(jn=[]),e=Iu(jn,e,t),t=Fe,(Bt===null?t.memoizedState:Bt.next)===null&&(t=t.alternate,G.H=t===null||t.memoizedState===null?Dd:rh),e}function ro(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Wa(e);if(e.$$typeof===c)return Yt(e)}throw Error(T(438,String(e)))}function Kc(e){var t=null,i=Fe.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=Fe.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=so(),Fe.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),s=0;s<e;s++)i[s]=O;return t.index++,i}function ks(e,t){return typeof t=="function"?t(e):t}function no(e){var t=Dt();return Vc(t,ut,e)}function Vc(e,t,i){var s=e.queue;if(s===null)throw Error(T(311));s.lastRenderedReducer=i;var a=e.baseQueue,f=s.pending;if(f!==null){if(a!==null){var D=a.next;a.next=f.next,f.next=D}t.baseQueue=a=f,s.pending=null}if(f=e.baseState,a===null)e.memoizedState=f;else{t=a.next;var I=D=null,Q=null,oe=t,fe=!1;do{var ve=oe.lane&-536870913;if(ve!==oe.lane?(Ve&ve)===ve:(Ds&ve)===ve){var ce=oe.revertLane;if(ce===0)Q!==null&&(Q=Q.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),ve===Mn&&(fe=!0);else if((Ds&ce)===ce){oe=oe.next,ce===Mn&&(fe=!0);continue}else ve={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},Q===null?(I=Q=ve,D=f):Q=Q.next=ve,Fe.lanes|=ce,hr|=ce;ve=oe.action,Wr&&i(f,ve),f=oe.hasEagerState?oe.eagerState:i(f,ve)}else ce={lane:ve,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},Q===null?(I=Q=ce,D=f):Q=Q.next=ce,Fe.lanes|=ve,hr|=ve;oe=oe.next}while(oe!==null&&oe!==t);if(Q===null?D=f:Q.next=I,!ai(f,e.memoizedState)&&(jt=!0,fe&&(i=Tn,i!==null)))throw i;e.memoizedState=f,e.baseState=D,e.baseQueue=Q,s.lastRenderedState=f}return a===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Yc(e){var t=Dt(),i=t.queue;if(i===null)throw Error(T(311));i.lastRenderedReducer=e;var s=i.dispatch,a=i.pending,f=t.memoizedState;if(a!==null){i.pending=null;var D=a=a.next;do f=e(f,D.action),D=D.next;while(D!==a);ai(f,t.memoizedState)||(jt=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),i.lastRenderedState=f}return[f,s]}function Zu(e,t,i){var s=Fe,a=Dt(),f=Ze;if(f){if(i===void 0)throw Error(T(407));i=i()}else i=t();var D=!ai((ut||a).memoizedState,i);if(D&&(a.memoizedState=i,jt=!0),a=a.queue,Qc(ed.bind(null,s,a,e),[e]),a.getSnapshot!==t||D||Bt!==null&&Bt.memoizedState.tag&1){if(s.flags|=2048,Nn(9,{destroy:void 0},Ju.bind(null,s,a,i,t),null),_t===null)throw Error(T(349));f||(Ds&127)!==0||Qu(s,t,i)}return i}function Qu(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Fe.updateQueue,t===null?(t=so(),Fe.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Ju(e,t,i,s){t.value=i,t.getSnapshot=s,td(t)&&id(e)}function ed(e,t,i){return i(function(){td(t)&&id(e)})}function td(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!ai(e,i)}catch{return!0}}function id(e){var t=Ai(e,2);t!==null&&bi(t,e,2)}function Xc(e){var t=ci();if(typeof e=="function"){var i=e;if(e=i(),Wr){Qt(!0);try{i()}finally{Qt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ks,lastRenderedState:e},t}function sd(e,t,i,s){return e.baseState=i,Vc(e,ut,typeof s=="function"?s:ks)}function am(e,t,i,s,a){if(oo(e))throw Error(T(485));if(e=t.action,e!==null){var f={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){f.listeners.push(D)}};G.T!==null?i(!0):f.isTransition=!1,s(f),i=t.pending,i===null?(f.next=t.pending=f,rd(t,f)):(f.next=i.next,t.pending=i.next=f)}}function rd(e,t){var i=t.action,s=t.payload,a=e.state;if(t.isTransition){var f=G.T,D={};G.T=D;try{var I=i(a,s),Q=G.S;Q!==null&&Q(D,I),nd(e,t,I)}catch(oe){Zc(e,t,oe)}finally{f!==null&&D.types!==null&&(f.types=D.types),G.T=f}}else try{f=i(a,s),nd(e,t,f)}catch(oe){Zc(e,t,oe)}}function nd(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){ad(e,t,s)},function(s){return Zc(e,t,s)}):ad(e,t,i)}function ad(e,t,i){t.status="fulfilled",t.value=i,ld(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,rd(e,i)))}function Zc(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,ld(t),t=t.next;while(t!==s)}e.action=null}function ld(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function od(e,t){return t}function cd(e,t){if(Ze){var i=_t.formState;if(i!==null){e:{var s=Fe;if(Ze){if(vt){t:{for(var a=vt,f=Pi;a.nodeType!==8;){if(!f){a=null;break t}if(a=Fi(a.nextSibling),a===null){a=null;break t}}f=a.data,a=f==="F!"||f==="F"?a:null}if(a){vt=Fi(a.nextSibling),s=a.data==="F!";break e}}tr(s)}s=!1}s&&(t=i[0])}}return i=ci(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:od,lastRenderedState:t},i.queue=s,i=Ld.bind(null,Fe,s),s.dispatch=i,s=Xc(!1),f=sh.bind(null,Fe,!1,s.queue),s=ci(),a={state:t,dispatch:null,action:e,pending:null},s.queue=a,i=am.bind(null,Fe,a,f,i),a.dispatch=i,s.memoizedState=e,[t,i,!1]}function hd(e){var t=Dt();return ud(t,ut,e)}function ud(e,t,i){if(t=Vc(e,t,od)[0],e=no(ks)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Wa(t)}catch(D){throw D===Dn?Yl:D}else s=t;t=Dt();var a=t.queue,f=a.dispatch;return i!==t.memoizedState&&(Fe.flags|=2048,Nn(9,{destroy:void 0},lm.bind(null,a,i),null)),[s,f,e]}function lm(e,t){e.action=t}function dd(e){var t=Dt(),i=ut;if(i!==null)return ud(t,i,e);Dt(),t=t.memoizedState,i=Dt();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function Nn(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=Fe.updateQueue,t===null&&(t=so(),Fe.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(s=i.next,i.next=e,e.next=s,t.lastEffect=e),e}function fd(){return Dt().memoizedState}function ao(e,t,i,s){var a=ci();Fe.flags|=e,a.memoizedState=Nn(1|t,{destroy:void 0},i,s===void 0?null:s)}function lo(e,t,i,s){var a=Dt();s=s===void 0?null:s;var f=a.memoizedState.inst;ut!==null&&s!==null&&$c(s,ut.memoizedState.deps)?a.memoizedState=Nn(t,f,i,s):(Fe.flags|=e,a.memoizedState=Nn(1|t,f,i,s))}function _d(e,t){ao(8390656,8,e,t)}function Qc(e,t){lo(2048,8,e,t)}function om(e){Fe.flags|=4;var t=Fe.updateQueue;if(t===null)t=so(),Fe.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function pd(e){var t=Dt().memoizedState;return om({ref:t,nextImpl:e}),function(){if((at&2)!==0)throw Error(T(440));return t.impl.apply(void 0,arguments)}}function md(e,t){return lo(4,2,e,t)}function vd(e,t){return lo(4,4,e,t)}function gd(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 Sd(e,t,i){i=i!=null?i.concat([e]):null,lo(4,4,gd.bind(null,t,e),i)}function Jc(){}function bd(e,t){var i=Dt();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&$c(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function yd(e,t){var i=Dt();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&$c(t,s[1]))return s[0];if(s=e(),Wr){Qt(!0);try{e()}finally{Qt(!1)}}return i.memoizedState=[s,t],s}function eh(e,t,i){return i===void 0||(Ds&1073741824)!==0&&(Ve&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=wf(),Fe.lanes|=e,hr|=e,i)}function Cd(e,t,i,s){return ai(i,t)?i:On.current!==null?(e=eh(e,i,s),ai(e,t)||(jt=!0),e):(Ds&42)===0||(Ds&1073741824)!==0&&(Ve&261930)===0?(jt=!0,e.memoizedState=i):(e=wf(),Fe.lanes|=e,hr|=e,t)}function wd(e,t,i,s,a){var f=Y.p;Y.p=f!==0&&8>f?f:8;var D=G.T,I={};G.T=I,sh(e,!1,t,i);try{var Q=a(),oe=G.S;if(oe!==null&&oe(I,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var fe=sm(Q,s);qa(e,t,fe,Di(e))}else qa(e,t,s,Di(e))}catch(ve){qa(e,t,{then:function(){},status:"rejected",reason:ve},Di())}finally{Y.p=f,D!==null&&I.types!==null&&(D.types=I.types),G.T=D}}function cm(){}function th(e,t,i,s){if(e.tag!==5)throw Error(T(476));var a=xd(e).queue;wd(e,a,t,X,i===null?cm:function(){return Ed(e),i(s)})}function xd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ks,lastRenderedState:X},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ks,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ed(e){var t=xd(e);t.next===null&&(t=e.alternate.memoizedState),qa(e,t.next.queue,{},Di())}function ih(){return Yt(ol)}function Ad(){return Dt().memoizedState}function Rd(){return Dt().memoizedState}function hm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Di();e=rr(i);var s=nr(t,e,i);s!==null&&(bi(s,t,i),Ia(s,t,i)),t={cache:Dc()},e.payload=t;return}t=t.return}}function um(e,t,i){var s=Di();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},oo(e)?Md(t,i):(i=Da(e,t,i,s),i!==null&&(bi(i,e,s),Td(i,t,s)))}function Ld(e,t,i){var s=Di();qa(e,t,i,s)}function qa(e,t,i,s){var a={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(oo(e))Md(t,a);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var D=t.lastRenderedState,I=f(D,i);if(a.hasEagerState=!0,a.eagerState=I,ai(I,D))return En(e,t,a,0),_t===null&&xn(),!1}catch{}if(i=Da(e,t,a,s),i!==null)return bi(i,e,s),Td(i,t,s),!0}return!1}function sh(e,t,i,s){if(s={lane:2,revertLane:jh(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},oo(e)){if(t)throw Error(T(479))}else t=Da(e,i,s,2),t!==null&&bi(t,e,2)}function oo(e){var t=e.alternate;return e===Fe||t!==null&&t===Fe}function Md(e,t){Bn=to=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Td(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,bs(e,i)}}var Ga={readContext:Yt,use:ro,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};Ga.useEffectEvent=Et;var Dd={readContext:Yt,use:ro,useCallback:function(e,t){return ci().memoizedState=[e,t===void 0?null:t],e},useContext:Yt,useEffect:_d,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,ao(4194308,4,gd.bind(null,t,e),i)},useLayoutEffect:function(e,t){return ao(4194308,4,e,t)},useInsertionEffect:function(e,t){ao(4,2,e,t)},useMemo:function(e,t){var i=ci();t=t===void 0?null:t;var s=e();if(Wr){Qt(!0);try{e()}finally{Qt(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=ci();if(i!==void 0){var a=i(t);if(Wr){Qt(!0);try{i(t)}finally{Qt(!1)}}}else a=t;return s.memoizedState=s.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},s.queue=e,e=e.dispatch=um.bind(null,Fe,e),[s.memoizedState,e]},useRef:function(e){var t=ci();return e={current:e},t.memoizedState=e},useState:function(e){e=Xc(e);var t=e.queue,i=Ld.bind(null,Fe,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Jc,useDeferredValue:function(e,t){var i=ci();return eh(i,e,t)},useTransition:function(){var e=Xc(!1);return e=wd.bind(null,Fe,e.queue,!0,!1),ci().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=Fe,a=ci();if(Ze){if(i===void 0)throw Error(T(407));i=i()}else{if(i=t(),_t===null)throw Error(T(349));(Ve&127)!==0||Qu(s,t,i)}a.memoizedState=i;var f={value:i,getSnapshot:t};return a.queue=f,_d(ed.bind(null,s,f,e),[e]),s.flags|=2048,Nn(9,{destroy:void 0},Ju.bind(null,s,f,i,t),null),i},useId:function(){var e=ci(),t=_t.identifierPrefix;if(Ze){var i=Ui,s=oi;i=(s&~(1<<32-zt(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=io++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=rm++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:ih,useFormState:cd,useActionState:cd,useOptimistic:function(e){var t=ci();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=sh.bind(null,Fe,!0,i),i.dispatch=t,[e,t]},useMemoCache:Kc,useCacheRefresh:function(){return ci().memoizedState=hm.bind(null,Fe)},useEffectEvent:function(e){var t=ci(),i={impl:e};return t.memoizedState=i,function(){if((at&2)!==0)throw Error(T(440));return i.impl.apply(void 0,arguments)}}},rh={readContext:Yt,use:ro,useCallback:bd,useContext:Yt,useEffect:Qc,useImperativeHandle:Sd,useInsertionEffect:md,useLayoutEffect:vd,useMemo:yd,useReducer:no,useRef:fd,useState:function(){return no(ks)},useDebugValue:Jc,useDeferredValue:function(e,t){var i=Dt();return Cd(i,ut.memoizedState,e,t)},useTransition:function(){var e=no(ks)[0],t=Dt().memoizedState;return[typeof e=="boolean"?e:Wa(e),t]},useSyncExternalStore:Zu,useId:Ad,useHostTransitionStatus:ih,useFormState:hd,useActionState:hd,useOptimistic:function(e,t){var i=Dt();return sd(i,ut,e,t)},useMemoCache:Kc,useCacheRefresh:Rd};rh.useEffectEvent=pd;var kd={readContext:Yt,use:ro,useCallback:bd,useContext:Yt,useEffect:Qc,useImperativeHandle:Sd,useInsertionEffect:md,useLayoutEffect:vd,useMemo:yd,useReducer:Yc,useRef:fd,useState:function(){return Yc(ks)},useDebugValue:Jc,useDeferredValue:function(e,t){var i=Dt();return ut===null?eh(i,e,t):Cd(i,ut.memoizedState,e,t)},useTransition:function(){var e=Yc(ks)[0],t=Dt().memoizedState;return[typeof e=="boolean"?e:Wa(e),t]},useSyncExternalStore:Zu,useId:Ad,useHostTransitionStatus:ih,useFormState:dd,useActionState:dd,useOptimistic:function(e,t){var i=Dt();return ut!==null?sd(i,ut,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Kc,useCacheRefresh:Rd};kd.useEffectEvent=pd;function nh(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:o({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var ah={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=Di(),a=rr(s);a.payload=t,i!=null&&(a.callback=i),t=nr(e,a,s),t!==null&&(bi(t,e,s),Ia(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=Di(),a=rr(s);a.tag=1,a.payload=t,i!=null&&(a.callback=i),t=nr(e,a,s),t!==null&&(bi(t,e,s),Ia(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Di(),s=rr(i);s.tag=2,t!=null&&(s.callback=t),t=nr(e,s,i),t!==null&&(bi(t,e,i),Ia(t,e,i))}};function Od(e,t,i,s,a,f,D){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,f,D):t.prototype&&t.prototype.isPureReactComponent?!kr(i,s)||!kr(a,f):!0}function Bd(e,t,i,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,s),t.state!==e&&ah.enqueueReplaceState(t,t.state,null)}function qr(e,t){var i=t;if("ref"in t){i={};for(var s in t)s!=="ref"&&(i[s]=t[s])}if(e=e.defaultProps){i===t&&(i=o({},i));for(var a in e)i[a]===void 0&&(i[a]=e[a])}return i}function jd(e){Br(e)}function Nd(e){console.error(e)}function Hd(e){Br(e)}function co(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function zd(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function lh(e,t,i){return i=rr(i),i.tag=3,i.payload={element:null},i.callback=function(){co(e,t)},i}function Ud(e){return e=rr(e),e.tag=3,e}function Id(e,t,i,s){var a=i.type.getDerivedStateFromError;if(typeof a=="function"){var f=s.value;e.payload=function(){return a(f)},e.callback=function(){zd(t,i,s)}}var D=i.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(e.callback=function(){zd(t,i,s),typeof a!="function"&&(ur===null?ur=new Set([this]):ur.add(this));var I=s.stack;this.componentDidCatch(s.value,{componentStack:I!==null?I:""})})}function dm(e,t,i,s,a){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&Ln(t,i,a,!0),i=Ri.current,i!==null){switch(i.tag){case 31:case 13:return $i===null?Co():i.alternate===null&&At===0&&(At=3),i.flags&=-257,i.flags|=65536,i.lanes=a,s===Xl?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),kh(e,s,a)),!1;case 22:return i.flags|=65536,s===Xl?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([s]):i.add(s)),kh(e,s,a)),!1}throw Error(T(435,i.tag))}return kh(e,s,a),Co(),!1}if(Ze)return t=Ri.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=a,s!==Ac&&(e=Error(T(422),{cause:s}),ja(pt(e,i)))):(s!==Ac&&(t=Error(T(423),{cause:s}),ja(pt(t,i))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,s=pt(s,i),a=lh(e.stateNode,s,a),Hc(e,a),At!==4&&(At=2)),!1;var f=Error(T(520),{cause:s});if(f=pt(f,i),el===null?el=[f]:el.push(f),At!==4&&(At=2),t===null)return!0;s=pt(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=a&-a,i.lanes|=e,e=lh(i.stateNode,s,e),Hc(i,e),!1;case 1:if(t=i.type,f=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(ur===null||!ur.has(f))))return i.flags|=65536,a&=-a,i.lanes|=a,a=Ud(a),Id(a,e,i,s),Hc(i,a),!1}i=i.return}while(i!==null);return!1}var oh=Error(T(461)),jt=!1;function Xt(e,t,i,s){t.child=e===null?Wu(t,null,i,s):Fr(t,e.child,i,s)}function Pd(e,t,i,s,a){i=i.render;var f=t.ref;if("ref"in s){var D={};for(var I in s)I!=="ref"&&(D[I]=s[I])}else D=s;return Ur(t),s=Fc(e,t,i,D,f,a),I=Wc(),e!==null&&!jt?(qc(e,t,a),Os(e,t,a)):(Ze&&I&&Ba(t),t.flags|=1,Xt(e,t,s,a),t.child)}function $d(e,t,i,s,a){if(e===null){var f=i.type;return typeof f=="function"&&!Oa(f)&&f.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=f,Fd(e,t,f,s,a)):(e=V(i.type,null,s,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!mh(e,a)){var D=f.memoizedProps;if(i=i.compare,i=i!==null?i:kr,i(D,s)&&e.ref===t.ref)return Os(e,t,a)}return t.flags|=1,e=w(f,s),e.ref=t.ref,e.return=t,t.child=e}function Fd(e,t,i,s,a){if(e!==null){var f=e.memoizedProps;if(kr(f,s)&&e.ref===t.ref)if(jt=!1,t.pendingProps=s=f,mh(e,a))(e.flags&131072)!==0&&(jt=!0);else return t.lanes=e.lanes,Os(e,t,a)}return ch(e,t,i,s,a)}function Wd(e,t,i,s){var a=s.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|i:i,e!==null){for(s=t.child=e.child,a=0;s!==null;)a=a|s.lanes|s.childLanes,s=s.sibling;s=a&~f}else s=0,t.child=null;return qd(e,t,f,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Vl(t,f!==null?f.cachePool:null),f!==null?Ku(t,f):Uc(),Vu(t);else return s=t.lanes=536870912,qd(e,t,f!==null?f.baseLanes|i:i,i,s)}else f!==null?(Vl(t,f.cachePool),Ku(t,f),lr(),t.memoizedState=null):(e!==null&&Vl(t,null),Uc(),lr());return Xt(e,t,a,i),t.child}function Ka(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function qd(e,t,i,s,a){var f=Oc();return f=f===null?null:{parent:Ot._currentValue,pool:f},t.memoizedState={baseLanes:i,cachePool:f},e!==null&&Vl(t,null),Uc(),Vu(t),e!==null&&Ln(e,t,s,!0),t.childLanes=a,null}function ho(e,t){return t=fo({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Gd(e,t,i){return Fr(t,e.child,null,i),e=ho(t,t.pendingProps),e.flags|=2,Li(t),t.memoizedState=null,e}function fm(e,t,i){var s=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ze){if(s.mode==="hidden")return e=ho(t,s),t.lanes=536870912,Ka(null,e);if(Pc(t),(e=vt)?(e=n_(e,Pi),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:pi!==null?{id:oi,overflow:Ui}:null,retryLane:536870912,hydrationErrors:null},i=we(e),i.return=t,t.child=i,Vt=t,vt=null)):e=null,e===null)throw tr(t);return t.lanes=536870912,null}return ho(t,s)}var f=e.memoizedState;if(f!==null){var D=f.dehydrated;if(Pc(t),a)if(t.flags&256)t.flags&=-257,t=Gd(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(T(558));else if(jt||Ln(e,t,i,!1),a=(i&e.childLanes)!==0,jt||a){if(s=_t,s!==null&&(D=an(s,i),D!==0&&D!==f.retryLane))throw f.retryLane=D,Ai(e,D),bi(s,e,D),oh;Co(),t=Gd(e,t,i)}else e=f.treeContext,vt=Fi(D.nextSibling),Vt=t,Ze=!0,er=null,Pi=!1,e!==null&&Nr(t,e),t=ho(t,s),t.flags|=4096;return t}return e=w(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function uo(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(T(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function ch(e,t,i,s,a){return Ur(t),i=Fc(e,t,i,s,void 0,a),s=Wc(),e!==null&&!jt?(qc(e,t,a),Os(e,t,a)):(Ze&&s&&Ba(t),t.flags|=1,Xt(e,t,i,a),t.child)}function Kd(e,t,i,s,a,f){return Ur(t),t.updateQueue=null,i=Xu(t,s,i,a),Yu(e),s=Wc(),e!==null&&!jt?(qc(e,t,f),Os(e,t,f)):(Ze&&s&&Ba(t),t.flags|=1,Xt(e,t,i,f),t.child)}function Vd(e,t,i,s,a){if(Ur(t),t.stateNode===null){var f=Js,D=i.contextType;typeof D=="object"&&D!==null&&(f=Yt(D)),f=new i(s,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=ah,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=s,f.state=t.memoizedState,f.refs={},jc(t),D=i.contextType,f.context=typeof D=="object"&&D!==null?Yt(D):Js,f.state=t.memoizedState,D=i.getDerivedStateFromProps,typeof D=="function"&&(nh(t,i,D,s),f.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(D=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),D!==f.state&&ah.enqueueReplaceState(f,f.state,null),$a(t,s,f,a),Pa(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){f=t.stateNode;var I=t.memoizedProps,Q=qr(i,I);f.props=Q;var oe=f.context,fe=i.contextType;D=Js,typeof fe=="object"&&fe!==null&&(D=Yt(fe));var ve=i.getDerivedStateFromProps;fe=typeof ve=="function"||typeof f.getSnapshotBeforeUpdate=="function",I=t.pendingProps!==I,fe||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(I||oe!==D)&&Bd(t,f,s,D),sr=!1;var ce=t.memoizedState;f.state=ce,$a(t,s,f,a),Pa(),oe=t.memoizedState,I||ce!==oe||sr?(typeof ve=="function"&&(nh(t,i,ve,s),oe=t.memoizedState),(Q=sr||Od(t,i,Q,s,ce,oe,D))?(fe||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=oe),f.props=s,f.state=oe,f.context=D,s=Q):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{f=t.stateNode,Nc(e,t),D=t.memoizedProps,fe=qr(i,D),f.props=fe,ve=t.pendingProps,ce=f.context,oe=i.contextType,Q=Js,typeof oe=="object"&&oe!==null&&(Q=Yt(oe)),I=i.getDerivedStateFromProps,(oe=typeof I=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(D!==ve||ce!==Q)&&Bd(t,f,s,Q),sr=!1,ce=t.memoizedState,f.state=ce,$a(t,s,f,a),Pa();var he=t.memoizedState;D!==ve||ce!==he||sr||e!==null&&e.dependencies!==null&&Gl(e.dependencies)?(typeof I=="function"&&(nh(t,i,I,s),he=t.memoizedState),(fe=sr||Od(t,i,fe,s,ce,he,Q)||e!==null&&e.dependencies!==null&&Gl(e.dependencies))?(oe||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(s,he,Q),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(s,he,Q)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||D===e.memoizedProps&&ce===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&ce===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=he),f.props=s,f.state=he,f.context=Q,s=fe):(typeof f.componentDidUpdate!="function"||D===e.memoizedProps&&ce===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&ce===e.memoizedState||(t.flags|=1024),s=!1)}return f=s,uo(e,t),s=(t.flags&128)!==0,f||s?(f=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&s?(t.child=Fr(t,e.child,null,a),t.child=Fr(t,null,i,a)):Xt(e,t,i,a),t.memoizedState=f.state,e=t.child):e=Os(e,t,a),e}function Yd(e,t,i,s){return Hr(),t.flags|=256,Xt(e,t,i,s),t.child}var hh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function uh(e){return{baseLanes:e,cachePool:zu()}}function dh(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Ti),e}function Xd(e,t,i){var s=t.pendingProps,a=!1,f=(t.flags&128)!==0,D;if((D=f)||(D=e!==null&&e.memoizedState===null?!1:(Tt.current&2)!==0),D&&(a=!0,t.flags&=-129),D=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ze){if(a?ar(t):lr(),(e=vt)?(e=n_(e,Pi),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:pi!==null?{id:oi,overflow:Ui}:null,retryLane:536870912,hydrationErrors:null},i=we(e),i.return=t,t.child=i,Vt=t,vt=null)):e=null,e===null)throw tr(t);return Vh(e)?t.lanes=32:t.lanes=536870912,null}var I=s.children;return s=s.fallback,a?(lr(),a=t.mode,I=fo({mode:"hidden",children:I},a),s=ee(s,a,i,null),I.return=t,s.return=t,I.sibling=s,t.child=I,s=t.child,s.memoizedState=uh(i),s.childLanes=dh(e,D,i),t.memoizedState=hh,Ka(null,s)):(ar(t),fh(t,I))}var Q=e.memoizedState;if(Q!==null&&(I=Q.dehydrated,I!==null)){if(f)t.flags&256?(ar(t),t.flags&=-257,t=_h(e,t,i)):t.memoizedState!==null?(lr(),t.child=e.child,t.flags|=128,t=null):(lr(),I=s.fallback,a=t.mode,s=fo({mode:"visible",children:s.children},a),I=ee(I,a,i,null),I.flags|=2,s.return=t,I.return=t,s.sibling=I,t.child=s,Fr(t,e.child,null,i),s=t.child,s.memoizedState=uh(i),s.childLanes=dh(e,D,i),t.memoizedState=hh,t=Ka(null,s));else if(ar(t),Vh(I)){if(D=I.nextSibling&&I.nextSibling.dataset,D)var oe=D.dgst;D=oe,s=Error(T(419)),s.stack="",s.digest=D,ja({value:s,source:null,stack:null}),t=_h(e,t,i)}else if(jt||Ln(e,t,i,!1),D=(i&e.childLanes)!==0,jt||D){if(D=_t,D!==null&&(s=an(D,i),s!==0&&s!==Q.retryLane))throw Q.retryLane=s,Ai(e,s),bi(D,e,s),oh;Kh(I)||Co(),t=_h(e,t,i)}else Kh(I)?(t.flags|=192,t.child=e.child,t=null):(e=Q.treeContext,vt=Fi(I.nextSibling),Vt=t,Ze=!0,er=null,Pi=!1,e!==null&&Nr(t,e),t=fh(t,s.children),t.flags|=4096);return t}return a?(lr(),I=s.fallback,a=t.mode,Q=e.child,oe=Q.sibling,s=w(Q,{mode:"hidden",children:s.children}),s.subtreeFlags=Q.subtreeFlags&65011712,oe!==null?I=w(oe,I):(I=ee(I,a,i,null),I.flags|=2),I.return=t,s.return=t,s.sibling=I,t.child=s,Ka(null,s),s=t.child,I=e.child.memoizedState,I===null?I=uh(i):(a=I.cachePool,a!==null?(Q=Ot._currentValue,a=a.parent!==Q?{parent:Q,pool:Q}:a):a=zu(),I={baseLanes:I.baseLanes|i,cachePool:a}),s.memoizedState=I,s.childLanes=dh(e,D,i),t.memoizedState=hh,Ka(e.child,s)):(ar(t),i=e.child,e=i.sibling,i=w(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(D=t.deletions,D===null?(t.deletions=[e],t.flags|=16):D.push(e)),t.child=i,t.memoizedState=null,i)}function fh(e,t){return t=fo({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function fo(e,t){return e=li(22,e,null,t),e.lanes=0,e}function _h(e,t,i){return Fr(t,e.child,null,i),e=fh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Zd(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Mc(e.return,t,i)}function ph(e,t,i,s,a,f){var D=e.memoizedState;D===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:a,treeForkCount:f}:(D.isBackwards=t,D.rendering=null,D.renderingStartTime=0,D.last=s,D.tail=i,D.tailMode=a,D.treeForkCount=f)}function Qd(e,t,i){var s=t.pendingProps,a=s.revealOrder,f=s.tail;s=s.children;var D=Tt.current,I=(D&2)!==0;if(I?(D=D&1|2,t.flags|=128):D&=1,J(Tt,D),Xt(e,t,s,i),s=Ze?Qi:0,!I&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Zd(e,i,t);else if(e.tag===19)Zd(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(a){case"forwards":for(i=t.child,a=null;i!==null;)e=i.alternate,e!==null&&eo(e)===null&&(a=i),i=i.sibling;i=a,i===null?(a=t.child,t.child=null):(a=i.sibling,i.sibling=null),ph(t,!1,a,i,f,s);break;case"backwards":case"unstable_legacy-backwards":for(i=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&eo(e)===null){t.child=a;break}e=a.sibling,a.sibling=i,i=a,a=e}ph(t,!0,i,null,f,s);break;case"together":ph(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Os(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),hr|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Ln(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(T(153));if(t.child!==null){for(e=t.child,i=w(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=w(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function mh(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Gl(e)))}function _m(e,t,i){switch(t.tag){case 3:F(t,t.stateNode.containerInfo),ir(t,Ot,e.memoizedState.cache),Hr();break;case 27:case 5:me(t);break;case 4:F(t,t.stateNode.containerInfo);break;case 10:ir(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Pc(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(ar(t),t.flags|=128,null):(i&t.child.childLanes)!==0?Xd(e,t,i):(ar(t),e=Os(e,t,i),e!==null?e.sibling:null);ar(t);break;case 19:var a=(e.flags&128)!==0;if(s=(i&t.childLanes)!==0,s||(Ln(e,t,i,!1),s=(i&t.childLanes)!==0),a){if(s)return Qd(e,t,i);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),J(Tt,Tt.current),s)break;return null;case 22:return t.lanes=0,Wd(e,t,i,t.pendingProps);case 24:ir(t,Ot,e.memoizedState.cache)}return Os(e,t,i)}function Jd(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)jt=!0;else{if(!mh(e,i)&&(t.flags&128)===0)return jt=!1,_m(e,t,i);jt=(e.flags&131072)!==0}else jt=!1,Ze&&(t.flags&1048576)!==0&&Ii(t,Qi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=Pr(t.elementType),t.type=e,typeof e=="function")Oa(e)?(s=qr(e,s),t.tag=1,t=Vd(null,t,e,s,i)):(t.tag=0,t=ch(null,t,e,s,i));else{if(e!=null){var a=e.$$typeof;if(a===g){t.tag=11,t=Pd(null,t,e,s,i);break e}else if(a===M){t.tag=14,t=$d(null,t,e,s,i);break e}}throw t=K(e)||e,Error(T(306,t,""))}}return t;case 0:return ch(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,a=qr(s,t.pendingProps),Vd(e,t,s,a,i);case 3:e:{if(F(t,t.stateNode.containerInfo),e===null)throw Error(T(387));s=t.pendingProps;var f=t.memoizedState;a=f.element,Nc(e,t),$a(t,s,null,i);var D=t.memoizedState;if(s=D.cache,ir(t,Ot,s),s!==f.cache&&Tc(t,[Ot],i,!0),Pa(),s=D.element,f.isDehydrated)if(f={element:s,isDehydrated:!1,cache:D.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=Yd(e,t,s,i);break e}else if(s!==a){a=pt(Error(T(424)),t),ja(a),t=Yd(e,t,s,i);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,vt=Fi(e.firstChild),Vt=t,Ze=!0,er=null,Pi=!0,i=Wu(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Hr(),s===a){t=Os(e,t,i);break e}Xt(e,t,s,i)}t=t.child}return t;case 26:return uo(e,t),e===null?(i=u_(t.type,null,t.pendingProps,null))?t.memoizedState=i:Ze||(i=t.type,e=t.pendingProps,s=Mo(_e.current).createElement(i),s[Ct]=t,s[Ut]=e,Zt(s,i,e),xt(s),t.stateNode=s):t.memoizedState=u_(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return me(t),e===null&&Ze&&(s=t.stateNode=o_(t.type,t.pendingProps,_e.current),Vt=t,Pi=!0,a=vt,pr(t.type)?(Yh=a,vt=Fi(s.firstChild)):vt=a),Xt(e,t,t.pendingProps.children,i),uo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ze&&((a=s=vt)&&(s=Wm(s,t.type,t.pendingProps,Pi),s!==null?(t.stateNode=s,Vt=t,vt=Fi(s.firstChild),Pi=!1,a=!0):a=!1),a||tr(t)),me(t),a=t.type,f=t.pendingProps,D=e!==null?e.memoizedProps:null,s=f.children,Wh(a,f)?s=null:D!==null&&Wh(a,D)&&(t.flags|=32),t.memoizedState!==null&&(a=Fc(e,t,nm,null,null,i),ol._currentValue=a),uo(e,t),Xt(e,t,s,i),t.child;case 6:return e===null&&Ze&&((e=i=vt)&&(i=qm(i,t.pendingProps,Pi),i!==null?(t.stateNode=i,Vt=t,vt=null,e=!0):e=!1),e||tr(t)),null;case 13:return Xd(e,t,i);case 4:return F(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Fr(t,null,s,i):Xt(e,t,s,i),t.child;case 11:return Pd(e,t,t.type,t.pendingProps,i);case 7:return Xt(e,t,t.pendingProps,i),t.child;case 8:return Xt(e,t,t.pendingProps.children,i),t.child;case 12:return Xt(e,t,t.pendingProps.children,i),t.child;case 10:return s=t.pendingProps,ir(t,t.type,s.value),Xt(e,t,s.children,i),t.child;case 9:return a=t.type._context,s=t.pendingProps.children,Ur(t),a=Yt(a),s=s(a),t.flags|=1,Xt(e,t,s,i),t.child;case 14:return $d(e,t,t.type,t.pendingProps,i);case 15:return Fd(e,t,t.type,t.pendingProps,i);case 19:return Qd(e,t,i);case 31:return fm(e,t,i);case 22:return Wd(e,t,i,t.pendingProps);case 24:return Ur(t),s=Yt(Ot),e===null?(a=Oc(),a===null&&(a=_t,f=Dc(),a.pooledCache=f,f.refCount++,f!==null&&(a.pooledCacheLanes|=i),a=f),t.memoizedState={parent:s,cache:a},jc(t),ir(t,Ot,a)):((e.lanes&i)!==0&&(Nc(e,t),$a(t,null,null,i),Pa()),a=e.memoizedState,f=t.memoizedState,a.parent!==s?(a={parent:s,cache:s},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ir(t,Ot,s)):(s=f.cache,ir(t,Ot,s),s!==a.cache&&Tc(t,[Ot],i,!0))),Xt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(T(156,t.tag))}function Bs(e){e.flags|=4}function vh(e,t,i,s,a){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(Rf())e.flags|=8192;else throw $r=Xl,Bc}else e.flags&=-16777217}function ef(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!m_(t))if(Rf())e.flags|=8192;else throw $r=Xl,Bc}function _o(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ea():536870912,e.lanes|=t,In|=t)}function Va(e,t){if(!Ze)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 s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function gt(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var a=e.child;a!==null;)i|=a.lanes|a.childLanes,s|=a.subtreeFlags&65011712,s|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)i|=a.lanes|a.childLanes,s|=a.subtreeFlags,s|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function pm(e,t,i){var s=t.pendingProps;switch(jr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gt(t),null;case 1:return gt(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Ts(Ot),ae(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Rn(t)?Bs(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Rc())),gt(t),null;case 26:var a=t.type,f=t.memoizedState;return e===null?(Bs(t),f!==null?(gt(t),ef(t,f)):(gt(t),vh(t,a,null,s,i))):f?f!==e.memoizedState?(Bs(t),gt(t),ef(t,f)):(gt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Bs(t),gt(t),vh(t,a,e,s,i)),null;case 27:if(xe(t),i=_e.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Bs(t);else{if(!s){if(t.stateNode===null)throw Error(T(166));return gt(t),null}e=se.current,Rn(t)?Ou(t):(e=o_(a,s,i),t.stateNode=e,Bs(t))}return gt(t),null;case 5:if(xe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Bs(t);else{if(!s){if(t.stateNode===null)throw Error(T(166));return gt(t),null}if(f=se.current,Rn(t))Ou(t);else{var D=Mo(_e.current);switch(f){case 1:f=D.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:f=D.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":f=D.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":f=D.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":f=D.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof s.is=="string"?D.createElement("select",{is:s.is}):D.createElement("select"),s.multiple?f.multiple=!0:s.size&&(f.size=s.size);break;default:f=typeof s.is=="string"?D.createElement(a,{is:s.is}):D.createElement(a)}}f[Ct]=t,f[Ut]=s;e:for(D=t.child;D!==null;){if(D.tag===5||D.tag===6)f.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===t)break e;for(;D.sibling===null;){if(D.return===null||D.return===t)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}t.stateNode=f;e:switch(Zt(f,a,s),a){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Bs(t)}}return gt(t),vh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Bs(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(T(166));if(e=_e.current,Rn(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,a=Vt,a!==null)switch(a.tag){case 27:case 5:s=a.memoizedProps}e[Ct]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||Zf(e.nodeValue,i)),e||tr(t,!0)}else e=Mo(e).createTextNode(s),e[Ct]=t,t.stateNode=e}return gt(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=Rn(t),i!==null){if(e===null){if(!s)throw Error(T(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(T(557));e[Ct]=t}else Hr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),e=!1}else i=Rc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(Li(t),t):(Li(t),null);if((t.flags&128)!==0)throw Error(T(558))}return gt(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Rn(t),s!==null&&s.dehydrated!==null){if(e===null){if(!a)throw Error(T(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(T(317));a[Ct]=t}else Hr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),a=!1}else a=Rc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Li(t),t):(Li(t),null)}return Li(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,a=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(a=s.alternate.memoizedState.cachePool.pool),f=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),f!==a&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),_o(t,t.updateQueue),gt(t),null);case 4:return ae(),e===null&&Uh(t.stateNode.containerInfo),gt(t),null;case 10:return Ts(t.type),gt(t),null;case 19:if(P(Tt),s=t.memoizedState,s===null)return gt(t),null;if(a=(t.flags&128)!==0,f=s.rendering,f===null)if(a)Va(s,!1);else{if(At!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=eo(e),f!==null){for(t.flags|=128,Va(s,!1),e=f.updateQueue,t.updateQueue=e,_o(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)U(i,e),i=i.sibling;return J(Tt,Tt.current&1|2),Ze&&fs(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Re()>So&&(t.flags|=128,a=!0,Va(s,!1),t.lanes=4194304)}else{if(!a)if(e=eo(f),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,_o(t,e),Va(s,!0),s.tail===null&&s.tailMode==="hidden"&&!f.alternate&&!Ze)return gt(t),null}else 2*Re()-s.renderingStartTime>So&&i!==536870912&&(t.flags|=128,a=!0,Va(s,!1),t.lanes=4194304);s.isBackwards?(f.sibling=t.child,t.child=f):(e=s.last,e!==null?e.sibling=f:t.child=f,s.last=f)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Re(),e.sibling=null,i=Tt.current,J(Tt,a?i&1|2:i&1),Ze&&fs(t,s.treeForkCount),e):(gt(t),null);case 22:case 23:return Li(t),Ic(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(i&536870912)!==0&&(t.flags&128)===0&&(gt(t),t.subtreeFlags&6&&(t.flags|=8192)):gt(t),i=t.updateQueue,i!==null&&_o(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==i&&(t.flags|=2048),e!==null&&P(Ir),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Ts(Ot),gt(t),null;case 25:return null;case 30:return null}throw Error(T(156,t.tag))}function mm(e,t){switch(jr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ts(Ot),ae(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return xe(t),null;case 31:if(t.memoizedState!==null){if(Li(t),t.alternate===null)throw Error(T(340));Hr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Li(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(T(340));Hr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return P(Tt),null;case 4:return ae(),null;case 10:return Ts(t.type),null;case 22:case 23:return Li(t),Ic(),e!==null&&P(Ir),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ts(Ot),null;case 25:return null;default:return null}}function tf(e,t){switch(jr(t),t.tag){case 3:Ts(Ot),ae();break;case 26:case 27:case 5:xe(t);break;case 4:ae();break;case 31:t.memoizedState!==null&&Li(t);break;case 13:Li(t);break;case 19:P(Tt);break;case 10:Ts(t.type);break;case 22:case 23:Li(t),Ic(),e!==null&&P(Ir);break;case 24:Ts(Ot)}}function Ya(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var a=s.next;i=a;do{if((i.tag&e)===e){s=void 0;var f=i.create,D=i.inst;s=f(),D.destroy=s}i=i.next}while(i!==a)}}catch(I){ct(t,t.return,I)}}function or(e,t,i){try{var s=t.updateQueue,a=s!==null?s.lastEffect:null;if(a!==null){var f=a.next;s=f;do{if((s.tag&e)===e){var D=s.inst,I=D.destroy;if(I!==void 0){D.destroy=void 0,a=t;var Q=i,oe=I;try{oe()}catch(fe){ct(a,Q,fe)}}}s=s.next}while(s!==f)}}catch(fe){ct(t,t.return,fe)}}function sf(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Gu(t,i)}catch(s){ct(e,e.return,s)}}}function rf(e,t,i){i.props=qr(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){ct(e,t,s)}}function Xa(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof i=="function"?e.refCleanup=i(s):i.current=s}}catch(a){ct(e,t,a)}}function _s(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(a){ct(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(a){ct(e,t,a)}else i.current=null}function nf(e){var t=e.type,i=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break e;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(a){ct(e,e.return,a)}}function gh(e,t,i){try{var s=e.stateNode;zm(s,e.type,i,t),s[Ut]=t}catch(a){ct(e,e.return,a)}}function af(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&pr(e.type)||e.tag===4}function Sh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||af(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&&pr(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 bh(e,t,i){var s=e.tag;if(s===5||s===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=Vi));else if(s!==4&&(s===27&&pr(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(bh(e,t,i),e=e.sibling;e!==null;)bh(e,t,i),e=e.sibling}function po(e,t,i){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(s!==4&&(s===27&&pr(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(po(e,t,i),e=e.sibling;e!==null;)po(e,t,i),e=e.sibling}function lf(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);Zt(t,s,i),t[Ct]=e,t[Ut]=i}catch(f){ct(e,e.return,f)}}var js=!1,Nt=!1,yh=!1,of=typeof WeakSet=="function"?WeakSet:Set,Wt=null;function vm(e,t){if(e=e.containerInfo,$h=No,e=Ea(e),Aa(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var s=i.getSelection&&i.getSelection();if(s&&s.rangeCount!==0){i=s.anchorNode;var a=s.anchorOffset,f=s.focusNode;s=s.focusOffset;try{i.nodeType,f.nodeType}catch{i=null;break e}var D=0,I=-1,Q=-1,oe=0,fe=0,ve=e,ce=null;t:for(;;){for(var he;ve!==i||a!==0&&ve.nodeType!==3||(I=D+a),ve!==f||s!==0&&ve.nodeType!==3||(Q=D+s),ve.nodeType===3&&(D+=ve.nodeValue.length),(he=ve.firstChild)!==null;)ce=ve,ve=he;for(;;){if(ve===e)break t;if(ce===i&&++oe===a&&(I=D),ce===f&&++fe===s&&(Q=D),(he=ve.nextSibling)!==null)break;ve=ce,ce=ve.parentNode}ve=he}i=I===-1||Q===-1?null:{start:I,end:Q}}else i=null}i=i||{start:0,end:0}}else i=null;for(Fh={focusedElem:e,selectionRange:i},No=!1,Wt=t;Wt!==null;)if(t=Wt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Wt=e;else for(;Wt!==null;){switch(t=Wt,f=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++)a=e[i],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,i=t,a=f.memoizedProps,f=f.memoizedState,s=i.stateNode;try{var Le=qr(i.type,a);e=s.getSnapshotBeforeUpdate(Le,f),s.__reactInternalSnapshotBeforeUpdate=e}catch(Ne){ct(i,i.return,Ne)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)Gh(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Gh(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(T(163))}if(e=t.sibling,e!==null){e.return=t.return,Wt=e;break}Wt=t.return}}function cf(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:Hs(e,i),s&4&&Ya(5,i);break;case 1:if(Hs(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(D){ct(i,i.return,D)}else{var a=qr(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(D){ct(i,i.return,D)}}s&64&&sf(i),s&512&&Xa(i,i.return);break;case 3:if(Hs(e,i),s&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{Gu(e,t)}catch(D){ct(i,i.return,D)}}break;case 27:t===null&&s&4&&lf(i);case 26:case 5:Hs(e,i),t===null&&s&4&&nf(i),s&512&&Xa(i,i.return);break;case 12:Hs(e,i);break;case 31:Hs(e,i),s&4&&df(e,i);break;case 13:Hs(e,i),s&4&&ff(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=Am.bind(null,i),Gm(e,i))));break;case 22:if(s=i.memoizedState!==null||js,!s){t=t!==null&&t.memoizedState!==null||Nt,a=js;var f=Nt;js=s,(Nt=t)&&!f?zs(e,i,(i.subtreeFlags&8772)!==0):Hs(e,i),js=a,Nt=f}break;case 30:break;default:Hs(e,i)}}function hf(e){var t=e.alternate;t!==null&&(e.alternate=null,hf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&qs(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 St=null,mi=!1;function Ns(e,t,i){for(i=i.child;i!==null;)uf(e,t,i),i=i.sibling}function uf(e,t,i){if(Rt&&typeof Rt.onCommitFiberUnmount=="function")try{Rt.onCommitFiberUnmount(Ci,i)}catch{}switch(i.tag){case 26:Nt||_s(i,t),Ns(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Nt||_s(i,t);var s=St,a=mi;pr(i.type)&&(St=i.stateNode,mi=!1),Ns(e,t,i),nl(i.stateNode),St=s,mi=a;break;case 5:Nt||_s(i,t);case 6:if(s=St,a=mi,St=null,Ns(e,t,i),St=s,mi=a,St!==null)if(mi)try{(St.nodeType===9?St.body:St.nodeName==="HTML"?St.ownerDocument.body:St).removeChild(i.stateNode)}catch(f){ct(i,t,f)}else try{St.removeChild(i.stateNode)}catch(f){ct(i,t,f)}break;case 18:St!==null&&(mi?(e=St,s_(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Vn(e)):s_(St,i.stateNode));break;case 4:s=St,a=mi,St=i.stateNode.containerInfo,mi=!0,Ns(e,t,i),St=s,mi=a;break;case 0:case 11:case 14:case 15:or(2,i,t),Nt||or(4,i,t),Ns(e,t,i);break;case 1:Nt||(_s(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&rf(i,t,s)),Ns(e,t,i);break;case 21:Ns(e,t,i);break;case 22:Nt=(s=Nt)||i.memoizedState!==null,Ns(e,t,i),Nt=s;break;default:Ns(e,t,i)}}function df(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Vn(e)}catch(i){ct(t,t.return,i)}}}function ff(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Vn(e)}catch(i){ct(t,t.return,i)}}function gm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new of),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new of),t;default:throw Error(T(435,e.tag))}}function mo(e,t){var i=gm(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var a=Rm.bind(null,e,s);s.then(a,a)}})}function vi(e,t){var i=t.deletions;if(i!==null)for(var s=0;s<i.length;s++){var a=i[s],f=e,D=t,I=D;e:for(;I!==null;){switch(I.tag){case 27:if(pr(I.type)){St=I.stateNode,mi=!1;break e}break;case 5:St=I.stateNode,mi=!1;break e;case 3:case 4:St=I.stateNode.containerInfo,mi=!0;break e}I=I.return}if(St===null)throw Error(T(160));uf(f,D,a),St=null,mi=!1,f=a.alternate,f!==null&&(f.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_f(t,e),t=t.sibling}var Ji=null;function _f(e,t){var i=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:vi(t,e),gi(e),s&4&&(or(3,e,e.return),Ya(3,e),or(5,e,e.return));break;case 1:vi(t,e),gi(e),s&512&&(Nt||i===null||_s(i,i.return)),s&64&&js&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?s:i.concat(s))));break;case 26:var a=Ji;if(vi(t,e),gi(e),s&512&&(Nt||i===null||_s(i,i.return)),s&4){var f=i!==null?i.memoizedState:null;if(s=e.memoizedState,i===null)if(s===null)if(e.stateNode===null){e:{s=e.type,i=e.memoizedProps,a=a.ownerDocument||a;t:switch(s){case"title":f=a.getElementsByTagName("title")[0],(!f||f[rs]||f[Ct]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=a.createElement(s),a.head.insertBefore(f,a.querySelector("head > title"))),Zt(f,s,i),f[Ct]=e,xt(f),s=f;break e;case"link":var D=__("link","href",a).get(s+(i.href||""));if(D){for(var I=0;I<D.length;I++)if(f=D[I],f.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&f.getAttribute("rel")===(i.rel==null?null:i.rel)&&f.getAttribute("title")===(i.title==null?null:i.title)&&f.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){D.splice(I,1);break t}}f=a.createElement(s),Zt(f,s,i),a.head.appendChild(f);break;case"meta":if(D=__("meta","content",a).get(s+(i.content||""))){for(I=0;I<D.length;I++)if(f=D[I],f.getAttribute("content")===(i.content==null?null:""+i.content)&&f.getAttribute("name")===(i.name==null?null:i.name)&&f.getAttribute("property")===(i.property==null?null:i.property)&&f.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&f.getAttribute("charset")===(i.charSet==null?null:i.charSet)){D.splice(I,1);break t}}f=a.createElement(s),Zt(f,s,i),a.head.appendChild(f);break;default:throw Error(T(468,s))}f[Ct]=e,xt(f),s=f}e.stateNode=s}else p_(a,e.type,e.stateNode);else e.stateNode=f_(a,s,e.memoizedProps);else f!==s?(f===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):f.count--,s===null?p_(a,e.type,e.stateNode):f_(a,s,e.memoizedProps)):s===null&&e.stateNode!==null&&gh(e,e.memoizedProps,i.memoizedProps)}break;case 27:vi(t,e),gi(e),s&512&&(Nt||i===null||_s(i,i.return)),i!==null&&s&4&&gh(e,e.memoizedProps,i.memoizedProps);break;case 5:if(vi(t,e),gi(e),s&512&&(Nt||i===null||_s(i,i.return)),e.flags&32){a=e.stateNode;try{Es(a,"")}catch(Le){ct(e,e.return,Le)}}s&4&&e.stateNode!=null&&(a=e.memoizedProps,gh(e,a,i!==null?i.memoizedProps:a)),s&1024&&(yh=!0);break;case 6:if(vi(t,e),gi(e),s&4){if(e.stateNode===null)throw Error(T(162));s=e.memoizedProps,i=e.stateNode;try{i.nodeValue=s}catch(Le){ct(e,e.return,Le)}}break;case 3:if(ko=null,a=Ji,Ji=To(t.containerInfo),vi(t,e),Ji=a,gi(e),s&4&&i!==null&&i.memoizedState.isDehydrated)try{Vn(t.containerInfo)}catch(Le){ct(e,e.return,Le)}yh&&(yh=!1,pf(e));break;case 4:s=Ji,Ji=To(e.stateNode.containerInfo),vi(t,e),gi(e),Ji=s;break;case 12:vi(t,e),gi(e);break;case 31:vi(t,e),gi(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,mo(e,s)));break;case 13:vi(t,e),gi(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(go=Re()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,mo(e,s)));break;case 22:a=e.memoizedState!==null;var Q=i!==null&&i.memoizedState!==null,oe=js,fe=Nt;if(js=oe||a,Nt=fe||Q,vi(t,e),Nt=fe,js=oe,gi(e),s&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(i===null||Q||js||Nt||Gr(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){Q=i=t;try{if(f=Q.stateNode,a)D=f.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{I=Q.stateNode;var ve=Q.memoizedProps.style,ce=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;I.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(Le){ct(Q,Q.return,Le)}}}else if(t.tag===6){if(i===null){Q=t;try{Q.stateNode.nodeValue=a?"":Q.memoizedProps}catch(Le){ct(Q,Q.return,Le)}}}else if(t.tag===18){if(i===null){Q=t;try{var he=Q.stateNode;a?r_(he,!0):r_(Q.stateNode,!1)}catch(Le){ct(Q,Q.return,Le)}}}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}s&4&&(s=e.updateQueue,s!==null&&(i=s.retryQueue,i!==null&&(s.retryQueue=null,mo(e,i))));break;case 19:vi(t,e),gi(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,mo(e,s)));break;case 30:break;case 21:break;default:vi(t,e),gi(e)}}function gi(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(af(s)){i=s;break}s=s.return}if(i==null)throw Error(T(160));switch(i.tag){case 27:var a=i.stateNode,f=Sh(e);po(e,f,a);break;case 5:var D=i.stateNode;i.flags&32&&(Es(D,""),i.flags&=-33);var I=Sh(e);po(e,I,D);break;case 3:case 4:var Q=i.stateNode.containerInfo,oe=Sh(e);bh(e,oe,Q);break;default:throw Error(T(161))}}catch(fe){ct(e,e.return,fe)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function pf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;pf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Hs(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)cf(e,t.alternate,t),t=t.sibling}function Gr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:or(4,t,t.return),Gr(t);break;case 1:_s(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&rf(t,t.return,i),Gr(t);break;case 27:nl(t.stateNode);case 26:case 5:_s(t,t.return),Gr(t);break;case 22:t.memoizedState===null&&Gr(t);break;case 30:Gr(t);break;default:Gr(t)}e=e.sibling}}function zs(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,a=e,f=t,D=f.flags;switch(f.tag){case 0:case 11:case 15:zs(a,f,i),Ya(4,f);break;case 1:if(zs(a,f,i),s=f,a=s.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(oe){ct(s,s.return,oe)}if(s=f,a=s.updateQueue,a!==null){var I=s.stateNode;try{var Q=a.shared.hiddenCallbacks;if(Q!==null)for(a.shared.hiddenCallbacks=null,a=0;a<Q.length;a++)qu(Q[a],I)}catch(oe){ct(s,s.return,oe)}}i&&D&64&&sf(f),Xa(f,f.return);break;case 27:lf(f);case 26:case 5:zs(a,f,i),i&&s===null&&D&4&&nf(f),Xa(f,f.return);break;case 12:zs(a,f,i);break;case 31:zs(a,f,i),i&&D&4&&df(a,f);break;case 13:zs(a,f,i),i&&D&4&&ff(a,f);break;case 22:f.memoizedState===null&&zs(a,f,i),Xa(f,f.return);break;case 30:break;default:zs(a,f,i)}t=t.sibling}}function Ch(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&&Na(i))}function wh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Na(e))}function es(e,t,i,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)mf(e,t,i,s),t=t.sibling}function mf(e,t,i,s){var a=t.flags;switch(t.tag){case 0:case 11:case 15:es(e,t,i,s),a&2048&&Ya(9,t);break;case 1:es(e,t,i,s);break;case 3:es(e,t,i,s),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Na(e)));break;case 12:if(a&2048){es(e,t,i,s),e=t.stateNode;try{var f=t.memoizedProps,D=f.id,I=f.onPostCommit;typeof I=="function"&&I(D,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(Q){ct(t,t.return,Q)}}else es(e,t,i,s);break;case 31:es(e,t,i,s);break;case 13:es(e,t,i,s);break;case 23:break;case 22:f=t.stateNode,D=t.alternate,t.memoizedState!==null?f._visibility&2?es(e,t,i,s):Za(e,t):f._visibility&2?es(e,t,i,s):(f._visibility|=2,Hn(e,t,i,s,(t.subtreeFlags&10256)!==0||!1)),a&2048&&Ch(D,t);break;case 24:es(e,t,i,s),a&2048&&wh(t.alternate,t);break;default:es(e,t,i,s)}}function Hn(e,t,i,s,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,D=t,I=i,Q=s,oe=D.flags;switch(D.tag){case 0:case 11:case 15:Hn(f,D,I,Q,a),Ya(8,D);break;case 23:break;case 22:var fe=D.stateNode;D.memoizedState!==null?fe._visibility&2?Hn(f,D,I,Q,a):Za(f,D):(fe._visibility|=2,Hn(f,D,I,Q,a)),a&&oe&2048&&Ch(D.alternate,D);break;case 24:Hn(f,D,I,Q,a),a&&oe&2048&&wh(D.alternate,D);break;default:Hn(f,D,I,Q,a)}t=t.sibling}}function Za(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,a=s.flags;switch(s.tag){case 22:Za(i,s),a&2048&&Ch(s.alternate,s);break;case 24:Za(i,s),a&2048&&wh(s.alternate,s);break;default:Za(i,s)}t=t.sibling}}var Qa=8192;function zn(e,t,i){if(e.subtreeFlags&Qa)for(e=e.child;e!==null;)vf(e,t,i),e=e.sibling}function vf(e,t,i){switch(e.tag){case 26:zn(e,t,i),e.flags&Qa&&e.memoizedState!==null&&rv(i,Ji,e.memoizedState,e.memoizedProps);break;case 5:zn(e,t,i);break;case 3:case 4:var s=Ji;Ji=To(e.stateNode.containerInfo),zn(e,t,i),Ji=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Qa,Qa=16777216,zn(e,t,i),Qa=s):zn(e,t,i));break;default:zn(e,t,i)}}function gf(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 Ja(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];Wt=s,bf(s,e)}gf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Sf(e),e=e.sibling}function Sf(e){switch(e.tag){case 0:case 11:case 15:Ja(e),e.flags&2048&&or(9,e,e.return);break;case 3:Ja(e);break;case 12:Ja(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,vo(e)):Ja(e);break;default:Ja(e)}}function vo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];Wt=s,bf(s,e)}gf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:or(8,t,t.return),vo(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,vo(t));break;default:vo(t)}e=e.sibling}}function bf(e,t){for(;Wt!==null;){var i=Wt;switch(i.tag){case 0:case 11:case 15:or(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var s=i.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Na(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,Wt=s;else e:for(i=e;Wt!==null;){s=Wt;var a=s.sibling,f=s.return;if(hf(s),s===i){Wt=null;break e}if(a!==null){a.return=f,Wt=a;break e}Wt=f}}}var Sm={getCacheForType:function(e){var t=Yt(Ot),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Yt(Ot).controller.signal}},bm=typeof WeakMap=="function"?WeakMap:Map,at=0,_t=null,qe=null,Ve=0,ot=0,Mi=null,cr=!1,Un=!1,xh=!1,Us=0,At=0,hr=0,Kr=0,Eh=0,Ti=0,In=0,el=null,Si=null,Ah=!1,go=0,yf=0,So=1/0,bo=null,ur=null,Pt=0,dr=null,Pn=null,Is=0,Rh=0,Lh=null,Cf=null,tl=0,Mh=null;function Di(){return(at&2)!==0&&Ve!==0?Ve&-Ve:G.T!==null?jh():Cs()}function wf(){if(Ti===0)if((Ve&536870912)===0||Ze){var e=yt;yt<<=1,(yt&3932160)===0&&(yt=262144),Ti=e}else Ti=536870912;return e=Ri.current,e!==null&&(e.flags|=32),Ti}function bi(e,t,i){(e===_t&&(ot===2||ot===9)||e.cancelPendingCommit!==null)&&($n(e,0),fr(e,Ve,Ti,!1)),Oi(e,i),((at&2)===0||e!==_t)&&(e===_t&&((at&2)===0&&(Kr|=i),At===4&&fr(e,Ve,Ti,!1)),ps(e))}function xf(e,t,i){if((at&6)!==0)throw Error(T(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Fs(e,t),a=s?wm(e,t):Dh(e,t,!0),f=s;do{if(a===0){Un&&!s&&fr(e,t,0,!1);break}else{if(i=e.current.alternate,f&&!ym(i)){a=Dh(e,t,!1),f=!1;continue}if(a===2){if(f=t,e.errorRecoveryDisabledLanes&f)var D=0;else D=e.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){t=D;e:{var I=e;a=el;var Q=I.current.memoizedState.isDehydrated;if(Q&&($n(I,D).flags|=256),D=Dh(I,D,!1),D!==2){if(xh&&!Q){I.errorRecoveryDisabledLanes|=f,Kr|=f,a=4;break e}f=Si,Si=a,f!==null&&(Si===null?Si=f:Si.push.apply(Si,f))}a=D}if(f=!1,a!==2)continue}}if(a===1){$n(e,0),fr(e,t,0,!0);break}e:{switch(s=e,f=a,f){case 0:case 1:throw Error(T(345));case 4:if((t&4194048)!==t)break;case 6:fr(s,t,Ti,!cr);break e;case 2:Si=null;break;case 3:case 5:break;default:throw Error(T(329))}if((t&62914560)===t&&(a=go+300-Re(),10<a)){if(fr(s,t,Ti,!cr),nn(s,0,!0)!==0)break e;Is=t,s.timeoutHandle=t_(Ef.bind(null,s,i,Si,bo,Ah,t,Ti,Kr,In,cr,f,"Throttled",-0,0),a);break e}Ef(s,i,Si,bo,Ah,t,Ti,Kr,In,cr,f,null,-0,0)}}break}while(!0);ps(e)}function Ef(e,t,i,s,a,f,D,I,Q,oe,fe,ve,ce,he){if(e.timeoutHandle=-1,ve=t.subtreeFlags,ve&8192||(ve&16785408)===16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Vi},vf(t,f,ve);var Le=(f&62914560)===f?go-Re():(f&4194048)===f?yf-Re():0;if(Le=nv(ve,Le),Le!==null){Is=f,e.cancelPendingCommit=Le(Of.bind(null,e,t,f,i,s,a,D,I,Q,fe,ve,null,ce,he)),fr(e,f,D,!oe);return}}Of(e,t,f,i,s,a,D,I,Q)}function ym(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 s=0;s<i.length;s++){var a=i[s],f=a.getSnapshot;a=a.value;try{if(!ai(f(),a))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 fr(e,t,i,s){t&=~Eh,t&=~Kr,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var a=t;0<a;){var f=31-zt(a),D=1<<f;s[f]=-1,a&=~D}i!==0&&ta(e,i,t)}function yo(){return(at&6)===0?(il(0),!1):!0}function Th(){if(qe!==null){if(ot===0)var e=qe.return;else e=qe,Ms=zr=null,Gc(e),kn=null,za=0,e=qe;for(;e!==null;)tf(e.alternate,e),e=e.return;qe=null}}function $n(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,Pm(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Is=0,Th(),_t=e,qe=i=w(e.current,null),Ve=t,ot=0,Mi=null,cr=!1,Un=Fs(e,t),xh=!1,In=Ti=Eh=Kr=hr=At=0,Si=el=null,Ah=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var a=31-zt(s),f=1<<a;t|=e[a],s&=~f}return Us=t,xn(),i}function Af(e,t){Fe=null,G.H=Ga,t===Dn||t===Yl?(t=Pu(),ot=3):t===Bc?(t=Pu(),ot=4):ot=t===oh?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Mi=t,qe===null&&(At=1,co(e,pt(t,e.current)))}function Rf(){var e=Ri.current;return e===null?!0:(Ve&4194048)===Ve?$i===null:(Ve&62914560)===Ve||(Ve&536870912)!==0?e===$i:!1}function Lf(){var e=G.H;return G.H=Ga,e===null?Ga:e}function Mf(){var e=G.A;return G.A=Sm,e}function Co(){At=4,cr||(Ve&4194048)!==Ve&&Ri.current!==null||(Un=!0),(hr&134217727)===0&&(Kr&134217727)===0||_t===null||fr(_t,Ve,Ti,!1)}function Dh(e,t,i){var s=at;at|=2;var a=Lf(),f=Mf();(_t!==e||Ve!==t)&&(bo=null,$n(e,t)),t=!1;var D=At;e:do try{if(ot!==0&&qe!==null){var I=qe,Q=Mi;switch(ot){case 8:Th(),D=6;break e;case 3:case 2:case 9:case 6:Ri.current===null&&(t=!0);var oe=ot;if(ot=0,Mi=null,Fn(e,I,Q,oe),i&&Un){D=0;break e}break;default:oe=ot,ot=0,Mi=null,Fn(e,I,Q,oe)}}Cm(),D=At;break}catch(fe){Af(e,fe)}while(!0);return t&&e.shellSuspendCounter++,Ms=zr=null,at=s,G.H=a,G.A=f,qe===null&&(_t=null,Ve=0,xn()),D}function Cm(){for(;qe!==null;)Tf(qe)}function wm(e,t){var i=at;at|=2;var s=Lf(),a=Mf();_t!==e||Ve!==t?(bo=null,So=Re()+500,$n(e,t)):Un=Fs(e,t);e:do try{if(ot!==0&&qe!==null){t=qe;var f=Mi;t:switch(ot){case 1:ot=0,Mi=null,Fn(e,t,f,1);break;case 2:case 9:if(Uu(f)){ot=0,Mi=null,Df(t);break}t=function(){ot!==2&&ot!==9||_t!==e||(ot=7),ps(e)},f.then(t,t);break e;case 3:ot=7;break e;case 4:ot=5;break e;case 7:Uu(f)?(ot=0,Mi=null,Df(t)):(ot=0,Mi=null,Fn(e,t,f,7));break;case 5:var D=null;switch(qe.tag){case 26:D=qe.memoizedState;case 5:case 27:var I=qe;if(D?m_(D):I.stateNode.complete){ot=0,Mi=null;var Q=I.sibling;if(Q!==null)qe=Q;else{var oe=I.return;oe!==null?(qe=oe,wo(oe)):qe=null}break t}}ot=0,Mi=null,Fn(e,t,f,5);break;case 6:ot=0,Mi=null,Fn(e,t,f,6);break;case 8:Th(),At=6;break e;default:throw Error(T(462))}}xm();break}catch(fe){Af(e,fe)}while(!0);return Ms=zr=null,G.H=s,G.A=a,at=i,qe!==null?0:(_t=null,Ve=0,xn(),At)}function xm(){for(;qe!==null&&!Ee();)Tf(qe)}function Tf(e){var t=Jd(e.alternate,e,Us);e.memoizedProps=e.pendingProps,t===null?wo(e):qe=t}function Df(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Kd(i,t,t.pendingProps,t.type,void 0,Ve);break;case 11:t=Kd(i,t,t.pendingProps,t.type.render,t.ref,Ve);break;case 5:Gc(t);default:tf(i,t),t=qe=U(t,Us),t=Jd(i,t,Us)}e.memoizedProps=e.pendingProps,t===null?wo(e):qe=t}function Fn(e,t,i,s){Ms=zr=null,Gc(t),kn=null,za=0;var a=t.return;try{if(dm(e,a,t,i,Ve)){At=1,co(e,pt(i,e.current)),qe=null;return}}catch(f){if(a!==null)throw qe=a,f;At=1,co(e,pt(i,e.current)),qe=null;return}t.flags&32768?(Ze||s===1?e=!0:Un||(Ve&536870912)!==0?e=!1:(cr=e=!0,(s===2||s===9||s===3||s===6)&&(s=Ri.current,s!==null&&s.tag===13&&(s.flags|=16384))),kf(t,e)):wo(t)}function wo(e){var t=e;do{if((t.flags&32768)!==0){kf(t,cr);return}e=t.return;var i=pm(t.alternate,t,Us);if(i!==null){qe=i;return}if(t=t.sibling,t!==null){qe=t;return}qe=t=e}while(t!==null);At===0&&(At=5)}function kf(e,t){do{var i=mm(e.alternate,e);if(i!==null){i.flags&=32767,qe=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){qe=e;return}qe=e=i}while(e!==null);At=6,qe=null}function Of(e,t,i,s,a,f,D,I,Q){e.cancelPendingCommit=null;do xo();while(Pt!==0);if((at&6)!==0)throw Error(T(327));if(t!==null){if(t===e.current)throw Error(T(177));if(f=t.lanes|t.childLanes,f|=Ta,is(e,i,f,D,I,Q),e===_t&&(qe=_t=null,Ve=0),Pn=t,dr=e,Is=i,Rh=f,Lh=a,Cf=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Lm(ht,function(){return zf(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=G.T,G.T=null,a=Y.p,Y.p=2,D=at,at|=4;try{vm(e,t,i)}finally{at=D,Y.p=a,G.T=s}}Pt=1,Bf(),jf(),Nf()}}function Bf(){if(Pt===1){Pt=0;var e=dr,t=Pn,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=G.T,G.T=null;var s=Y.p;Y.p=2;var a=at;at|=4;try{_f(t,e);var f=Fh,D=Ea(e.containerInfo),I=f.focusedElem,Q=f.selectionRange;if(D!==I&&I&&I.ownerDocument&&xa(I.ownerDocument.documentElement,I)){if(Q!==null&&Aa(I)){var oe=Q.start,fe=Q.end;if(fe===void 0&&(fe=oe),"selectionStart"in I)I.selectionStart=oe,I.selectionEnd=Math.min(fe,I.value.length);else{var ve=I.ownerDocument||document,ce=ve&&ve.defaultView||window;if(ce.getSelection){var he=ce.getSelection(),Le=I.textContent.length,Ne=Math.min(Q.start,Le),ft=Q.end===void 0?Ne:Math.min(Q.end,Le);!he.extend&&Ne>ft&&(D=ft,ft=Ne,Ne=D);var ne=yn(I,Ne),te=yn(I,ft);if(ne&&te&&(he.rangeCount!==1||he.anchorNode!==ne.node||he.anchorOffset!==ne.offset||he.focusNode!==te.node||he.focusOffset!==te.offset)){var le=ve.createRange();le.setStart(ne.node,ne.offset),he.removeAllRanges(),Ne>ft?(he.addRange(le),he.extend(te.node,te.offset)):(le.setEnd(te.node,te.offset),he.addRange(le))}}}}for(ve=[],he=I;he=he.parentNode;)he.nodeType===1&&ve.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof I.focus=="function"&&I.focus(),I=0;I<ve.length;I++){var pe=ve[I];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}No=!!$h,Fh=$h=null}finally{at=a,Y.p=s,G.T=i}}e.current=t,Pt=2}}function jf(){if(Pt===2){Pt=0;var e=dr,t=Pn,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=G.T,G.T=null;var s=Y.p;Y.p=2;var a=at;at|=4;try{cf(e,t.alternate,t)}finally{at=a,Y.p=s,G.T=i}}Pt=3}}function Nf(){if(Pt===4||Pt===3){Pt=0,ye();var e=dr,t=Pn,i=Is,s=Cf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Pt=5:(Pt=0,Pn=dr=null,Hf(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(ur=null),ys(i),t=t.stateNode,Rt&&typeof Rt.onCommitFiberRoot=="function")try{Rt.onCommitFiberRoot(Ci,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=G.T,a=Y.p,Y.p=2,G.T=null;try{for(var f=e.onRecoverableError,D=0;D<s.length;D++){var I=s[D];f(I.value,{componentStack:I.stack})}}finally{G.T=t,Y.p=a}}(Is&3)!==0&&xo(),ps(e),a=e.pendingLanes,(i&261930)!==0&&(a&42)!==0?e===Mh?tl++:(tl=0,Mh=e):tl=0,il(0)}}function Hf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Na(t)))}function xo(){return Bf(),jf(),Nf(),zf()}function zf(){if(Pt!==5)return!1;var e=dr,t=Rh;Rh=0;var i=ys(Is),s=G.T,a=Y.p;try{Y.p=32>i?32:i,G.T=null,i=Lh,Lh=null;var f=dr,D=Is;if(Pt=0,Pn=dr=null,Is=0,(at&6)!==0)throw Error(T(331));var I=at;if(at|=4,Sf(f.current),mf(f,f.current,D,i),at=I,il(0,!1),Rt&&typeof Rt.onPostCommitFiberRoot=="function")try{Rt.onPostCommitFiberRoot(Ci,f)}catch{}return!0}finally{Y.p=a,G.T=s,Hf(e,t)}}function Uf(e,t,i){t=pt(i,t),t=lh(e.stateNode,t,2),e=nr(e,t,2),e!==null&&(Oi(e,2),ps(e))}function ct(e,t,i){if(e.tag===3)Uf(e,e,i);else for(;t!==null;){if(t.tag===3){Uf(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ur===null||!ur.has(s))){e=pt(i,e),i=Ud(2),s=nr(t,i,2),s!==null&&(Id(i,s,t,e),Oi(s,2),ps(s));break}}t=t.return}}function kh(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new bm;var a=new Set;s.set(t,a)}else a=s.get(t),a===void 0&&(a=new Set,s.set(t,a));a.has(i)||(xh=!0,a.add(i),e=Em.bind(null,e,t,i),t.then(e,e))}function Em(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,_t===e&&(Ve&i)===i&&(At===4||At===3&&(Ve&62914560)===Ve&&300>Re()-go?(at&2)===0&&$n(e,0):Eh|=i,In===Ve&&(In=0)),ps(e)}function If(e,t){t===0&&(t=ea()),e=Ai(e,t),e!==null&&(Oi(e,t),ps(e))}function Am(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),If(e,i)}function Rm(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,a=e.memoizedState;a!==null&&(i=a.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(T(314))}s!==null&&s.delete(t),If(e,i)}function Lm(e,t){return de(e,t)}var Eo=null,Wn=null,Oh=!1,Ao=!1,Bh=!1,_r=0;function ps(e){e!==Wn&&e.next===null&&(Wn===null?Eo=Wn=e:Wn=Wn.next=e),Ao=!0,Oh||(Oh=!0,Tm())}function il(e,t){if(!Bh&&Ao){Bh=!0;do for(var i=!1,s=Eo;s!==null;){if(e!==0){var a=s.pendingLanes;if(a===0)var f=0;else{var D=s.suspendedLanes,I=s.pingedLanes;f=(1<<31-zt(42|e)+1)-1,f&=a&~(D&~I),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(i=!0,Wf(s,f))}else f=Ve,f=nn(s,s===_t?f:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(f&3)===0||Fs(s,f)||(i=!0,Wf(s,f));s=s.next}while(i);Bh=!1}}function Mm(){Pf()}function Pf(){Ao=Oh=!1;var e=0;_r!==0&&Im()&&(e=_r);for(var t=Re(),i=null,s=Eo;s!==null;){var a=s.next,f=$f(s,t);f===0?(s.next=null,i===null?Eo=a:i.next=a,a===null&&(Wn=i)):(i=s,(e!==0||(f&3)!==0)&&(Ao=!0)),s=a}Pt!==0&&Pt!==5||il(e),_r!==0&&(_r=0)}function $f(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,a=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var D=31-zt(f),I=1<<D,Q=a[D];Q===-1?((I&i)===0||(I&s)!==0)&&(a[D]=sc(I,t)):Q<=t&&(e.expiredLanes|=I),f&=~I}if(t=_t,i=Ve,i=nn(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(ot===2||ot===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Se(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Fs(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&Se(s),ys(i)){case 2:case 8:i=st;break;case 32:i=ht;break;case 268435456:i=tt;break;default:i=ht}return s=Ff.bind(null,e),i=de(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&Se(s),e.callbackPriority=2,e.callbackNode=null,2}function Ff(e,t){if(Pt!==0&&Pt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(xo()&&e.callbackNode!==i)return null;var s=Ve;return s=nn(e,e===_t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(xf(e,s,t),$f(e,Re()),e.callbackNode!=null&&e.callbackNode===i?Ff.bind(null,e):null)}function Wf(e,t){if(xo())return null;xf(e,t,!0)}function Tm(){$m(function(){(at&6)!==0?de(Be,Mm):Pf()})}function jh(){if(_r===0){var e=Mn;e===0&&(e=Je,Je<<=1,(Je&261888)===0&&(Je=256)),_r=e}return _r}function qf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ti(""+e)}function Gf(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 Dm(e,t,i,s,a){if(t==="submit"&&i&&i.stateNode===a){var f=qf((a[Ut]||null).action),D=s.submitter;D&&(t=(t=D[Ut]||null)?qf(t.formAction):D.getAttribute("formAction"),t!==null&&(f=t,D=null));var I=new Ni("action","action",null,s,a);e.push({event:I,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(_r!==0){var Q=D?Gf(a,D):new FormData(a);th(i,{pending:!0,data:Q,method:a.method,action:f},null,Q)}}else typeof f=="function"&&(I.preventDefault(),Q=D?Gf(a,D):new FormData(a),th(i,{pending:!0,data:Q,method:a.method,action:f},f,Q))},currentTarget:a}]})}}for(var Nh=0;Nh<wn.length;Nh++){var Hh=wn[Nh],km=Hh.toLowerCase(),Om=Hh[0].toUpperCase()+Hh.slice(1);fi(km,"on"+Om)}fi(Il,"onAnimationEnd"),fi(La,"onAnimationIteration"),fi(Ma,"onAnimationStart"),fi("dblclick","onDoubleClick"),fi("focusin","onFocus"),fi("focusout","onBlur"),fi(Pl,"onTransitionRun"),fi(Cn,"onTransitionStart"),fi($l,"onTransitionCancel"),fi(Fl,"onTransitionEnd"),Ki("onMouseEnter",["mouseout","mouseover"]),Ki("onMouseLeave",["mouseout","mouseover"]),Ki("onPointerEnter",["pointerout","pointerover"]),Ki("onPointerLeave",["pointerout","pointerover"]),ns("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ns("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ns("onBeforeInput",["compositionend","keypress","textInput","paste"]),ns("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ns("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ns("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var sl="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(" "),Bm=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(sl));function Kf(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],a=s.event;s=s.listeners;e:{var f=void 0;if(t)for(var D=s.length-1;0<=D;D--){var I=s[D],Q=I.instance,oe=I.currentTarget;if(I=I.listener,Q!==f&&a.isPropagationStopped())break e;f=I,a.currentTarget=oe;try{f(a)}catch(fe){Br(fe)}a.currentTarget=null,f=Q}else for(D=0;D<s.length;D++){if(I=s[D],Q=I.instance,oe=I.currentTarget,I=I.listener,Q!==f&&a.isPropagationStopped())break e;f=I,a.currentTarget=oe;try{f(a)}catch(fe){Br(fe)}a.currentTarget=null,f=Q}}}}function Ge(e,t){var i=t[Ws];i===void 0&&(i=t[Ws]=new Set);var s=e+"__bubble";i.has(s)||(Vf(t,e,2,!1),i.add(s))}function zh(e,t,i){var s=0;t&&(s|=4),Vf(i,e,s,t)}var Ro="_reactListening"+Math.random().toString(36).slice(2);function Uh(e){if(!e[Ro]){e[Ro]=!0,ml.forEach(function(i){i!=="selectionchange"&&(Bm.has(i)||zh(i,!1,e),zh(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ro]||(t[Ro]=!0,zh("selectionchange",!1,t))}}function Vf(e,t,i,s){switch(w_(t)){case 2:var a=ov;break;case 8:a=cv;break;default:a=eu}i=a.bind(null,t,i,e),a=void 0,!fa||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),s?a!==void 0?e.addEventListener(t,i,{capture:!0,passive:a}):e.addEventListener(t,i,!0):a!==void 0?e.addEventListener(t,i,{passive:a}):e.addEventListener(t,i,!1)}function Ih(e,t,i,s,a){var f=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var D=s.tag;if(D===3||D===4){var I=s.stateNode.containerInfo;if(I===a)break;if(D===4)for(D=s.return;D!==null;){var Q=D.tag;if((Q===3||Q===4)&&D.stateNode.containerInfo===a)return;D=D.return}for(;I!==null;){if(D=ws(I),D===null)return;if(Q=D.tag,Q===5||Q===6||Q===26||Q===27){s=f=D;continue e}I=I.parentNode}}s=s.return}wl(function(){var oe=f,fe=ua(i),ve=[];e:{var ce=Wl.get(e);if(ce!==void 0){var he=Ni,Le=e;switch(e){case"keypress":if(et(i)===0)break e;case"keydown":case"keyup":he=fc;break;case"focusin":Le="focus",he=Yi;break;case"focusout":Le="blur",he=Yi;break;case"beforeblur":case"afterblur":he=Yi;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":he=pa;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=El;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=mc;break;case Il:case La:case Ma:he=Gt;break;case Fl:he=vn;break;case"scroll":case"scrollend":he=xl;break;case"wheel":he=gc;break;case"copy":case"cut":case"paste":he=oc;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=mn;break;case"toggle":case"beforetoggle":he=Sc}var Ne=(t&4)!==0,ft=!Ne&&(e==="scroll"||e==="scrollend"),ne=Ne?ce!==null?ce+"Capture":null:ce;Ne=[];for(var te=oe,le;te!==null;){var pe=te;if(le=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||le===null||ne===null||(pe=ii(te,ne),pe!=null&&Ne.push(rl(te,pe,le))),ft)break;te=te.return}0<Ne.length&&(ce=new he(ce,Le,null,i,fe),ve.push({event:ce,listeners:Ne}))}}if((t&7)===0){e:{if(ce=e==="mouseover"||e==="pointerover",he=e==="mouseout"||e==="pointerout",ce&&i!==ha&&(Le=i.relatedTarget||i.fromElement)&&(ws(Le)||Le[ni]))break e;if((he||ce)&&(ce=fe.window===fe?fe:(ce=fe.ownerDocument)?ce.defaultView||ce.parentWindow:window,he?(Le=i.relatedTarget||i.toElement,he=oe,Le=Le?ws(Le):null,Le!==null&&(ft=q(Le),Ne=Le.tag,Le!==ft||Ne!==5&&Ne!==27&&Ne!==6)&&(Le=null)):(he=null,Le=oe),he!==Le)){if(Ne=pa,pe="onMouseLeave",ne="onMouseEnter",te="mouse",(e==="pointerout"||e==="pointerover")&&(Ne=mn,pe="onPointerLeave",ne="onPointerEnter",te="pointer"),ft=he==null?ce:Gs(he),le=Le==null?ce:Gs(Le),ce=new Ne(pe,te+"leave",he,i,fe),ce.target=ft,ce.relatedTarget=le,pe=null,ws(fe)===oe&&(Ne=new Ne(ne,te+"enter",Le,i,fe),Ne.target=le,Ne.relatedTarget=ft,pe=Ne),ft=pe,he&&Le)t:{for(Ne=jm,ne=he,te=Le,le=0,pe=ne;pe;pe=Ne(pe))le++;pe=0;for(var Oe=te;Oe;Oe=Ne(Oe))pe++;for(;0<le-pe;)ne=Ne(ne),le--;for(;0<pe-le;)te=Ne(te),pe--;for(;le--;){if(ne===te||te!==null&&ne===te.alternate){Ne=ne;break t}ne=Ne(ne),te=Ne(te)}Ne=null}else Ne=null;he!==null&&Yf(ve,ce,he,Ne,!1),Le!==null&&ft!==null&&Yf(ve,ft,Le,Ne,!0)}}e:{if(ce=oe?Gs(oe):window,he=ce.nodeName&&ce.nodeName.toLowerCase(),he==="select"||he==="input"&&ce.type==="file")var rt=jl;else if(Ol(ce))if(Sn)rt=Ec;else{rt=wc;var Te=Cc}else he=ce.nodeName,!he||he.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?oe&&dn(oe.elementType)&&(rt=jl):rt=xc;if(rt&&(rt=rt(e,oe))){Bl(ve,rt,i,fe);break e}Te&&Te(e,ce,oe),e==="focusout"&&oe&&ce.type==="number"&&oe.memoizedProps.value!=null&&la(ce,"number",ce.value)}switch(Te=oe?Gs(oe):window,e){case"focusin":(Ol(Te)||Te.contentEditable==="true")&&(Ei=Te,Zs=oe,Or=null);break;case"focusout":Or=Zs=Ei=null;break;case"mousedown":Ra=!0;break;case"contextmenu":case"mouseup":case"dragend":Ra=!1,Ul(ve,i,fe);break;case"selectionchange":if(zl)break;case"keydown":case"keyup":Ul(ve,i,fe)}var We;if(ga)e:{switch(e){case"compositionstart":var Ye="onCompositionStart";break e;case"compositionend":Ye="onCompositionEnd";break e;case"compositionupdate":Ye="onCompositionUpdate";break e}Ye=void 0}else cs?Tl(e,i)&&(Ye="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ye="onCompositionStart");Ye&&(gn&&i.locale!=="ko"&&(cs||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&cs&&(We=_a()):($t=fe,wt="value"in $t?$t.value:$t.textContent,cs=!0)),Te=Lo(oe,Ye),0<Te.length&&(Ye=new os(Ye,e,null,i,fe),ve.push({event:Ye,listeners:Te}),We?Ye.data=We:(We=ba(i),We!==null&&(Ye.data=We)))),(We=Ll?yc(e,i):Dl(e,i))&&(Ye=Lo(oe,"onBeforeInput"),0<Ye.length&&(Te=new os("onBeforeInput","beforeinput",null,i,fe),ve.push({event:Te,listeners:Ye}),Te.data=We)),Dm(ve,e,oe,i,fe)}Kf(ve,t)})}function rl(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Lo(e,t){for(var i=t+"Capture",s=[];e!==null;){var a=e,f=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||f===null||(a=ii(e,i),a!=null&&s.unshift(rl(e,a,f)),a=ii(e,t),a!=null&&s.push(rl(e,a,f))),e.tag===3)return s;e=e.return}return[]}function jm(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yf(e,t,i,s,a){for(var f=t._reactName,D=[];i!==null&&i!==s;){var I=i,Q=I.alternate,oe=I.stateNode;if(I=I.tag,Q!==null&&Q===s)break;I!==5&&I!==26&&I!==27||oe===null||(Q=oe,a?(oe=ii(i,f),oe!=null&&D.unshift(rl(i,oe,Q))):a||(oe=ii(i,f),oe!=null&&D.push(rl(i,oe,Q)))),i=i.return}D.length!==0&&e.push({event:t,listeners:D})}var Nm=/\r\n?/g,Hm=/\u0000|\uFFFD/g;function Xf(e){return(typeof e=="string"?e:""+e).replace(Nm,`
|
|
9
|
+
`).replace(Hm,"")}function Zf(e,t){return t=Xf(t),Xf(e)===t}function dt(e,t,i,s,a,f){switch(i){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Es(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Es(e,""+s);break;case"className":xr(e,"class",s);break;case"tabIndex":xr(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":xr(e,i,s);break;case"style":ca(e,s,f);break;case"data":if(t!=="object"){xr(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=ti(""+s),e.setAttribute(i,s);break;case"action":case"formAction":if(typeof s=="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 f=="function"&&(i==="formAction"?(t!=="input"&&dt(e,t,"name",a.name,a,null),dt(e,t,"formEncType",a.formEncType,a,null),dt(e,t,"formMethod",a.formMethod,a,null),dt(e,t,"formTarget",a.formTarget,a,null)):(dt(e,t,"encType",a.encType,a,null),dt(e,t,"method",a.method,a,null),dt(e,t,"target",a.target,a,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=ti(""+s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=Vi);break;case"onScroll":s!=null&&Ge("scroll",e);break;case"onScrollEnd":s!=null&&Ge("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(T(61));if(i=s.__html,i!=null){if(a.children!=null)throw Error(T(60));e.innerHTML=i}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}i=ti(""+s),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":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""+s):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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":s===!0?e.setAttribute(i,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(i,s):e.removeAttribute(i);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(i):e.setAttribute(i,s);break;case"popover":Ge("beforetoggle",e),Ge("toggle",e),na(e,"popover",s);break;case"xlinkActuate":xi(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":xi(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":xi(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":xi(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":xi(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":xi(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":xi(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":xi(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":xi(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":na(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=bl.get(i)||i,na(e,i,s))}}function Ph(e,t,i,s,a,f){switch(i){case"style":ca(e,s,f);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(T(61));if(i=s.__html,i!=null){if(a.children!=null)throw Error(T(60));e.innerHTML=i}}break;case"children":typeof s=="string"?Es(e,s):(typeof s=="number"||typeof s=="bigint")&&Es(e,""+s);break;case"onScroll":s!=null&&Ge("scroll",e);break;case"onScrollEnd":s!=null&&Ge("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Vi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!on.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(a=i.endsWith("Capture"),t=i.slice(2,a?i.length-7:void 0),f=e[Ut]||null,f=f!=null?f[i]:null,typeof f=="function"&&e.removeEventListener(t,f,a),typeof s=="function")){typeof f!="function"&&f!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,s,a);break e}i in e?e[i]=s:s===!0?e.setAttribute(i,""):na(e,i,s)}}}function Zt(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 s=!1,a=!1,f;for(f in i)if(i.hasOwnProperty(f)){var D=i[f];if(D!=null)switch(f){case"src":s=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(T(137,t));default:dt(e,t,f,D,i,null)}}a&&dt(e,t,"srcSet",i.srcSet,i,null),s&&dt(e,t,"src",i.src,i,null);return;case"input":Ge("invalid",e);var I=f=D=a=null,Q=null,oe=null;for(s in i)if(i.hasOwnProperty(s)){var fe=i[s];if(fe!=null)switch(s){case"name":a=fe;break;case"type":D=fe;break;case"checked":Q=fe;break;case"defaultChecked":oe=fe;break;case"value":f=fe;break;case"defaultValue":I=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(T(137,t));break;default:dt(e,t,s,fe,i,null)}}Ar(e,f,I,Q,oe,D,a,!1);return;case"select":Ge("invalid",e),s=D=f=null;for(a in i)if(i.hasOwnProperty(a)&&(I=i[a],I!=null))switch(a){case"value":f=I;break;case"defaultValue":D=I;break;case"multiple":s=I;default:dt(e,t,a,I,i,null)}t=f,i=D,e.multiple=!!s,t!=null?as(e,!!s,t,!1):i!=null&&as(e,!!s,i,!0);return;case"textarea":Ge("invalid",e),f=a=s=null;for(D in i)if(i.hasOwnProperty(D)&&(I=i[D],I!=null))switch(D){case"value":s=I;break;case"defaultValue":a=I;break;case"children":f=I;break;case"dangerouslySetInnerHTML":if(I!=null)throw Error(T(91));break;default:dt(e,t,D,I,i,null)}gl(e,s,a,f);return;case"option":for(Q in i)i.hasOwnProperty(Q)&&(s=i[Q],s!=null)&&(Q==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":dt(e,t,Q,s,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(s=0;s<sl.length;s++)Ge(sl[s],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)&&(s=i[oe],s!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(T(137,t));default:dt(e,t,oe,s,i,null)}return;default:if(dn(t)){for(fe in i)i.hasOwnProperty(fe)&&(s=i[fe],s!==void 0&&Ph(e,t,fe,s,i,void 0));return}}for(I in i)i.hasOwnProperty(I)&&(s=i[I],s!=null&&dt(e,t,I,s,i,null))}function zm(e,t,i,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,f=null,D=null,I=null,Q=null,oe=null,fe=null;for(he in i){var ve=i[he];if(i.hasOwnProperty(he)&&ve!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":Q=ve;default:s.hasOwnProperty(he)||dt(e,t,he,null,s,ve)}}for(var ce in s){var he=s[ce];if(ve=i[ce],s.hasOwnProperty(ce)&&(he!=null||ve!=null))switch(ce){case"type":f=he;break;case"name":a=he;break;case"checked":oe=he;break;case"defaultChecked":fe=he;break;case"value":D=he;break;case"defaultValue":I=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(T(137,t));break;default:he!==ve&&dt(e,t,ce,he,s,ve)}}aa(e,D,I,Q,oe,fe,f,a);return;case"select":he=D=I=ce=null;for(f in i)if(Q=i[f],i.hasOwnProperty(f)&&Q!=null)switch(f){case"value":break;case"multiple":he=Q;default:s.hasOwnProperty(f)||dt(e,t,f,null,s,Q)}for(a in s)if(f=s[a],Q=i[a],s.hasOwnProperty(a)&&(f!=null||Q!=null))switch(a){case"value":ce=f;break;case"defaultValue":I=f;break;case"multiple":D=f;default:f!==Q&&dt(e,t,a,f,s,Q)}t=I,i=D,s=he,ce!=null?as(e,!!i,ce,!1):!!s!=!!i&&(t!=null?as(e,!!i,t,!0):as(e,!!i,i?[]:"",!1));return;case"textarea":he=ce=null;for(I in i)if(a=i[I],i.hasOwnProperty(I)&&a!=null&&!s.hasOwnProperty(I))switch(I){case"value":break;case"children":break;default:dt(e,t,I,null,s,a)}for(D in s)if(a=s[D],f=i[D],s.hasOwnProperty(D)&&(a!=null||f!=null))switch(D){case"value":ce=a;break;case"defaultValue":he=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(T(91));break;default:a!==f&&dt(e,t,D,a,s,f)}oa(e,ce,he);return;case"option":for(var Le in i)ce=i[Le],i.hasOwnProperty(Le)&&ce!=null&&!s.hasOwnProperty(Le)&&(Le==="selected"?e.selected=!1:dt(e,t,Le,null,s,ce));for(Q in s)ce=s[Q],he=i[Q],s.hasOwnProperty(Q)&&ce!==he&&(ce!=null||he!=null)&&(Q==="selected"?e.selected=ce&&typeof ce!="function"&&typeof ce!="symbol":dt(e,t,Q,ce,s,he));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 Ne in i)ce=i[Ne],i.hasOwnProperty(Ne)&&ce!=null&&!s.hasOwnProperty(Ne)&&dt(e,t,Ne,null,s,ce);for(oe in s)if(ce=s[oe],he=i[oe],s.hasOwnProperty(oe)&&ce!==he&&(ce!=null||he!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(T(137,t));break;default:dt(e,t,oe,ce,s,he)}return;default:if(dn(t)){for(var ft in i)ce=i[ft],i.hasOwnProperty(ft)&&ce!==void 0&&!s.hasOwnProperty(ft)&&Ph(e,t,ft,void 0,s,ce);for(fe in s)ce=s[fe],he=i[fe],!s.hasOwnProperty(fe)||ce===he||ce===void 0&&he===void 0||Ph(e,t,fe,ce,s,he);return}}for(var ne in i)ce=i[ne],i.hasOwnProperty(ne)&&ce!=null&&!s.hasOwnProperty(ne)&&dt(e,t,ne,null,s,ce);for(ve in s)ce=s[ve],he=i[ve],!s.hasOwnProperty(ve)||ce===he||ce==null&&he==null||dt(e,t,ve,ce,s,he)}function Qf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Um(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var a=i[s],f=a.transferSize,D=a.initiatorType,I=a.duration;if(f&&I&&Qf(D)){for(D=0,I=a.responseEnd,s+=1;s<i.length;s++){var Q=i[s],oe=Q.startTime;if(oe>I)break;var fe=Q.transferSize,ve=Q.initiatorType;fe&&Qf(ve)&&(Q=Q.responseEnd,D+=fe*(Q<I?1:(I-oe)/(Q-oe)))}if(--s,t+=8*(f+D)/(a.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 $h=null,Fh=null;function Mo(e){return e.nodeType===9?e:e.ownerDocument}function Jf(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 e_(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 Wh(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 qh=null;function Im(){var e=window.event;return e&&e.type==="popstate"?e===qh?!1:(qh=e,!0):(qh=null,!1)}var t_=typeof setTimeout=="function"?setTimeout:void 0,Pm=typeof clearTimeout=="function"?clearTimeout:void 0,i_=typeof Promise=="function"?Promise:void 0,$m=typeof queueMicrotask=="function"?queueMicrotask:typeof i_<"u"?function(e){return i_.resolve(null).then(e).catch(Fm)}:t_;function Fm(e){setTimeout(function(){throw e})}function pr(e){return e==="head"}function s_(e,t){var i=t,s=0;do{var a=i.nextSibling;if(e.removeChild(i),a&&a.nodeType===8)if(i=a.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(a),Vn(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")nl(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,nl(i);for(var f=i.firstChild;f;){var D=f.nextSibling,I=f.nodeName;f[rs]||I==="SCRIPT"||I==="STYLE"||I==="LINK"&&f.rel.toLowerCase()==="stylesheet"||i.removeChild(f),f=D}}else i==="body"&&nl(e.ownerDocument.body);i=a}while(i);Vn(t)}function r_(e,t){var i=e;e=0;do{var s=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||""),s&&s.nodeType===8)if(i=s.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=s}while(i)}function Gh(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":Gh(i),qs(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function Wm(e,t,i,s){for(;e.nodeType===1;){var a=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[rs])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=Fi(e.nextSibling),e===null)break}return null}function qm(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Fi(e.nextSibling),e===null))return null;return e}function n_(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Fi(e.nextSibling),e===null))return null;return e}function Kh(e){return e.data==="$?"||e.data==="$~"}function Vh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Gm(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var s=function(){t(),i.removeEventListener("DOMContentLoaded",s)};i.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Fi(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 Yh=null;function a_(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Fi(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function l_(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 o_(e,t,i){switch(t=Mo(i),e){case"html":if(e=t.documentElement,!e)throw Error(T(452));return e;case"head":if(e=t.head,!e)throw Error(T(453));return e;case"body":if(e=t.body,!e)throw Error(T(454));return e;default:throw Error(T(451))}}function nl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);qs(e)}var Wi=new Map,c_=new Set;function To(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ps=Y.d;Y.d={f:Km,r:Vm,D:Ym,C:Xm,L:Zm,m:Qm,X:ev,S:Jm,M:tv};function Km(){var e=Ps.f(),t=yo();return e||t}function Vm(e){var t=wi(e);t!==null&&t.tag===5&&t.type==="form"?Ed(t):Ps.r(e)}var qn=typeof document>"u"?null:document;function h_(e,t,i){var s=qn;if(s&&typeof t=="string"&&t){var a=ei(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof i=="string"&&(a+='[crossorigin="'+i+'"]'),c_.has(a)||(c_.add(a),e={rel:e,crossOrigin:i,href:t},s.querySelector(a)===null&&(t=s.createElement("link"),Zt(t,"link",e),xt(t),s.head.appendChild(t)))}}function Ym(e){Ps.D(e),h_("dns-prefetch",e,null)}function Xm(e,t){Ps.C(e,t),h_("preconnect",e,t)}function Zm(e,t,i){Ps.L(e,t,i);var s=qn;if(s&&e&&t){var a='link[rel="preload"][as="'+ei(t)+'"]';t==="image"&&i&&i.imageSrcSet?(a+='[imagesrcset="'+ei(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(a+='[imagesizes="'+ei(i.imageSizes)+'"]')):a+='[href="'+ei(e)+'"]';var f=a;switch(t){case"style":f=Gn(e);break;case"script":f=Kn(e)}Wi.has(f)||(e=o({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Wi.set(f,e),s.querySelector(a)!==null||t==="style"&&s.querySelector(al(f))||t==="script"&&s.querySelector(ll(f))||(t=s.createElement("link"),Zt(t,"link",e),xt(t),s.head.appendChild(t)))}}function Qm(e,t){Ps.m(e,t);var i=qn;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+ei(s)+'"][href="'+ei(e)+'"]',f=a;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Kn(e)}if(!Wi.has(f)&&(e=o({rel:"modulepreload",href:e},t),Wi.set(f,e),i.querySelector(a)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(ll(f)))return}s=i.createElement("link"),Zt(s,"link",e),xt(s),i.head.appendChild(s)}}}function Jm(e,t,i){Ps.S(e,t,i);var s=qn;if(s&&e){var a=xs(s).hoistableStyles,f=Gn(e);t=t||"default";var D=a.get(f);if(!D){var I={loading:0,preload:null};if(D=s.querySelector(al(f)))I.loading=5;else{e=o({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Wi.get(f))&&Xh(e,i);var Q=D=s.createElement("link");xt(Q),Zt(Q,"link",e),Q._p=new Promise(function(oe,fe){Q.onload=oe,Q.onerror=fe}),Q.addEventListener("load",function(){I.loading|=1}),Q.addEventListener("error",function(){I.loading|=2}),I.loading|=4,Do(D,t,s)}D={type:"stylesheet",instance:D,count:1,state:I},a.set(f,D)}}}function ev(e,t){Ps.X(e,t);var i=qn;if(i&&e){var s=xs(i).hoistableScripts,a=Kn(e),f=s.get(a);f||(f=i.querySelector(ll(a)),f||(e=o({src:e,async:!0},t),(t=Wi.get(a))&&Zh(e,t),f=i.createElement("script"),xt(f),Zt(f,"link",e),i.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},s.set(a,f))}}function tv(e,t){Ps.M(e,t);var i=qn;if(i&&e){var s=xs(i).hoistableScripts,a=Kn(e),f=s.get(a);f||(f=i.querySelector(ll(a)),f||(e=o({src:e,async:!0,type:"module"},t),(t=Wi.get(a))&&Zh(e,t),f=i.createElement("script"),xt(f),Zt(f,"link",e),i.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},s.set(a,f))}}function u_(e,t,i,s){var a=(a=_e.current)?To(a):null;if(!a)throw Error(T(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Gn(i.href),i=xs(a).hoistableStyles,s=i.get(t),s||(s={type:"style",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Gn(i.href);var f=xs(a).hoistableStyles,D=f.get(e);if(D||(a=a.ownerDocument||a,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,D),(f=a.querySelector(al(e)))&&!f._p&&(D.instance=f,D.state.loading=5),Wi.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},Wi.set(e,i),f||iv(a,e,i,D.state))),t&&s===null)throw Error(T(528,""));return D}if(t&&s!==null)throw Error(T(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Kn(i),i=xs(a).hoistableScripts,s=i.get(t),s||(s={type:"script",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(T(444,e))}}function Gn(e){return'href="'+ei(e)+'"'}function al(e){return'link[rel="stylesheet"]['+e+"]"}function d_(e){return o({},e,{"data-precedence":e.precedence,precedence:null})}function iv(e,t,i,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),Zt(t,"link",i),xt(t),e.head.appendChild(t))}function Kn(e){return'[src="'+ei(e)+'"]'}function ll(e){return"script[async]"+e}function f_(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+ei(i.href)+'"]');if(s)return t.instance=s,xt(s),s;var a=o({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),xt(s),Zt(s,"style",a),Do(s,i.precedence,e),t.instance=s;case"stylesheet":a=Gn(i.href);var f=e.querySelector(al(a));if(f)return t.state.loading|=4,t.instance=f,xt(f),f;s=d_(i),(a=Wi.get(a))&&Xh(s,a),f=(e.ownerDocument||e).createElement("link"),xt(f);var D=f;return D._p=new Promise(function(I,Q){D.onload=I,D.onerror=Q}),Zt(f,"link",s),t.state.loading|=4,Do(f,i.precedence,e),t.instance=f;case"script":return f=Kn(i.src),(a=e.querySelector(ll(f)))?(t.instance=a,xt(a),a):(s=i,(a=Wi.get(f))&&(s=o({},i),Zh(s,a)),e=e.ownerDocument||e,a=e.createElement("script"),xt(a),Zt(a,"link",s),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(T(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Do(s,i.precedence,e));return t.instance}function Do(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=s.length?s[s.length-1]:null,f=a,D=0;D<s.length;D++){var I=s[D];if(I.dataset.precedence===t)f=I;else if(f!==a)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Xh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Zh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ko=null;function __(e,t,i){if(ko===null){var s=new Map,a=ko=new Map;a.set(i,s)}else a=ko,s=a.get(i),s||(s=new Map,a.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),a=0;a<i.length;a++){var f=i[a];if(!(f[rs]||f[Ct]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var D=f.getAttribute(t)||"";D=e+D;var I=s.get(D);I?I.push(f):s.set(D,[f])}}return s}function p_(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function sv(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;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!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 m_(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function rv(e,t,i,s){if(i.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var a=Gn(s.href),f=t.querySelector(al(a));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Oo.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=f,xt(f);return}f=t.ownerDocument||t,s=d_(s),(a=Wi.get(a))&&Xh(s,a),f=f.createElement("link"),xt(f);var D=f;D._p=new Promise(function(I,Q){D.onload=I,D.onerror=Q}),Zt(f,"link",s),i.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Oo.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Qh=0;function nv(e,t){return e.stylesheets&&e.count===0&&jo(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&jo(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&Qh===0&&(Qh=62500*Um());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&jo(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Qh?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(a)}}:null}function Oo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)jo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Bo=null;function jo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Bo=new Map,t.forEach(av,e),Bo=null,Oo.call(e))}function av(e,t){if(!(t.state.loading&4)){var i=Bo.get(e);if(i)var s=i.get(null);else{i=new Map,Bo.set(e,i);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<a.length;f++){var D=a[f];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(i.set(D.dataset.precedence,D),s=D)}s&&i.set(null,s)}a=t.instance,D=a.getAttribute("data-precedence"),f=i.get(D)||s,f===s&&i.set(null,a),i.set(D,a),this.count++,s=Oo.bind(this),a.addEventListener("load",s),a.addEventListener("error",s),f?f.parentNode.insertBefore(a,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var ol={$$typeof:c,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function lv(e,t,i,s,a,f,D,I,Q){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=hi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hi(0),this.hiddenUpdates=hi(null),this.identifierPrefix=s,this.onUncaughtError=a,this.onCaughtError=f,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Q,this.incompleteTransitions=new Map}function v_(e,t,i,s,a,f,D,I,Q,oe,fe,ve){return e=new lv(e,t,i,D,Q,oe,fe,ve,I),t=1,f===!0&&(t|=24),f=li(3,null,null,t),e.current=f,f.stateNode=e,t=Dc(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:s,isDehydrated:i,cache:t},jc(f),e}function g_(e){return e?(e=Js,e):Js}function S_(e,t,i,s,a,f){a=g_(a),s.context===null?s.context=a:s.pendingContext=a,s=rr(t),s.payload={element:i},f=f===void 0?null:f,f!==null&&(s.callback=f),i=nr(e,s,t),i!==null&&(bi(i,e,t),Ia(i,e,t))}function b_(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Jh(e,t){b_(e,t),(e=e.alternate)&&b_(e,t)}function y_(e){if(e.tag===13||e.tag===31){var t=Ai(e,67108864);t!==null&&bi(t,e,67108864),Jh(e,67108864)}}function C_(e){if(e.tag===13||e.tag===31){var t=Di();t=qi(t);var i=Ai(e,t);i!==null&&bi(i,e,t),Jh(e,t)}}var No=!0;function ov(e,t,i,s){var a=G.T;G.T=null;var f=Y.p;try{Y.p=2,eu(e,t,i,s)}finally{Y.p=f,G.T=a}}function cv(e,t,i,s){var a=G.T;G.T=null;var f=Y.p;try{Y.p=8,eu(e,t,i,s)}finally{Y.p=f,G.T=a}}function eu(e,t,i,s){if(No){var a=tu(s);if(a===null)Ih(e,t,s,Ho,i),x_(e,s);else if(uv(a,e,t,i,s))s.stopPropagation();else if(x_(e,s),t&4&&-1<hv.indexOf(e)){for(;a!==null;){var f=wi(a);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var D=Jt(f.pendingLanes);if(D!==0){var I=f;for(I.pendingLanes|=2,I.entangledLanes|=2;D;){var Q=1<<31-zt(D);I.entanglements[1]|=Q,D&=~Q}ps(f),(at&6)===0&&(So=Re()+500,il(0))}}break;case 31:case 13:I=Ai(f,2),I!==null&&bi(I,f,2),yo(),Jh(f,2)}if(f=tu(s),f===null&&Ih(e,t,s,Ho,i),f===a)break;a=f}a!==null&&s.stopPropagation()}else Ih(e,t,s,null,i)}}function tu(e){return e=ua(e),iu(e)}var Ho=null;function iu(e){if(Ho=null,e=ws(e),e!==null){var t=q(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=W(t),e!==null)return e;e=null}else if(i===31){if(e=r(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 Ho=e,null}function w_(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(Ke()){case Be:return 2;case st:return 8;case ht:case kt:return 32;case tt:return 268435456;default:return 32}default:return 32}}var su=!1,mr=null,vr=null,gr=null,cl=new Map,hl=new Map,Sr=[],hv="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 x_(e,t){switch(e){case"focusin":case"focusout":mr=null;break;case"dragenter":case"dragleave":vr=null;break;case"mouseover":case"mouseout":gr=null;break;case"pointerover":case"pointerout":cl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":hl.delete(t.pointerId)}}function ul(e,t,i,s,a,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:f,targetContainers:[a]},t!==null&&(t=wi(t),t!==null&&y_(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function uv(e,t,i,s,a){switch(t){case"focusin":return mr=ul(mr,e,t,i,s,a),!0;case"dragenter":return vr=ul(vr,e,t,i,s,a),!0;case"mouseover":return gr=ul(gr,e,t,i,s,a),!0;case"pointerover":var f=a.pointerId;return cl.set(f,ul(cl.get(f)||null,e,t,i,s,a)),!0;case"gotpointercapture":return f=a.pointerId,hl.set(f,ul(hl.get(f)||null,e,t,i,s,a)),!0}return!1}function E_(e){var t=ws(e.target);if(t!==null){var i=q(t);if(i!==null){if(t=i.tag,t===13){if(t=W(i),t!==null){e.blockedOn=t,Gi(e.priority,function(){C_(i)});return}}else if(t===31){if(t=r(i),t!==null){e.blockedOn=t,Gi(e.priority,function(){C_(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 zo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=tu(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);ha=s,i.target.dispatchEvent(s),ha=null}else return t=wi(i),t!==null&&y_(t),e.blockedOn=i,!1;t.shift()}return!0}function A_(e,t,i){zo(e)&&i.delete(t)}function dv(){su=!1,mr!==null&&zo(mr)&&(mr=null),vr!==null&&zo(vr)&&(vr=null),gr!==null&&zo(gr)&&(gr=null),cl.forEach(A_),hl.forEach(A_)}function Uo(e,t){e.blockedOn===t&&(e.blockedOn=null,su||(su=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,dv)))}var Io=null;function R_(e){Io!==e&&(Io=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){Io===e&&(Io=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],a=e[t+2];if(typeof s!="function"){if(iu(s||i)===null)continue;break}var f=wi(i);f!==null&&(e.splice(t,3),t-=3,th(f,{pending:!0,data:a,method:i.method,action:s},s,a))}}))}function Vn(e){function t(Q){return Uo(Q,e)}mr!==null&&Uo(mr,e),vr!==null&&Uo(vr,e),gr!==null&&Uo(gr,e),cl.forEach(t),hl.forEach(t);for(var i=0;i<Sr.length;i++){var s=Sr[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Sr.length&&(i=Sr[0],i.blockedOn===null);)E_(i),i.blockedOn===null&&Sr.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var a=i[s],f=i[s+1],D=a[Ut]||null;if(typeof f=="function")D||R_(i);else if(D){var I=null;if(f&&f.hasAttribute("formAction")){if(a=f,D=f[Ut]||null)I=D.formAction;else if(iu(a)!==null)continue}else I=D.action;typeof I=="function"?i[s+1]=I:(i.splice(s,3),s-=3),R_(i)}}}function L_(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(D){return a=D})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,a=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),a!==null&&(a(),a=null)}}}function ru(e){this._internalRoot=e}Po.prototype.render=ru.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(T(409));var i=t.current,s=Di();S_(i,s,e,t,null,null)},Po.prototype.unmount=ru.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;S_(e.current,2,null,e,null,null),yo(),t[ni]=null}};function Po(e){this._internalRoot=e}Po.prototype.unstable_scheduleHydration=function(e){if(e){var t=Cs();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Sr.length&&t!==0&&t<Sr[i].priority;i++);Sr.splice(i,0,e),i===0&&E_(e)}};var M_=x.version;if(M_!=="19.2.8")throw Error(T(527,M_,"19.2.8"));Y.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(T(188)):(e=Object.keys(e).join(","),Error(T(268,e)));return e=_(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var fv={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $o=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$o.isDisabled&&$o.supportsFiber)try{Ci=$o.inject(fv),Rt=$o}catch{}}return fl.createRoot=function(e,t){if(!N(e))throw Error(T(299));var i=!1,s="",a=jd,f=Nd,D=Hd;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(D=t.onRecoverableError)),t=v_(e,1,!1,null,null,i,s,null,a,f,D,L_),e[ni]=t.current,Uh(e),new ru(t)},fl.hydrateRoot=function(e,t,i){if(!N(e))throw Error(T(299));var s=!1,a="",f=jd,D=Nd,I=Hd,Q=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(a=i.identifierPrefix),i.onUncaughtError!==void 0&&(f=i.onUncaughtError),i.onCaughtError!==void 0&&(D=i.onCaughtError),i.onRecoverableError!==void 0&&(I=i.onRecoverableError),i.formState!==void 0&&(Q=i.formState)),t=v_(e,1,!0,t,i??null,s,a,Q,f,D,I,L_),t.context=g_(null),i=t.current,s=Di(),s=qi(s),a=rr(s),a.callback=null,nr(i,a,s),i=s,t.current.lanes=i,Oi(t,i),ps(t),e[ni]=t.current,Uh(e),new Po(t)},fl.version="19.2.8",fl}var U_;function xv(){if(U_)return lu.exports;U_=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(x){console.error(x)}}return l(),lu.exports=wv(),lu.exports}var Ev=xv(),uu={exports:{}},I_;function Av(){return I_||(I_=1,(function(l,x){(function(L,T){l.exports=T()})(globalThis,(()=>(()=>{var L={4567:function(W,r,d){var _=this&&this.__decorate||function(u,c,g,R){var y,M=arguments.length,b=M<3?c:R===null?R=Object.getOwnPropertyDescriptor(c,g):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(u,c,g,R);else for(var A=u.length-1;A>=0;A--)(y=u[A])&&(b=(M<3?y(b):M>3?y(c,g,b):y(c,g))||b);return M>3&&b&&Object.defineProperty(c,g,b),b},v=this&&this.__param||function(u,c){return function(g,R){c(g,R,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const o=d(9042),S=d(9924),C=d(844),E=d(4725),p=d(2585),n=d(3656);let h=r.AccessibilityManager=class extends C.Disposable{constructor(u,c,g,R){super(),this._terminal=u,this._coreBrowserService=g,this._renderService=R,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 y=0;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);if(this._topBoundaryFocusListener=y=>this._handleBoundaryFocus(y,0),this._bottomBoundaryFocusListener=y=>this._handleBoundaryFocus(y,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new S.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((y=>this._handleResize(y.rows)))),this.register(this._terminal.onRender((y=>this._refreshRows(y.start,y.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((y=>this._handleChar(y)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
10
|
+
`)))),this.register(this._terminal.onA11yTab((y=>this._handleTab(y)))),this.register(this._terminal.onKey((y=>this._handleKey(y.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,n.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,C.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(u){for(let c=0;c<u;c++)this._handleChar(" ")}_handleChar(u){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==u&&(this._charsToAnnounce+=u):this._charsToAnnounce+=u,u===`
|
|
11
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=o.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(u){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(u)||this._charsToConsume.push(u)}_refreshRows(u,c){this._liveRegionDebouncer.refresh(u,c,this._terminal.rows)}_renderRows(u,c){const g=this._terminal.buffer,R=g.lines.length.toString();for(let y=u;y<=c;y++){const M=g.lines.get(g.ydisp+y),b=[],A=M?.translateToString(!0,void 0,void 0,b)||"",O=(g.ydisp+y+1).toString(),z=this._rowElements[y];z&&(A.length===0?(z.innerText=" ",this._rowColumns.set(z,[0,1])):(z.textContent=A,this._rowColumns.set(z,b)),z.setAttribute("aria-posinset",O),z.setAttribute("aria-setsize",R))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(u,c){const g=u.target,R=this._rowElements[c===0?1:this._rowElements.length-2];if(g.getAttribute("aria-posinset")===(c===0?"1":`${this._terminal.buffer.lines.length}`)||u.relatedTarget!==R)return;let y,M;if(c===0?(y=g,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(y=this._rowElements.shift(),M=g,this._rowContainer.removeChild(y)),y.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),c===0){const b=this._createAccessibilityTreeNode();this._rowElements.unshift(b),this._rowContainer.insertAdjacentElement("afterbegin",b)}else{const b=this._createAccessibilityTreeNode();this._rowElements.push(b),this._rowContainer.appendChild(b)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(c===0?-1:1),this._rowElements[c===0?1:this._rowElements.length-2].focus(),u.preventDefault(),u.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const u=document.getSelection();if(!u)return;if(u.isCollapsed)return void(this._rowContainer.contains(u.anchorNode)&&this._terminal.clearSelection());if(!u.anchorNode||!u.focusNode)return void console.error("anchorNode and/or focusNode are null");let c={node:u.anchorNode,offset:u.anchorOffset},g={node:u.focusNode,offset:u.focusOffset};if((c.node.compareDocumentPosition(g.node)&Node.DOCUMENT_POSITION_PRECEDING||c.node===g.node&&c.offset>g.offset)&&([c,g]=[g,c]),c.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(c={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(c.node))return;const R=this._rowElements.slice(-1)[0];if(g.node.compareDocumentPosition(R)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(g={node:R,offset:R.textContent?.length??0}),!this._rowContainer.contains(g.node))return;const y=({node:A,offset:O})=>{const z=A instanceof Text?A.parentNode:A;let H=parseInt(z?.getAttribute("aria-posinset"),10)-1;if(isNaN(H))return console.warn("row is invalid. Race condition?"),null;const k=this._rowColumns.get(z);if(!k)return console.warn("columns is null. Race condition?"),null;let K=O<k.length?k[O]:k.slice(-1)[0]+1;return K>=this._terminal.cols&&(++H,K=0),{row:H,column:K}},M=y(c),b=y(g);if(M&&b){if(M.row>b.row||M.row===b.row&&M.column>=b.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(b.row-M.row)*this._terminal.cols-M.column+b.column)}}_handleResize(u){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let c=this._rowContainer.children.length;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);for(;this._rowElements.length>u;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const u=this._coreBrowserService.mainDocument.createElement("div");return u.setAttribute("role","listitem"),u.tabIndex=-1,this._refreshRowDimensions(u),u}_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 u=0;u<this._terminal.rows;u++)this._refreshRowDimensions(this._rowElements[u])}}_refreshRowDimensions(u){u.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=h=_([v(1,p.IInstantiationService),v(2,E.ICoreBrowserService),v(3,E.IRenderService)],h)},3614:(W,r)=>{function d(S){return S.replace(/\r?\n/g,"\r")}function _(S,C){return C?"\x1B[200~"+S+"\x1B[201~":S}function v(S,C,E,p){S=_(S=d(S),E.decPrivateModes.bracketedPasteMode&&p.rawOptions.ignoreBracketedPasteMode!==!0),E.triggerDataEvent(S,!0),C.value=""}function o(S,C,E){const p=E.getBoundingClientRect(),n=S.clientX-p.left-10,h=S.clientY-p.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${n}px`,C.style.top=`${h}px`,C.style.zIndex="1000",C.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=d,r.bracketTextForPaste=_,r.copyHandler=function(S,C){S.clipboardData&&S.clipboardData.setData("text/plain",C.selectionText),S.preventDefault()},r.handlePasteEvent=function(S,C,E,p){S.stopPropagation(),S.clipboardData&&v(S.clipboardData.getData("text/plain"),C,E,p)},r.paste=v,r.moveTextAreaUnderMouseCursor=o,r.rightClickHandler=function(S,C,E,p,n){o(S,C,E),n&&p.rightClickSelect(S),C.value=p.selectionText,C.select()}},7239:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const _=d(1505);r.ColorContrastCache=class{constructor(){this._color=new _.TwoKeyMap,this._css=new _.TwoKeyMap}setCss(v,o,S){this._css.set(v,o,S)}getCss(v,o){return this._css.get(v,o)}setColor(v,o,S){this._color.set(v,o,S)}getColor(v,o){return this._color.get(v,o)}clear(){this._color.clear(),this._css.clear()}}},3656:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(d,_,v,o){d.addEventListener(_,v,o);let S=!1;return{dispose:()=>{S||(S=!0,d.removeEventListener(_,v,o))}}}},3551:function(W,r,d){var _=this&&this.__decorate||function(h,u,c,g){var R,y=arguments.length,M=y<3?u:g===null?g=Object.getOwnPropertyDescriptor(u,c):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(h,u,c,g);else for(var b=h.length-1;b>=0;b--)(R=h[b])&&(M=(y<3?R(M):y>3?R(u,c,M):R(u,c))||M);return y>3&&M&&Object.defineProperty(u,c,M),M},v=this&&this.__param||function(h,u){return function(c,g){u(c,g,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier=void 0;const o=d(3656),S=d(8460),C=d(844),E=d(2585),p=d(4725);let n=r.Linkifier=class extends C.Disposable{get currentLink(){return this._currentLink}constructor(h,u,c,g,R){super(),this._element=h,this._mouseService=u,this._renderService=c,this._bufferService=g,this._linkProviderService=R,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new S.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new S.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,C.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,C.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,o.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,o.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,o.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,o.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(h){this._lastMouseEvent=h;const u=this._positionFromMouseEvent(h,this._element,this._mouseService);if(!u)return;this._isMouseOut=!1;const c=h.composedPath();for(let g=0;g<c.length;g++){const R=c[g];if(R.classList.contains("xterm"))break;if(R.classList.contains("xterm-hover"))return}this._lastBufferCell&&u.x===this._lastBufferCell.x&&u.y===this._lastBufferCell.y||(this._handleHover(u),this._lastBufferCell=u)}_handleHover(h){if(this._activeLine!==h.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(h,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,h)||(this._clearCurrentLink(),this._askForLink(h,!0))}_askForLink(h,u){this._activeProviderReplies&&u||(this._activeProviderReplies?.forEach((g=>{g?.forEach((R=>{R.link.dispose&&R.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=h.y);let c=!1;for(const[g,R]of this._linkProviderService.linkProviders.entries())u?this._activeProviderReplies?.get(g)&&(c=this._checkLinkProviderResult(g,h,c)):R.provideLinks(h.y,(y=>{if(this._isMouseOut)return;const M=y?.map((b=>({link:b})));this._activeProviderReplies?.set(g,M),c=this._checkLinkProviderResult(g,h,c),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(h.y,this._activeProviderReplies)}))}_removeIntersectingLinks(h,u){const c=new Set;for(let g=0;g<u.size;g++){const R=u.get(g);if(R)for(let y=0;y<R.length;y++){const M=R[y],b=M.link.range.start.y<h?0:M.link.range.start.x,A=M.link.range.end.y>h?this._bufferService.cols:M.link.range.end.x;for(let O=b;O<=A;O++){if(c.has(O)){R.splice(y--,1);break}c.add(O)}}}}_checkLinkProviderResult(h,u,c){if(!this._activeProviderReplies)return c;const g=this._activeProviderReplies.get(h);let R=!1;for(let y=0;y<h;y++)this._activeProviderReplies.has(y)&&!this._activeProviderReplies.get(y)||(R=!0);if(!R&&g){const y=g.find((M=>this._linkAtPosition(M.link,u)));y&&(c=!0,this._handleNewLink(y))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!c)for(let y=0;y<this._activeProviderReplies.size;y++){const M=this._activeProviderReplies.get(y)?.find((b=>this._linkAtPosition(b.link,u)));if(M){c=!0,this._handleNewLink(M);break}}return c}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(h){if(!this._currentLink)return;const u=this._positionFromMouseEvent(h,this._element,this._mouseService);u&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,u)&&this._currentLink.link.activate(h,this._currentLink.link.text)}_clearCurrentLink(h,u){this._currentLink&&this._lastMouseEvent&&(!h||!u||this._currentLink.link.range.start.y>=h&&this._currentLink.link.range.end.y<=u)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,C.disposeArray)(this._linkCacheDisposables))}_handleNewLink(h){if(!this._lastMouseEvent)return;const u=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);u&&this._linkAtPosition(h.link,u)&&(this._currentLink=h,this._currentLink.state={decorations:{underline:h.link.decorations===void 0||h.link.decorations.underline,pointerCursor:h.link.decorations===void 0||h.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,h.link,this._lastMouseEvent),h.link.decorations={},Object.defineProperties(h.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:c=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==c&&(this._currentLink.state.decorations.pointerCursor=c,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",c))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:c=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==c&&(this._currentLink.state.decorations.underline=c,this._currentLink.state.isHovered&&this._fireUnderlineEvent(h.link,c))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((c=>{if(!this._currentLink)return;const g=c.start===0?0:c.start+1+this._bufferService.buffer.ydisp,R=this._bufferService.buffer.ydisp+1+c.end;if(this._currentLink.link.range.start.y>=g&&this._currentLink.link.range.end.y<=R&&(this._clearCurrentLink(g,R),this._lastMouseEvent)){const y=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);y&&this._askForLink(y,!1)}}))))}_linkHover(h,u,c){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(u,!0),this._currentLink.state.decorations.pointerCursor&&h.classList.add("xterm-cursor-pointer")),u.hover&&u.hover(c,u.text)}_fireUnderlineEvent(h,u){const c=h.range,g=this._bufferService.buffer.ydisp,R=this._createLinkUnderlineEvent(c.start.x-1,c.start.y-g-1,c.end.x,c.end.y-g-1,void 0);(u?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(R)}_linkLeave(h,u,c){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(u,!1),this._currentLink.state.decorations.pointerCursor&&h.classList.remove("xterm-cursor-pointer")),u.leave&&u.leave(c,u.text)}_linkAtPosition(h,u){const c=h.range.start.y*this._bufferService.cols+h.range.start.x,g=h.range.end.y*this._bufferService.cols+h.range.end.x,R=u.y*this._bufferService.cols+u.x;return c<=R&&R<=g}_positionFromMouseEvent(h,u,c){const g=c.getCoords(h,u,this._bufferService.cols,this._bufferService.rows);if(g)return{x:g[0],y:g[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(h,u,c,g,R){return{x1:h,y1:u,x2:c,y2:g,cols:this._bufferService.cols,fg:R}}};r.Linkifier=n=_([v(1,p.IMouseService),v(2,p.IRenderService),v(3,E.IBufferService),v(4,p.ILinkProviderService)],n)},9042:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(W,r,d){var _=this&&this.__decorate||function(p,n,h,u){var c,g=arguments.length,R=g<3?n:u===null?u=Object.getOwnPropertyDescriptor(n,h):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(p,n,h,u);else for(var y=p.length-1;y>=0;y--)(c=p[y])&&(R=(g<3?c(R):g>3?c(n,h,R):c(n,h))||R);return g>3&&R&&Object.defineProperty(n,h,R),R},v=this&&this.__param||function(p,n){return function(h,u){n(h,u,p)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const o=d(511),S=d(2585);let C=r.OscLinkProvider=class{constructor(p,n,h){this._bufferService=p,this._optionsService=n,this._oscLinkService=h}provideLinks(p,n){const h=this._bufferService.buffer.lines.get(p-1);if(!h)return void n(void 0);const u=[],c=this._optionsService.rawOptions.linkHandler,g=new o.CellData,R=h.getTrimmedLength();let y=-1,M=-1,b=!1;for(let A=0;A<R;A++)if(M!==-1||h.hasContent(A)){if(h.loadCell(A,g),g.hasExtendedAttrs()&&g.extended.urlId){if(M===-1){M=A,y=g.extended.urlId;continue}b=g.extended.urlId!==y}else M!==-1&&(b=!0);if(b||M!==-1&&A===R-1){const O=this._oscLinkService.getLinkData(y)?.uri;if(O){const z={start:{x:M+1,y:p},end:{x:A+(b||A!==R-1?0:1),y:p}};let H=!1;if(!c?.allowNonHttpProtocols)try{const k=new URL(O);["http:","https:"].includes(k.protocol)||(H=!0)}catch{H=!0}H||u.push({text:O,range:z,activate:(k,K)=>c?c.activate(k,K,z):E(0,K),hover:(k,K)=>c?.hover?.(k,K,z),leave:(k,K)=>c?.leave?.(k,K,z)})}b=!1,g.hasExtendedAttrs()&&g.extended.urlId?(M=A,y=g.extended.urlId):(M=-1,y=-1)}}n(u)}};function E(p,n){if(confirm(`Do you want to navigate to ${n}?
|
|
12
|
+
|
|
13
|
+
WARNING: This link could potentially be dangerous`)){const h=window.open();if(h){try{h.opener=null}catch{}h.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=C=_([v(0,S.IBufferService),v(1,S.IOptionsService),v(2,S.IOscLinkService)],C)},6193:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(d,_){this._renderCallback=d,this._coreBrowserService=_,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(d){return this._refreshCallbacks.push(d),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(d,_,v){this._rowCount=v,d=d!==void 0?d:0,_=_!==void 0?_:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,d):d,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,_):_,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 d=Math.max(this._rowStart,0),_=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(d,_),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const d of this._refreshCallbacks)d(0);this._refreshCallbacks=[]}}},3236:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const _=d(3614),v=d(3656),o=d(3551),S=d(9042),C=d(3730),E=d(1680),p=d(3107),n=d(5744),h=d(2950),u=d(1296),c=d(428),g=d(4269),R=d(5114),y=d(8934),M=d(3230),b=d(9312),A=d(4725),O=d(6731),z=d(8055),H=d(8969),k=d(8460),K=d(844),re=d(6114),G=d(8437),Y=d(2584),X=d(7399),j=d(5941),$=d(9074),B=d(2585),P=d(5435),J=d(4567),se=d(779);class ue extends H.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(Z={}){super(Z),this.browser=re,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new K.MutableDisposable),this._onCursorMove=this.register(new k.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new k.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new k.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new k.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new k.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new k.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new k.EventEmitter),this._onBlur=this.register(new k.EventEmitter),this._onA11yCharEmitter=this.register(new k.EventEmitter),this._onA11yTabEmitter=this.register(new k.EventEmitter),this._onWillOpen=this.register(new k.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance($.DecorationService),this._instantiationService.setService(B.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(se.LinkProviderService),this._instantiationService.setService(A.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(C.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((F,ae)=>this.refresh(F,ae)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((F=>this._reportWindowsOptions(F)))),this.register(this._inputHandler.onColor((F=>this._handleColorEvent(F)))),this.register((0,k.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,k.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,k.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,k.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((F=>this._afterResize(F.cols,F.rows)))),this.register((0,K.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(Z){if(this._themeService)for(const F of Z){let ae,me="";switch(F.index){case 256:ae="foreground",me="10";break;case 257:ae="background",me="11";break;case 258:ae="cursor",me="12";break;default:ae="ansi",me="4;"+F.index}switch(F.type){case 0:const xe=z.color.toColorRGB(ae==="ansi"?this._themeService.colors.ansi[F.index]:this._themeService.colors[ae]);this.coreService.triggerDataEvent(`${Y.C0.ESC}]${me};${(0,j.toRgbString)(xe)}${Y.C1_ESCAPED.ST}`);break;case 1:if(ae==="ansi")this._themeService.modifyColors((Ce=>Ce.ansi[F.index]=z.channels.toColor(...F.color)));else{const Ce=ae;this._themeService.modifyColors((je=>je[Ce]=z.channels.toColor(...F.color)))}break;case 2:this._themeService.restoreColor(F.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Z){Z?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(J.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Z){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.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 Z=this.buffer.ybase+this.buffer.y,F=this.buffer.lines.get(Z);if(!F)return;const ae=Math.min(this.buffer.x,this.cols-1),me=this._renderService.dimensions.css.cell.height,xe=F.getWidth(ae),Ce=this._renderService.dimensions.css.cell.width*xe,je=this.buffer.y*this._renderService.dimensions.css.cell.height,Ae=ae*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ae+"px",this.textarea.style.top=je+"px",this.textarea.style.width=Ce+"px",this.textarea.style.height=me+"px",this.textarea.style.lineHeight=me+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,v.addDisposableDomListener)(this.element,"copy",(F=>{this.hasSelection()&&(0,_.copyHandler)(F,this._selectionService)})));const Z=F=>(0,_.handlePasteEvent)(F,this.textarea,this.coreService,this.optionsService);this.register((0,v.addDisposableDomListener)(this.textarea,"paste",Z)),this.register((0,v.addDisposableDomListener)(this.element,"paste",Z)),re.isFirefox?this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(F=>{F.button===2&&(0,_.rightClickHandler)(F,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,v.addDisposableDomListener)(this.element,"contextmenu",(F=>{(0,_.rightClickHandler)(F,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),re.isLinux&&this.register((0,v.addDisposableDomListener)(this.element,"auxclick",(F=>{F.button===1&&(0,_.moveTextAreaUnderMouseCursor)(F,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,v.addDisposableDomListener)(this.textarea,"keyup",(Z=>this._keyUp(Z)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keydown",(Z=>this._keyDown(Z)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keypress",(Z=>this._keyPress(Z)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionupdate",(Z=>this._compositionHelper.compositionupdate(Z)))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,v.addDisposableDomListener)(this.textarea,"input",(Z=>this._inputEvent(Z)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Z){if(!Z)throw new Error("Terminal requires a parent element.");if(Z.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Z.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"),Z.appendChild(this.element);const F=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),F.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,v.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),F.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",S.promptLabel),re.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(R.CoreBrowserService,this.textarea,Z.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(A.ICoreBrowserService,this._coreBrowserService),this.register((0,v.addDisposableDomListener)(this.textarea,"focus",(ae=>this._handleTextAreaFocus(ae)))),this.register((0,v.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(c.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(A.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(O.ThemeService),this._instantiationService.setService(A.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(g.CharacterJoinerService),this._instantiationService.setService(A.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(A.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(h.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(y.MouseService),this._instantiationService.setService(A.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(o.Linkifier,this.screenElement)),this.element.appendChild(F);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(E.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(b.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(A.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,v.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(p.BufferDecorationRenderer,this.screenElement)),this.register((0,v.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(J.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ae=>this._handleScreenReaderModeOptionChange(ae)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ae=>{!this._overviewRulerRenderer&&ae&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(u.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Z=this,F=this.element;function ae(Ce){const je=Z._mouseService.getMouseReportCoords(Ce,Z.screenElement);if(!je)return!1;let Ae,$e;switch(Ce.overrideType||Ce.type){case"mousemove":$e=32,Ce.buttons===void 0?(Ae=3,Ce.button!==void 0&&(Ae=Ce.button<3?Ce.button:3)):Ae=1&Ce.buttons?0:4&Ce.buttons?1:2&Ce.buttons?2:3;break;case"mouseup":$e=0,Ae=Ce.button<3?Ce.button:3;break;case"mousedown":$e=1,Ae=Ce.button<3?Ce.button:3;break;case"wheel":if(Z._customWheelEventHandler&&Z._customWheelEventHandler(Ce)===!1||Z.viewport.getLinesScrolled(Ce)===0)return!1;$e=Ce.deltaY<0?0:1,Ae=4;break;default:return!1}return!($e===void 0||Ae===void 0||Ae>4)&&Z.coreMouseService.triggerMouseEvent({col:je.col,row:je.row,x:je.x,y:je.y,button:Ae,action:$e,ctrl:Ce.ctrlKey,alt:Ce.altKey,shift:Ce.shiftKey})}const me={mouseup:null,wheel:null,mousedrag:null,mousemove:null},xe={mouseup:Ce=>(ae(Ce),Ce.buttons||(this._document.removeEventListener("mouseup",me.mouseup),me.mousedrag&&this._document.removeEventListener("mousemove",me.mousedrag)),this.cancel(Ce)),wheel:Ce=>(ae(Ce),this.cancel(Ce,!0)),mousedrag:Ce=>{Ce.buttons&&ae(Ce)},mousemove:Ce=>{Ce.buttons||ae(Ce)}};this.register(this.coreMouseService.onProtocolChange((Ce=>{Ce?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Ce)),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&Ce?me.mousemove||(F.addEventListener("mousemove",xe.mousemove),me.mousemove=xe.mousemove):(F.removeEventListener("mousemove",me.mousemove),me.mousemove=null),16&Ce?me.wheel||(F.addEventListener("wheel",xe.wheel,{passive:!1}),me.wheel=xe.wheel):(F.removeEventListener("wheel",me.wheel),me.wheel=null),2&Ce?me.mouseup||(me.mouseup=xe.mouseup):(this._document.removeEventListener("mouseup",me.mouseup),me.mouseup=null),4&Ce?me.mousedrag||(me.mousedrag=xe.mousedrag):(this._document.removeEventListener("mousemove",me.mousedrag),me.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,v.addDisposableDomListener)(F,"mousedown",(Ce=>{if(Ce.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Ce))return ae(Ce),me.mouseup&&this._document.addEventListener("mouseup",me.mouseup),me.mousedrag&&this._document.addEventListener("mousemove",me.mousedrag),this.cancel(Ce)}))),this.register((0,v.addDisposableDomListener)(F,"wheel",(Ce=>{if(!me.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Ce)===!1)return!1;if(!this.buffer.hasScrollback){const je=this.viewport.getLinesScrolled(Ce);if(je===0)return;const Ae=Y.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Ce.deltaY<0?"A":"B");let $e="";for(let Xe=0;Xe<Math.abs(je);Xe++)$e+=Ae;return this.coreService.triggerDataEvent($e,!0),this.cancel(Ce,!0)}return this.viewport.handleWheel(Ce)?this.cancel(Ce):void 0}}),{passive:!1})),this.register((0,v.addDisposableDomListener)(F,"touchstart",(Ce=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Ce),this.cancel(Ce)}),{passive:!0})),this.register((0,v.addDisposableDomListener)(F,"touchmove",(Ce=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Ce)?void 0:this.cancel(Ce)}),{passive:!1}))}refresh(Z,F){this._renderService?.refreshRows(Z,F)}updateCursorStyle(Z){this._selectionService?.shouldColumnSelect(Z)?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(Z,F,ae=0){ae===1?(super.scrollLines(Z,F,ae),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(Z)}paste(Z){(0,_.paste)(Z,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Z){this._customKeyEventHandler=Z}attachCustomWheelEventHandler(Z){this._customWheelEventHandler=Z}registerLinkProvider(Z){return this._linkProviderService.registerLinkProvider(Z)}registerCharacterJoiner(Z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const F=this._characterJoinerService.register(Z);return this.refresh(0,this.rows-1),F}deregisterCharacterJoiner(Z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Z)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Z){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Z)}registerDecoration(Z){return this._decorationService.registerDecoration(Z)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Z,F,ae){this._selectionService.setSelection(Z,F,ae)}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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(Z,F){this._selectionService?.selectLines(Z,F)}_keyDown(Z){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1)return!1;const F=this.browser.isMac&&this.options.macOptionIsMeta&&Z.altKey;if(!F&&!this._compositionHelper.keydown(Z))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;F||Z.key!=="Dead"&&Z.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ae=(0,X.evaluateKeyboardEvent)(Z,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Z),ae.type===3||ae.type===2){const me=this.rows-1;return this.scrollLines(ae.type===2?-me:me),this.cancel(Z,!0)}return ae.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Z)||(ae.cancel&&this.cancel(Z,!0),!ae.key||!!(Z.key&&!Z.ctrlKey&&!Z.altKey&&!Z.metaKey&&Z.key.length===1&&Z.key.charCodeAt(0)>=65&&Z.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ae.key!==Y.C0.ETX&&ae.key!==Y.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ae.key,domEvent:Z}),this._showCursor(),this.coreService.triggerDataEvent(ae.key,!0),!this.optionsService.rawOptions.screenReaderMode||Z.altKey||Z.ctrlKey?this.cancel(Z,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Z,F){const ae=Z.isMac&&!this.options.macOptionIsMeta&&F.altKey&&!F.ctrlKey&&!F.metaKey||Z.isWindows&&F.altKey&&F.ctrlKey&&!F.metaKey||Z.isWindows&&F.getModifierState("AltGraph");return F.type==="keypress"?ae:ae&&(!F.keyCode||F.keyCode>47)}_keyUp(Z){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1||((function(F){return F.keyCode===16||F.keyCode===17||F.keyCode===18})(Z)||this.focus(),this.updateCursorStyle(Z),this._keyPressHandled=!1)}_keyPress(Z){let F;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1)return!1;if(this.cancel(Z),Z.charCode)F=Z.charCode;else if(Z.which===null||Z.which===void 0)F=Z.keyCode;else{if(Z.which===0||Z.charCode===0)return!1;F=Z.which}return!(!F||(Z.altKey||Z.ctrlKey||Z.metaKey)&&!this._isThirdLevelShift(this.browser,Z)||(F=String.fromCharCode(F),this._onKey.fire({key:F,domEvent:Z}),this._showCursor(),this.coreService.triggerDataEvent(F,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Z){if(Z.data&&Z.inputType==="insertText"&&(!Z.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const F=Z.data;return this.coreService.triggerDataEvent(F,!0),this.cancel(Z),!0}return!1}resize(Z,F){Z!==this.cols||F!==this.rows?super.resize(Z,F):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Z,F){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let Z=1;Z<this.rows;Z++)this.buffer.lines.push(this.buffer.getBlankLine(G.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const Z=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=Z,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(Y.C0.ESC+"[I"):this.coreService.triggerDataEvent(Y.C0.ESC+"[O")}_reportWindowsOptions(Z){if(this._renderService)switch(Z){case P.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const F=this._renderService.dimensions.css.canvas.width.toFixed(0),ae=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[4;${ae};${F}t`);break;case P.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const me=this._renderService.dimensions.css.cell.width.toFixed(0),xe=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[6;${xe};${me}t`)}}cancel(Z,F){if(this.options.cancelEvents||F)return Z.preventDefault(),Z.stopPropagation(),!1}}r.Terminal=ue},9924:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(d,_=1e3){this._renderCallback=d,this._debounceThresholdMS=_,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(d,_,v){this._rowCount=v,d=d!==void 0?d:0,_=_!==void 0?_:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,d):d,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,_):_;const o=Date.now();if(o-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=o,this._innerRefresh();else if(!this._additionalRefreshRequested){const S=o-this._lastRefreshMs,C=this._debounceThresholdMS-S;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),C)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const d=Math.max(this._rowStart,0),_=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(d,_)}}},1680:function(W,r,d){var _=this&&this.__decorate||function(h,u,c,g){var R,y=arguments.length,M=y<3?u:g===null?g=Object.getOwnPropertyDescriptor(u,c):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(h,u,c,g);else for(var b=h.length-1;b>=0;b--)(R=h[b])&&(M=(y<3?R(M):y>3?R(u,c,M):R(u,c))||M);return y>3&&M&&Object.defineProperty(u,c,M),M},v=this&&this.__param||function(h,u){return function(c,g){u(c,g,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;const o=d(3656),S=d(4725),C=d(8460),E=d(844),p=d(2585);let n=r.Viewport=class extends E.Disposable{constructor(h,u,c,g,R,y,M,b){super(),this._viewportElement=h,this._scrollArea=u,this._bufferService=c,this._optionsService=g,this._charSizeService=R,this._renderService=y,this._coreBrowserService=M,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,o.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((A=>this._activeBuffer=A.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((A=>this._renderDimensions=A))),this._handleThemeChange(b.colors),this.register(b.onChangeColors((A=>this._handleThemeChange(A)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(h){this._viewportElement.style.backgroundColor=h.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(h){if(h)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 u=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==u&&(this._lastRecordedBufferHeight=u,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const h=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==h&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=h),this._refreshAnimationFrame=null}syncScrollArea(h=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(h);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(h)}_handleScroll(h){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 u=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:u,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const h=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(h*(this._smoothScrollState.target-this._smoothScrollState.origin)),h<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(h,u){const c=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(u<0&&this._viewportElement.scrollTop!==0||u>0&&c<this._lastRecordedBufferHeight)||(h.cancelable&&h.preventDefault(),!1)}handleWheel(h){const u=this._getPixelsScrolled(h);return u!==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+u:this._smoothScrollState.target+=u,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=u,this._bubbleScroll(h,u))}scrollLines(h){if(h!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const u=h*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+u,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:h,suppressScrollEvent:!1})}_getPixelsScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let u=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_LINE?u*=this._currentRowHeight:h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(u*=this._currentRowHeight*this._bufferService.rows),u}getBufferElements(h,u){let c,g="";const R=[],y=u??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let b=h;b<y;b++){const A=M.get(b);if(!A)continue;const O=M.get(b+1)?.isWrapped;if(g+=A.translateToString(!O),!O||b===M.length-1){const z=document.createElement("div");z.textContent=g,R.push(z),g.length>0&&(c=z),g=""}}return{bufferElements:R,cursorElement:c}}getLinesScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let u=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(u/=this._currentRowHeight+0,this._wheelPartialScroll+=u,u=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(u*=this._bufferService.rows),u}_applyScrollModifier(h,u){const c=this._optionsService.rawOptions.fastScrollModifier;return c==="alt"&&u.altKey||c==="ctrl"&&u.ctrlKey||c==="shift"&&u.shiftKey?h*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:h*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(h){this._lastTouchY=h.touches[0].pageY}handleTouchMove(h){const u=this._lastTouchY-h.touches[0].pageY;return this._lastTouchY=h.touches[0].pageY,u!==0&&(this._viewportElement.scrollTop+=u,this._bubbleScroll(h,u))}};r.Viewport=n=_([v(2,p.IBufferService),v(3,p.IOptionsService),v(4,S.ICharSizeService),v(5,S.IRenderService),v(6,S.ICoreBrowserService),v(7,S.IThemeService)],n)},3107:function(W,r,d){var _=this&&this.__decorate||function(p,n,h,u){var c,g=arguments.length,R=g<3?n:u===null?u=Object.getOwnPropertyDescriptor(n,h):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(p,n,h,u);else for(var y=p.length-1;y>=0;y--)(c=p[y])&&(R=(g<3?c(R):g>3?c(n,h,R):c(n,h))||R);return g>3&&R&&Object.defineProperty(n,h,R),R},v=this&&this.__param||function(p,n){return function(h,u){n(h,u,p)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;const o=d(4725),S=d(844),C=d(2585);let E=r.BufferDecorationRenderer=class extends S.Disposable{constructor(p,n,h,u,c){super(),this._screenElement=p,this._bufferService=n,this._coreBrowserService=h,this._decorationService=u,this._renderService=c,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((g=>this._removeDecoration(g)))),this.register((0,S.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const p of this._decorationService.decorations)this._renderDecoration(p);this._dimensionsChanged=!1}_renderDecoration(p){this._refreshStyle(p),this._dimensionsChanged&&this._refreshXPosition(p)}_createElement(p){const n=this._coreBrowserService.mainDocument.createElement("div");n.classList.add("xterm-decoration"),n.classList.toggle("xterm-decoration-top-layer",p?.options?.layer==="top"),n.style.width=`${Math.round((p.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=(p.options.height||1)*this._renderService.dimensions.css.cell.height+"px",n.style.top=(p.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const h=p.options.x??0;return h&&h>this._bufferService.cols&&(n.style.display="none"),this._refreshXPosition(p,n),n}_refreshStyle(p){const n=p.marker.line-this._bufferService.buffers.active.ydisp;if(n<0||n>=this._bufferService.rows)p.element&&(p.element.style.display="none",p.onRenderEmitter.fire(p.element));else{let h=this._decorationElements.get(p);h||(h=this._createElement(p),p.element=h,this._decorationElements.set(p,h),this._container.appendChild(h),p.onDispose((()=>{this._decorationElements.delete(p),h.remove()}))),h.style.top=n*this._renderService.dimensions.css.cell.height+"px",h.style.display=this._altBufferIsActive?"none":"block",p.onRenderEmitter.fire(h)}}_refreshXPosition(p,n=p.element){if(!n)return;const h=p.options.x??0;(p.options.anchor||"left")==="right"?n.style.right=h?h*this._renderService.dimensions.css.cell.width+"px":"":n.style.left=h?h*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(p){this._decorationElements.get(p)?.remove(),this._decorationElements.delete(p),p.dispose()}};r.BufferDecorationRenderer=E=_([v(1,C.IBufferService),v(2,o.ICoreBrowserService),v(3,C.IDecorationService),v(4,o.IRenderService)],E)},5871:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorZoneStore=void 0,r.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(d){if(d.options.overviewRulerOptions){for(const _ of this._zones)if(_.color===d.options.overviewRulerOptions.color&&_.position===d.options.overviewRulerOptions.position){if(this._lineIntersectsZone(_,d.marker.line))return;if(this._lineAdjacentToZone(_,d.marker.line,d.options.overviewRulerOptions.position))return void this._addLineToZone(_,d.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=d.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=d.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=d.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=d.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:d.options.overviewRulerOptions.color,position:d.options.overviewRulerOptions.position,startBufferLine:d.marker.line,endBufferLine:d.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(d){this._linePadding=d}_lineIntersectsZone(d,_){return _>=d.startBufferLine&&_<=d.endBufferLine}_lineAdjacentToZone(d,_,v){return _>=d.startBufferLine-this._linePadding[v||"full"]&&_<=d.endBufferLine+this._linePadding[v||"full"]}_addLineToZone(d,_){d.startBufferLine=Math.min(d.startBufferLine,_),d.endBufferLine=Math.max(d.endBufferLine,_)}}},5744:function(W,r,d){var _=this&&this.__decorate||function(c,g,R,y){var M,b=arguments.length,A=b<3?g:y===null?y=Object.getOwnPropertyDescriptor(g,R):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(c,g,R,y);else for(var O=c.length-1;O>=0;O--)(M=c[O])&&(A=(b<3?M(A):b>3?M(g,R,A):M(g,R))||A);return b>3&&A&&Object.defineProperty(g,R,A),A},v=this&&this.__param||function(c,g){return function(R,y){g(R,y,c)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;const o=d(5871),S=d(4725),C=d(844),E=d(2585),p={full:0,left:0,center:0,right:0},n={full:0,left:0,center:0,right:0},h={full:0,left:0,center:0,right:0};let u=r.OverviewRulerRenderer=class extends C.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(c,g,R,y,M,b,A){super(),this._viewportElement=c,this._screenElement=g,this._bufferService=R,this._decorationService=y,this._renderService=M,this._optionsService=b,this._coreBrowserService=A,this._colorZoneStore=new o.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(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const O=this._canvas.getContext("2d");if(!O)throw new Error("Ctx cannot be null");this._ctx=O,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,C.toDisposable)((()=>{this._canvas?.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 c=Math.floor(this._canvas.width/3),g=Math.ceil(this._canvas.width/3);n.full=this._canvas.width,n.left=c,n.center=g,n.right=c,this._refreshDrawHeightConstants(),h.full=0,h.left=0,h.center=n.left,h.right=n.left+n.center}_refreshDrawHeightConstants(){p.full=Math.round(2*this._coreBrowserService.dpr);const c=this._canvas.height/this._bufferService.buffer.lines.length,g=Math.round(Math.max(Math.min(c,12),6)*this._coreBrowserService.dpr);p.left=g,p.center=g,p.right=g}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.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 g of this._decorationService.decorations)this._colorZoneStore.addDecoration(g);this._ctx.lineWidth=1;const c=this._colorZoneStore.zones;for(const g of c)g.position!=="full"&&this._renderColorZone(g);for(const g of c)g.position==="full"&&this._renderColorZone(g);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(c){this._ctx.fillStyle=c.color,this._ctx.fillRect(h[c.position||"full"],Math.round((this._canvas.height-1)*(c.startBufferLine/this._bufferService.buffers.active.lines.length)-p[c.position||"full"]/2),n[c.position||"full"],Math.round((this._canvas.height-1)*((c.endBufferLine-c.startBufferLine)/this._bufferService.buffers.active.lines.length)+p[c.position||"full"]))}_queueRefresh(c,g){this._shouldUpdateDimensions=c||this._shouldUpdateDimensions,this._shouldUpdateAnchor=g||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};r.OverviewRulerRenderer=u=_([v(2,E.IBufferService),v(3,E.IDecorationService),v(4,S.IRenderService),v(5,E.IOptionsService),v(6,S.ICoreBrowserService)],u)},2950:function(W,r,d){var _=this&&this.__decorate||function(p,n,h,u){var c,g=arguments.length,R=g<3?n:u===null?u=Object.getOwnPropertyDescriptor(n,h):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(p,n,h,u);else for(var y=p.length-1;y>=0;y--)(c=p[y])&&(R=(g<3?c(R):g>3?c(n,h,R):c(n,h))||R);return g>3&&R&&Object.defineProperty(n,h,R),R},v=this&&this.__param||function(p,n){return function(h,u){n(h,u,p)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;const o=d(4725),S=d(2585),C=d(2584);let E=r.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(p,n,h,u,c,g){this._textarea=p,this._compositionView=n,this._bufferService=h,this._optionsService=u,this._coreService=c,this._renderService=g,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(p){this._compositionView.textContent=p.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(p){if(this._isComposing||this._isSendingComposition){if(p.keyCode===229||p.keyCode===16||p.keyCode===17||p.keyCode===18)return!1;this._finalizeComposition(!1)}return p.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(p){if(this._compositionView.classList.remove("active"),this._isComposing=!1,p){const n={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let h;this._isSendingComposition=!1,n.start+=this._dataAlreadySent.length,h=this._isComposing?this._textarea.value.substring(n.start,n.end):this._textarea.value.substring(n.start),h.length>0&&this._coreService.triggerDataEvent(h,!0)}}),0)}else{this._isSendingComposition=!1;const n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(n,!0)}}_handleAnyTextareaChanges(){const p=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const n=this._textarea.value,h=n.replace(p,"");this._dataAlreadySent=h,n.length>p.length?this._coreService.triggerDataEvent(h,!0):n.length<p.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):n.length===p.length&&n!==p&&this._coreService.triggerDataEvent(n,!0)}}),0)}updateCompositionElements(p){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const n=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),h=this._renderService.dimensions.css.cell.height,u=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,c=n*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=c+"px",this._compositionView.style.top=u+"px",this._compositionView.style.height=h+"px",this._compositionView.style.lineHeight=h+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const g=this._compositionView.getBoundingClientRect();this._textarea.style.left=c+"px",this._textarea.style.top=u+"px",this._textarea.style.width=Math.max(g.width,1)+"px",this._textarea.style.height=Math.max(g.height,1)+"px",this._textarea.style.lineHeight=g.height+"px"}p||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};r.CompositionHelper=E=_([v(2,S.IBufferService),v(3,S.IOptionsService),v(4,S.ICoreService),v(5,o.IRenderService)],E)},9806:(W,r)=>{function d(_,v,o){const S=o.getBoundingClientRect(),C=_.getComputedStyle(o),E=parseInt(C.getPropertyValue("padding-left")),p=parseInt(C.getPropertyValue("padding-top"));return[v.clientX-S.left-E,v.clientY-S.top-p]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=d,r.getCoords=function(_,v,o,S,C,E,p,n,h){if(!E)return;const u=d(_,v,o);return u?(u[0]=Math.ceil((u[0]+(h?p/2:0))/p),u[1]=Math.ceil(u[1]/n),u[0]=Math.min(Math.max(u[0],1),S+(h?1:0)),u[1]=Math.min(Math.max(u[1],1),C),u):void 0}},9504:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;const _=d(2584);function v(n,h,u,c){const g=n-o(n,u),R=h-o(h,u),y=Math.abs(g-R)-(function(M,b,A){let O=0;const z=M-o(M,A),H=b-o(b,A);for(let k=0;k<Math.abs(z-H);k++){const K=S(M,b)==="A"?-1:1;A.buffer.lines.get(z+K*k)?.isWrapped&&O++}return O})(n,h,u);return p(y,E(S(n,h),c))}function o(n,h){let u=0,c=h.buffer.lines.get(n),g=c?.isWrapped;for(;g&&n>=0&&n<h.rows;)u++,c=h.buffer.lines.get(--n),g=c?.isWrapped;return u}function S(n,h){return n>h?"A":"B"}function C(n,h,u,c,g,R){let y=n,M=h,b="";for(;y!==u||M!==c;)y+=g?1:-1,g&&y>R.cols-1?(b+=R.buffer.translateBufferLineToString(M,!1,n,y),y=0,n=0,M++):!g&&y<0&&(b+=R.buffer.translateBufferLineToString(M,!1,0,n+1),y=R.cols-1,n=y,M--);return b+R.buffer.translateBufferLineToString(M,!1,n,y)}function E(n,h){const u=h?"O":"[";return _.C0.ESC+u+n}function p(n,h){n=Math.floor(n);let u="";for(let c=0;c<n;c++)u+=h;return u}r.moveToCellSequence=function(n,h,u,c){const g=u.buffer.x,R=u.buffer.y;if(!u.buffer.hasScrollback)return(function(b,A,O,z,H,k){return v(A,z,H,k).length===0?"":p(C(b,A,b,A-o(A,H),!1,H).length,E("D",k))})(g,R,0,h,u,c)+v(R,h,u,c)+(function(b,A,O,z,H,k){let K;K=v(A,z,H,k).length>0?z-o(z,H):A;const re=z,G=(function(Y,X,j,$,B,P){let J;return J=v(j,$,B,P).length>0?$-o($,B):X,Y<j&&J<=$||Y>=j&&J<$?"C":"D"})(b,A,O,z,H,k);return p(C(b,K,O,re,G==="C",H).length,E(G,k))})(g,R,n,h,u,c);let y;if(R===h)return y=g>n?"D":"C",p(Math.abs(g-n),E(y,c));y=R>h?"D":"C";const M=Math.abs(R-h);return p((function(b,A){return A.cols-b})(R>h?n:g,u)+(M-1)*u.cols+1+((R>h?g:n)-1),E(y,c))}},1296:function(W,r,d){var _=this&&this.__decorate||function(k,K,re,G){var Y,X=arguments.length,j=X<3?K:G===null?G=Object.getOwnPropertyDescriptor(K,re):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(k,K,re,G);else for(var $=k.length-1;$>=0;$--)(Y=k[$])&&(j=(X<3?Y(j):X>3?Y(K,re,j):Y(K,re))||j);return X>3&&j&&Object.defineProperty(K,re,j),j},v=this&&this.__param||function(k,K){return function(re,G){K(re,G,k)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;const o=d(3787),S=d(2550),C=d(2223),E=d(6171),p=d(6052),n=d(4725),h=d(8055),u=d(8460),c=d(844),g=d(2585),R="xterm-dom-renderer-owner-",y="xterm-rows",M="xterm-fg-",b="xterm-bg-",A="xterm-focus",O="xterm-selection";let z=1,H=r.DomRenderer=class extends c.Disposable{constructor(k,K,re,G,Y,X,j,$,B,P,J,se,ue){super(),this._terminal=k,this._document=K,this._element=re,this._screenElement=G,this._viewportElement=Y,this._helperContainer=X,this._linkifier2=j,this._charSizeService=B,this._optionsService=P,this._bufferService=J,this._coreBrowserService=se,this._themeService=ue,this._terminalClass=z++,this._rowElements=[],this._selectionRenderModel=(0,p.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new u.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(y),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(O),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,E.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((_e=>this._injectCss(_e)))),this._injectCss(this._themeService.colors),this._rowFactory=$.createInstance(o.DomRendererRowFactory,document),this._element.classList.add(R+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((_e=>this._handleLinkHover(_e)))),this.register(this._linkifier2.onHideLinkUnderline((_e=>this._handleLinkLeave(_e)))),this.register((0,c.toDisposable)((()=>{this._element.classList.remove(R+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new S.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const k=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*k,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*k),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/k),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/k),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 re of this._rowElements)re.style.width=`${this.dimensions.css.canvas.width}px`,re.style.height=`${this.dimensions.css.cell.height}px`,re.style.lineHeight=`${this.dimensions.css.cell.height}px`,re.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const K=`${this._terminalSelector} .${y} 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(k){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let K=`${this._terminalSelector} .${y} { color: ${k.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;K+=`${this._terminalSelector} .${y} .xterm-dim { color: ${h.color.multiplyOpacity(k.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 re=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,Y=`blink_block_${this._terminalClass}`;K+=`@keyframes ${re} { 50% { border-bottom-style: hidden; }}`,K+=`@keyframes ${G} { 50% { box-shadow: none; }}`,K+=`@keyframes ${Y} { 0% { background-color: ${k.cursor.css}; color: ${k.cursorAccent.css}; } 50% { background-color: inherit; color: ${k.cursor.css}; }}`,K+=`${this._terminalSelector} .${y}.${A} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${re} 1s step-end infinite;}${this._terminalSelector} .${y}.${A} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${y}.${A} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${k.cursor.css}; color: ${k.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${k.cursor.css} !important; color: ${k.cursorAccent.css} !important;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${k.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${k.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${k.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,K+=`${this._terminalSelector} .${O} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${O} div { position: absolute; background-color: ${k.selectionBackgroundOpaque.css};}${this._terminalSelector} .${O} div { position: absolute; background-color: ${k.selectionInactiveBackgroundOpaque.css};}`;for(const[X,j]of k.ansi.entries())K+=`${this._terminalSelector} .${M}${X} { color: ${j.css}; }${this._terminalSelector} .${M}${X}.xterm-dim { color: ${h.color.multiplyOpacity(j,.5).css}; }${this._terminalSelector} .${b}${X} { background-color: ${j.css}; }`;K+=`${this._terminalSelector} .${M}${C.INVERTED_DEFAULT_COLOR} { color: ${h.color.opaque(k.background).css}; }${this._terminalSelector} .${M}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${h.color.multiplyOpacity(h.color.opaque(k.background),.5).css}; }${this._terminalSelector} .${b}${C.INVERTED_DEFAULT_COLOR} { background-color: ${k.foreground.css}; }`,this._themeStyleElement.textContent=K}_setDefaultSpacing(){const k=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${k}px`,this._rowFactory.defaultSpacing=k}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(k,K){for(let re=this._rowElements.length;re<=K;re++){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(k,K){this._refreshRowElements(k,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(A),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(A),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(k,K,re){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(k,K,re),this.renderRows(0,this._bufferService.rows-1),!k||!K)return;this._selectionRenderModel.update(this._terminal,k,K,re);const G=this._selectionRenderModel.viewportStartRow,Y=this._selectionRenderModel.viewportEndRow,X=this._selectionRenderModel.viewportCappedStartRow,j=this._selectionRenderModel.viewportCappedEndRow;if(X>=this._bufferService.rows||j<0)return;const $=this._document.createDocumentFragment();if(re){const B=k[0]>K[0];$.appendChild(this._createSelectionElement(X,B?K[0]:k[0],B?k[0]:K[0],j-X+1))}else{const B=G===X?k[0]:0,P=X===Y?K[0]:this._bufferService.cols;$.appendChild(this._createSelectionElement(X,B,P));const J=j-X-1;if($.appendChild(this._createSelectionElement(X+1,0,this._bufferService.cols,J)),X!==j){const se=Y===j?K[0]:this._bufferService.cols;$.appendChild(this._createSelectionElement(j,0,se))}}this._selectionContainer.appendChild($)}_createSelectionElement(k,K,re,G=1){const Y=this._document.createElement("div"),X=K*this.dimensions.css.cell.width;let j=this.dimensions.css.cell.width*(re-K);return X+j>this.dimensions.css.canvas.width&&(j=this.dimensions.css.canvas.width-X),Y.style.height=G*this.dimensions.css.cell.height+"px",Y.style.top=k*this.dimensions.css.cell.height+"px",Y.style.left=`${X}px`,Y.style.width=`${j}px`,Y}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 k of this._rowElements)k.replaceChildren()}renderRows(k,K){const re=this._bufferService.buffer,G=re.ybase+re.y,Y=Math.min(re.x,this._bufferService.cols-1),X=this._optionsService.rawOptions.cursorBlink,j=this._optionsService.rawOptions.cursorStyle,$=this._optionsService.rawOptions.cursorInactiveStyle;for(let B=k;B<=K;B++){const P=B+re.ydisp,J=this._rowElements[B],se=re.lines.get(P);if(!J||!se)break;J.replaceChildren(...this._rowFactory.createRow(se,P,P===G,j,$,Y,X,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${R}${this._terminalClass}`}_handleLinkHover(k){this._setCellUnderline(k.x1,k.x2,k.y1,k.y2,k.cols,!0)}_handleLinkLeave(k){this._setCellUnderline(k.x1,k.x2,k.y1,k.y2,k.cols,!1)}_setCellUnderline(k,K,re,G,Y,X){re<0&&(k=0),G<0&&(K=0);const j=this._bufferService.rows-1;re=Math.max(Math.min(re,j),0),G=Math.max(Math.min(G,j),0),Y=Math.min(Y,this._bufferService.cols);const $=this._bufferService.buffer,B=$.ybase+$.y,P=Math.min($.x,Y-1),J=this._optionsService.rawOptions.cursorBlink,se=this._optionsService.rawOptions.cursorStyle,ue=this._optionsService.rawOptions.cursorInactiveStyle;for(let _e=re;_e<=G;++_e){const Z=_e+$.ydisp,F=this._rowElements[_e],ae=$.lines.get(Z);if(!F||!ae)break;F.replaceChildren(...this._rowFactory.createRow(ae,Z,Z===B,se,ue,P,J,this.dimensions.css.cell.width,this._widthCache,X?_e===re?k:0:-1,X?(_e===G?K:Y)-1:-1))}}};r.DomRenderer=H=_([v(7,g.IInstantiationService),v(8,n.ICharSizeService),v(9,g.IOptionsService),v(10,g.IBufferService),v(11,n.ICoreBrowserService),v(12,n.IThemeService)],H)},3787:function(W,r,d){var _=this&&this.__decorate||function(y,M,b,A){var O,z=arguments.length,H=z<3?M:A===null?A=Object.getOwnPropertyDescriptor(M,b):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(y,M,b,A);else for(var k=y.length-1;k>=0;k--)(O=y[k])&&(H=(z<3?O(H):z>3?O(M,b,H):O(M,b))||H);return z>3&&H&&Object.defineProperty(M,b,H),H},v=this&&this.__param||function(y,M){return function(b,A){M(b,A,y)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=void 0;const o=d(2223),S=d(643),C=d(511),E=d(2585),p=d(8055),n=d(4725),h=d(4269),u=d(6171),c=d(3734);let g=r.DomRendererRowFactory=class{constructor(y,M,b,A,O,z,H){this._document=y,this._characterJoinerService=M,this._optionsService=b,this._coreBrowserService=A,this._coreService=O,this._decorationService=z,this._themeService=H,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(y,M,b){this._selectionStart=y,this._selectionEnd=M,this._columnSelectMode=b}createRow(y,M,b,A,O,z,H,k,K,re,G){const Y=[],X=this._characterJoinerService.getJoinedCharacters(M),j=this._themeService.colors;let $,B=y.getNoBgTrimmedLength();b&&B<z+1&&(B=z+1);let P=0,J="",se=0,ue=0,_e=0,Z=!1,F=0,ae=!1,me=0;const xe=[],Ce=re!==-1&&G!==-1;for(let je=0;je<B;je++){y.loadCell(je,this._workCell);let Ae=this._workCell.getWidth();if(Ae===0)continue;let $e=!1,Xe=je,ke=this._workCell;if(X.length>0&&je===X[0][0]){$e=!0;const He=X.shift();ke=new h.JoinedCellData(this._workCell,y.translateToString(!0,He[0],He[1]),He[1]-He[0]),Xe=He[1]-1,Ae=ke.getWidth()}const Ht=this._isCellInSelection(je,M),ge=b&&je===z,de=Ce&&je>=re&&je<=G;let Se=!1;this._decorationService.forEachDecorationAtCell(je,M,void 0,(He=>{Se=!0}));let Ee=ke.getChars()||S.WHITESPACE_CELL_CHAR;if(Ee===" "&&(ke.isUnderline()||ke.isOverline())&&(Ee=" "),me=Ae*k-K.get(Ee,ke.isBold(),ke.isItalic()),$){if(P&&(Ht&&ae||!Ht&&!ae&&ke.bg===se)&&(Ht&&ae&&j.selectionForeground||ke.fg===ue)&&ke.extended.ext===_e&&de===Z&&me===F&&!ge&&!$e&&!Se){ke.isInvisible()?J+=S.WHITESPACE_CELL_CHAR:J+=Ee,P++;continue}P&&($.textContent=J),$=this._document.createElement("span"),P=0,J=""}else $=this._document.createElement("span");if(se=ke.bg,ue=ke.fg,_e=ke.extended.ext,Z=de,F=me,ae=Ht,$e&&z>=je&&z<=Xe&&(z=je),!this._coreService.isCursorHidden&&ge&&this._coreService.isCursorInitialized){if(xe.push("xterm-cursor"),this._coreBrowserService.isFocused)H&&xe.push("xterm-cursor-blink"),xe.push(A==="bar"?"xterm-cursor-bar":A==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(O)switch(O){case"outline":xe.push("xterm-cursor-outline");break;case"block":xe.push("xterm-cursor-block");break;case"bar":xe.push("xterm-cursor-bar");break;case"underline":xe.push("xterm-cursor-underline")}}if(ke.isBold()&&xe.push("xterm-bold"),ke.isItalic()&&xe.push("xterm-italic"),ke.isDim()&&xe.push("xterm-dim"),J=ke.isInvisible()?S.WHITESPACE_CELL_CHAR:ke.getChars()||S.WHITESPACE_CELL_CHAR,ke.isUnderline()&&(xe.push(`xterm-underline-${ke.extended.underlineStyle}`),J===" "&&(J=" "),!ke.isUnderlineColorDefault()))if(ke.isUnderlineColorRGB())$.style.textDecorationColor=`rgb(${c.AttributeData.toColorRGB(ke.getUnderlineColor()).join(",")})`;else{let He=ke.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ke.isBold()&&He<8&&(He+=8),$.style.textDecorationColor=j.ansi[He].css}ke.isOverline()&&(xe.push("xterm-overline"),J===" "&&(J=" ")),ke.isStrikethrough()&&xe.push("xterm-strikethrough"),de&&($.style.textDecoration="underline");let ye=ke.getFgColor(),Re=ke.getFgColorMode(),Ke=ke.getBgColor(),Be=ke.getBgColorMode();const st=!!ke.isInverse();if(st){const He=ye;ye=Ke,Ke=He;const Ci=Re;Re=Be,Be=Ci}let ht,kt,tt,Qe=!1;switch(this._decorationService.forEachDecorationAtCell(je,M,void 0,(He=>{He.options.layer!=="top"&&Qe||(He.backgroundColorRGB&&(Be=50331648,Ke=He.backgroundColorRGB.rgba>>8&16777215,ht=He.backgroundColorRGB),He.foregroundColorRGB&&(Re=50331648,ye=He.foregroundColorRGB.rgba>>8&16777215,kt=He.foregroundColorRGB),Qe=He.options.layer==="top")})),!Qe&&Ht&&(ht=this._coreBrowserService.isFocused?j.selectionBackgroundOpaque:j.selectionInactiveBackgroundOpaque,Ke=ht.rgba>>8&16777215,Be=50331648,Qe=!0,j.selectionForeground&&(Re=50331648,ye=j.selectionForeground.rgba>>8&16777215,kt=j.selectionForeground)),Qe&&xe.push("xterm-decoration-top"),Be){case 16777216:case 33554432:tt=j.ansi[Ke],xe.push(`xterm-bg-${Ke}`);break;case 50331648:tt=p.channels.toColor(Ke>>16,Ke>>8&255,255&Ke),this._addStyle($,`background-color:#${R((Ke>>>0).toString(16),"0",6)}`);break;default:st?(tt=j.foreground,xe.push(`xterm-bg-${o.INVERTED_DEFAULT_COLOR}`)):tt=j.background}switch(ht||ke.isDim()&&(ht=p.color.multiplyOpacity(tt,.5)),Re){case 16777216:case 33554432:ke.isBold()&&ye<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ye+=8),this._applyMinimumContrast($,tt,j.ansi[ye],ke,ht,void 0)||xe.push(`xterm-fg-${ye}`);break;case 50331648:const He=p.channels.toColor(ye>>16&255,ye>>8&255,255&ye);this._applyMinimumContrast($,tt,He,ke,ht,kt)||this._addStyle($,`color:#${R(ye.toString(16),"0",6)}`);break;default:this._applyMinimumContrast($,tt,j.foreground,ke,ht,kt)||st&&xe.push(`xterm-fg-${o.INVERTED_DEFAULT_COLOR}`)}xe.length&&($.className=xe.join(" "),xe.length=0),ge||$e||Se?$.textContent=J:P++,me!==this.defaultSpacing&&($.style.letterSpacing=`${me}px`),Y.push($),je=Xe}return $&&P&&($.textContent=J),Y}_applyMinimumContrast(y,M,b,A,O,z){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,u.treatGlyphAsBackgroundColor)(A.getCode()))return!1;const H=this._getContrastCache(A);let k;if(O||z||(k=H.getColor(M.rgba,b.rgba)),k===void 0){const K=this._optionsService.rawOptions.minimumContrastRatio/(A.isDim()?2:1);k=p.color.ensureContrastRatio(O||M,z||b,K),H.setColor((O||M).rgba,(z||b).rgba,k??null)}return!!k&&(this._addStyle(y,`color:${k.css}`),!0)}_getContrastCache(y){return y.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(y,M){y.setAttribute("style",`${y.getAttribute("style")||""}${M};`)}_isCellInSelection(y,M){const b=this._selectionStart,A=this._selectionEnd;return!(!b||!A)&&(this._columnSelectMode?b[0]<=A[0]?y>=b[0]&&M>=b[1]&&y<A[0]&&M<=A[1]:y<b[0]&&M>=b[1]&&y>=A[0]&&M<=A[1]:M>b[1]&&M<A[1]||b[1]===A[1]&&M===b[1]&&y>=b[0]&&y<A[0]||b[1]<A[1]&&M===A[1]&&y<A[0]||b[1]<A[1]&&M===b[1]&&y>=b[0])}};function R(y,M,b){for(;y.length<b;)y=M+y;return y}r.DomRendererRowFactory=g=_([v(1,n.ICharacterJoinerService),v(2,E.IOptionsService),v(3,n.ICoreBrowserService),v(4,E.ICoreService),v(5,E.IDecorationService),v(6,n.IThemeService)],g)},2550:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WidthCache=void 0,r.WidthCache=class{constructor(d,_){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=d.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 v=d.createElement("span");v.classList.add("xterm-char-measure-element");const o=d.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontWeight="bold";const S=d.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontStyle="italic";const C=d.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontWeight="bold",C.style.fontStyle="italic",this._measureElements=[v,o,S,C],this._container.appendChild(v),this._container.appendChild(o),this._container.appendChild(S),this._container.appendChild(C),_.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(d,_,v,o){d===this._font&&_===this._fontSize&&v===this._weight&&o===this._weightBold||(this._font=d,this._fontSize=_,this._weight=v,this._weightBold=o,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${v}`,this._measureElements[1].style.fontWeight=`${o}`,this._measureElements[2].style.fontWeight=`${v}`,this._measureElements[3].style.fontWeight=`${o}`,this.clear())}get(d,_,v){let o=0;if(!_&&!v&&d.length===1&&(o=d.charCodeAt(0))<256){if(this._flat[o]!==-9999)return this._flat[o];const E=this._measure(d,0);return E>0&&(this._flat[o]=E),E}let S=d;_&&(S+="B"),v&&(S+="I");let C=this._holey.get(S);if(C===void 0){let E=0;_&&(E|=1),v&&(E|=2),C=this._measure(d,E),C>0&&this._holey.set(S,C)}return C}_measure(d,_){const v=this._measureElements[_];return v.textContent=d.repeat(32),v.offsetWidth/32}}},2223:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const _=d(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=_.isFirefox||_.isLegacyEdge?"bottom":"ideographic"},6171:(W,r)=>{function d(v){return 57508<=v&&v<=57558}function _(v){return v>=128512&&v<=128591||v>=127744&&v<=128511||v>=128640&&v<=128767||v>=9728&&v<=9983||v>=9984&&v<=10175||v>=65024&&v<=65039||v>=129280&&v<=129535||v>=127462&&v<=127487}Object.defineProperty(r,"__esModule",{value:!0}),r.computeNextVariantOffset=r.createRenderDimensions=r.treatGlyphAsBackgroundColor=r.allowRescaling=r.isEmoji=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(v){if(!v)throw new Error("value must not be falsy");return v},r.isPowerlineGlyph=d,r.isRestrictedPowerlineGlyph=function(v){return 57520<=v&&v<=57527},r.isEmoji=_,r.allowRescaling=function(v,o,S,C){return o===1&&S>Math.ceil(1.5*C)&&v!==void 0&&v>255&&!_(v)&&!d(v)&&!(function(E){return 57344<=E&&E<=63743})(v)},r.treatGlyphAsBackgroundColor=function(v){return d(v)||(function(o){return 9472<=o&&o<=9631})(v)},r.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}}}},r.computeNextVariantOffset=function(v,o,S=0){return(v-(2*Math.round(o)-S))%(2*Math.round(o))}},6052:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createSelectionRenderModel=void 0;class d{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(v,o,S,C=!1){if(this.selectionStart=o,this.selectionEnd=S,!o||!S||o[0]===S[0]&&o[1]===S[1])return void this.clear();const E=v.buffers.active.ydisp,p=o[1]-E,n=S[1]-E,h=Math.max(p,0),u=Math.min(n,v.rows-1);h>=v.rows||u<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=C,this.viewportStartRow=p,this.viewportEndRow=n,this.viewportCappedStartRow=h,this.viewportCappedEndRow=u,this.startCol=o[0],this.endCol=S[0])}isCellSelected(v,o,S){return!!this.hasSelection&&(S-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?o>=this.startCol&&S>=this.viewportCappedStartRow&&o<this.endCol&&S<=this.viewportCappedEndRow:o<this.startCol&&S>=this.viewportCappedStartRow&&o>=this.endCol&&S<=this.viewportCappedEndRow:S>this.viewportStartRow&&S<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&S===this.viewportStartRow&&o>=this.startCol&&o<this.endCol||this.viewportStartRow<this.viewportEndRow&&S===this.viewportEndRow&&o<this.endCol||this.viewportStartRow<this.viewportEndRow&&S===this.viewportStartRow&&o>=this.startCol)}}r.createSelectionRenderModel=function(){return new d}},456:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.SelectionModel=class{constructor(d){this._bufferService=d,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 d=this.selectionStart[0]+this.selectionStartLength;return d>this._bufferService.cols?d%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)-1]:[d%this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)]:[d,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const d=this.selectionStart[0]+this.selectionStartLength;return d>this._bufferService.cols?[d%this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)]:[Math.max(d,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const d=this.selectionStart,_=this.selectionEnd;return!(!d||!_)&&(d[1]>_[1]||d[1]===_[1]&&d[0]>_[0])}handleTrim(d){return this.selectionStart&&(this.selectionStart[1]-=d),this.selectionEnd&&(this.selectionEnd[1]-=d),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(W,r,d){var _=this&&this.__decorate||function(u,c,g,R){var y,M=arguments.length,b=M<3?c:R===null?R=Object.getOwnPropertyDescriptor(c,g):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(u,c,g,R);else for(var A=u.length-1;A>=0;A--)(y=u[A])&&(b=(M<3?y(b):M>3?y(c,g,b):y(c,g))||b);return M>3&&b&&Object.defineProperty(c,g,b),b},v=this&&this.__param||function(u,c){return function(g,R){c(g,R,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;const o=d(2585),S=d(8460),C=d(844);let E=r.CharSizeService=class extends C.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(u,c,g){super(),this._optionsService=g,this.width=0,this.height=0,this._onCharSizeChange=this.register(new S.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new h(this._optionsService))}catch{this._measureStrategy=this.register(new n(u,c,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const u=this._measureStrategy.measure();u.width===this.width&&u.height===this.height||(this.width=u.width,this.height=u.height,this._onCharSizeChange.fire())}};r.CharSizeService=E=_([v(2,o.IOptionsService)],E);class p extends C.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(c,g){c!==void 0&&c>0&&g!==void 0&&g>0&&(this._result.width=c,this._result.height=g)}}class n extends p{constructor(c,g,R){super(),this._document=c,this._parentElement=g,this._optionsService=R,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 h extends p{constructor(c){super(),this._optionsService=c,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const g=this._ctx.measureText("W");if(!("width"in g&&"fontBoundingBoxAscent"in g&&"fontBoundingBoxDescent"in g))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const c=this._ctx.measureText("W");return this._validateAndSet(c.width,c.fontBoundingBoxAscent+c.fontBoundingBoxDescent),this._result}}},4269:function(W,r,d){var _=this&&this.__decorate||function(h,u,c,g){var R,y=arguments.length,M=y<3?u:g===null?g=Object.getOwnPropertyDescriptor(u,c):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(h,u,c,g);else for(var b=h.length-1;b>=0;b--)(R=h[b])&&(M=(y<3?R(M):y>3?R(u,c,M):R(u,c))||M);return y>3&&M&&Object.defineProperty(u,c,M),M},v=this&&this.__param||function(h,u){return function(c,g){u(c,g,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const o=d(3734),S=d(643),C=d(511),E=d(2585);class p extends o.AttributeData{constructor(u,c,g){super(),this.content=0,this.combinedData="",this.fg=u.fg,this.bg=u.bg,this.combinedData=c,this._width=g}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(u){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=p;let n=r.CharacterJoinerService=class wp{constructor(u){this._bufferService=u,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new C.CellData}register(u){const c={id:this._nextCharacterJoinerId++,handler:u};return this._characterJoiners.push(c),c.id}deregister(u){for(let c=0;c<this._characterJoiners.length;c++)if(this._characterJoiners[c].id===u)return this._characterJoiners.splice(c,1),!0;return!1}getJoinedCharacters(u){if(this._characterJoiners.length===0)return[];const c=this._bufferService.buffer.lines.get(u);if(!c||c.length===0)return[];const g=[],R=c.translateToString(!0);let y=0,M=0,b=0,A=c.getFg(0),O=c.getBg(0);for(let z=0;z<c.getTrimmedLength();z++)if(c.loadCell(z,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==A||this._workCell.bg!==O){if(z-y>1){const H=this._getJoinedRanges(R,b,M,c,y);for(let k=0;k<H.length;k++)g.push(H[k])}y=z,b=M,A=this._workCell.fg,O=this._workCell.bg}M+=this._workCell.getChars().length||S.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-y>1){const z=this._getJoinedRanges(R,b,M,c,y);for(let H=0;H<z.length;H++)g.push(z[H])}return g}_getJoinedRanges(u,c,g,R,y){const M=u.substring(c,g);let b=[];try{b=this._characterJoiners[0].handler(M)}catch(A){console.error(A)}for(let A=1;A<this._characterJoiners.length;A++)try{const O=this._characterJoiners[A].handler(M);for(let z=0;z<O.length;z++)wp._mergeRanges(b,O[z])}catch(O){console.error(O)}return this._stringRangesToCellRanges(b,R,y),b}_stringRangesToCellRanges(u,c,g){let R=0,y=!1,M=0,b=u[R];if(b){for(let A=g;A<this._bufferService.cols;A++){const O=c.getWidth(A),z=c.getString(A).length||S.WHITESPACE_CELL_CHAR.length;if(O!==0){if(!y&&b[0]<=M&&(b[0]=A,y=!0),b[1]<=M){if(b[1]=A,b=u[++R],!b)break;b[0]<=M?(b[0]=A,y=!0):y=!1}M+=z}}b&&(b[1]=this._bufferService.cols)}}static _mergeRanges(u,c){let g=!1;for(let R=0;R<u.length;R++){const y=u[R];if(g){if(c[1]<=y[0])return u[R-1][1]=c[1],u;if(c[1]<=y[1])return u[R-1][1]=Math.max(c[1],y[1]),u.splice(R,1),u;u.splice(R,1),R--}else{if(c[1]<=y[0])return u.splice(R,0,c),u;if(c[1]<=y[1])return y[0]=Math.min(c[0],y[0]),u;c[0]<y[1]&&(y[0]=Math.min(c[0],y[0]),g=!0)}}return g?u[u.length-1][1]=c[1]:u.push(c),u}};r.CharacterJoinerService=n=_([v(0,E.IBufferService)],n)},5114:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0;const _=d(844),v=d(8460),o=d(3656);class S extends _.Disposable{constructor(p,n,h){super(),this._textarea=p,this._window=n,this.mainDocument=h,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new C(this._window),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new v.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((u=>this._screenDprMonitor.setWindow(u)))),this.register((0,v.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(p){this._window!==p&&(this._window=p,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}}r.CoreBrowserService=S;class C extends _.Disposable{constructor(p){super(),this._parentWindow=p,this._windowResizeListener=this.register(new _.MutableDisposable),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,_.toDisposable)((()=>this.clearListener())))}setWindow(p){this._parentWindow=p,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,o.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.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:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkProviderService=void 0;const _=d(844);class v extends _.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,_.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(S){return this.linkProviders.push(S),{dispose:()=>{const C=this.linkProviders.indexOf(S);C!==-1&&this.linkProviders.splice(C,1)}}}}r.LinkProviderService=v},8934:function(W,r,d){var _=this&&this.__decorate||function(E,p,n,h){var u,c=arguments.length,g=c<3?p:h===null?h=Object.getOwnPropertyDescriptor(p,n):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(E,p,n,h);else for(var R=E.length-1;R>=0;R--)(u=E[R])&&(g=(c<3?u(g):c>3?u(p,n,g):u(p,n))||g);return c>3&&g&&Object.defineProperty(p,n,g),g},v=this&&this.__param||function(E,p){return function(n,h){p(n,h,E)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;const o=d(4725),S=d(9806);let C=r.MouseService=class{constructor(E,p){this._renderService=E,this._charSizeService=p}getCoords(E,p,n,h,u){return(0,S.getCoords)(window,E,p,n,h,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,u)}getMouseReportCoords(E,p){const n=(0,S.getCoordsRelativeToElement)(window,E,p);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};r.MouseService=C=_([v(0,o.IRenderService),v(1,o.ICharSizeService)],C)},3230:function(W,r,d){var _=this&&this.__decorate||function(u,c,g,R){var y,M=arguments.length,b=M<3?c:R===null?R=Object.getOwnPropertyDescriptor(c,g):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(u,c,g,R);else for(var A=u.length-1;A>=0;A--)(y=u[A])&&(b=(M<3?y(b):M>3?y(c,g,b):y(c,g))||b);return M>3&&b&&Object.defineProperty(c,g,b),b},v=this&&this.__param||function(u,c){return function(g,R){c(g,R,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;const o=d(6193),S=d(4725),C=d(8460),E=d(844),p=d(7226),n=d(2585);let h=r.RenderService=class extends E.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(u,c,g,R,y,M,b,A){super(),this._rowCount=u,this._charSizeService=R,this._renderer=this.register(new E.MutableDisposable),this._pausedResizeTask=new p.DebouncedIdleTask,this._observerDisposable=this.register(new E.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 o.RenderDebouncer(((O,z)=>this._renderRows(O,z)),b),this.register(this._renderDebouncer),this.register(b.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(g.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(y.onDecorationRegistered((()=>this._fullRefresh()))),this.register(y.onDecorationRemoved((()=>this._fullRefresh()))),this.register(g.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(M.cols,M.rows),this._fullRefresh()}))),this.register(g.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.buffer.y,!0)))),this.register(A.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(b.window,c),this.register(b.onWindowChange((O=>this._registerIntersectionObserver(O,c))))}_registerIntersectionObserver(u,c){if("IntersectionObserver"in u){const g=new u.IntersectionObserver((R=>this._handleIntersectionChange(R[R.length-1])),{threshold:0});g.observe(c),this._observerDisposable.value=(0,E.toDisposable)((()=>g.disconnect()))}}_handleIntersectionChange(u){this._isPaused=u.isIntersecting===void 0?u.intersectionRatio===0:!u.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(u,c,g=!1){this._isPaused?this._needsFullRefresh=!0:(g||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(u,c,this._rowCount))}_renderRows(u,c){this._renderer.value&&(u=Math.min(u,this._rowCount-1),c=Math.min(c,this._rowCount-1),this._renderer.value.renderRows(u,c),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:u,end:c}),this._onRender.fire({start:u,end:c}),this._isNextRenderRedrawOnly=!0)}resize(u,c){this._rowCount=c,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(u){this._renderer.value=u,this._renderer.value&&(this._renderer.value.onRequestRedraw((c=>this.refreshRows(c.start,c.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(u){return this._renderDebouncer.addRefreshCallback(u)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(u,c){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(u,c))):this._renderer.value.handleResize(u,c),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(u,c,g){this._selectionState.start=u,this._selectionState.end=c,this._selectionState.columnSelectMode=g,this._renderer.value?.handleSelectionChanged(u,c,g)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};r.RenderService=h=_([v(2,n.IOptionsService),v(3,S.ICharSizeService),v(4,n.IDecorationService),v(5,n.IBufferService),v(6,S.ICoreBrowserService),v(7,S.IThemeService)],h)},9312:function(W,r,d){var _=this&&this.__decorate||function(b,A,O,z){var H,k=arguments.length,K=k<3?A:z===null?z=Object.getOwnPropertyDescriptor(A,O):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(b,A,O,z);else for(var re=b.length-1;re>=0;re--)(H=b[re])&&(K=(k<3?H(K):k>3?H(A,O,K):H(A,O))||K);return k>3&&K&&Object.defineProperty(A,O,K),K},v=this&&this.__param||function(b,A){return function(O,z){A(O,z,b)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;const o=d(9806),S=d(9504),C=d(456),E=d(4725),p=d(8460),n=d(844),h=d(6114),u=d(4841),c=d(511),g=d(2585),R=" ",y=new RegExp(R,"g");let M=r.SelectionService=class extends n.Disposable{constructor(b,A,O,z,H,k,K,re,G){super(),this._element=b,this._screenElement=A,this._linkifier=O,this._bufferService=z,this._coreService=H,this._mouseService=k,this._optionsService=K,this._renderService=re,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new c.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new p.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new p.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new p.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new p.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Y=>this._handleMouseMove(Y),this._mouseUpListener=Y=>this._handleMouseUp(Y),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Y=>this._handleTrim(Y))),this.register(this._bufferService.buffers.onBufferActivate((Y=>this._handleBufferActivate(Y)))),this.enable(),this._model=new C.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,n.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 b=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!(!b||!A||b[0]===A[0]&&b[1]===A[1])}get selectionText(){const b=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;if(!b||!A)return"";const O=this._bufferService.buffer,z=[];if(this._activeSelectionMode===3){if(b[0]===A[0])return"";const H=b[0]<A[0]?b[0]:A[0],k=b[0]<A[0]?A[0]:b[0];for(let K=b[1];K<=A[1];K++){const re=O.translateBufferLineToString(K,!0,H,k);z.push(re)}}else{const H=b[1]===A[1]?A[0]:void 0;z.push(O.translateBufferLineToString(b[1],!0,b[0],H));for(let k=b[1]+1;k<=A[1]-1;k++){const K=O.lines.get(k),re=O.translateBufferLineToString(k,!0);K?.isWrapped?z[z.length-1]+=re:z.push(re)}if(b[1]!==A[1]){const k=O.lines.get(A[1]),K=O.translateBufferLineToString(A[1],!0,0,A[0]);k&&k.isWrapped?z[z.length-1]+=K:z.push(K)}}return z.map((H=>H.replace(y," "))).join(h.isWindows?`\r
|
|
14
|
+
`:`
|
|
15
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(b){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),h.isLinux&&b&&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(b){const A=this._getMouseBufferCoords(b),O=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!!(O&&z&&A)&&this._areCoordsInSelection(A,O,z)}isCellInSelection(b,A){const O=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!(!O||!z)&&this._areCoordsInSelection([b,A],O,z)}_areCoordsInSelection(b,A,O){return b[1]>A[1]&&b[1]<O[1]||A[1]===O[1]&&b[1]===A[1]&&b[0]>=A[0]&&b[0]<O[0]||A[1]<O[1]&&b[1]===O[1]&&b[0]<O[0]||A[1]<O[1]&&b[1]===A[1]&&b[0]>=A[0]}_selectWordAtCursor(b,A){const O=this._linkifier.currentLink?.link?.range;if(O)return this._model.selectionStart=[O.start.x-1,O.start.y-1],this._model.selectionStartLength=(0,u.getRangeLength)(O,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const z=this._getMouseBufferCoords(b);return!!z&&(this._selectWordAt(z,A),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(b,A){this._model.clearSelection(),b=Math.max(b,0),A=Math.min(A,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,b],this._model.selectionEnd=[this._bufferService.cols,A],this.refresh(),this._onSelectionChange.fire()}_handleTrim(b){this._model.handleTrim(b)&&this.refresh()}_getMouseBufferCoords(b){const A=this._mouseService.getCoords(b,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(A)return A[0]--,A[1]--,A[1]+=this._bufferService.buffer.ydisp,A}_getMouseEventScrollAmount(b){let A=(0,o.getCoordsRelativeToElement)(this._coreBrowserService.window,b,this._screenElement)[1];const O=this._renderService.dimensions.css.canvas.height;return A>=0&&A<=O?0:(A>O&&(A-=O),A=Math.min(Math.max(A,-50),50),A/=50,A/Math.abs(A)+Math.round(14*A))}shouldForceSelection(b){return h.isMac?b.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:b.shiftKey}handleMouseDown(b){if(this._mouseDownTimeStamp=b.timeStamp,(b.button!==2||!this.hasSelection)&&b.button===0){if(!this._enabled){if(!this.shouldForceSelection(b))return;b.stopPropagation()}b.preventDefault(),this._dragScrollAmount=0,this._enabled&&b.shiftKey?this._handleIncrementalClick(b):b.detail===1?this._handleSingleClick(b):b.detail===2?this._handleDoubleClick(b):b.detail===3&&this._handleTripleClick(b),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(b){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(b))}_handleSingleClick(b){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(b)?3:0,this._model.selectionStart=this._getMouseBufferCoords(b),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const A=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);A&&A.length!==this._model.selectionStart[0]&&A.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(b){this._selectWordAtCursor(b,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(b){const A=this._getMouseBufferCoords(b);A&&(this._activeSelectionMode=2,this._selectLineAt(A[1]))}shouldColumnSelect(b){return b.altKey&&!(h.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(b){if(b.stopImmediatePropagation(),!this._model.selectionStart)return;const A=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(b),!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(b),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const O=this._bufferService.buffer;if(this._model.selectionEnd[1]<O.lines.length){const z=O.lines.get(this._model.selectionEnd[1]);z&&z.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}A&&A[0]===this._model.selectionEnd[0]&&A[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 b=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(b.ydisp+this._bufferService.rows,b.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=b.ydisp),this.refresh()}}_handleMouseUp(b){const A=b.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&A<500&&b.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const O=this._mouseService.getCoords(b,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(O&&O[0]!==void 0&&O[1]!==void 0){const z=(0,S.moveToCellSequence)(O[0]-1,O[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(z,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const b=this._model.finalSelectionStart,A=this._model.finalSelectionEnd,O=!(!b||!A||b[0]===A[0]&&b[1]===A[1]);O?b&&A&&(this._oldSelectionStart&&this._oldSelectionEnd&&b[0]===this._oldSelectionStart[0]&&b[1]===this._oldSelectionStart[1]&&A[0]===this._oldSelectionEnd[0]&&A[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(b,A,O)):this._oldHasSelection&&this._fireOnSelectionChange(b,A,O)}_fireOnSelectionChange(b,A,O){this._oldSelectionStart=b,this._oldSelectionEnd=A,this._oldHasSelection=O,this._onSelectionChange.fire()}_handleBufferActivate(b){this.clearSelection(),this._trimListener.dispose(),this._trimListener=b.activeBuffer.lines.onTrim((A=>this._handleTrim(A)))}_convertViewportColToCharacterIndex(b,A){let O=A;for(let z=0;A>=z;z++){const H=b.loadCell(z,this._workCell).getChars().length;this._workCell.getWidth()===0?O--:H>1&&A!==z&&(O+=H-1)}return O}setSelection(b,A,O){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[b,A],this._model.selectionStartLength=O,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(b){this._isClickInSelection(b)||(this._selectWordAtCursor(b,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(b,A,O=!0,z=!0){if(b[0]>=this._bufferService.cols)return;const H=this._bufferService.buffer,k=H.lines.get(b[1]);if(!k)return;const K=H.translateBufferLineToString(b[1],!1);let re=this._convertViewportColToCharacterIndex(k,b[0]),G=re;const Y=b[0]-re;let X=0,j=0,$=0,B=0;if(K.charAt(re)===" "){for(;re>0&&K.charAt(re-1)===" ";)re--;for(;G<K.length&&K.charAt(G+1)===" ";)G++}else{let se=b[0],ue=b[0];k.getWidth(se)===0&&(X++,se--),k.getWidth(ue)===2&&(j++,ue++);const _e=k.getString(ue).length;for(_e>1&&(B+=_e-1,G+=_e-1);se>0&&re>0&&!this._isCharWordSeparator(k.loadCell(se-1,this._workCell));){k.loadCell(se-1,this._workCell);const Z=this._workCell.getChars().length;this._workCell.getWidth()===0?(X++,se--):Z>1&&($+=Z-1,re-=Z-1),re--,se--}for(;ue<k.length&&G+1<K.length&&!this._isCharWordSeparator(k.loadCell(ue+1,this._workCell));){k.loadCell(ue+1,this._workCell);const Z=this._workCell.getChars().length;this._workCell.getWidth()===2?(j++,ue++):Z>1&&(B+=Z-1,G+=Z-1),G++,ue++}}G++;let P=re+Y-X+$,J=Math.min(this._bufferService.cols,G-re+X+j-$-B);if(A||K.slice(re,G).trim()!==""){if(O&&P===0&&k.getCodePoint(0)!==32){const se=H.lines.get(b[1]-1);if(se&&k.isWrapped&&se.getCodePoint(this._bufferService.cols-1)!==32){const ue=this._getWordAt([this._bufferService.cols-1,b[1]-1],!1,!0,!1);if(ue){const _e=this._bufferService.cols-ue.start;P-=_e,J+=_e}}}if(z&&P+J===this._bufferService.cols&&k.getCodePoint(this._bufferService.cols-1)!==32){const se=H.lines.get(b[1]+1);if(se?.isWrapped&&se.getCodePoint(0)!==32){const ue=this._getWordAt([0,b[1]+1],!1,!1,!0);ue&&(J+=ue.length)}}return{start:P,length:J}}}_selectWordAt(b,A){const O=this._getWordAt(b,A);if(O){for(;O.start<0;)O.start+=this._bufferService.cols,b[1]--;this._model.selectionStart=[O.start,b[1]],this._model.selectionStartLength=O.length}}_selectToWordAt(b){const A=this._getWordAt(b,!0);if(A){let O=b[1];for(;A.start<0;)A.start+=this._bufferService.cols,O--;if(!this._model.areSelectionValuesReversed())for(;A.start+A.length>this._bufferService.cols;)A.length-=this._bufferService.cols,O++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?A.start:A.start+A.length,O]}}_isCharWordSeparator(b){return b.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(b.getChars())>=0}_selectLineAt(b){const A=this._bufferService.buffer.getWrappedRangeForLine(b),O={start:{x:0,y:A.first},end:{x:this._bufferService.cols-1,y:A.last}};this._model.selectionStart=[0,A.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,u.getRangeLength)(O,this._bufferService.cols)}};r.SelectionService=M=_([v(3,g.IBufferService),v(4,g.ICoreService),v(5,E.IMouseService),v(6,g.IOptionsService),v(7,E.IRenderService),v(8,E.ICoreBrowserService)],M)},4725:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ILinkProviderService=r.IThemeService=r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;const _=d(8343);r.ICharSizeService=(0,_.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,_.createDecorator)("CoreBrowserService"),r.IMouseService=(0,_.createDecorator)("MouseService"),r.IRenderService=(0,_.createDecorator)("RenderService"),r.ISelectionService=(0,_.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,_.createDecorator)("CharacterJoinerService"),r.IThemeService=(0,_.createDecorator)("ThemeService"),r.ILinkProviderService=(0,_.createDecorator)("LinkProviderService")},6731:function(W,r,d){var _=this&&this.__decorate||function(M,b,A,O){var z,H=arguments.length,k=H<3?b:O===null?O=Object.getOwnPropertyDescriptor(b,A):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(M,b,A,O);else for(var K=M.length-1;K>=0;K--)(z=M[K])&&(k=(H<3?z(k):H>3?z(b,A,k):z(b,A))||k);return H>3&&k&&Object.defineProperty(b,A,k),k},v=this&&this.__param||function(M,b){return function(A,O){b(A,O,M)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;const o=d(7239),S=d(8055),C=d(8460),E=d(844),p=d(2585),n=S.css.toColor("#ffffff"),h=S.css.toColor("#000000"),u=S.css.toColor("#ffffff"),c=S.css.toColor("#000000"),g={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[S.css.toColor("#2e3436"),S.css.toColor("#cc0000"),S.css.toColor("#4e9a06"),S.css.toColor("#c4a000"),S.css.toColor("#3465a4"),S.css.toColor("#75507b"),S.css.toColor("#06989a"),S.css.toColor("#d3d7cf"),S.css.toColor("#555753"),S.css.toColor("#ef2929"),S.css.toColor("#8ae234"),S.css.toColor("#fce94f"),S.css.toColor("#729fcf"),S.css.toColor("#ad7fa8"),S.css.toColor("#34e2e2"),S.css.toColor("#eeeeec")],b=[0,95,135,175,215,255];for(let A=0;A<216;A++){const O=b[A/36%6|0],z=b[A/6%6|0],H=b[A%6];M.push({css:S.channels.toCss(O,z,H),rgba:S.channels.toRgba(O,z,H)})}for(let A=0;A<24;A++){const O=8+10*A;M.push({css:S.channels.toCss(O,O,O),rgba:S.channels.toRgba(O,O,O)})}return M})());let R=r.ThemeService=class extends E.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new o.ColorContrastCache,this._halfContrastCache=new o.ColorContrastCache,this._onChangeColors=this.register(new C.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:n,background:h,cursor:u,cursorAccent:c,selectionForeground:void 0,selectionBackgroundTransparent:g,selectionBackgroundOpaque:S.color.blend(h,g),selectionInactiveBackgroundTransparent:g,selectionInactiveBackgroundOpaque:S.color.blend(h,g),ansi:r.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(M={}){const b=this._colors;if(b.foreground=y(M.foreground,n),b.background=y(M.background,h),b.cursor=y(M.cursor,u),b.cursorAccent=y(M.cursorAccent,c),b.selectionBackgroundTransparent=y(M.selectionBackground,g),b.selectionBackgroundOpaque=S.color.blend(b.background,b.selectionBackgroundTransparent),b.selectionInactiveBackgroundTransparent=y(M.selectionInactiveBackground,b.selectionBackgroundTransparent),b.selectionInactiveBackgroundOpaque=S.color.blend(b.background,b.selectionInactiveBackgroundTransparent),b.selectionForeground=M.selectionForeground?y(M.selectionForeground,S.NULL_COLOR):void 0,b.selectionForeground===S.NULL_COLOR&&(b.selectionForeground=void 0),S.color.isOpaque(b.selectionBackgroundTransparent)&&(b.selectionBackgroundTransparent=S.color.opacity(b.selectionBackgroundTransparent,.3)),S.color.isOpaque(b.selectionInactiveBackgroundTransparent)&&(b.selectionInactiveBackgroundTransparent=S.color.opacity(b.selectionInactiveBackgroundTransparent,.3)),b.ansi=r.DEFAULT_ANSI_COLORS.slice(),b.ansi[0]=y(M.black,r.DEFAULT_ANSI_COLORS[0]),b.ansi[1]=y(M.red,r.DEFAULT_ANSI_COLORS[1]),b.ansi[2]=y(M.green,r.DEFAULT_ANSI_COLORS[2]),b.ansi[3]=y(M.yellow,r.DEFAULT_ANSI_COLORS[3]),b.ansi[4]=y(M.blue,r.DEFAULT_ANSI_COLORS[4]),b.ansi[5]=y(M.magenta,r.DEFAULT_ANSI_COLORS[5]),b.ansi[6]=y(M.cyan,r.DEFAULT_ANSI_COLORS[6]),b.ansi[7]=y(M.white,r.DEFAULT_ANSI_COLORS[7]),b.ansi[8]=y(M.brightBlack,r.DEFAULT_ANSI_COLORS[8]),b.ansi[9]=y(M.brightRed,r.DEFAULT_ANSI_COLORS[9]),b.ansi[10]=y(M.brightGreen,r.DEFAULT_ANSI_COLORS[10]),b.ansi[11]=y(M.brightYellow,r.DEFAULT_ANSI_COLORS[11]),b.ansi[12]=y(M.brightBlue,r.DEFAULT_ANSI_COLORS[12]),b.ansi[13]=y(M.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),b.ansi[14]=y(M.brightCyan,r.DEFAULT_ANSI_COLORS[14]),b.ansi[15]=y(M.brightWhite,r.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const A=Math.min(b.ansi.length-16,M.extendedAnsi.length);for(let O=0;O<A;O++)b.ansi[O+16]=y(M.extendedAnsi[O],r.DEFAULT_ANSI_COLORS[O+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(M){this._restoreColor(M),this._onChangeColors.fire(this.colors)}_restoreColor(M){if(M!==void 0)switch(M){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[M]=this._restoreColors.ansi[M]}else for(let b=0;b<this._restoreColors.ansi.length;++b)this._colors.ansi[b]=this._restoreColors.ansi[b]}modifyColors(M){M(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 y(M,b){if(M!==void 0)try{return S.css.toColor(M)}catch{}return b}r.ThemeService=R=_([v(0,p.IOptionsService)],R)},6349:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;const _=d(8460),v=d(844);class o extends v.Disposable{constructor(C){super(),this._maxLength=C,this.onDeleteEmitter=this.register(new _.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new _.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new _.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 E=new Array(C);for(let p=0;p<Math.min(C,this.length);p++)E[p]=this._array[this._getCyclicIndex(p)];this._array=E,this._maxLength=C,this._startIndex=0}get length(){return this._length}set length(C){if(C>this._length)for(let E=this._length;E<C;E++)this._array[E]=void 0;this._length=C}get(C){return this._array[this._getCyclicIndex(C)]}set(C,E){this._array[this._getCyclicIndex(C)]=E}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,E,...p){if(E){for(let n=C;n<this._length-E;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+E)];this._length-=E,this.onDeleteEmitter.fire({index:C,amount:E})}for(let n=this._length-1;n>=C;n--)this._array[this._getCyclicIndex(n+p.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<p.length;n++)this._array[this._getCyclicIndex(C+n)]=p[n];if(p.length&&this.onInsertEmitter.fire({index:C,amount:p.length}),this._length+p.length>this._maxLength){const n=this._length+p.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=p.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,E,p){if(!(E<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+p<0)throw new Error("Cannot shift elements in list beyond index 0");if(p>0){for(let h=E-1;h>=0;h--)this.set(C+h+p,this.get(C+h));const n=C+E+p-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<E;n++)this.set(C+n+p,this.get(C+n))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}r.CircularList=o},1439:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function d(_,v=5){if(typeof _!="object")return _;const o=Array.isArray(_)?[]:{};for(const S in _)o[S]=v<=1?_[S]:_[S]&&d(_[S],v-1);return o}},8055:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;let d=0,_=0,v=0,o=0;var S,C,E,p,n;function h(c){const g=c.toString(16);return g.length<2?"0"+g:g}function u(c,g){return c<g?(g+.05)/(c+.05):(c+.05)/(g+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},(function(c){c.toCss=function(g,R,y,M){return M!==void 0?`#${h(g)}${h(R)}${h(y)}${h(M)}`:`#${h(g)}${h(R)}${h(y)}`},c.toRgba=function(g,R,y,M=255){return(g<<24|R<<16|y<<8|M)>>>0},c.toColor=function(g,R,y,M){return{css:c.toCss(g,R,y,M),rgba:c.toRgba(g,R,y,M)}}})(S||(r.channels=S={})),(function(c){function g(R,y){return o=Math.round(255*y),[d,_,v]=n.toChannels(R.rgba),{css:S.toCss(d,_,v,o),rgba:S.toRgba(d,_,v,o)}}c.blend=function(R,y){if(o=(255&y.rgba)/255,o===1)return{css:y.css,rgba:y.rgba};const M=y.rgba>>24&255,b=y.rgba>>16&255,A=y.rgba>>8&255,O=R.rgba>>24&255,z=R.rgba>>16&255,H=R.rgba>>8&255;return d=O+Math.round((M-O)*o),_=z+Math.round((b-z)*o),v=H+Math.round((A-H)*o),{css:S.toCss(d,_,v),rgba:S.toRgba(d,_,v)}},c.isOpaque=function(R){return(255&R.rgba)==255},c.ensureContrastRatio=function(R,y,M){const b=n.ensureContrastRatio(R.rgba,y.rgba,M);if(b)return S.toColor(b>>24&255,b>>16&255,b>>8&255)},c.opaque=function(R){const y=(255|R.rgba)>>>0;return[d,_,v]=n.toChannels(y),{css:S.toCss(d,_,v),rgba:y}},c.opacity=g,c.multiplyOpacity=function(R,y){return o=255&R.rgba,g(R,o*y/255)},c.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(C||(r.color=C={})),(function(c){let g,R;try{const y=document.createElement("canvas");y.width=1,y.height=1;const M=y.getContext("2d",{willReadFrequently:!0});M&&(g=M,g.globalCompositeOperation="copy",R=g.createLinearGradient(0,0,1,1))}catch{}c.toColor=function(y){if(y.match(/#[\da-f]{3,8}/i))switch(y.length){case 4:return d=parseInt(y.slice(1,2).repeat(2),16),_=parseInt(y.slice(2,3).repeat(2),16),v=parseInt(y.slice(3,4).repeat(2),16),S.toColor(d,_,v);case 5:return d=parseInt(y.slice(1,2).repeat(2),16),_=parseInt(y.slice(2,3).repeat(2),16),v=parseInt(y.slice(3,4).repeat(2),16),o=parseInt(y.slice(4,5).repeat(2),16),S.toColor(d,_,v,o);case 7:return{css:y,rgba:(parseInt(y.slice(1),16)<<8|255)>>>0};case 9:return{css:y,rgba:parseInt(y.slice(1),16)>>>0}}const M=y.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(M)return d=parseInt(M[1]),_=parseInt(M[2]),v=parseInt(M[3]),o=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),S.toColor(d,_,v,o);if(!g||!R)throw new Error("css.toColor: Unsupported css format");if(g.fillStyle=R,g.fillStyle=y,typeof g.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(g.fillRect(0,0,1,1),[d,_,v,o]=g.getImageData(0,0,1,1).data,o!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:S.toRgba(d,_,v,o),css:y}}})(E||(r.css=E={})),(function(c){function g(R,y,M){const b=R/255,A=y/255,O=M/255;return .2126*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.7152*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}c.relativeLuminance=function(R){return g(R>>16&255,R>>8&255,255&R)},c.relativeLuminance2=g})(p||(r.rgb=p={})),(function(c){function g(y,M,b){const A=y>>24&255,O=y>>16&255,z=y>>8&255;let H=M>>24&255,k=M>>16&255,K=M>>8&255,re=u(p.relativeLuminance2(H,k,K),p.relativeLuminance2(A,O,z));for(;re<b&&(H>0||k>0||K>0);)H-=Math.max(0,Math.ceil(.1*H)),k-=Math.max(0,Math.ceil(.1*k)),K-=Math.max(0,Math.ceil(.1*K)),re=u(p.relativeLuminance2(H,k,K),p.relativeLuminance2(A,O,z));return(H<<24|k<<16|K<<8|255)>>>0}function R(y,M,b){const A=y>>24&255,O=y>>16&255,z=y>>8&255;let H=M>>24&255,k=M>>16&255,K=M>>8&255,re=u(p.relativeLuminance2(H,k,K),p.relativeLuminance2(A,O,z));for(;re<b&&(H<255||k<255||K<255);)H=Math.min(255,H+Math.ceil(.1*(255-H))),k=Math.min(255,k+Math.ceil(.1*(255-k))),K=Math.min(255,K+Math.ceil(.1*(255-K))),re=u(p.relativeLuminance2(H,k,K),p.relativeLuminance2(A,O,z));return(H<<24|k<<16|K<<8|255)>>>0}c.blend=function(y,M){if(o=(255&M)/255,o===1)return M;const b=M>>24&255,A=M>>16&255,O=M>>8&255,z=y>>24&255,H=y>>16&255,k=y>>8&255;return d=z+Math.round((b-z)*o),_=H+Math.round((A-H)*o),v=k+Math.round((O-k)*o),S.toRgba(d,_,v)},c.ensureContrastRatio=function(y,M,b){const A=p.relativeLuminance(y>>8),O=p.relativeLuminance(M>>8);if(u(A,O)<b){if(O<A){const k=g(y,M,b),K=u(A,p.relativeLuminance(k>>8));if(K<b){const re=R(y,M,b);return K>u(A,p.relativeLuminance(re>>8))?k:re}return k}const z=R(y,M,b),H=u(A,p.relativeLuminance(z>>8));if(H<b){const k=g(y,M,b);return H>u(A,p.relativeLuminance(k>>8))?z:k}return z}},c.reduceLuminance=g,c.increaseLuminance=R,c.toChannels=function(y){return[y>>24&255,y>>16&255,y>>8&255,255&y]}})(n||(r.rgba=n={})),r.toPaddedHex=h,r.contrastRatio=u},8969:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;const _=d(844),v=d(2585),o=d(4348),S=d(7866),C=d(744),E=d(7302),p=d(6975),n=d(8460),h=d(1753),u=d(1480),c=d(7994),g=d(9282),R=d(5435),y=d(5981),M=d(2660);let b=!1;class A extends _.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new n.EventEmitter),this._onScroll.event((z=>{this._onScrollApi?.fire(z.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(z){for(const H in z)this.optionsService.options[H]=z[H]}constructor(z){super(),this._windowsWrappingHeuristics=this.register(new _.MutableDisposable),this._onBinary=this.register(new n.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new n.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new n.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new n.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new n.EventEmitter),this._instantiationService=new o.InstantiationService,this.optionsService=this.register(new E.OptionsService(z)),this._instantiationService.setService(v.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(C.BufferService)),this._instantiationService.setService(v.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(S.LogService)),this._instantiationService.setService(v.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(p.CoreService)),this._instantiationService.setService(v.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(h.CoreMouseService)),this._instantiationService.setService(v.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(u.UnicodeService)),this._instantiationService.setService(v.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(c.CharsetService),this._instantiationService.setService(v.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(M.OscLinkService),this._instantiationService.setService(v.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new R.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,n.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,n.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,n.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,n.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((H=>{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((H=>{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 y.WriteBuffer(((H,k)=>this._inputHandler.parse(H,k)))),this.register((0,n.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(z,H){this._writeBuffer.write(z,H)}writeSync(z,H){this._logService.logLevel<=v.LogLevelEnum.WARN&&!b&&(this._logService.warn("writeSync is unreliable and will be removed soon."),b=!0),this._writeBuffer.writeSync(z,H)}input(z,H=!0){this.coreService.triggerDataEvent(z,H)}resize(z,H){isNaN(z)||isNaN(H)||(z=Math.max(z,C.MINIMUM_COLS),H=Math.max(H,C.MINIMUM_ROWS),this._bufferService.resize(z,H))}scroll(z,H=!1){this._bufferService.scroll(z,H)}scrollLines(z,H,k){this._bufferService.scrollLines(z,H,k)}scrollPages(z){this.scrollLines(z*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(z){const H=z-this._bufferService.buffer.ydisp;H!==0&&this.scrollLines(H)}registerEscHandler(z,H){return this._inputHandler.registerEscHandler(z,H)}registerDcsHandler(z,H){return this._inputHandler.registerDcsHandler(z,H)}registerCsiHandler(z,H){return this._inputHandler.registerCsiHandler(z,H)}registerOscHandler(z,H){return this._inputHandler.registerOscHandler(z,H)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let z=!1;const H=this.optionsService.rawOptions.windowsPty;H&&H.buildNumber!==void 0&&H.buildNumber!==void 0?z=H.backend==="conpty"&&H.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(z=!0),z?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const z=[];z.push(this.onLineFeed(g.updateWindowsModeWrappedState.bind(null,this._bufferService))),z.push(this.registerCsiHandler({final:"H"},(()=>((0,g.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,_.toDisposable)((()=>{for(const H of z)H.dispose()}))}}}r.CoreTerminal=A},8460:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.runAndSubscribe=r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=d=>(this._listeners.push(d),{dispose:()=>{if(!this._disposed){for(let _=0;_<this._listeners.length;_++)if(this._listeners[_]===d)return void this._listeners.splice(_,1)}}})),this._event}fire(d,_){const v=[];for(let o=0;o<this._listeners.length;o++)v.push(this._listeners[o]);for(let o=0;o<v.length;o++)v[o].call(void 0,d,_)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(d,_){return d((v=>_.fire(v)))},r.runAndSubscribe=function(d,_){return _(void 0),d((v=>_(v)))}},5435:function(W,r,d){var _=this&&this.__decorate||function(X,j,$,B){var P,J=arguments.length,se=J<3?j:B===null?B=Object.getOwnPropertyDescriptor(j,$):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")se=Reflect.decorate(X,j,$,B);else for(var ue=X.length-1;ue>=0;ue--)(P=X[ue])&&(se=(J<3?P(se):J>3?P(j,$,se):P(j,$))||se);return J>3&&se&&Object.defineProperty(j,$,se),se},v=this&&this.__param||function(X,j){return function($,B){j($,B,X)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;const o=d(2584),S=d(7116),C=d(2015),E=d(844),p=d(482),n=d(8437),h=d(8460),u=d(643),c=d(511),g=d(3734),R=d(2585),y=d(1480),M=d(6242),b=d(6351),A=d(5941),O={"(":0,")":1,"*":2,"+":3,"-":1,".":2},z=131072;function H(X,j){if(X>24)return j.setWinLines||!1;switch(X){case 1:return!!j.restoreWin;case 2:return!!j.minimizeWin;case 3:return!!j.setWinPosition;case 4:return!!j.setWinSizePixels;case 5:return!!j.raiseWin;case 6:return!!j.lowerWin;case 7:return!!j.refreshWin;case 8:return!!j.setWinSizeChars;case 9:return!!j.maximizeWin;case 10:return!!j.fullscreenWin;case 11:return!!j.getWinState;case 13:return!!j.getWinPosition;case 14:return!!j.getWinSizePixels;case 15:return!!j.getScreenSizePixels;case 16:return!!j.getCellSizePixels;case 18:return!!j.getWinSizeChars;case 19:return!!j.getScreenSizeChars;case 20:return!!j.getIconTitle;case 21:return!!j.getWinTitle;case 22:return!!j.pushTitle;case 23:return!!j.popTitle;case 24:return!!j.setWinLines}return!1}var k;(function(X){X[X.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",X[X.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(k||(r.WindowsOptionsReportType=k={}));let K=0;class re extends E.Disposable{getAttrData(){return this._curAttrData}constructor(j,$,B,P,J,se,ue,_e,Z=new C.EscapeSequenceParser){super(),this._bufferService=j,this._charsetService=$,this._coreService=B,this._logService=P,this._optionsService=J,this._oscLinkService=se,this._coreMouseService=ue,this._unicodeService=_e,this._parser=Z,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new p.StringToUtf32,this._utf8Decoder=new p.Utf8ToUtf32,this._workCell=new c.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new h.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new h.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new h.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new h.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new h.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new h.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new h.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new h.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new h.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new h.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new h.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new h.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((F=>this._activeBuffer=F.activeBuffer))),this._parser.setCsiHandlerFallback(((F,ae)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(F),params:ae.toArray()})})),this._parser.setEscHandlerFallback((F=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(F)})})),this._parser.setExecuteHandlerFallback((F=>{this._logService.debug("Unknown EXECUTE code: ",{code:F})})),this._parser.setOscHandlerFallback(((F,ae,me)=>{this._logService.debug("Unknown OSC code: ",{identifier:F,action:ae,data:me})})),this._parser.setDcsHandlerFallback(((F,ae,me)=>{ae==="HOOK"&&(me=me.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(F),action:ae,payload:me})})),this._parser.setPrintHandler(((F,ae,me)=>this.print(F,ae,me))),this._parser.registerCsiHandler({final:"@"},(F=>this.insertChars(F))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(F=>this.scrollLeft(F))),this._parser.registerCsiHandler({final:"A"},(F=>this.cursorUp(F))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(F=>this.scrollRight(F))),this._parser.registerCsiHandler({final:"B"},(F=>this.cursorDown(F))),this._parser.registerCsiHandler({final:"C"},(F=>this.cursorForward(F))),this._parser.registerCsiHandler({final:"D"},(F=>this.cursorBackward(F))),this._parser.registerCsiHandler({final:"E"},(F=>this.cursorNextLine(F))),this._parser.registerCsiHandler({final:"F"},(F=>this.cursorPrecedingLine(F))),this._parser.registerCsiHandler({final:"G"},(F=>this.cursorCharAbsolute(F))),this._parser.registerCsiHandler({final:"H"},(F=>this.cursorPosition(F))),this._parser.registerCsiHandler({final:"I"},(F=>this.cursorForwardTab(F))),this._parser.registerCsiHandler({final:"J"},(F=>this.eraseInDisplay(F,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(F=>this.eraseInDisplay(F,!0))),this._parser.registerCsiHandler({final:"K"},(F=>this.eraseInLine(F,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(F=>this.eraseInLine(F,!0))),this._parser.registerCsiHandler({final:"L"},(F=>this.insertLines(F))),this._parser.registerCsiHandler({final:"M"},(F=>this.deleteLines(F))),this._parser.registerCsiHandler({final:"P"},(F=>this.deleteChars(F))),this._parser.registerCsiHandler({final:"S"},(F=>this.scrollUp(F))),this._parser.registerCsiHandler({final:"T"},(F=>this.scrollDown(F))),this._parser.registerCsiHandler({final:"X"},(F=>this.eraseChars(F))),this._parser.registerCsiHandler({final:"Z"},(F=>this.cursorBackwardTab(F))),this._parser.registerCsiHandler({final:"`"},(F=>this.charPosAbsolute(F))),this._parser.registerCsiHandler({final:"a"},(F=>this.hPositionRelative(F))),this._parser.registerCsiHandler({final:"b"},(F=>this.repeatPrecedingCharacter(F))),this._parser.registerCsiHandler({final:"c"},(F=>this.sendDeviceAttributesPrimary(F))),this._parser.registerCsiHandler({prefix:">",final:"c"},(F=>this.sendDeviceAttributesSecondary(F))),this._parser.registerCsiHandler({final:"d"},(F=>this.linePosAbsolute(F))),this._parser.registerCsiHandler({final:"e"},(F=>this.vPositionRelative(F))),this._parser.registerCsiHandler({final:"f"},(F=>this.hVPosition(F))),this._parser.registerCsiHandler({final:"g"},(F=>this.tabClear(F))),this._parser.registerCsiHandler({final:"h"},(F=>this.setMode(F))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(F=>this.setModePrivate(F))),this._parser.registerCsiHandler({final:"l"},(F=>this.resetMode(F))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(F=>this.resetModePrivate(F))),this._parser.registerCsiHandler({final:"m"},(F=>this.charAttributes(F))),this._parser.registerCsiHandler({final:"n"},(F=>this.deviceStatus(F))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(F=>this.deviceStatusPrivate(F))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(F=>this.softReset(F))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(F=>this.setCursorStyle(F))),this._parser.registerCsiHandler({final:"r"},(F=>this.setScrollRegion(F))),this._parser.registerCsiHandler({final:"s"},(F=>this.saveCursor(F))),this._parser.registerCsiHandler({final:"t"},(F=>this.windowOptions(F))),this._parser.registerCsiHandler({final:"u"},(F=>this.restoreCursor(F))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(F=>this.insertColumns(F))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(F=>this.deleteColumns(F))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(F=>this.selectProtected(F))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(F=>this.requestMode(F,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(F=>this.requestMode(F,!1))),this._parser.setExecuteHandler(o.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(o.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(o.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(o.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(o.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(o.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(o.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(o.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(o.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(o.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(o.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(o.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler((F=>(this.setTitle(F),this.setIconName(F),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((F=>this.setIconName(F)))),this._parser.registerOscHandler(2,new M.OscHandler((F=>this.setTitle(F)))),this._parser.registerOscHandler(4,new M.OscHandler((F=>this.setOrReportIndexedColor(F)))),this._parser.registerOscHandler(8,new M.OscHandler((F=>this.setHyperlink(F)))),this._parser.registerOscHandler(10,new M.OscHandler((F=>this.setOrReportFgColor(F)))),this._parser.registerOscHandler(11,new M.OscHandler((F=>this.setOrReportBgColor(F)))),this._parser.registerOscHandler(12,new M.OscHandler((F=>this.setOrReportCursorColor(F)))),this._parser.registerOscHandler(104,new M.OscHandler((F=>this.restoreIndexedColor(F)))),this._parser.registerOscHandler(110,new M.OscHandler((F=>this.restoreFgColor(F)))),this._parser.registerOscHandler(111,new M.OscHandler((F=>this.restoreBgColor(F)))),this._parser.registerOscHandler(112,new M.OscHandler((F=>this.restoreCursorColor(F)))),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 F in S.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:F},(()=>this.selectCharset("("+F))),this._parser.registerEscHandler({intermediates:")",final:F},(()=>this.selectCharset(")"+F))),this._parser.registerEscHandler({intermediates:"*",final:F},(()=>this.selectCharset("*"+F))),this._parser.registerEscHandler({intermediates:"+",final:F},(()=>this.selectCharset("+"+F))),this._parser.registerEscHandler({intermediates:"-",final:F},(()=>this.selectCharset("-"+F))),this._parser.registerEscHandler({intermediates:".",final:F},(()=>this.selectCharset("."+F))),this._parser.registerEscHandler({intermediates:"/",final:F},(()=>this.selectCharset("/"+F)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((F=>(this._logService.error("Parsing error: ",F),F))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new b.DcsHandler(((F,ae)=>this.requestStatusString(F,ae))))}_preserveStack(j,$,B,P){this._parseStack.paused=!0,this._parseStack.cursorStartX=j,this._parseStack.cursorStartY=$,this._parseStack.decodedLength=B,this._parseStack.position=P}_logSlowResolvingAsync(j){this._logService.logLevel<=R.LogLevelEnum.WARN&&Promise.race([j,new Promise((($,B)=>setTimeout((()=>B("#SLOW_TIMEOUT")),5e3)))]).catch(($=>{if($!=="#SLOW_TIMEOUT")throw $;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(j,$){let B,P=this._activeBuffer.x,J=this._activeBuffer.y,se=0;const ue=this._parseStack.paused;if(ue){if(B=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,$))return this._logSlowResolvingAsync(B),B;P=this._parseStack.cursorStartX,J=this._parseStack.cursorStartY,this._parseStack.paused=!1,j.length>z&&(se=this._parseStack.position+z)}if(this._logService.logLevel<=R.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof j=="string"?` "${j}"`:` "${Array.prototype.map.call(j,(F=>String.fromCharCode(F))).join("")}"`),typeof j=="string"?j.split("").map((F=>F.charCodeAt(0))):j),this._parseBuffer.length<j.length&&this._parseBuffer.length<z&&(this._parseBuffer=new Uint32Array(Math.min(j.length,z))),ue||this._dirtyRowTracker.clearRange(),j.length>z)for(let F=se;F<j.length;F+=z){const ae=F+z<j.length?F+z:j.length,me=typeof j=="string"?this._stringDecoder.decode(j.substring(F,ae),this._parseBuffer):this._utf8Decoder.decode(j.subarray(F,ae),this._parseBuffer);if(B=this._parser.parse(this._parseBuffer,me))return this._preserveStack(P,J,me,F),this._logSlowResolvingAsync(B),B}else if(!ue){const F=typeof j=="string"?this._stringDecoder.decode(j,this._parseBuffer):this._utf8Decoder.decode(j,this._parseBuffer);if(B=this._parser.parse(this._parseBuffer,F))return this._preserveStack(P,J,F,0),this._logSlowResolvingAsync(B),B}this._activeBuffer.x===P&&this._activeBuffer.y===J||this._onCursorMove.fire();const _e=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Z=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Z<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Z,this._bufferService.rows-1),Math.min(_e,this._bufferService.rows-1))}print(j,$,B){let P,J;const se=this._charsetService.charset,ue=this._optionsService.rawOptions.screenReaderMode,_e=this._bufferService.cols,Z=this._coreService.decPrivateModes.wraparound,F=this._coreService.modes.insertMode,ae=this._curAttrData;let me=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&B-$>0&&me.getWidth(this._activeBuffer.x-1)===2&&me.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ae);let xe=this._parser.precedingJoinState;for(let Ce=$;Ce<B;++Ce){if(P=j[Ce],P<127&&se){const Xe=se[String.fromCharCode(P)];Xe&&(P=Xe.charCodeAt(0))}const je=this._unicodeService.charProperties(P,xe);J=y.UnicodeService.extractWidth(je);const Ae=y.UnicodeService.extractShouldJoin(je),$e=Ae?y.UnicodeService.extractWidth(xe):0;if(xe=je,ue&&this._onA11yChar.fire((0,p.stringFromCodePoint)(P)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+J-$e>_e){if(Z){const Xe=me;let ke=this._activeBuffer.x-$e;for(this._activeBuffer.x=$e,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),me=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),$e>0&&me instanceof n.BufferLine&&me.copyCellsFrom(Xe,ke,0,$e,!1);ke<_e;)Xe.setCellFromCodepoint(ke++,0,1,ae)}else if(this._activeBuffer.x=_e-1,J===2)continue}if(Ae&&this._activeBuffer.x){const Xe=me.getWidth(this._activeBuffer.x-1)?1:2;me.addCodepointToCell(this._activeBuffer.x-Xe,P,J);for(let ke=J-$e;--ke>=0;)me.setCellFromCodepoint(this._activeBuffer.x++,0,0,ae)}else if(F&&(me.insertCells(this._activeBuffer.x,J-$e,this._activeBuffer.getNullCell(ae)),me.getWidth(_e-1)===2&&me.setCellFromCodepoint(_e-1,u.NULL_CELL_CODE,u.NULL_CELL_WIDTH,ae)),me.setCellFromCodepoint(this._activeBuffer.x++,P,J,ae),J>0)for(;--J;)me.setCellFromCodepoint(this._activeBuffer.x++,0,0,ae)}this._parser.precedingJoinState=xe,this._activeBuffer.x<_e&&B-$>0&&me.getWidth(this._activeBuffer.x)===0&&!me.hasContent(this._activeBuffer.x)&&me.setCellFromCodepoint(this._activeBuffer.x,0,1,ae),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(j,$){return j.final!=="t"||j.prefix||j.intermediates?this._parser.registerCsiHandler(j,$):this._parser.registerCsiHandler(j,(B=>!H(B.params[0],this._optionsService.rawOptions.windowOptions)||$(B)))}registerDcsHandler(j,$){return this._parser.registerDcsHandler(j,new b.DcsHandler($))}registerEscHandler(j,$){return this._parser.registerEscHandler(j,$)}registerOscHandler(j,$){return this._parser.registerOscHandler(j,new M.OscHandler($))}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(){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&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.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 j=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-j),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(j=this._bufferService.cols-1){this._activeBuffer.x=Math.min(j,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(j,$){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=j,this._activeBuffer.y=this._activeBuffer.scrollTop+$):(this._activeBuffer.x=j,this._activeBuffer.y=$),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(j,$){this._restrictCursor(),this._setCursor(this._activeBuffer.x+j,this._activeBuffer.y+$)}cursorUp(j){const $=this._activeBuffer.y-this._activeBuffer.scrollTop;return $>=0?this._moveCursor(0,-Math.min($,j.params[0]||1)):this._moveCursor(0,-(j.params[0]||1)),!0}cursorDown(j){const $=this._activeBuffer.scrollBottom-this._activeBuffer.y;return $>=0?this._moveCursor(0,Math.min($,j.params[0]||1)):this._moveCursor(0,j.params[0]||1),!0}cursorForward(j){return this._moveCursor(j.params[0]||1,0),!0}cursorBackward(j){return this._moveCursor(-(j.params[0]||1),0),!0}cursorNextLine(j){return this.cursorDown(j),this._activeBuffer.x=0,!0}cursorPrecedingLine(j){return this.cursorUp(j),this._activeBuffer.x=0,!0}cursorCharAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(j){return this._setCursor(j.length>=2?(j.params[1]||1)-1:0,(j.params[0]||1)-1),!0}charPosAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(j){return this._moveCursor(j.params[0]||1,0),!0}linePosAbsolute(j){return this._setCursor(this._activeBuffer.x,(j.params[0]||1)-1),!0}vPositionRelative(j){return this._moveCursor(0,j.params[0]||1),!0}hVPosition(j){return this.cursorPosition(j),!0}tabClear(j){const $=j.params[0];return $===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:$===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let $=j.params[0]||1;for(;$--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let $=j.params[0]||1;for(;$--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(j){const $=j.params[0];return $===1&&(this._curAttrData.bg|=536870912),$!==2&&$!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(j,$,B,P=!1,J=!1){const se=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);se.replaceCells($,B,this._activeBuffer.getNullCell(this._eraseAttrData()),J),P&&(se.isWrapped=!1)}_resetBufferLine(j,$=!1){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);B&&(B.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),$),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+j),B.isWrapped=!1)}eraseInDisplay(j,$=!1){let B;switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:for(B=this._activeBuffer.y,this._dirtyRowTracker.markDirty(B),this._eraseInBufferLine(B++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,$);B<this._bufferService.rows;B++)this._resetBufferLine(B,$);this._dirtyRowTracker.markDirty(B);break;case 1:for(B=this._activeBuffer.y,this._dirtyRowTracker.markDirty(B),this._eraseInBufferLine(B,0,this._activeBuffer.x+1,!0,$),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(B+1).isWrapped=!1);B--;)this._resetBufferLine(B,$);this._dirtyRowTracker.markDirty(0);break;case 2:for(B=this._bufferService.rows,this._dirtyRowTracker.markDirty(B-1);B--;)this._resetBufferLine(B,$);this._dirtyRowTracker.markDirty(0);break;case 3:const P=this._activeBuffer.lines.length-this._bufferService.rows;P>0&&(this._activeBuffer.lines.trimStart(P),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-P,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-P,0),this._onScroll.fire(0))}return!0}eraseInLine(j,$=!1){switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,$);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,$);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,$)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(j){this._restrictCursor();let $=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=this._activeBuffer.ybase+this._activeBuffer.y,P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,J=this._bufferService.rows-1+this._activeBuffer.ybase-P+1;for(;$--;)this._activeBuffer.lines.splice(J-1,1),this._activeBuffer.lines.splice(B,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(j){this._restrictCursor();let $=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=this._activeBuffer.ybase+this._activeBuffer.y;let P;for(P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,P=this._bufferService.rows-1+this._activeBuffer.ybase-P;$--;)this._activeBuffer.lines.splice(B,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(j){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.insertCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(j){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.deleteCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(j){let $=j.params[0]||1;for(;$--;)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(j){let $=j.params[0]||1;for(;$--;)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(n.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=j.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);P.deleteCells(0,$,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=j.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);P.insertCells(0,$,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=j.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);P.insertCells(this._activeBuffer.x,$,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=j.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);P.deleteCells(this._activeBuffer.x,$,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(j){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(j.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(j){const $=this._parser.precedingJoinState;if(!$)return!0;const B=j.params[0]||1,P=y.UnicodeService.extractWidth($),J=this._activeBuffer.x-P,se=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(J),ue=new Uint32Array(se.length*B);let _e=0;for(let F=0;F<se.length;){const ae=se.codePointAt(F)||0;ue[_e++]=ae,F+=ae>65535?2:1}let Z=_e;for(let F=1;F<B;++F)ue.copyWithin(Z,0,_e),Z+=_e;return this.print(ue,0,Z),!0}sendDeviceAttributesPrimary(j){return j.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(o.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(o.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(j){return j.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(o.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(o.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(j.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(o.C0.ESC+"[>83;40003;0c")),!0}_is(j){return(this._optionsService.rawOptions.termName+"").indexOf(j)===0}setMode(j){for(let $=0;$<j.length;$++)switch(j.params[$]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(j){for(let $=0;$<j.length;$++)switch(j.params[$]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,S.DEFAULT_CHARSET),this._charsetService.setgCharset(1,S.DEFAULT_CHARSET),this._charsetService.setgCharset(2,S.DEFAULT_CHARSET),this._charsetService.setgCharset(3,S.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(j){for(let $=0;$<j.length;$++)switch(j.params[$]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(j){for(let $=0;$<j.length;$++)switch(j.params[$]){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(),j.params[$]===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(j,$){const B=this._coreService.decPrivateModes,{activeProtocol:P,activeEncoding:J}=this._coreMouseService,se=this._coreService,{buffers:ue,cols:_e}=this._bufferService,{active:Z,alt:F}=ue,ae=this._optionsService.rawOptions,me=Ae=>Ae?1:2,xe=j.params[0];return Ce=xe,je=$?xe===2?4:xe===4?me(se.modes.insertMode):xe===12?3:xe===20?me(ae.convertEol):0:xe===1?me(B.applicationCursorKeys):xe===3?ae.windowOptions.setWinLines?_e===80?2:_e===132?1:0:0:xe===6?me(B.origin):xe===7?me(B.wraparound):xe===8?3:xe===9?me(P==="X10"):xe===12?me(ae.cursorBlink):xe===25?me(!se.isCursorHidden):xe===45?me(B.reverseWraparound):xe===66?me(B.applicationKeypad):xe===67?4:xe===1e3?me(P==="VT200"):xe===1002?me(P==="DRAG"):xe===1003?me(P==="ANY"):xe===1004?me(B.sendFocus):xe===1005?4:xe===1006?me(J==="SGR"):xe===1015?4:xe===1016?me(J==="SGR_PIXELS"):xe===1048?1:xe===47||xe===1047||xe===1049?me(Z===F):xe===2004?me(B.bracketedPasteMode):0,se.triggerDataEvent(`${o.C0.ESC}[${$?"":"?"}${Ce};${je}$y`),!0;var Ce,je}_updateAttrColor(j,$,B,P,J){return $===2?(j|=50331648,j&=-16777216,j|=g.AttributeData.fromColorRGB([B,P,J])):$===5&&(j&=-50331904,j|=33554432|255&B),j}_extractColor(j,$,B){const P=[0,0,-1,0,0,0];let J=0,se=0;do{if(P[se+J]=j.params[$+se],j.hasSubParams($+se)){const ue=j.getSubParams($+se);let _e=0;do P[1]===5&&(J=1),P[se+_e+1+J]=ue[_e];while(++_e<ue.length&&_e+se+1+J<P.length);break}if(P[1]===5&&se+J>=2||P[1]===2&&se+J>=5)break;P[1]&&(J=1)}while(++se+$<j.length&&se+J<P.length);for(let ue=2;ue<P.length;++ue)P[ue]===-1&&(P[ue]=0);switch(P[0]){case 38:B.fg=this._updateAttrColor(B.fg,P[1],P[3],P[4],P[5]);break;case 48:B.bg=this._updateAttrColor(B.bg,P[1],P[3],P[4],P[5]);break;case 58:B.extended=B.extended.clone(),B.extended.underlineColor=this._updateAttrColor(B.extended.underlineColor,P[1],P[3],P[4],P[5])}return se}_processUnderline(j,$){$.extended=$.extended.clone(),(!~j||j>5)&&(j=1),$.extended.underlineStyle=j,$.fg|=268435456,j===0&&($.fg&=-268435457),$.updateExtended()}_processSGR0(j){j.fg=n.DEFAULT_ATTR_DATA.fg,j.bg=n.DEFAULT_ATTR_DATA.bg,j.extended=j.extended.clone(),j.extended.underlineStyle=0,j.extended.underlineColor&=-67108864,j.updateExtended()}charAttributes(j){if(j.length===1&&j.params[0]===0)return this._processSGR0(this._curAttrData),!0;const $=j.length;let B;const P=this._curAttrData;for(let J=0;J<$;J++)B=j.params[J],B>=30&&B<=37?(P.fg&=-50331904,P.fg|=16777216|B-30):B>=40&&B<=47?(P.bg&=-50331904,P.bg|=16777216|B-40):B>=90&&B<=97?(P.fg&=-50331904,P.fg|=16777224|B-90):B>=100&&B<=107?(P.bg&=-50331904,P.bg|=16777224|B-100):B===0?this._processSGR0(P):B===1?P.fg|=134217728:B===3?P.bg|=67108864:B===4?(P.fg|=268435456,this._processUnderline(j.hasSubParams(J)?j.getSubParams(J)[0]:1,P)):B===5?P.fg|=536870912:B===7?P.fg|=67108864:B===8?P.fg|=1073741824:B===9?P.fg|=2147483648:B===2?P.bg|=134217728:B===21?this._processUnderline(2,P):B===22?(P.fg&=-134217729,P.bg&=-134217729):B===23?P.bg&=-67108865:B===24?(P.fg&=-268435457,this._processUnderline(0,P)):B===25?P.fg&=-536870913:B===27?P.fg&=-67108865:B===28?P.fg&=-1073741825:B===29?P.fg&=2147483647:B===39?(P.fg&=-67108864,P.fg|=16777215&n.DEFAULT_ATTR_DATA.fg):B===49?(P.bg&=-67108864,P.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):B===38||B===48||B===58?J+=this._extractColor(j,J,P):B===53?P.bg|=1073741824:B===55?P.bg&=-1073741825:B===59?(P.extended=P.extended.clone(),P.extended.underlineColor=-1,P.updateExtended()):B===100?(P.fg&=-67108864,P.fg|=16777215&n.DEFAULT_ATTR_DATA.fg,P.bg&=-67108864,P.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",B);return!0}deviceStatus(j){switch(j.params[0]){case 5:this._coreService.triggerDataEvent(`${o.C0.ESC}[0n`);break;case 6:const $=this._activeBuffer.y+1,B=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${o.C0.ESC}[${$};${B}R`)}return!0}deviceStatusPrivate(j){if(j.params[0]===6){const $=this._activeBuffer.y+1,B=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${o.C0.ESC}[?${$};${B}R`)}return!0}softReset(j){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=n.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(j){const $=j.params[0]||1;switch($){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 B=$%2==1;return this._optionsService.options.cursorBlink=B,!0}setScrollRegion(j){const $=j.params[0]||1;let B;return(j.length<2||(B=j.params[1])>this._bufferService.rows||B===0)&&(B=this._bufferService.rows),B>$&&(this._activeBuffer.scrollTop=$-1,this._activeBuffer.scrollBottom=B-1,this._setCursor(0,0)),!0}windowOptions(j){if(!H(j.params[0],this._optionsService.rawOptions.windowOptions))return!0;const $=j.length>1?j.params[1]:0;switch(j.params[0]){case 14:$!==2&&this._onRequestWindowsOptionsReport.fire(k.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(k.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${o.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:$!==0&&$!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),$!==0&&$!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:$!==0&&$!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),$!==0&&$!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(j){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(j){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(j){return this._windowTitle=j,this._onTitleChange.fire(j),!0}setIconName(j){return this._iconName=j,!0}setOrReportIndexedColor(j){const $=[],B=j.split(";");for(;B.length>1;){const P=B.shift(),J=B.shift();if(/^\d+$/.exec(P)){const se=parseInt(P);if(Y(se))if(J==="?")$.push({type:0,index:se});else{const ue=(0,A.parseColor)(J);ue&&$.push({type:1,index:se,color:ue})}}}return $.length&&this._onColor.fire($),!0}setHyperlink(j){const $=j.split(";");return!($.length<2)&&($[1]?this._createHyperlink($[0],$[1]):!$[0]&&this._finishHyperlink())}_createHyperlink(j,$){this._getCurrentLinkId()&&this._finishHyperlink();const B=j.split(":");let P;const J=B.findIndex((se=>se.startsWith("id=")));return J!==-1&&(P=B[J].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:P,uri:$}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(j,$){const B=j.split(";");for(let P=0;P<B.length&&!($>=this._specialColors.length);++P,++$)if(B[P]==="?")this._onColor.fire([{type:0,index:this._specialColors[$]}]);else{const J=(0,A.parseColor)(B[P]);J&&this._onColor.fire([{type:1,index:this._specialColors[$],color:J}])}return!0}setOrReportFgColor(j){return this._setOrReportSpecialColor(j,0)}setOrReportBgColor(j){return this._setOrReportSpecialColor(j,1)}setOrReportCursorColor(j){return this._setOrReportSpecialColor(j,2)}restoreIndexedColor(j){if(!j)return this._onColor.fire([{type:2}]),!0;const $=[],B=j.split(";");for(let P=0;P<B.length;++P)if(/^\d+$/.exec(B[P])){const J=parseInt(B[P]);Y(J)&&$.push({type:2,index:J})}return $.length&&this._onColor.fire($),!0}restoreFgColor(j){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(j){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(j){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,S.DEFAULT_CHARSET),!0}selectCharset(j){return j.length!==2?(this.selectDefaultCharset(),!0):(j[0]==="/"||this._charsetService.setgCharset(O[j[0]],S.CHARSETS[j[1]]||S.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const j=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,j,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=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(j){return this._charsetService.setgLevel(j),!0}screenAlignmentPattern(){const j=new c.CellData;j.content=4194373,j.fg=this._curAttrData.fg,j.bg=this._curAttrData.bg,this._setCursor(0,0);for(let $=0;$<this._bufferService.rows;++$){const B=this._activeBuffer.ybase+this._activeBuffer.y+$,P=this._activeBuffer.lines.get(B);P&&(P.fill(j),P.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(j,$){const B=this._bufferService.buffer,P=this._optionsService.rawOptions;return(J=>(this._coreService.triggerDataEvent(`${o.C0.ESC}${J}${o.C0.ESC}\\`),!0))(j==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:j==='"p'?'P1$r61;1"p':j==="r"?`P1$r${B.scrollTop+1};${B.scrollBottom+1}r`:j==="m"?"P1$r0m":j===" q"?`P1$r${{block:2,underline:4,bar:6}[P.cursorStyle]-(P.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(j,$){this._dirtyRowTracker.markRangeDirty(j,$)}}r.InputHandler=re;let G=class{constructor(X){this._bufferService=X,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(X){X<this.start?this.start=X:X>this.end&&(this.end=X)}markRangeDirty(X,j){X>j&&(K=X,X=j,j=K),X<this.start&&(this.start=X),j>this.end&&(this.end=j)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Y(X){return 0<=X&&X<256}G=_([v(0,R.IBufferService)],G)},844:(W,r)=>{function d(_){for(const v of _)v.dispose();_.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const _ of this._disposables)_.dispose();this._disposables.length=0}register(_){return this._disposables.push(_),_}unregister(_){const v=this._disposables.indexOf(_);v!==-1&&this._disposables.splice(v,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(_){this._isDisposed||_===this._value||(this._value?.dispose(),this._value=_)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},r.toDisposable=function(_){return{dispose:_}},r.disposeArray=d,r.getDisposeArrayDisposable=function(_){return{dispose:()=>d(_)}}},1505:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class d{constructor(){this._data={}}set(v,o,S){this._data[v]||(this._data[v]={}),this._data[v][o]=S}get(v,o){return this._data[v]?this._data[v][o]:void 0}clear(){this._data={}}}r.TwoKeyMap=d,r.FourKeyMap=class{constructor(){this._data=new d}set(_,v,o,S,C){this._data.get(_,v)||this._data.set(_,v,new d),this._data.get(_,v).set(o,S,C)}get(_,v,o,S){return this._data.get(_,v)?.get(o,S)}clear(){this._data.clear()}}},6114:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof process<"u"&&"title"in process;const d=r.isNode?"node":navigator.userAgent,_=r.isNode?"node":navigator.platform;r.isFirefox=d.includes("Firefox"),r.isLegacyEdge=d.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(d),r.getSafariVersion=function(){if(!r.isSafari)return 0;const v=d.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(_),r.isIpad=_==="iPad",r.isIphone=_==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(_),r.isLinux=_.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(d)},6106:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let d=0;r.SortedList=class{constructor(_){this._getKey=_,this._array=[]}clear(){this._array.length=0}insert(_){this._array.length!==0?(d=this._search(this._getKey(_)),this._array.splice(d,0,_)):this._array.push(_)}delete(_){if(this._array.length===0)return!1;const v=this._getKey(_);if(v===void 0||(d=this._search(v),d===-1)||this._getKey(this._array[d])!==v)return!1;do if(this._array[d]===_)return this._array.splice(d,1),!0;while(++d<this._array.length&&this._getKey(this._array[d])===v);return!1}*getKeyIterator(_){if(this._array.length!==0&&(d=this._search(_),!(d<0||d>=this._array.length)&&this._getKey(this._array[d])===_))do yield this._array[d];while(++d<this._array.length&&this._getKey(this._array[d])===_)}forEachByKey(_,v){if(this._array.length!==0&&(d=this._search(_),!(d<0||d>=this._array.length)&&this._getKey(this._array[d])===_))do v(this._array[d]);while(++d<this._array.length&&this._getKey(this._array[d])===_)}values(){return[...this._array].values()}_search(_){let v=0,o=this._array.length-1;for(;o>=v;){let S=v+o>>1;const C=this._getKey(this._array[S]);if(C>_)o=S-1;else{if(!(C<_)){for(;S>0&&this._getKey(this._array[S-1])===_;)S--;return S}v=S+1}}return v}}},7226:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const _=d(6114);class v{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 E=0,p=0,n=C.timeRemaining(),h=0;for(;this._i<this._tasks.length;){if(E=Date.now(),this._tasks[this._i]()||this._i++,E=Math.max(1,Date.now()-E),p=Math.max(E,p),h=C.timeRemaining(),1.5*p>h)return n-E<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-E))}ms`),void this._start();n=h}this.clear()}}class o extends v{_requestCallback(C){return setTimeout((()=>C(this._createDeadline(16))))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const E=Date.now()+C;return{timeRemaining:()=>Math.max(0,E-Date.now())}}}r.PriorityTaskQueue=o,r.IdleTaskQueue=!_.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(S){return requestIdleCallback(S)}_cancelCallback(S){cancelIdleCallback(S)}}:o,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(S){this._queue.clear(),this._queue.enqueue(S)}flush(){this._queue.flush()}}},9282:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;const _=d(643);r.updateWindowsModeWrappedState=function(v){const o=v.buffer.lines.get(v.buffer.ybase+v.buffer.y-1),S=o?.get(v.cols-1),C=v.buffer.lines.get(v.buffer.ybase+v.buffer.y);C&&S&&(C.isWrapped=S[_.CHAR_DATA_CODE_INDEX]!==_.NULL_CELL_CODE&&S[_.CHAR_DATA_CODE_INDEX]!==_.WHITESPACE_CELL_CODE)}},3734:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class d{constructor(){this.fg=0,this.bg=0,this.extended=new _}static toColorRGB(o){return[o>>>16&255,o>>>8&255,255&o]}static fromColorRGB(o){return(255&o[0])<<16|(255&o[1])<<8|255&o[2]}clone(){const o=new d;return o.fg=this.fg,o.bg=this.bg,o.extended=this.extended.clone(),o}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}}r.AttributeData=d;class _{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(o){this._ext=o}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(o){this._ext&=-469762049,this._ext|=o<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(o){this._ext&=-67108864,this._ext|=67108863&o}get urlId(){return this._urlId}set urlId(o){this._urlId=o}get underlineVariantOffset(){const o=(3758096384&this._ext)>>29;return o<0?4294967288^o:o}set underlineVariantOffset(o){this._ext&=536870911,this._ext|=o<<29&3758096384}constructor(o=0,S=0){this._ext=0,this._urlId=0,this._ext=o,this._urlId=S}clone(){return new _(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=_},9092:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;const _=d(6349),v=d(7226),o=d(3734),S=d(8437),C=d(4634),E=d(511),p=d(643),n=d(4863),h=d(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(u,c,g){this._hasScrollback=u,this._optionsService=c,this._bufferService=g,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=S.DEFAULT_ATTR_DATA.clone(),this.savedCharset=h.DEFAULT_CHARSET,this.markers=[],this._nullCell=E.CellData.fromCharData([0,p.NULL_CELL_CHAR,p.NULL_CELL_WIDTH,p.NULL_CELL_CODE]),this._whitespaceCell=E.CellData.fromCharData([0,p.WHITESPACE_CELL_CHAR,p.WHITESPACE_CELL_WIDTH,p.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new v.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new _.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(u){return u?(this._nullCell.fg=u.fg,this._nullCell.bg=u.bg,this._nullCell.extended=u.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new o.ExtendedAttrs),this._nullCell}getWhitespaceCell(u){return u?(this._whitespaceCell.fg=u.fg,this._whitespaceCell.bg=u.bg,this._whitespaceCell.extended=u.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new o.ExtendedAttrs),this._whitespaceCell}getBlankLine(u,c){return new S.BufferLine(this._bufferService.cols,this.getNullCell(u),c)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const u=this.ybase+this.y-this.ydisp;return u>=0&&u<this._rows}_getCorrectBufferLength(u){if(!this._hasScrollback)return u;const c=u+this._optionsService.rawOptions.scrollback;return c>r.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:c}fillViewportRows(u){if(this.lines.length===0){u===void 0&&(u=S.DEFAULT_ATTR_DATA);let c=this._rows;for(;c--;)this.lines.push(this.getBlankLine(u))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new _.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(u,c){const g=this.getNullCell(S.DEFAULT_ATTR_DATA);let R=0;const y=this._getCorrectBufferLength(c);if(y>this.lines.maxLength&&(this.lines.maxLength=y),this.lines.length>0){if(this._cols<u)for(let b=0;b<this.lines.length;b++)R+=+this.lines.get(b).resize(u,g);let M=0;if(this._rows<c)for(let b=this._rows;b<c;b++)this.lines.length<c+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new S.BufferLine(u,g)):this.ybase>0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new S.BufferLine(u,g)));else for(let b=this._rows;b>c;b--)this.lines.length>c+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(y<this.lines.maxLength){const b=this.lines.length-y;b>0&&(this.lines.trimStart(b),this.ybase=Math.max(this.ybase-b,0),this.ydisp=Math.max(this.ydisp-b,0),this.savedY=Math.max(this.savedY-b,0)),this.lines.maxLength=y}this.x=Math.min(this.x,u-1),this.y=Math.min(this.y,c-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,u-1),this.scrollTop=0}if(this.scrollBottom=c-1,this._isReflowEnabled&&(this._reflow(u,c),this._cols>u))for(let M=0;M<this.lines.length;M++)R+=+this.lines.get(M).resize(u,g);this._cols=u,this._rows=c,this._memoryCleanupQueue.clear(),R>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let u=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,u=!1);let c=0;for(;this._memoryCleanupPosition<this.lines.length;)if(c+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),c>100)return!0;return u}get _isReflowEnabled(){const u=this._optionsService.rawOptions.windowsPty;return u&&u.buildNumber?this._hasScrollback&&u.backend==="conpty"&&u.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(u,c){this._cols!==u&&(u>this._cols?this._reflowLarger(u,c):this._reflowSmaller(u,c))}_reflowLarger(u,c){const g=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,u,this.ybase+this.y,this.getNullCell(S.DEFAULT_ATTR_DATA));if(g.length>0){const R=(0,C.reflowLargerCreateNewLayout)(this.lines,g);(0,C.reflowLargerApplyNewLayout)(this.lines,R.layout),this._reflowLargerAdjustViewport(u,c,R.countRemoved)}}_reflowLargerAdjustViewport(u,c,g){const R=this.getNullCell(S.DEFAULT_ATTR_DATA);let y=g;for(;y-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<c&&this.lines.push(new S.BufferLine(u,R))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-g,0)}_reflowSmaller(u,c){const g=this.getNullCell(S.DEFAULT_ATTR_DATA),R=[];let y=0;for(let M=this.lines.length-1;M>=0;M--){let b=this.lines.get(M);if(!b||!b.isWrapped&&b.getTrimmedLength()<=u)continue;const A=[b];for(;b.isWrapped&&M>0;)b=this.lines.get(--M),A.unshift(b);const O=this.ybase+this.y;if(O>=M&&O<M+A.length)continue;const z=A[A.length-1].getTrimmedLength(),H=(0,C.reflowSmallerGetNewLineLengths)(A,this._cols,u),k=H.length-A.length;let K;K=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+k):Math.max(0,this.lines.length-this.lines.maxLength+k);const re=[];for(let B=0;B<k;B++){const P=this.getBlankLine(S.DEFAULT_ATTR_DATA,!0);re.push(P)}re.length>0&&(R.push({start:M+A.length+y,newLines:re}),y+=re.length),A.push(...re);let G=H.length-1,Y=H[G];Y===0&&(G--,Y=H[G]);let X=A.length-k-1,j=z;for(;X>=0;){const B=Math.min(j,Y);if(A[G]===void 0)break;if(A[G].copyCellsFrom(A[X],j-B,Y-B,B,!0),Y-=B,Y===0&&(G--,Y=H[G]),j-=B,j===0){X--;const P=Math.max(X,0);j=(0,C.getWrappedLineTrimmedLength)(A,P,this._cols)}}for(let B=0;B<A.length;B++)H[B]<u&&A[B].setCell(H[B],g);let $=k-K;for(;$-- >0;)this.ybase===0?this.y<c-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+y)-c&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+k,this.ybase+c-1)}if(R.length>0){const M=[],b=[];for(let G=0;G<this.lines.length;G++)b.push(this.lines.get(G));const A=this.lines.length;let O=A-1,z=0,H=R[z];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+y);let k=0;for(let G=Math.min(this.lines.maxLength-1,A+y-1);G>=0;G--)if(H&&H.start>O+k){for(let Y=H.newLines.length-1;Y>=0;Y--)this.lines.set(G--,H.newLines[Y]);G++,M.push({index:O+1,amount:H.newLines.length}),k+=H.newLines.length,H=R[++z]}else this.lines.set(G,b[O--]);let K=0;for(let G=M.length-1;G>=0;G--)M[G].index+=K,this.lines.onInsertEmitter.fire(M[G]),K+=M[G].amount;const re=Math.max(0,A+y-this.lines.maxLength);re>0&&this.lines.onTrimEmitter.fire(re)}}translateBufferLineToString(u,c,g=0,R){const y=this.lines.get(u);return y?y.translateToString(c,g,R):""}getWrappedRangeForLine(u){let c=u,g=u;for(;c>0&&this.lines.get(c).isWrapped;)c--;for(;g+1<this.lines.length&&this.lines.get(g+1).isWrapped;)g++;return{first:c,last:g}}setupTabStops(u){for(u!=null?this.tabs[u]||(u=this.prevStop(u)):(this.tabs={},u=0);u<this._cols;u+=this._optionsService.rawOptions.tabStopWidth)this.tabs[u]=!0}prevStop(u){for(u==null&&(u=this.x);!this.tabs[--u]&&u>0;);return u>=this._cols?this._cols-1:u<0?0:u}nextStop(u){for(u==null&&(u=this.x);!this.tabs[++u]&&u<this._cols;);return u>=this._cols?this._cols-1:u<0?0:u}clearMarkers(u){this._isClearing=!0;for(let c=0;c<this.markers.length;c++)this.markers[c].line===u&&(this.markers[c].dispose(),this.markers.splice(c--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let u=0;u<this.markers.length;u++)this.markers[u].dispose(),this.markers.splice(u--,1);this._isClearing=!1}addMarker(u){const c=new n.Marker(u);return this.markers.push(c),c.register(this.lines.onTrim((g=>{c.line-=g,c.line<0&&c.dispose()}))),c.register(this.lines.onInsert((g=>{c.line>=g.index&&(c.line+=g.amount)}))),c.register(this.lines.onDelete((g=>{c.line>=g.index&&c.line<g.index+g.amount&&c.dispose(),c.line>g.index&&(c.line-=g.amount)}))),c.register(c.onDispose((()=>this._removeMarker(c)))),c}_removeMarker(u){this._isClearing||this.markers.splice(this.markers.indexOf(u),1)}}},8437:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;const _=d(3734),v=d(511),o=d(643),S=d(482);r.DEFAULT_ATTR_DATA=Object.freeze(new _.AttributeData);let C=0;class E{constructor(n,h,u=!1){this.isWrapped=u,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*n);const c=h||v.CellData.fromCharData([0,o.NULL_CELL_CHAR,o.NULL_CELL_WIDTH,o.NULL_CELL_CODE]);for(let g=0;g<n;++g)this.setCell(g,c);this.length=n}get(n){const h=this._data[3*n+0],u=2097151&h;return[this._data[3*n+1],2097152&h?this._combined[n]:u?(0,S.stringFromCodePoint)(u):"",h>>22,2097152&h?this._combined[n].charCodeAt(this._combined[n].length-1):u]}set(n,h){this._data[3*n+1]=h[o.CHAR_DATA_ATTR_INDEX],h[o.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[n]=h[1],this._data[3*n+0]=2097152|n|h[o.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*n+0]=h[o.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|h[o.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(n){return this._data[3*n+0]>>22}hasWidth(n){return 12582912&this._data[3*n+0]}getFg(n){return this._data[3*n+1]}getBg(n){return this._data[3*n+2]}hasContent(n){return 4194303&this._data[3*n+0]}getCodePoint(n){const h=this._data[3*n+0];return 2097152&h?this._combined[n].charCodeAt(this._combined[n].length-1):2097151&h}isCombined(n){return 2097152&this._data[3*n+0]}getString(n){const h=this._data[3*n+0];return 2097152&h?this._combined[n]:2097151&h?(0,S.stringFromCodePoint)(2097151&h):""}isProtected(n){return 536870912&this._data[3*n+2]}loadCell(n,h){return C=3*n,h.content=this._data[C+0],h.fg=this._data[C+1],h.bg=this._data[C+2],2097152&h.content&&(h.combinedData=this._combined[n]),268435456&h.bg&&(h.extended=this._extendedAttrs[n]),h}setCell(n,h){2097152&h.content&&(this._combined[n]=h.combinedData),268435456&h.bg&&(this._extendedAttrs[n]=h.extended),this._data[3*n+0]=h.content,this._data[3*n+1]=h.fg,this._data[3*n+2]=h.bg}setCellFromCodepoint(n,h,u,c){268435456&c.bg&&(this._extendedAttrs[n]=c.extended),this._data[3*n+0]=h|u<<22,this._data[3*n+1]=c.fg,this._data[3*n+2]=c.bg}addCodepointToCell(n,h,u){let c=this._data[3*n+0];2097152&c?this._combined[n]+=(0,S.stringFromCodePoint)(h):2097151&c?(this._combined[n]=(0,S.stringFromCodePoint)(2097151&c)+(0,S.stringFromCodePoint)(h),c&=-2097152,c|=2097152):c=h|4194304,u&&(c&=-12582913,c|=u<<22),this._data[3*n+0]=c}insertCells(n,h,u){if((n%=this.length)&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,u),h<this.length-n){const c=new v.CellData;for(let g=this.length-n-h-1;g>=0;--g)this.setCell(n+h+g,this.loadCell(n+g,c));for(let g=0;g<h;++g)this.setCell(n+g,u)}else for(let c=n;c<this.length;++c)this.setCell(c,u);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,u)}deleteCells(n,h,u){if(n%=this.length,h<this.length-n){const c=new v.CellData;for(let g=0;g<this.length-n-h;++g)this.setCell(n+g,this.loadCell(n+h+g,c));for(let g=this.length-h;g<this.length;++g)this.setCell(g,u)}else for(let c=n;c<this.length;++c)this.setCell(c,u);n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,u),this.getWidth(n)!==0||this.hasContent(n)||this.setCellFromCodepoint(n,0,1,u)}replaceCells(n,h,u,c=!1){if(c)for(n&&this.getWidth(n-1)===2&&!this.isProtected(n-1)&&this.setCellFromCodepoint(n-1,0,1,u),h<this.length&&this.getWidth(h-1)===2&&!this.isProtected(h)&&this.setCellFromCodepoint(h,0,1,u);n<h&&n<this.length;)this.isProtected(n)||this.setCell(n,u),n++;else for(n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,u),h<this.length&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h,0,1,u);n<h&&n<this.length;)this.setCell(n++,u)}resize(n,h){if(n===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const u=3*n;if(n>this.length){if(this._data.buffer.byteLength>=4*u)this._data=new Uint32Array(this._data.buffer,0,u);else{const c=new Uint32Array(u);c.set(this._data),this._data=c}for(let c=this.length;c<n;++c)this.setCell(c,h)}else{this._data=this._data.subarray(0,u);const c=Object.keys(this._combined);for(let R=0;R<c.length;R++){const y=parseInt(c[R],10);y>=n&&delete this._combined[y]}const g=Object.keys(this._extendedAttrs);for(let R=0;R<g.length;R++){const y=parseInt(g[R],10);y>=n&&delete this._extendedAttrs[y]}}return this.length=n,4*u*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const n=new Uint32Array(this._data.length);return n.set(this._data),this._data=n,1}return 0}fill(n,h=!1){if(h)for(let u=0;u<this.length;++u)this.isProtected(u)||this.setCell(u,n);else{this._combined={},this._extendedAttrs={};for(let u=0;u<this.length;++u)this.setCell(u,n)}}copyFrom(n){this.length!==n.length?this._data=new Uint32Array(n._data):this._data.set(n._data),this.length=n.length,this._combined={};for(const h in n._combined)this._combined[h]=n._combined[h];this._extendedAttrs={};for(const h in n._extendedAttrs)this._extendedAttrs[h]=n._extendedAttrs[h];this.isWrapped=n.isWrapped}clone(){const n=new E(0);n._data=new Uint32Array(this._data),n.length=this.length;for(const h in this._combined)n._combined[h]=this._combined[h];for(const h in this._extendedAttrs)n._extendedAttrs[h]=this._extendedAttrs[h];return n.isWrapped=this.isWrapped,n}getTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0])return n+(this._data[3*n+0]>>22);return 0}getNoBgTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0]||50331648&this._data[3*n+2])return n+(this._data[3*n+0]>>22);return 0}copyCellsFrom(n,h,u,c,g){const R=n._data;if(g)for(let M=c-1;M>=0;M--){for(let b=0;b<3;b++)this._data[3*(u+M)+b]=R[3*(h+M)+b];268435456&R[3*(h+M)+2]&&(this._extendedAttrs[u+M]=n._extendedAttrs[h+M])}else for(let M=0;M<c;M++){for(let b=0;b<3;b++)this._data[3*(u+M)+b]=R[3*(h+M)+b];268435456&R[3*(h+M)+2]&&(this._extendedAttrs[u+M]=n._extendedAttrs[h+M])}const y=Object.keys(n._combined);for(let M=0;M<y.length;M++){const b=parseInt(y[M],10);b>=h&&(this._combined[b-h+u]=n._combined[b])}}translateToString(n,h,u,c){h=h??0,u=u??this.length,n&&(u=Math.min(u,this.getTrimmedLength())),c&&(c.length=0);let g="";for(;h<u;){const R=this._data[3*h+0],y=2097151&R,M=2097152&R?this._combined[h]:y?(0,S.stringFromCodePoint)(y):o.WHITESPACE_CELL_CHAR;if(g+=M,c)for(let b=0;b<M.length;++b)c.push(h);h+=R>>22||1}return c&&c.push(h),g}}r.BufferLine=E},4841:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(d,_){if(d.start.y>d.end.y)throw new Error(`Buffer range end (${d.end.x}, ${d.end.y}) cannot be before start (${d.start.x}, ${d.start.y})`);return _*(d.end.y-d.start.y)+(d.end.x-d.start.x+1)}},4634:(W,r)=>{function d(_,v,o){if(v===_.length-1)return _[v].getTrimmedLength();const S=!_[v].hasContent(o-1)&&_[v].getWidth(o-1)===1,C=_[v+1].getWidth(0)===2;return S&&C?o-1:o}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(_,v,o,S,C){const E=[];for(let p=0;p<_.length-1;p++){let n=p,h=_.get(++n);if(!h.isWrapped)continue;const u=[_.get(p)];for(;n<_.length&&h.isWrapped;)u.push(h),h=_.get(++n);if(S>=p&&S<n){p+=u.length-1;continue}let c=0,g=d(u,c,v),R=1,y=0;for(;R<u.length;){const b=d(u,R,v),A=b-y,O=o-g,z=Math.min(A,O);u[c].copyCellsFrom(u[R],y,g,z,!1),g+=z,g===o&&(c++,g=0),y+=z,y===b&&(R++,y=0),g===0&&c!==0&&u[c-1].getWidth(o-1)===2&&(u[c].copyCellsFrom(u[c-1],o-1,g++,1,!1),u[c-1].setCell(o-1,C))}u[c].replaceCells(g,o,C);let M=0;for(let b=u.length-1;b>0&&(b>c||u[b].getTrimmedLength()===0);b--)M++;M>0&&(E.push(p+u.length-M),E.push(M)),p+=u.length-1}return E},r.reflowLargerCreateNewLayout=function(_,v){const o=[];let S=0,C=v[S],E=0;for(let p=0;p<_.length;p++)if(C===p){const n=v[++S];_.onDeleteEmitter.fire({index:p-E,amount:n}),p+=n-1,E+=n,C=v[++S]}else o.push(p);return{layout:o,countRemoved:E}},r.reflowLargerApplyNewLayout=function(_,v){const o=[];for(let S=0;S<v.length;S++)o.push(_.get(v[S]));for(let S=0;S<o.length;S++)_.set(S,o[S]);_.length=v.length},r.reflowSmallerGetNewLineLengths=function(_,v,o){const S=[],C=_.map(((h,u)=>d(_,u,v))).reduce(((h,u)=>h+u));let E=0,p=0,n=0;for(;n<C;){if(C-n<o){S.push(C-n);break}E+=o;const h=d(_,p,v);E>h&&(E-=h,p++);const u=_[p].getWidth(E-1)===2;u&&E--;const c=u?o-1:o;S.push(c),n+=c}return S},r.getWrappedLineTrimmedLength=d},5295:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;const _=d(8460),v=d(844),o=d(9092);class S extends v.Disposable{constructor(E,p){super(),this._optionsService=E,this._bufferService=p,this._onBufferActivate=this.register(new _.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 o.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new o.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(E){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(E),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(E,p){this._normal.resize(E,p),this._alt.resize(E,p),this.setupTabStops(E)}setupTabStops(E){this._normal.setupTabStops(E),this._alt.setupTabStops(E)}}r.BufferSet=S},511:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const _=d(482),v=d(643),o=d(3734);class S extends o.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new o.ExtendedAttrs,this.combinedData=""}static fromCharData(E){const p=new S;return p.setFromCharData(E),p}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,_.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(E){this.fg=E[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let p=!1;if(E[v.CHAR_DATA_CHAR_INDEX].length>2)p=!0;else if(E[v.CHAR_DATA_CHAR_INDEX].length===2){const n=E[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const h=E[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(n-55296)+h-56320+65536|E[v.CHAR_DATA_WIDTH_INDEX]<<22:p=!0}else p=!0}else this.content=E[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|E[v.CHAR_DATA_WIDTH_INDEX]<<22;p&&(this.combinedData=E[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|E[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=S},643:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},4863:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;const _=d(8460),v=d(844);class o{get id(){return this._id}constructor(C){this.line=C,this.isDisposed=!1,this._disposables=[],this._id=o._nextId++,this._onDispose=this.register(new _.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,v.disposeArray)(this._disposables),this._disposables.length=0)}register(C){return this._disposables.push(C),C}}r.Marker=o,o._nextId=1},7116:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.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:"≥","{":"π","|":"≠","}":"£","~":"·"},r.CHARSETS.A={"#":"£"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},r.CHARSETS.C=r.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},r.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},r.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},r.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},r.CHARSETS.E=r.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},r.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},r.CHARSETS.H=r.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(W,r)=>{var d,_,v;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,(function(o){o.NUL="\0",o.SOH="",o.STX="",o.ETX="",o.EOT="",o.ENQ="",o.ACK="",o.BEL="\x07",o.BS="\b",o.HT=" ",o.LF=`
|
|
16
|
+
`,o.VT="\v",o.FF="\f",o.CR="\r",o.SO="",o.SI="",o.DLE="",o.DC1="",o.DC2="",o.DC3="",o.DC4="",o.NAK="",o.SYN="",o.ETB="",o.CAN="",o.EM="",o.SUB="",o.ESC="\x1B",o.FS="",o.GS="",o.RS="",o.US="",o.SP=" ",o.DEL=""})(d||(r.C0=d={})),(function(o){o.PAD="",o.HOP="",o.BPH="",o.NBH="",o.IND="",o.NEL="
",o.SSA="",o.ESA="",o.HTS="",o.HTJ="",o.VTS="",o.PLD="",o.PLU="",o.RI="",o.SS2="",o.SS3="",o.DCS="",o.PU1="",o.PU2="",o.STS="",o.CCH="",o.MW="",o.SPA="",o.EPA="",o.SOS="",o.SGCI="",o.SCI="",o.CSI="",o.ST="",o.OSC="",o.PM="",o.APC=""})(_||(r.C1=_={})),(function(o){o.ST=`${d.ESC}\\`})(v||(r.C1_ESCAPED=v={}))},7399:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;const _=d(2584),v={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:["'",'"']};r.evaluateKeyboardEvent=function(o,S,C,E){const p={type:0,cancel:!1,key:void 0},n=(o.shiftKey?1:0)|(o.altKey?2:0)|(o.ctrlKey?4:0)|(o.metaKey?8:0);switch(o.keyCode){case 0:o.key==="UIKeyInputUpArrow"?p.key=S?_.C0.ESC+"OA":_.C0.ESC+"[A":o.key==="UIKeyInputLeftArrow"?p.key=S?_.C0.ESC+"OD":_.C0.ESC+"[D":o.key==="UIKeyInputRightArrow"?p.key=S?_.C0.ESC+"OC":_.C0.ESC+"[C":o.key==="UIKeyInputDownArrow"&&(p.key=S?_.C0.ESC+"OB":_.C0.ESC+"[B");break;case 8:p.key=o.ctrlKey?"\b":_.C0.DEL,o.altKey&&(p.key=_.C0.ESC+p.key);break;case 9:if(o.shiftKey){p.key=_.C0.ESC+"[Z";break}p.key=_.C0.HT,p.cancel=!0;break;case 13:p.key=o.altKey?_.C0.ESC+_.C0.CR:_.C0.CR,p.cancel=!0;break;case 27:p.key=_.C0.ESC,o.altKey&&(p.key=_.C0.ESC+_.C0.ESC),p.cancel=!0;break;case 37:if(o.metaKey)break;n?(p.key=_.C0.ESC+"[1;"+(n+1)+"D",p.key===_.C0.ESC+"[1;3D"&&(p.key=_.C0.ESC+(C?"b":"[1;5D"))):p.key=S?_.C0.ESC+"OD":_.C0.ESC+"[D";break;case 39:if(o.metaKey)break;n?(p.key=_.C0.ESC+"[1;"+(n+1)+"C",p.key===_.C0.ESC+"[1;3C"&&(p.key=_.C0.ESC+(C?"f":"[1;5C"))):p.key=S?_.C0.ESC+"OC":_.C0.ESC+"[C";break;case 38:if(o.metaKey)break;n?(p.key=_.C0.ESC+"[1;"+(n+1)+"A",C||p.key!==_.C0.ESC+"[1;3A"||(p.key=_.C0.ESC+"[1;5A")):p.key=S?_.C0.ESC+"OA":_.C0.ESC+"[A";break;case 40:if(o.metaKey)break;n?(p.key=_.C0.ESC+"[1;"+(n+1)+"B",C||p.key!==_.C0.ESC+"[1;3B"||(p.key=_.C0.ESC+"[1;5B")):p.key=S?_.C0.ESC+"OB":_.C0.ESC+"[B";break;case 45:o.shiftKey||o.ctrlKey||(p.key=_.C0.ESC+"[2~");break;case 46:p.key=n?_.C0.ESC+"[3;"+(n+1)+"~":_.C0.ESC+"[3~";break;case 36:p.key=n?_.C0.ESC+"[1;"+(n+1)+"H":S?_.C0.ESC+"OH":_.C0.ESC+"[H";break;case 35:p.key=n?_.C0.ESC+"[1;"+(n+1)+"F":S?_.C0.ESC+"OF":_.C0.ESC+"[F";break;case 33:o.shiftKey?p.type=2:o.ctrlKey?p.key=_.C0.ESC+"[5;"+(n+1)+"~":p.key=_.C0.ESC+"[5~";break;case 34:o.shiftKey?p.type=3:o.ctrlKey?p.key=_.C0.ESC+"[6;"+(n+1)+"~":p.key=_.C0.ESC+"[6~";break;case 112:p.key=n?_.C0.ESC+"[1;"+(n+1)+"P":_.C0.ESC+"OP";break;case 113:p.key=n?_.C0.ESC+"[1;"+(n+1)+"Q":_.C0.ESC+"OQ";break;case 114:p.key=n?_.C0.ESC+"[1;"+(n+1)+"R":_.C0.ESC+"OR";break;case 115:p.key=n?_.C0.ESC+"[1;"+(n+1)+"S":_.C0.ESC+"OS";break;case 116:p.key=n?_.C0.ESC+"[15;"+(n+1)+"~":_.C0.ESC+"[15~";break;case 117:p.key=n?_.C0.ESC+"[17;"+(n+1)+"~":_.C0.ESC+"[17~";break;case 118:p.key=n?_.C0.ESC+"[18;"+(n+1)+"~":_.C0.ESC+"[18~";break;case 119:p.key=n?_.C0.ESC+"[19;"+(n+1)+"~":_.C0.ESC+"[19~";break;case 120:p.key=n?_.C0.ESC+"[20;"+(n+1)+"~":_.C0.ESC+"[20~";break;case 121:p.key=n?_.C0.ESC+"[21;"+(n+1)+"~":_.C0.ESC+"[21~";break;case 122:p.key=n?_.C0.ESC+"[23;"+(n+1)+"~":_.C0.ESC+"[23~";break;case 123:p.key=n?_.C0.ESC+"[24;"+(n+1)+"~":_.C0.ESC+"[24~";break;default:if(!o.ctrlKey||o.shiftKey||o.altKey||o.metaKey)if(C&&!E||!o.altKey||o.metaKey)!C||o.altKey||o.ctrlKey||o.shiftKey||!o.metaKey?o.key&&!o.ctrlKey&&!o.altKey&&!o.metaKey&&o.keyCode>=48&&o.key.length===1?p.key=o.key:o.key&&o.ctrlKey&&(o.key==="_"&&(p.key=_.C0.US),o.key==="@"&&(p.key=_.C0.NUL)):o.keyCode===65&&(p.type=1);else{const h=v[o.keyCode],u=h?.[o.shiftKey?1:0];if(u)p.key=_.C0.ESC+u;else if(o.keyCode>=65&&o.keyCode<=90){const c=o.ctrlKey?o.keyCode-64:o.keyCode+32;let g=String.fromCharCode(c);o.shiftKey&&(g=g.toUpperCase()),p.key=_.C0.ESC+g}else if(o.keyCode===32)p.key=_.C0.ESC+(o.ctrlKey?_.C0.NUL:" ");else if(o.key==="Dead"&&o.code.startsWith("Key")){let c=o.code.slice(3,4);o.shiftKey||(c=c.toLowerCase()),p.key=_.C0.ESC+c,p.cancel=!0}}else o.keyCode>=65&&o.keyCode<=90?p.key=String.fromCharCode(o.keyCode-64):o.keyCode===32?p.key=_.C0.NUL:o.keyCode>=51&&o.keyCode<=55?p.key=String.fromCharCode(o.keyCode-51+27):o.keyCode===56?p.key=_.C0.DEL:o.keyCode===219?p.key=_.C0.ESC:o.keyCode===220?p.key=_.C0.FS:o.keyCode===221&&(p.key=_.C0.GS)}return p}},482:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(d){return d>65535?(d-=65536,String.fromCharCode(55296+(d>>10))+String.fromCharCode(d%1024+56320)):String.fromCharCode(d)},r.utf32ToString=function(d,_=0,v=d.length){let o="";for(let S=_;S<v;++S){let C=d[S];C>65535?(C-=65536,o+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):o+=String.fromCharCode(C)}return o},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(d,_){const v=d.length;if(!v)return 0;let o=0,S=0;if(this._interim){const C=d.charCodeAt(S++);56320<=C&&C<=57343?_[o++]=1024*(this._interim-55296)+C-56320+65536:(_[o++]=this._interim,_[o++]=C),this._interim=0}for(let C=S;C<v;++C){const E=d.charCodeAt(C);if(55296<=E&&E<=56319){if(++C>=v)return this._interim=E,o;const p=d.charCodeAt(C);56320<=p&&p<=57343?_[o++]=1024*(E-55296)+p-56320+65536:(_[o++]=E,_[o++]=p)}else E!==65279&&(_[o++]=E)}return o}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(d,_){const v=d.length;if(!v)return 0;let o,S,C,E,p=0,n=0,h=0;if(this.interim[0]){let g=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let y,M=0;for(;(y=63&this.interim[++M])&&M<4;)R<<=6,R|=y;const b=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,A=b-M;for(;h<A;){if(h>=v)return 0;if(y=d[h++],(192&y)!=128){h--,g=!0;break}this.interim[M++]=y,R<<=6,R|=63&y}g||(b===2?R<128?h--:_[p++]=R:b===3?R<2048||R>=55296&&R<=57343||R===65279||(_[p++]=R):R<65536||R>1114111||(_[p++]=R)),this.interim.fill(0)}const u=v-4;let c=h;for(;c<v;){for(;!(!(c<u)||128&(o=d[c])||128&(S=d[c+1])||128&(C=d[c+2])||128&(E=d[c+3]));)_[p++]=o,_[p++]=S,_[p++]=C,_[p++]=E,c+=4;if(o=d[c++],o<128)_[p++]=o;else if((224&o)==192){if(c>=v)return this.interim[0]=o,p;if(S=d[c++],(192&S)!=128){c--;continue}if(n=(31&o)<<6|63&S,n<128){c--;continue}_[p++]=n}else if((240&o)==224){if(c>=v)return this.interim[0]=o,p;if(S=d[c++],(192&S)!=128){c--;continue}if(c>=v)return this.interim[0]=o,this.interim[1]=S,p;if(C=d[c++],(192&C)!=128){c--;continue}if(n=(15&o)<<12|(63&S)<<6|63&C,n<2048||n>=55296&&n<=57343||n===65279)continue;_[p++]=n}else if((248&o)==240){if(c>=v)return this.interim[0]=o,p;if(S=d[c++],(192&S)!=128){c--;continue}if(c>=v)return this.interim[0]=o,this.interim[1]=S,p;if(C=d[c++],(192&C)!=128){c--;continue}if(c>=v)return this.interim[0]=o,this.interim[1]=S,this.interim[2]=C,p;if(E=d[c++],(192&E)!=128){c--;continue}if(n=(7&o)<<18|(63&S)<<12|(63&C)<<6|63&E,n<65536||n>1114111)continue;_[p++]=n}}return p}}},225:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;const _=d(1480),v=[[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]],o=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let S;r.UnicodeV6=class{constructor(){if(this.version="6",!S){S=new Uint8Array(65536),S.fill(1),S[0]=0,S.fill(0,1,32),S.fill(0,127,160),S.fill(2,4352,4448),S[9001]=2,S[9002]=2,S.fill(2,11904,42192),S[12351]=1,S.fill(2,44032,55204),S.fill(2,63744,64256),S.fill(2,65040,65050),S.fill(2,65072,65136),S.fill(2,65280,65377),S.fill(2,65504,65511);for(let C=0;C<v.length;++C)S.fill(0,v[C][0],v[C][1]+1)}}wcwidth(C){return C<32?0:C<127?1:C<65536?S[C]:(function(E,p){let n,h=0,u=p.length-1;if(E<p[0][0]||E>p[u][1])return!1;for(;u>=h;)if(n=h+u>>1,E>p[n][1])h=n+1;else{if(!(E<p[n][0]))return!0;u=n-1}return!1})(C,o)?0:C>=131072&&C<=196605||C>=196608&&C<=262141?2:1}charProperties(C,E){let p=this.wcwidth(C),n=p===0&&E!==0;if(n){const h=_.UnicodeService.extractWidth(E);h===0?n=!1:h>p&&(p=h)}return _.UnicodeService.createPropertyValue(0,p,n)}}},5981:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;const _=d(8460),v=d(844);class o extends v.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 _.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(C,E){if(E!==void 0&&this._syncCalls>E)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 p;for(this._isSyncWriting=!0;p=this._writeBuffer.shift();){this._action(p);const n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(C,E){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(E),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(E)}_innerWrite(C=0,E=!0){const p=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const n=this._writeBuffer[this._bufferOffset],h=this._action(n,E);if(h){const c=g=>Date.now()-p>=12?setTimeout((()=>this._innerWrite(0,g))):this._innerWrite(p,g);return void h.catch((g=>(queueMicrotask((()=>{throw g})),Promise.resolve(!1)))).then(c)}const u=this._callbacks[this._bufferOffset];if(u&&u(),this._bufferOffset++,this._pendingData-=n.length,Date.now()-p>=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()}}r.WriteBuffer=o},5941:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.parseColor=void 0;const d=/^([\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})$/,_=/^[\da-f]+$/;function v(o,S){const C=o.toString(16),E=C.length<2?"0"+C:C;switch(S){case 4:return C[0];case 8:return E;case 12:return(E+E).slice(0,3);default:return E+E}}r.parseColor=function(o){if(!o)return;let S=o.toLowerCase();if(S.indexOf("rgb:")===0){S=S.slice(4);const C=d.exec(S);if(C){const E=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/E*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/E*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/E*255)]}}else if(S.indexOf("#")===0&&(S=S.slice(1),_.exec(S)&&[3,6,9,12].includes(S.length))){const C=S.length/3,E=[0,0,0];for(let p=0;p<3;++p){const n=parseInt(S.slice(C*p,C*p+C),16);E[p]=C===1?n<<4:C===2?n:C===3?n>>4:n>>8}return E}},r.toRgbString=function(o,S=16){const[C,E,p]=o;return`rgb:${v(C,S)}/${v(E,S)}/${v(p,S)}`}},5770:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;const _=d(482),v=d(8742),o=d(5770),S=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=S,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=S}registerHandler(E,p){this._handlers[E]===void 0&&(this._handlers[E]=[]);const n=this._handlers[E];return n.push(p),{dispose:()=>{const h=n.indexOf(p);h!==-1&&n.splice(h,1)}}}clearHandler(E){this._handlers[E]&&delete this._handlers[E]}setHandlerFallback(E){this._handlerFb=E}reset(){if(this._active.length)for(let E=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;E>=0;--E)this._active[E].unhook(!1);this._stack.paused=!1,this._active=S,this._ident=0}hook(E,p){if(this.reset(),this._ident=E,this._active=this._handlers[E]||S,this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(p);else this._handlerFb(this._ident,"HOOK",p)}put(E,p,n){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(E,p,n);else this._handlerFb(this._ident,"PUT",(0,_.utf32ToString)(E,p,n))}unhook(E,p=!0){if(this._active.length){let n=!1,h=this._active.length-1,u=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,n=p,u=this._stack.fallThrough,this._stack.paused=!1),!u&&n===!1){for(;h>=0&&(n=this._active[h].unhook(E),n!==!0);h--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,n;h--}for(;h>=0;h--)if(n=this._active[h].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,"UNHOOK",E);this._active=S,this._ident=0}};const C=new v.Params;C.addParam(0),r.DcsHandler=class{constructor(E){this._handler=E,this._data="",this._params=C,this._hitLimit=!1}hook(E){this._params=E.length>1||E.params[0]?E.clone():C,this._data="",this._hitLimit=!1}put(E,p,n){this._hitLimit||(this._data+=(0,_.utf32ToString)(E,p,n),this._data.length>o.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(E){let p=!1;if(this._hitLimit)p=!1;else if(E&&(p=this._handler(this._data,this._params),p instanceof Promise))return p.then((n=>(this._params=C,this._data="",this._hitLimit=!1,n)));return this._params=C,this._data="",this._hitLimit=!1,p}}},2015:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;const _=d(844),v=d(8742),o=d(6242),S=d(6351);class C{constructor(h){this.table=new Uint8Array(h)}setDefault(h,u){this.table.fill(h<<4|u)}add(h,u,c,g){this.table[u<<8|h]=c<<4|g}addMany(h,u,c,g){for(let R=0;R<h.length;R++)this.table[u<<8|h[R]]=c<<4|g}}r.TransitionTable=C;const E=160;r.VT500_TRANSITION_TABLE=(function(){const n=new C(4095),h=Array.apply(null,Array(256)).map(((M,b)=>b)),u=(M,b)=>h.slice(M,b),c=u(32,127),g=u(0,24);g.push(25),g.push.apply(g,u(28,32));const R=u(0,14);let y;for(y in n.setDefault(1,0),n.addMany(c,0,2,0),R)n.addMany([24,26,153,154],y,3,0),n.addMany(u(128,144),y,3,0),n.addMany(u(144,152),y,3,0),n.add(156,y,0,0),n.add(27,y,11,1),n.add(157,y,4,8),n.addMany([152,158,159],y,0,7),n.add(155,y,11,3),n.add(144,y,11,9);return n.addMany(g,0,3,0),n.addMany(g,1,3,1),n.add(127,1,0,1),n.addMany(g,8,0,8),n.addMany(g,3,3,3),n.add(127,3,0,3),n.addMany(g,4,3,4),n.add(127,4,0,4),n.addMany(g,6,3,6),n.addMany(g,5,3,5),n.add(127,5,0,5),n.addMany(g,2,3,2),n.add(127,2,0,2),n.add(93,1,4,8),n.addMany(c,8,5,8),n.add(127,8,5,8),n.addMany([156,27,24,26,7],8,6,0),n.addMany(u(28,32),8,0,8),n.addMany([88,94,95],1,0,7),n.addMany(c,7,0,7),n.addMany(g,7,0,7),n.add(156,7,0,0),n.add(127,7,0,7),n.add(91,1,11,3),n.addMany(u(64,127),3,7,0),n.addMany(u(48,60),3,8,4),n.addMany([60,61,62,63],3,9,4),n.addMany(u(48,60),4,8,4),n.addMany(u(64,127),4,7,0),n.addMany([60,61,62,63],4,0,6),n.addMany(u(32,64),6,0,6),n.add(127,6,0,6),n.addMany(u(64,127),6,0,0),n.addMany(u(32,48),3,9,5),n.addMany(u(32,48),5,9,5),n.addMany(u(48,64),5,0,6),n.addMany(u(64,127),5,7,0),n.addMany(u(32,48),4,9,5),n.addMany(u(32,48),1,9,2),n.addMany(u(32,48),2,9,2),n.addMany(u(48,127),2,10,0),n.addMany(u(48,80),1,10,0),n.addMany(u(81,88),1,10,0),n.addMany([89,90,92],1,10,0),n.addMany(u(96,127),1,10,0),n.add(80,1,11,9),n.addMany(g,9,0,9),n.add(127,9,0,9),n.addMany(u(28,32),9,0,9),n.addMany(u(32,48),9,9,12),n.addMany(u(48,60),9,8,10),n.addMany([60,61,62,63],9,9,10),n.addMany(g,11,0,11),n.addMany(u(32,128),11,0,11),n.addMany(u(28,32),11,0,11),n.addMany(g,10,0,10),n.add(127,10,0,10),n.addMany(u(28,32),10,0,10),n.addMany(u(48,60),10,8,10),n.addMany([60,61,62,63],10,0,11),n.addMany(u(32,48),10,9,12),n.addMany(g,12,0,12),n.add(127,12,0,12),n.addMany(u(28,32),12,0,12),n.addMany(u(32,48),12,9,12),n.addMany(u(48,64),12,0,11),n.addMany(u(64,127),12,12,13),n.addMany(u(64,127),10,12,13),n.addMany(u(64,127),9,12,13),n.addMany(g,13,13,13),n.addMany(c,13,13,13),n.add(127,13,0,13),n.addMany([27,156,24,26],13,14,0),n.add(E,0,2,0),n.add(E,8,5,8),n.add(E,6,0,6),n.add(E,11,0,11),n.add(E,13,13,13),n})();class p extends _.Disposable{constructor(h=r.VT500_TRANSITION_TABLE){super(),this._transitions=h,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new v.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(u,c,g)=>{},this._executeHandlerFb=u=>{},this._csiHandlerFb=(u,c)=>{},this._escHandlerFb=u=>{},this._errorHandlerFb=u=>u,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,_.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new o.OscParser),this._dcsParser=this.register(new S.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(h,u=[64,126]){let c=0;if(h.prefix){if(h.prefix.length>1)throw new Error("only one byte as prefix supported");if(c=h.prefix.charCodeAt(0),c&&60>c||c>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(h.intermediates){if(h.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let R=0;R<h.intermediates.length;++R){const y=h.intermediates.charCodeAt(R);if(32>y||y>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");c<<=8,c|=y}}if(h.final.length!==1)throw new Error("final must be a single byte");const g=h.final.charCodeAt(0);if(u[0]>g||g>u[1])throw new Error(`final must be in range ${u[0]} .. ${u[1]}`);return c<<=8,c|=g,c}identToString(h){const u=[];for(;h;)u.push(String.fromCharCode(255&h)),h>>=8;return u.reverse().join("")}setPrintHandler(h){this._printHandler=h}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(h,u){const c=this._identifier(h,[48,126]);this._escHandlers[c]===void 0&&(this._escHandlers[c]=[]);const g=this._escHandlers[c];return g.push(u),{dispose:()=>{const R=g.indexOf(u);R!==-1&&g.splice(R,1)}}}clearEscHandler(h){this._escHandlers[this._identifier(h,[48,126])]&&delete this._escHandlers[this._identifier(h,[48,126])]}setEscHandlerFallback(h){this._escHandlerFb=h}setExecuteHandler(h,u){this._executeHandlers[h.charCodeAt(0)]=u}clearExecuteHandler(h){this._executeHandlers[h.charCodeAt(0)]&&delete this._executeHandlers[h.charCodeAt(0)]}setExecuteHandlerFallback(h){this._executeHandlerFb=h}registerCsiHandler(h,u){const c=this._identifier(h);this._csiHandlers[c]===void 0&&(this._csiHandlers[c]=[]);const g=this._csiHandlers[c];return g.push(u),{dispose:()=>{const R=g.indexOf(u);R!==-1&&g.splice(R,1)}}}clearCsiHandler(h){this._csiHandlers[this._identifier(h)]&&delete this._csiHandlers[this._identifier(h)]}setCsiHandlerFallback(h){this._csiHandlerFb=h}registerDcsHandler(h,u){return this._dcsParser.registerHandler(this._identifier(h),u)}clearDcsHandler(h){this._dcsParser.clearHandler(this._identifier(h))}setDcsHandlerFallback(h){this._dcsParser.setHandlerFallback(h)}registerOscHandler(h,u){return this._oscParser.registerHandler(h,u)}clearOscHandler(h){this._oscParser.clearHandler(h)}setOscHandlerFallback(h){this._oscParser.setHandlerFallback(h)}setErrorHandler(h){this._errorHandler=h}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(h,u,c,g,R){this._parseStack.state=h,this._parseStack.handlers=u,this._parseStack.handlerPos=c,this._parseStack.transition=g,this._parseStack.chunkPos=R}parse(h,u,c){let g,R=0,y=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(c===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const b=this._parseStack.handlers;let A=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(c===!1&&A>-1){for(;A>=0&&(g=b[A](this._params),g!==!0);A--)if(g instanceof Promise)return this._parseStack.handlerPos=A,g}this._parseStack.handlers=[];break;case 4:if(c===!1&&A>-1){for(;A>=0&&(g=b[A](),g!==!0);A--)if(g instanceof Promise)return this._parseStack.handlerPos=A,g}this._parseStack.handlers=[];break;case 6:if(R=h[this._parseStack.chunkPos],g=this._dcsParser.unhook(R!==24&&R!==26,c),g)return g;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(R=h[this._parseStack.chunkPos],g=this._oscParser.end(R!==24&&R!==26,c),g)return g;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,M=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let b=M;b<u;++b){switch(R=h[b],y=this._transitions.table[this.currentState<<8|(R<160?R:E)],y>>4){case 2:for(let k=b+1;;++k){if(k>=u||(R=h[k])<32||R>126&&R<E){this._printHandler(h,b,k),b=k-1;break}if(++k>=u||(R=h[k])<32||R>126&&R<E){this._printHandler(h,b,k),b=k-1;break}if(++k>=u||(R=h[k])<32||R>126&&R<E){this._printHandler(h,b,k),b=k-1;break}if(++k>=u||(R=h[k])<32||R>126&&R<E){this._printHandler(h,b,k),b=k-1;break}}break;case 3:this._executeHandlers[R]?this._executeHandlers[R]():this._executeHandlerFb(R),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:b,code:R,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const A=this._csiHandlers[this._collect<<8|R];let O=A?A.length-1:-1;for(;O>=0&&(g=A[O](this._params),g!==!0);O--)if(g instanceof Promise)return this._preserveStack(3,A,O,y,b),g;O<0&&this._csiHandlerFb(this._collect<<8|R,this._params),this.precedingJoinState=0;break;case 8:do switch(R){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(R-48)}while(++b<u&&(R=h[b])>47&&R<60);b--;break;case 9:this._collect<<=8,this._collect|=R;break;case 10:const z=this._escHandlers[this._collect<<8|R];let H=z?z.length-1:-1;for(;H>=0&&(g=z[H](),g!==!0);H--)if(g instanceof Promise)return this._preserveStack(4,z,H,y,b),g;H<0&&this._escHandlerFb(this._collect<<8|R),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|R,this._params);break;case 13:for(let k=b+1;;++k)if(k>=u||(R=h[k])===24||R===26||R===27||R>127&&R<E){this._dcsParser.put(h,b,k),b=k-1;break}break;case 14:if(g=this._dcsParser.unhook(R!==24&&R!==26),g)return this._preserveStack(6,[],0,y,b),g;R===27&&(y|=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 k=b+1;;k++)if(k>=u||(R=h[k])<32||R>127&&R<E){this._oscParser.put(h,b,k),b=k-1;break}break;case 6:if(g=this._oscParser.end(R!==24&&R!==26),g)return this._preserveStack(5,[],0,y,b),g;R===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&y}}}r.EscapeSequenceParser=p},6242:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;const _=d(5770),v=d(482),o=[];r.OscParser=class{constructor(){this._state=0,this._active=o,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(S,C){this._handlers[S]===void 0&&(this._handlers[S]=[]);const E=this._handlers[S];return E.push(C),{dispose:()=>{const p=E.indexOf(C);p!==-1&&E.splice(p,1)}}}clearHandler(S){this._handlers[S]&&delete this._handlers[S]}setHandlerFallback(S){this._handlerFb=S}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=o}reset(){if(this._state===2)for(let S=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;S>=0;--S)this._active[S].end(!1);this._stack.paused=!1,this._active=o,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||o,this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].start();else this._handlerFb(this._id,"START")}_put(S,C,E){if(this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].put(S,C,E);else this._handlerFb(this._id,"PUT",(0,v.utf32ToString)(S,C,E))}start(){this.reset(),this._state=1}put(S,C,E){if(this._state!==3){if(this._state===1)for(;C<E;){const p=S[C++];if(p===59){this._state=2,this._start();break}if(p<48||57<p)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+p-48}this._state===2&&E-C>0&&this._put(S,C,E)}}end(S,C=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let E=!1,p=this._active.length-1,n=!1;if(this._stack.paused&&(p=this._stack.loopPosition-1,E=C,n=this._stack.fallThrough,this._stack.paused=!1),!n&&E===!1){for(;p>=0&&(E=this._active[p].end(S),E!==!0);p--)if(E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!1,E;p--}for(;p>=0;p--)if(E=this._active[p].end(!1),E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!0,E}else this._handlerFb(this._id,"END",S);this._active=o,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(S){this._handler=S,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(S,C,E){this._hitLimit||(this._data+=(0,v.utf32ToString)(S,C,E),this._data.length>_.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(S){let C=!1;if(this._hitLimit)C=!1;else if(S&&(C=this._handler(this._data),C instanceof Promise))return C.then((E=>(this._data="",this._hitLimit=!1,E)));return this._data="",this._hitLimit=!1,C}}},8742:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;const d=2147483647;class _{static fromArray(o){const S=new _;if(!o.length)return S;for(let C=Array.isArray(o[0])?1:0;C<o.length;++C){const E=o[C];if(Array.isArray(E))for(let p=0;p<E.length;++p)S.addSubParam(E[p]);else S.addParam(E)}return S}constructor(o=32,S=32){if(this.maxLength=o,this.maxSubParamsLength=S,S>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(o),this.length=0,this._subParams=new Int32Array(S),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(o),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const o=new _(this.maxLength,this.maxSubParamsLength);return o.params.set(this.params),o.length=this.length,o._subParams.set(this._subParams),o._subParamsLength=this._subParamsLength,o._subParamsIdx.set(this._subParamsIdx),o._rejectDigits=this._rejectDigits,o._rejectSubDigits=this._rejectSubDigits,o._digitIsSub=this._digitIsSub,o}toArray(){const o=[];for(let S=0;S<this.length;++S){o.push(this.params[S]);const C=this._subParamsIdx[S]>>8,E=255&this._subParamsIdx[S];E-C>0&&o.push(Array.prototype.slice.call(this._subParams,C,E))}return o}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(o){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(o<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=o>d?d:o}}addSubParam(o){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(o<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=o>d?d:o,this._subParamsIdx[this.length-1]++}}hasSubParams(o){return(255&this._subParamsIdx[o])-(this._subParamsIdx[o]>>8)>0}getSubParams(o){const S=this._subParamsIdx[o]>>8,C=255&this._subParamsIdx[o];return C-S>0?this._subParams.subarray(S,C):null}getSubParamsAll(){const o={};for(let S=0;S<this.length;++S){const C=this._subParamsIdx[S]>>8,E=255&this._subParamsIdx[S];E-C>0&&(o[S]=this._subParams.slice(C,E))}return o}addDigit(o){let S;if(this._rejectDigits||!(S=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const C=this._digitIsSub?this._subParams:this.params,E=C[S-1];C[S-1]=~E?Math.min(10*E+o,d):o}}r.Params=_},5741:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let d=this._addons.length-1;d>=0;d--)this._addons[d].instance.dispose()}loadAddon(d,_){const v={instance:_,dispose:_.dispose,isDisposed:!1};this._addons.push(v),_.dispose=()=>this._wrappedAddonDispose(v),_.activate(d)}_wrappedAddonDispose(d){if(d.isDisposed)return;let _=-1;for(let v=0;v<this._addons.length;v++)if(this._addons[v]===d){_=v;break}if(_===-1)throw new Error("Could not dispose an addon that has not been loaded");d.isDisposed=!0,d.dispose.apply(d.instance),this._addons.splice(_,1)}}},8771:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;const _=d(3785),v=d(511);r.BufferApiView=class{constructor(o,S){this._buffer=o,this.type=S}init(o){return this._buffer=o,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(o){const S=this._buffer.lines.get(o);if(S)return new _.BufferLineApiView(S)}getNullCell(){return new v.CellData}}},3785:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;const _=d(511);r.BufferLineApiView=class{constructor(v){this._line=v}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(v,o){if(!(v<0||v>=this._line.length))return o?(this._line.loadCell(v,o),o):this._line.loadCell(v,new _.CellData)}translateToString(v,o,S){return this._line.translateToString(v,o,S)}}},8285:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;const _=d(8771),v=d(8460),o=d(844);class S extends o.Disposable{constructor(E){super(),this._core=E,this._onBufferChange=this.register(new v.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new _.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new _.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)}}r.BufferNamespaceApi=S},7975:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(d){this._core=d}registerCsiHandler(d,_){return this._core.registerCsiHandler(d,(v=>_(v.toArray())))}addCsiHandler(d,_){return this.registerCsiHandler(d,_)}registerDcsHandler(d,_){return this._core.registerDcsHandler(d,((v,o)=>_(v,o.toArray())))}addDcsHandler(d,_){return this.registerDcsHandler(d,_)}registerEscHandler(d,_){return this._core.registerEscHandler(d,_)}addEscHandler(d,_){return this.registerEscHandler(d,_)}registerOscHandler(d,_){return this._core.registerOscHandler(d,_)}addOscHandler(d,_){return this.registerOscHandler(d,_)}}},7090:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.UnicodeApi=class{constructor(d){this._core=d}register(d){this._core.unicodeService.register(d)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(d){this._core.unicodeService.activeVersion=d}}},744:function(W,r,d){var _=this&&this.__decorate||function(n,h,u,c){var g,R=arguments.length,y=R<3?h:c===null?c=Object.getOwnPropertyDescriptor(h,u):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(n,h,u,c);else for(var M=n.length-1;M>=0;M--)(g=n[M])&&(y=(R<3?g(y):R>3?g(h,u,y):g(h,u))||y);return R>3&&y&&Object.defineProperty(h,u,y),y},v=this&&this.__param||function(n,h){return function(u,c){h(u,c,n)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;const o=d(8460),S=d(844),C=d(5295),E=d(2585);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let p=r.BufferService=class extends S.Disposable{get buffer(){return this.buffers.active}constructor(n){super(),this.isUserScrolling=!1,this._onResize=this.register(new o.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new o.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(n.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(n.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=this.register(new C.BufferSet(n,this))}resize(n,h){this.cols=n,this.rows=h,this.buffers.resize(n,h),this._onResize.fire({cols:n,rows:h})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(n,h=!1){const u=this.buffer;let c;c=this._cachedBlankLine,c&&c.length===this.cols&&c.getFg(0)===n.fg&&c.getBg(0)===n.bg||(c=u.getBlankLine(n,h),this._cachedBlankLine=c),c.isWrapped=h;const g=u.ybase+u.scrollTop,R=u.ybase+u.scrollBottom;if(u.scrollTop===0){const y=u.lines.isFull;R===u.lines.length-1?y?u.lines.recycle().copyFrom(c):u.lines.push(c.clone()):u.lines.splice(R+1,0,c.clone()),y?this.isUserScrolling&&(u.ydisp=Math.max(u.ydisp-1,0)):(u.ybase++,this.isUserScrolling||u.ydisp++)}else{const y=R-g+1;u.lines.shiftElements(g+1,y-1,-1),u.lines.set(R,c.clone())}this.isUserScrolling||(u.ydisp=u.ybase),this._onScroll.fire(u.ydisp)}scrollLines(n,h,u){const c=this.buffer;if(n<0){if(c.ydisp===0)return;this.isUserScrolling=!0}else n+c.ydisp>=c.ybase&&(this.isUserScrolling=!1);const g=c.ydisp;c.ydisp=Math.max(Math.min(c.ydisp+n,c.ybase),0),g!==c.ydisp&&(h||this._onScroll.fire(c.ydisp))}};r.BufferService=p=_([v(0,E.IOptionsService)],p)},7994:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CharsetService=void 0,r.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(d){this.glevel=d,this.charset=this._charsets[d]}setgCharset(d,_){this._charsets[d]=_,this.glevel===d&&(this.charset=_)}}},1753:function(W,r,d){var _=this&&this.__decorate||function(c,g,R,y){var M,b=arguments.length,A=b<3?g:y===null?y=Object.getOwnPropertyDescriptor(g,R):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(c,g,R,y);else for(var O=c.length-1;O>=0;O--)(M=c[O])&&(A=(b<3?M(A):b>3?M(g,R,A):M(g,R))||A);return b>3&&A&&Object.defineProperty(g,R,A),A},v=this&&this.__param||function(c,g){return function(R,y){g(R,y,c)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;const o=d(2585),S=d(8460),C=d(844),E={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:c=>c.button!==4&&c.action===1&&(c.ctrl=!1,c.alt=!1,c.shift=!1,!0)},VT200:{events:19,restrict:c=>c.action!==32},DRAG:{events:23,restrict:c=>c.action!==32||c.button!==3},ANY:{events:31,restrict:c=>!0}};function p(c,g){let R=(c.ctrl?16:0)|(c.shift?4:0)|(c.alt?8:0);return c.button===4?(R|=64,R|=c.action):(R|=3&c.button,4&c.button&&(R|=64),8&c.button&&(R|=128),c.action===32?R|=32:c.action!==0||g||(R|=3)),R}const n=String.fromCharCode,h={DEFAULT:c=>{const g=[p(c,!1)+32,c.col+32,c.row+32];return g[0]>255||g[1]>255||g[2]>255?"":`\x1B[M${n(g[0])}${n(g[1])}${n(g[2])}`},SGR:c=>{const g=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${p(c,!0)};${c.col};${c.row}${g}`},SGR_PIXELS:c=>{const g=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${p(c,!0)};${c.x};${c.y}${g}`}};let u=r.CoreMouseService=class extends C.Disposable{constructor(c,g){super(),this._bufferService=c,this._coreService=g,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new S.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const R of Object.keys(E))this.addProtocol(R,E[R]);for(const R of Object.keys(h))this.addEncoding(R,h[R]);this.reset()}addProtocol(c,g){this._protocols[c]=g}addEncoding(c,g){this._encodings[c]=g}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(c){if(!this._protocols[c])throw new Error(`unknown protocol "${c}"`);this._activeProtocol=c,this._onProtocolChange.fire(this._protocols[c].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(c){if(!this._encodings[c])throw new Error(`unknown encoding "${c}"`);this._activeEncoding=c}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(c){if(c.col<0||c.col>=this._bufferService.cols||c.row<0||c.row>=this._bufferService.rows||c.button===4&&c.action===32||c.button===3&&c.action!==32||c.button!==4&&(c.action===2||c.action===3)||(c.col++,c.row++,c.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,c,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(c))return!1;const g=this._encodings[this._activeEncoding](c);return g&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(g):this._coreService.triggerDataEvent(g,!0)),this._lastEvent=c,!0}explainEvents(c){return{down:!!(1&c),up:!!(2&c),drag:!!(4&c),move:!!(8&c),wheel:!!(16&c)}}_equalEvents(c,g,R){if(R){if(c.x!==g.x||c.y!==g.y)return!1}else if(c.col!==g.col||c.row!==g.row)return!1;return c.button===g.button&&c.action===g.action&&c.ctrl===g.ctrl&&c.alt===g.alt&&c.shift===g.shift}};r.CoreMouseService=u=_([v(0,o.IBufferService),v(1,o.ICoreService)],u)},6975:function(W,r,d){var _=this&&this.__decorate||function(u,c,g,R){var y,M=arguments.length,b=M<3?c:R===null?R=Object.getOwnPropertyDescriptor(c,g):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(u,c,g,R);else for(var A=u.length-1;A>=0;A--)(y=u[A])&&(b=(M<3?y(b):M>3?y(c,g,b):y(c,g))||b);return M>3&&b&&Object.defineProperty(c,g,b),b},v=this&&this.__param||function(u,c){return function(g,R){c(g,R,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;const o=d(1439),S=d(8460),C=d(844),E=d(2585),p=Object.freeze({insertMode:!1}),n=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let h=r.CoreService=class extends C.Disposable{constructor(u,c,g){super(),this._bufferService=u,this._logService=c,this._optionsService=g,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new S.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new S.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new S.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new S.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,o.clone)(p),this.decPrivateModes=(0,o.clone)(n)}reset(){this.modes=(0,o.clone)(p),this.decPrivateModes=(0,o.clone)(n)}triggerDataEvent(u,c=!1){if(this._optionsService.rawOptions.disableStdin)return;const g=this._bufferService.buffer;c&&this._optionsService.rawOptions.scrollOnUserInput&&g.ybase!==g.ydisp&&this._onRequestScrollToBottom.fire(),c&&this._onUserInput.fire(),this._logService.debug(`sending data "${u}"`,(()=>u.split("").map((R=>R.charCodeAt(0))))),this._onData.fire(u)}triggerBinaryEvent(u){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${u}"`,(()=>u.split("").map((c=>c.charCodeAt(0))))),this._onBinary.fire(u))}};r.CoreService=h=_([v(0,E.IBufferService),v(1,E.ILogService),v(2,E.IOptionsService)],h)},9074:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;const _=d(8055),v=d(8460),o=d(844),S=d(6106);let C=0,E=0;class p extends o.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new S.SortedList((u=>u?.marker.line)),this._onDecorationRegistered=this.register(new v.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new v.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,o.toDisposable)((()=>this.reset())))}registerDecoration(u){if(u.marker.isDisposed)return;const c=new n(u);if(c){const g=c.marker.onDispose((()=>c.dispose()));c.onDispose((()=>{c&&(this._decorations.delete(c)&&this._onDecorationRemoved.fire(c),g.dispose())})),this._decorations.insert(c),this._onDecorationRegistered.fire(c)}return c}reset(){for(const u of this._decorations.values())u.dispose();this._decorations.clear()}*getDecorationsAtCell(u,c,g){let R=0,y=0;for(const M of this._decorations.getKeyIterator(c))R=M.options.x??0,y=R+(M.options.width??1),u>=R&&u<y&&(!g||(M.options.layer??"bottom")===g)&&(yield M)}forEachDecorationAtCell(u,c,g,R){this._decorations.forEachByKey(c,(y=>{C=y.options.x??0,E=C+(y.options.width??1),u>=C&&u<E&&(!g||(y.options.layer??"bottom")===g)&&R(y)}))}}r.DecorationService=p;class n extends o.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=_.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=_.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(u){super(),this.options=u,this.onRenderEmitter=this.register(new v.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new v.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=u.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;const _=d(2585),v=d(8343);class o{constructor(...C){this._entries=new Map;for(const[E,p]of C)this.set(E,p)}set(C,E){const p=this._entries.get(C);return this._entries.set(C,E),p}forEach(C){for(const[E,p]of this._entries.entries())C(E,p)}has(C){return this._entries.has(C)}get(C){return this._entries.get(C)}}r.ServiceCollection=o,r.InstantiationService=class{constructor(){this._services=new o,this._services.set(_.IInstantiationService,this)}setService(S,C){this._services.set(S,C)}getService(S){return this._services.get(S)}createInstance(S,...C){const E=(0,v.getServiceDependencies)(S).sort(((h,u)=>h.index-u.index)),p=[];for(const h of E){const u=this._services.get(h.id);if(!u)throw new Error(`[createInstance] ${S.name} depends on UNKNOWN service ${h.id}.`);p.push(u)}const n=E.length>0?E[0].index:C.length;if(C.length!==n)throw new Error(`[createInstance] First service dependency of ${S.name} at position ${n+1} conflicts with ${C.length} static arguments`);return new S(...C,...p)}}},7866:function(W,r,d){var _=this&&this.__decorate||function(n,h,u,c){var g,R=arguments.length,y=R<3?h:c===null?c=Object.getOwnPropertyDescriptor(h,u):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(n,h,u,c);else for(var M=n.length-1;M>=0;M--)(g=n[M])&&(y=(R<3?g(y):R>3?g(h,u,y):g(h,u))||y);return R>3&&y&&Object.defineProperty(h,u,y),y},v=this&&this.__param||function(n,h){return function(u,c){h(u,c,n)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const o=d(844),S=d(2585),C={trace:S.LogLevelEnum.TRACE,debug:S.LogLevelEnum.DEBUG,info:S.LogLevelEnum.INFO,warn:S.LogLevelEnum.WARN,error:S.LogLevelEnum.ERROR,off:S.LogLevelEnum.OFF};let E,p=r.LogService=class extends o.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=S.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),E=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let h=0;h<n.length;h++)typeof n[h]=="function"&&(n[h]=n[h]())}_log(n,h,u){this._evalLazyOptionalParams(u),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+h,...u)}trace(n,...h){this._logLevel<=S.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,n,h)}debug(n,...h){this._logLevel<=S.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,n,h)}info(n,...h){this._logLevel<=S.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,n,h)}warn(n,...h){this._logLevel<=S.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,n,h)}error(n,...h){this._logLevel<=S.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,n,h)}};r.LogService=p=_([v(0,S.IOptionsService)],p),r.setTraceLogger=function(n){E=n},r.traceCall=function(n,h,u){if(typeof u.value!="function")throw new Error("not supported");const c=u.value;u.value=function(...g){if(E.logLevel!==S.LogLevelEnum.TRACE)return c.apply(this,g);E.trace(`GlyphRenderer#${c.name}(${g.map((y=>JSON.stringify(y))).join(", ")})`);const R=c.apply(this,g);return E.trace(`GlyphRenderer#${c.name} return`,R),R}}},7302:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;const _=d(8460),v=d(844),o=d(6114);r.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:o.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const S=["normal","bold","100","200","300","400","500","600","700","800","900"];class C extends v.Disposable{constructor(p){super(),this._onOptionChange=this.register(new _.EventEmitter),this.onOptionChange=this._onOptionChange.event;const n={...r.DEFAULT_OPTIONS};for(const h in p)if(h in n)try{const u=p[h];n[h]=this._sanitizeAndValidateOption(h,u)}catch(u){console.error(u)}this.rawOptions=n,this.options={...n},this._setupOptions(),this.register((0,v.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(p,n){return this.onOptionChange((h=>{h===p&&n(this.rawOptions[p])}))}onMultipleOptionChange(p,n){return this.onOptionChange((h=>{p.indexOf(h)!==-1&&n()}))}_setupOptions(){const p=h=>{if(!(h in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);return this.rawOptions[h]},n=(h,u)=>{if(!(h in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);u=this._sanitizeAndValidateOption(h,u),this.rawOptions[h]!==u&&(this.rawOptions[h]=u,this._onOptionChange.fire(h))};for(const h in this.rawOptions){const u={get:p.bind(this,h),set:n.bind(this,h)};Object.defineProperty(this.options,h,u)}}_sanitizeAndValidateOption(p,n){switch(p){case"cursorStyle":if(n||(n=r.DEFAULT_OPTIONS[p]),!(function(h){return h==="block"||h==="underline"||h==="bar"})(n))throw new Error(`"${n}" is not a valid value for ${p}`);break;case"wordSeparator":n||(n=r.DEFAULT_OPTIONS[p]);break;case"fontWeight":case"fontWeightBold":if(typeof n=="number"&&1<=n&&n<=1e3)break;n=S.includes(n)?n:r.DEFAULT_OPTIONS[p];break;case"cursorWidth":n=Math.floor(n);case"lineHeight":case"tabStopWidth":if(n<1)throw new Error(`${p} cannot be less than 1, value: ${n}`);break;case"minimumContrastRatio":n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case"scrollback":if((n=Math.min(n,4294967295))<0)throw new Error(`${p} cannot be less than 0, value: ${n}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(n<=0)throw new Error(`${p} cannot be less than or equal to 0, value: ${n}`);break;case"rows":case"cols":if(!n&&n!==0)throw new Error(`${p} must be numeric, value: ${n}`);break;case"windowsPty":n=n??{}}return n}}r.OptionsService=C},2660:function(W,r,d){var _=this&&this.__decorate||function(C,E,p,n){var h,u=arguments.length,c=u<3?E:n===null?n=Object.getOwnPropertyDescriptor(E,p):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(C,E,p,n);else for(var g=C.length-1;g>=0;g--)(h=C[g])&&(c=(u<3?h(c):u>3?h(E,p,c):h(E,p))||c);return u>3&&c&&Object.defineProperty(E,p,c),c},v=this&&this.__param||function(C,E){return function(p,n){E(p,n,C)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;const o=d(2585);let S=r.OscLinkService=class{constructor(C){this._bufferService=C,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(C){const E=this._bufferService.buffer;if(C.id===void 0){const g=E.addMarker(E.ybase+E.y),R={data:C,id:this._nextId++,lines:[g]};return g.onDispose((()=>this._removeMarkerFromLink(R,g))),this._dataByLinkId.set(R.id,R),R.id}const p=C,n=this._getEntryIdKey(p),h=this._entriesWithId.get(n);if(h)return this.addLineToLink(h.id,E.ybase+E.y),h.id;const u=E.addMarker(E.ybase+E.y),c={id:this._nextId++,key:this._getEntryIdKey(p),data:p,lines:[u]};return u.onDispose((()=>this._removeMarkerFromLink(c,u))),this._entriesWithId.set(c.key,c),this._dataByLinkId.set(c.id,c),c.id}addLineToLink(C,E){const p=this._dataByLinkId.get(C);if(p&&p.lines.every((n=>n.line!==E))){const n=this._bufferService.buffer.addMarker(E);p.lines.push(n),n.onDispose((()=>this._removeMarkerFromLink(p,n)))}}getLinkData(C){return this._dataByLinkId.get(C)?.data}_getEntryIdKey(C){return`${C.id};;${C.uri}`}_removeMarkerFromLink(C,E){const p=C.lines.indexOf(E);p!==-1&&(C.lines.splice(p,1),C.lines.length===0&&(C.data.id!==void 0&&this._entriesWithId.delete(C.key),this._dataByLinkId.delete(C.id)))}};r.OscLinkService=S=_([v(0,o.IBufferService)],S)},8343:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const d="di$target",_="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(v){return v[_]||[]},r.createDecorator=function(v){if(r.serviceRegistry.has(v))return r.serviceRegistry.get(v);const o=function(S,C,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(p,n,h){n[d]===n?n[_].push({id:p,index:h}):(n[_]=[{id:p,index:h}],n[d]=n)})(o,S,E)};return o.toString=()=>v,r.serviceRegistry.set(v,o),o}},2585:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const _=d(8343);var v;r.IBufferService=(0,_.createDecorator)("BufferService"),r.ICoreMouseService=(0,_.createDecorator)("CoreMouseService"),r.ICoreService=(0,_.createDecorator)("CoreService"),r.ICharsetService=(0,_.createDecorator)("CharsetService"),r.IInstantiationService=(0,_.createDecorator)("InstantiationService"),(function(o){o[o.TRACE=0]="TRACE",o[o.DEBUG=1]="DEBUG",o[o.INFO=2]="INFO",o[o.WARN=3]="WARN",o[o.ERROR=4]="ERROR",o[o.OFF=5]="OFF"})(v||(r.LogLevelEnum=v={})),r.ILogService=(0,_.createDecorator)("LogService"),r.IOptionsService=(0,_.createDecorator)("OptionsService"),r.IOscLinkService=(0,_.createDecorator)("OscLinkService"),r.IUnicodeService=(0,_.createDecorator)("UnicodeService"),r.IDecorationService=(0,_.createDecorator)("DecorationService")},1480:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;const _=d(8460),v=d(225);class o{static extractShouldJoin(C){return(1&C)!=0}static extractWidth(C){return C>>1&3}static extractCharKind(C){return C>>3}static createPropertyValue(C,E,p=!1){return(16777215&C)<<3|(3&E)<<1|(p?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new _.EventEmitter,this.onChange=this._onChange.event;const C=new v.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 E=0,p=0;const n=C.length;for(let h=0;h<n;++h){let u=C.charCodeAt(h);if(55296<=u&&u<=56319){if(++h>=n)return E+this.wcwidth(u);const R=C.charCodeAt(h);56320<=R&&R<=57343?u=1024*(u-55296)+R-56320+65536:E+=this.wcwidth(R)}const c=this.charProperties(u,p);let g=o.extractWidth(c);o.extractShouldJoin(c)&&(g-=o.extractWidth(p)),E+=g,p=c}return E}charProperties(C,E){return this._activeProvider.charProperties(C,E)}}r.UnicodeService=o}},T={};function N(W){var r=T[W];if(r!==void 0)return r.exports;var d=T[W]={exports:{}};return L[W].call(d.exports,d,d.exports,N),d.exports}var q={};return(()=>{var W=q;Object.defineProperty(W,"__esModule",{value:!0}),W.Terminal=void 0;const r=N(9042),d=N(3236),_=N(844),v=N(5741),o=N(8285),S=N(7975),C=N(7090),E=["cols","rows"];class p extends _.Disposable{constructor(h){super(),this._core=this.register(new d.Terminal(h)),this._addonManager=this.register(new v.AddonManager),this._publicOptions={...this._core.options};const u=g=>this._core.options[g],c=(g,R)=>{this._checkReadonlyOptions(g),this._core.options[g]=R};for(const g in this._core.options){const R={get:u.bind(this,g),set:c.bind(this,g)};Object.defineProperty(this._publicOptions,g,R)}}_checkReadonlyOptions(h){if(E.includes(h))throw new Error(`Option "${h}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new S.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new C.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new o.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const h=this._core.coreService.decPrivateModes;let u="none";switch(this._core.coreMouseService.activeProtocol){case"X10":u="x10";break;case"VT200":u="vt200";break;case"DRAG":u="drag";break;case"ANY":u="any"}return{applicationCursorKeysMode:h.applicationCursorKeys,applicationKeypadMode:h.applicationKeypad,bracketedPasteMode:h.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:u,originMode:h.origin,reverseWraparoundMode:h.reverseWraparound,sendFocusMode:h.sendFocus,wraparoundMode:h.wraparound}}get options(){return this._publicOptions}set options(h){for(const u in h)this._publicOptions[u]=h[u]}blur(){this._core.blur()}focus(){this._core.focus()}input(h,u=!0){this._core.input(h,u)}resize(h,u){this._verifyIntegers(h,u),this._core.resize(h,u)}open(h){this._core.open(h)}attachCustomKeyEventHandler(h){this._core.attachCustomKeyEventHandler(h)}attachCustomWheelEventHandler(h){this._core.attachCustomWheelEventHandler(h)}registerLinkProvider(h){return this._core.registerLinkProvider(h)}registerCharacterJoiner(h){return this._checkProposedApi(),this._core.registerCharacterJoiner(h)}deregisterCharacterJoiner(h){this._checkProposedApi(),this._core.deregisterCharacterJoiner(h)}registerMarker(h=0){return this._verifyIntegers(h),this._core.registerMarker(h)}registerDecoration(h){return this._checkProposedApi(),this._verifyPositiveIntegers(h.x??0,h.width??0,h.height??0),this._core.registerDecoration(h)}hasSelection(){return this._core.hasSelection()}select(h,u,c){this._verifyIntegers(h,u,c),this._core.select(h,u,c)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(h,u){this._verifyIntegers(h,u),this._core.selectLines(h,u)}dispose(){super.dispose()}scrollLines(h){this._verifyIntegers(h),this._core.scrollLines(h)}scrollPages(h){this._verifyIntegers(h),this._core.scrollPages(h)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(h){this._verifyIntegers(h),this._core.scrollToLine(h)}clear(){this._core.clear()}write(h,u){this._core.write(h,u)}writeln(h,u){this._core.write(h),this._core.write(`\r
|
|
17
|
+
`,u)}paste(h){this._core.paste(h)}refresh(h,u){this._verifyIntegers(h,u),this._core.refresh(h,u)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(h){this._addonManager.loadAddon(this,h)}static get strings(){return r}_verifyIntegers(...h){for(const u of h)if(u===1/0||isNaN(u)||u%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...h){for(const u of h)if(u&&(u===1/0||isNaN(u)||u%1!=0||u<0))throw new Error("This API only accepts positive integers")}}W.Terminal=p})(),q})()))})(uu)),uu.exports}var Rv=Av(),du={exports:{}},P_;function Lv(){return P_||(P_=1,(function(l,x){(function(L,T){l.exports=T()})(self,(()=>(()=>{var L={};return(()=>{var T=L;Object.defineProperty(T,"__esModule",{value:!0}),T.FitAddon=void 0,T.FitAddon=class{activate(N){this._terminal=N}dispose(){}fit(){const N=this.proposeDimensions();if(!N||!this._terminal||isNaN(N.cols)||isNaN(N.rows))return;const q=this._terminal._core;this._terminal.rows===N.rows&&this._terminal.cols===N.cols||(q._renderService.clear(),this._terminal.resize(N.cols,N.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const N=this._terminal._core,q=N._renderService.dimensions;if(q.css.cell.width===0||q.css.cell.height===0)return;const W=this._terminal.options.scrollback===0?0:N.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),d=parseInt(r.getPropertyValue("height")),_=Math.max(0,parseInt(r.getPropertyValue("width"))),v=window.getComputedStyle(this._terminal.element),o=d-(parseInt(v.getPropertyValue("padding-top"))+parseInt(v.getPropertyValue("padding-bottom"))),S=_-(parseInt(v.getPropertyValue("padding-right"))+parseInt(v.getPropertyValue("padding-left")))-W;return{cols:Math.max(2,Math.floor(S/q.css.cell.width)),rows:Math.max(1,Math.floor(o/q.css.cell.height))}}}})(),L})()))})(du)),du.exports}var Mv=Lv(),fu={exports:{}},$_;function Tv(){return $_||($_=1,(function(l,x){(function(L,T){l.exports=T()})(self,(()=>(()=>{var L={965:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.GlyphRenderer=void 0;const _=d(374),v=d(509),o=d(855),S=d(859),C=d(381),E=11,p=E*Float32Array.BYTES_PER_ELEMENT;let n,h=0,u=0,c=0;class g extends S.Disposable{constructor(y,M,b,A){super(),this._terminal=y,this._gl=M,this._dimensions=b,this._optionsService=A,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const O=this._gl;v.TextureAtlas.maxAtlasPages===void 0&&(v.TextureAtlas.maxAtlasPages=Math.min(32,(0,_.throwIfFalsy)(O.getParameter(O.MAX_TEXTURE_IMAGE_UNITS))),v.TextureAtlas.maxTextureSize=(0,_.throwIfFalsy)(O.getParameter(O.MAX_TEXTURE_SIZE))),this._program=(0,_.throwIfFalsy)((0,C.createProgram)(O,`#version 300 es
|
|
18
|
+
layout (location = 0) in vec2 a_unitquad;
|
|
19
|
+
layout (location = 1) in vec2 a_cellpos;
|
|
20
|
+
layout (location = 2) in vec2 a_offset;
|
|
21
|
+
layout (location = 3) in vec2 a_size;
|
|
22
|
+
layout (location = 4) in float a_texpage;
|
|
23
|
+
layout (location = 5) in vec2 a_texcoord;
|
|
24
|
+
layout (location = 6) in vec2 a_texsize;
|
|
25
|
+
|
|
26
|
+
uniform mat4 u_projection;
|
|
27
|
+
uniform vec2 u_resolution;
|
|
28
|
+
|
|
29
|
+
out vec2 v_texcoord;
|
|
30
|
+
flat out int v_texpage;
|
|
31
|
+
|
|
32
|
+
void main() {
|
|
33
|
+
vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
|
|
34
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
35
|
+
v_texpage = int(a_texpage);
|
|
36
|
+
v_texcoord = a_texcoord + a_unitquad * a_texsize;
|
|
37
|
+
}`,(function(G){let Y="";for(let X=1;X<G;X++)Y+=` else if (v_texpage == ${X}) { outColor = texture(u_texture[${X}], v_texcoord); }`;return`#version 300 es
|
|
38
|
+
precision lowp float;
|
|
39
|
+
|
|
40
|
+
in vec2 v_texcoord;
|
|
41
|
+
flat in int v_texpage;
|
|
42
|
+
|
|
43
|
+
uniform sampler2D u_texture[${G}];
|
|
44
|
+
|
|
45
|
+
out vec4 outColor;
|
|
46
|
+
|
|
47
|
+
void main() {
|
|
48
|
+
if (v_texpage == 0) {
|
|
49
|
+
outColor = texture(u_texture[0], v_texcoord);
|
|
50
|
+
} ${Y}
|
|
51
|
+
}`})(v.TextureAtlas.maxAtlasPages))),this.register((0,S.toDisposable)((()=>O.deleteProgram(this._program)))),this._projectionLocation=(0,_.throwIfFalsy)(O.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,_.throwIfFalsy)(O.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,_.throwIfFalsy)(O.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=O.createVertexArray(),O.bindVertexArray(this._vertexArrayObject);const z=new Float32Array([0,0,1,0,0,1,1,1]),H=O.createBuffer();this.register((0,S.toDisposable)((()=>O.deleteBuffer(H)))),O.bindBuffer(O.ARRAY_BUFFER,H),O.bufferData(O.ARRAY_BUFFER,z,O.STATIC_DRAW),O.enableVertexAttribArray(0),O.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const k=new Uint8Array([0,1,2,3]),K=O.createBuffer();this.register((0,S.toDisposable)((()=>O.deleteBuffer(K)))),O.bindBuffer(O.ELEMENT_ARRAY_BUFFER,K),O.bufferData(O.ELEMENT_ARRAY_BUFFER,k,O.STATIC_DRAW),this._attributesBuffer=(0,_.throwIfFalsy)(O.createBuffer()),this.register((0,S.toDisposable)((()=>O.deleteBuffer(this._attributesBuffer)))),O.bindBuffer(O.ARRAY_BUFFER,this._attributesBuffer),O.enableVertexAttribArray(2),O.vertexAttribPointer(2,2,O.FLOAT,!1,p,0),O.vertexAttribDivisor(2,1),O.enableVertexAttribArray(3),O.vertexAttribPointer(3,2,O.FLOAT,!1,p,2*Float32Array.BYTES_PER_ELEMENT),O.vertexAttribDivisor(3,1),O.enableVertexAttribArray(4),O.vertexAttribPointer(4,1,O.FLOAT,!1,p,4*Float32Array.BYTES_PER_ELEMENT),O.vertexAttribDivisor(4,1),O.enableVertexAttribArray(5),O.vertexAttribPointer(5,2,O.FLOAT,!1,p,5*Float32Array.BYTES_PER_ELEMENT),O.vertexAttribDivisor(5,1),O.enableVertexAttribArray(6),O.vertexAttribPointer(6,2,O.FLOAT,!1,p,7*Float32Array.BYTES_PER_ELEMENT),O.vertexAttribDivisor(6,1),O.enableVertexAttribArray(1),O.vertexAttribPointer(1,2,O.FLOAT,!1,p,9*Float32Array.BYTES_PER_ELEMENT),O.vertexAttribDivisor(1,1),O.useProgram(this._program);const re=new Int32Array(v.TextureAtlas.maxAtlasPages);for(let G=0;G<v.TextureAtlas.maxAtlasPages;G++)re[G]=G;O.uniform1iv(this._textureLocation,re),O.uniformMatrix4fv(this._projectionLocation,!1,C.PROJECTION_MATRIX),this._atlasTextures=[];for(let G=0;G<v.TextureAtlas.maxAtlasPages;G++){const Y=new C.GLTexture((0,_.throwIfFalsy)(O.createTexture()));this.register((0,S.toDisposable)((()=>O.deleteTexture(Y.texture)))),O.activeTexture(O.TEXTURE0+G),O.bindTexture(O.TEXTURE_2D,Y.texture),O.texParameteri(O.TEXTURE_2D,O.TEXTURE_WRAP_S,O.CLAMP_TO_EDGE),O.texParameteri(O.TEXTURE_2D,O.TEXTURE_WRAP_T,O.CLAMP_TO_EDGE),O.texImage2D(O.TEXTURE_2D,0,O.RGBA,1,1,0,O.RGBA,O.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[G]=Y}O.enable(O.BLEND),O.blendFunc(O.SRC_ALPHA,O.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(y,M,b,A,O,z,H,k,K){this._updateCell(this._vertices.attributes,y,M,b,A,O,z,H,k,K)}_updateCell(y,M,b,A,O,z,H,k,K,re){h=(b*this._terminal.cols+M)*E,A!==o.NULL_CELL_CODE&&A!==void 0?this._atlas&&(n=k&&k.length>1?this._atlas.getRasterizedGlyphCombinedChar(k,O,z,H,!1):this._atlas.getRasterizedGlyph(A,O,z,H,!1),u=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),O!==re&&n.offset.x>u?(c=n.offset.x-u,y[h]=-(n.offset.x-c)+this._dimensions.device.char.left,y[h+1]=-n.offset.y+this._dimensions.device.char.top,y[h+2]=(n.size.x-c)/this._dimensions.device.canvas.width,y[h+3]=n.size.y/this._dimensions.device.canvas.height,y[h+4]=n.texturePage,y[h+5]=n.texturePositionClipSpace.x+c/this._atlas.pages[n.texturePage].canvas.width,y[h+6]=n.texturePositionClipSpace.y,y[h+7]=n.sizeClipSpace.x-c/this._atlas.pages[n.texturePage].canvas.width,y[h+8]=n.sizeClipSpace.y):(y[h]=-n.offset.x+this._dimensions.device.char.left,y[h+1]=-n.offset.y+this._dimensions.device.char.top,y[h+2]=n.size.x/this._dimensions.device.canvas.width,y[h+3]=n.size.y/this._dimensions.device.canvas.height,y[h+4]=n.texturePage,y[h+5]=n.texturePositionClipSpace.x,y[h+6]=n.texturePositionClipSpace.y,y[h+7]=n.sizeClipSpace.x,y[h+8]=n.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,_.allowRescaling)(A,K,n.size.x,this._dimensions.device.cell.width)&&(y[h+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):y.fill(0,h,h+E-1-2)}clear(){const y=this._terminal,M=y.cols*y.rows*E;this._vertices.count!==M?this._vertices.attributes=new Float32Array(M):this._vertices.attributes.fill(0);let b=0;for(;b<this._vertices.attributesBuffers.length;b++)this._vertices.count!==M?this._vertices.attributesBuffers[b]=new Float32Array(M):this._vertices.attributesBuffers[b].fill(0);this._vertices.count=M,b=0;for(let A=0;A<y.rows;A++)for(let O=0;O<y.cols;O++)this._vertices.attributes[b+9]=O/y.cols,this._vertices.attributes[b+10]=A/y.rows,b+=E}handleResize(){const y=this._gl;y.useProgram(this._program),y.viewport(0,0,y.canvas.width,y.canvas.height),y.uniform2f(this._resolutionLocation,y.canvas.width,y.canvas.height),this.clear()}render(y){if(!this._atlas)return;const M=this._gl;M.useProgram(this._program),M.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const b=this._vertices.attributesBuffers[this._activeBuffer];let A=0;for(let O=0;O<y.lineLengths.length;O++){const z=O*this._terminal.cols*E,H=this._vertices.attributes.subarray(z,z+y.lineLengths[O]*E);b.set(H,A),A+=H.length}M.bindBuffer(M.ARRAY_BUFFER,this._attributesBuffer),M.bufferData(M.ARRAY_BUFFER,b.subarray(0,A),M.STREAM_DRAW);for(let O=0;O<this._atlas.pages.length;O++)this._atlas.pages[O].version!==this._atlasTextures[O].version&&this._bindAtlasPageTexture(M,this._atlas,O);M.drawElementsInstanced(M.TRIANGLE_STRIP,4,M.UNSIGNED_BYTE,0,A/E)}setAtlas(y){this._atlas=y;for(const M of this._atlasTextures)M.version=-1}_bindAtlasPageTexture(y,M,b){y.activeTexture(y.TEXTURE0+b),y.bindTexture(y.TEXTURE_2D,this._atlasTextures[b].texture),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_WRAP_S,y.CLAMP_TO_EDGE),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_WRAP_T,y.CLAMP_TO_EDGE),y.texImage2D(y.TEXTURE_2D,0,y.RGBA,y.RGBA,y.UNSIGNED_BYTE,M.pages[b].canvas),y.generateMipmap(y.TEXTURE_2D),this._atlasTextures[b].version=M.pages[b].version}setDimensions(y){this._dimensions=y}}r.GlyphRenderer=g},742:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RectangleRenderer=void 0;const _=d(374),v=d(859),o=d(310),S=d(381),C=8*Float32Array.BYTES_PER_ELEMENT;class E{constructor(){this.attributes=new Float32Array(160),this.count=0}}let p=0,n=0,h=0,u=0,c=0,g=0,R=0;class y extends v.Disposable{constructor(b,A,O,z){super(),this._terminal=b,this._gl=A,this._dimensions=O,this._themeService=z,this._vertices=new E,this._verticesCursor=new E;const H=this._gl;this._program=(0,_.throwIfFalsy)((0,S.createProgram)(H,`#version 300 es
|
|
52
|
+
layout (location = 0) in vec2 a_position;
|
|
53
|
+
layout (location = 1) in vec2 a_size;
|
|
54
|
+
layout (location = 2) in vec4 a_color;
|
|
55
|
+
layout (location = 3) in vec2 a_unitquad;
|
|
56
|
+
|
|
57
|
+
uniform mat4 u_projection;
|
|
58
|
+
|
|
59
|
+
out vec4 v_color;
|
|
60
|
+
|
|
61
|
+
void main() {
|
|
62
|
+
vec2 zeroToOne = a_position + (a_unitquad * a_size);
|
|
63
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
64
|
+
v_color = a_color;
|
|
65
|
+
}`,`#version 300 es
|
|
66
|
+
precision lowp float;
|
|
67
|
+
|
|
68
|
+
in vec4 v_color;
|
|
69
|
+
|
|
70
|
+
out vec4 outColor;
|
|
71
|
+
|
|
72
|
+
void main() {
|
|
73
|
+
outColor = v_color;
|
|
74
|
+
}`)),this.register((0,v.toDisposable)((()=>H.deleteProgram(this._program)))),this._projectionLocation=(0,_.throwIfFalsy)(H.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=H.createVertexArray(),H.bindVertexArray(this._vertexArrayObject);const k=new Float32Array([0,0,1,0,0,1,1,1]),K=H.createBuffer();this.register((0,v.toDisposable)((()=>H.deleteBuffer(K)))),H.bindBuffer(H.ARRAY_BUFFER,K),H.bufferData(H.ARRAY_BUFFER,k,H.STATIC_DRAW),H.enableVertexAttribArray(3),H.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const re=new Uint8Array([0,1,2,3]),G=H.createBuffer();this.register((0,v.toDisposable)((()=>H.deleteBuffer(G)))),H.bindBuffer(H.ELEMENT_ARRAY_BUFFER,G),H.bufferData(H.ELEMENT_ARRAY_BUFFER,re,H.STATIC_DRAW),this._attributesBuffer=(0,_.throwIfFalsy)(H.createBuffer()),this.register((0,v.toDisposable)((()=>H.deleteBuffer(this._attributesBuffer)))),H.bindBuffer(H.ARRAY_BUFFER,this._attributesBuffer),H.enableVertexAttribArray(0),H.vertexAttribPointer(0,2,H.FLOAT,!1,C,0),H.vertexAttribDivisor(0,1),H.enableVertexAttribArray(1),H.vertexAttribPointer(1,2,H.FLOAT,!1,C,2*Float32Array.BYTES_PER_ELEMENT),H.vertexAttribDivisor(1,1),H.enableVertexAttribArray(2),H.vertexAttribPointer(2,4,H.FLOAT,!1,C,4*Float32Array.BYTES_PER_ELEMENT),H.vertexAttribDivisor(2,1),this._updateCachedColors(z.colors),this.register(this._themeService.onChangeColors((Y=>{this._updateCachedColors(Y),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(b){const A=this._gl;A.useProgram(this._program),A.bindVertexArray(this._vertexArrayObject),A.uniformMatrix4fv(this._projectionLocation,!1,S.PROJECTION_MATRIX),A.bindBuffer(A.ARRAY_BUFFER,this._attributesBuffer),A.bufferData(A.ARRAY_BUFFER,b.attributes,A.DYNAMIC_DRAW),A.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,A.UNSIGNED_BYTE,0,b.count)}handleResize(){this._updateViewportRectangle()}setDimensions(b){this._dimensions=b}_updateCachedColors(b){this._bgFloat=this._colorToFloat32Array(b.background),this._cursorFloat=this._colorToFloat32Array(b.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(b){const A=this._terminal,O=this._vertices;let z,H,k,K,re,G,Y,X,j,$,B,P=1;for(z=0;z<A.rows;z++){for(k=-1,K=0,re=0,G=!1,H=0;H<A.cols;H++)Y=(z*A.cols+H)*o.RENDER_MODEL_INDICIES_PER_CELL,X=b.cells[Y+o.RENDER_MODEL_BG_OFFSET],j=b.cells[Y+o.RENDER_MODEL_FG_OFFSET],$=!!(67108864&j),(X!==K||j!==re&&(G||$))&&((K!==0||G&&re!==0)&&(B=8*P++,this._updateRectangle(O,B,re,K,k,H,z)),k=H,K=X,re=j,G=$);(K!==0||G&&re!==0)&&(B=8*P++,this._updateRectangle(O,B,re,K,k,A.cols,z))}O.count=P}updateCursor(b){const A=this._verticesCursor,O=b.cursor;if(!O||O.style==="block")return void(A.count=0);let z,H=0;O.style!=="bar"&&O.style!=="outline"||(z=8*H++,this._addRectangleFloat(A.attributes,z,O.x*this._dimensions.device.cell.width,O.y*this._dimensions.device.cell.height,O.style==="bar"?O.dpr*O.cursorWidth:O.dpr,this._dimensions.device.cell.height,this._cursorFloat)),O.style!=="underline"&&O.style!=="outline"||(z=8*H++,this._addRectangleFloat(A.attributes,z,O.x*this._dimensions.device.cell.width,(O.y+1)*this._dimensions.device.cell.height-O.dpr,O.width*this._dimensions.device.cell.width,O.dpr,this._cursorFloat)),O.style==="outline"&&(z=8*H++,this._addRectangleFloat(A.attributes,z,O.x*this._dimensions.device.cell.width,O.y*this._dimensions.device.cell.height,O.width*this._dimensions.device.cell.width,O.dpr,this._cursorFloat),z=8*H++,this._addRectangleFloat(A.attributes,z,(O.x+O.width)*this._dimensions.device.cell.width-O.dpr,O.y*this._dimensions.device.cell.height,O.dpr,this._dimensions.device.cell.height,this._cursorFloat)),A.count=H}_updateRectangle(b,A,O,z,H,k,K){if(67108864&O)switch(50331648&O){case 16777216:case 33554432:p=this._themeService.colors.ansi[255&O].rgba;break;case 50331648:p=(16777215&O)<<8;break;default:p=this._themeService.colors.foreground.rgba}else switch(50331648&z){case 16777216:case 33554432:p=this._themeService.colors.ansi[255&z].rgba;break;case 50331648:p=(16777215&z)<<8;break;default:p=this._themeService.colors.background.rgba}b.attributes.length<A+4&&(b.attributes=(0,S.expandFloat32Array)(b.attributes,this._terminal.rows*this._terminal.cols*8)),n=H*this._dimensions.device.cell.width,h=K*this._dimensions.device.cell.height,u=(p>>24&255)/255,c=(p>>16&255)/255,g=(p>>8&255)/255,R=1,this._addRectangle(b.attributes,A,n,h,(k-H)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,u,c,g,R)}_addRectangle(b,A,O,z,H,k,K,re,G,Y){b[A]=O/this._dimensions.device.canvas.width,b[A+1]=z/this._dimensions.device.canvas.height,b[A+2]=H/this._dimensions.device.canvas.width,b[A+3]=k/this._dimensions.device.canvas.height,b[A+4]=K,b[A+5]=re,b[A+6]=G,b[A+7]=Y}_addRectangleFloat(b,A,O,z,H,k,K){b[A]=O/this._dimensions.device.canvas.width,b[A+1]=z/this._dimensions.device.canvas.height,b[A+2]=H/this._dimensions.device.canvas.width,b[A+3]=k/this._dimensions.device.canvas.height,b[A+4]=K[0],b[A+5]=K[1],b[A+6]=K[2],b[A+7]=K[3]}_colorToFloat32Array(b){return new Float32Array([(b.rgba>>24&255)/255,(b.rgba>>16&255)/255,(b.rgba>>8&255)/255,(255&b.rgba)/255])}}r.RectangleRenderer=y},310:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderModel=r.COMBINED_CHAR_BIT_MASK=r.RENDER_MODEL_EXT_OFFSET=r.RENDER_MODEL_FG_OFFSET=r.RENDER_MODEL_BG_OFFSET=r.RENDER_MODEL_INDICIES_PER_CELL=void 0;const _=d(296);r.RENDER_MODEL_INDICIES_PER_CELL=4,r.RENDER_MODEL_BG_OFFSET=1,r.RENDER_MODEL_FG_OFFSET=2,r.RENDER_MODEL_EXT_OFFSET=3,r.COMBINED_CHAR_BIT_MASK=2147483648,r.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,_.createSelectionRenderModel)()}resize(v,o){const S=v*o*r.RENDER_MODEL_INDICIES_PER_CELL;S!==this.cells.length&&(this.cells=new Uint32Array(S),this.lineLengths=new Uint32Array(o))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.JoinedCellData=r.WebglRenderer=void 0;const _=d(820),v=d(274),o=d(627),S=d(457),C=d(56),E=d(374),p=d(345),n=d(859),h=d(147),u=d(782),c=d(855),g=d(965),R=d(742),y=d(310),M=d(733);class b extends n.Disposable{constructor(H,k,K,re,G,Y,X,j,$){super(),this._terminal=H,this._characterJoinerService=k,this._charSizeService=K,this._coreBrowserService=re,this._coreService=G,this._decorationService=Y,this._optionsService=X,this._themeService=j,this._cursorBlinkStateManager=new n.MutableDisposable,this._charAtlasDisposable=this.register(new n.MutableDisposable),this._observerDisposable=this.register(new n.MutableDisposable),this._model=new y.RenderModel,this._workCell=new u.CellData,this._workCell2=new u.CellData,this._rectangleRenderer=this.register(new n.MutableDisposable),this._glyphRenderer=this.register(new n.MutableDisposable),this._onChangeTextureAtlas=this.register(new p.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new p.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new p.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new p.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new p.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new v.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new M.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,X,this._themeService)],this.dimensions=(0,E.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(X.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const B={antialias:!1,depth:!1,preserveDrawingBuffer:$};if(this._gl=this._canvas.getContext("webgl2",B),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,_.addDisposableDomListener)(this._canvas,"webglcontextlost",(P=>{console.log("webglcontextlost event received"),P.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(P)}),3e3)}))),this.register((0,_.addDisposableDomListener)(this._canvas,"webglcontextrestored",(P=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,o.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,C.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((P,J)=>this._setCanvasDevicePixelDimensions(P,J))),this.register(this._coreBrowserService.onWindowChange((P=>{this._observerDisposable.value=(0,C.observeDevicePixelDimensions)(this._canvas,P,((J,se)=>this._setCanvasDevicePixelDimensions(J,se)))}))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,n.toDisposable)((()=>{for(const P of this._renderLayers)P.dispose();this._canvas.parentElement?.removeChild(this._canvas),(0,o.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(H,k){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const K of this._renderLayers)K.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(const H of this._renderLayers)H.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(const H of this._renderLayers)H.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(H,k,K){for(const re of this._renderLayers)re.handleSelectionChanged(this._terminal,H,k,K);this._model.selection.update(this._core,H,k,K),this._requestRedrawViewport()}handleCursorMove(){for(const H of this._renderLayers)H.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new R.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new g.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const H=(0,o.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==H&&(this._onChangeTextureAtlas.fire(H.pages[0].canvas),this._charAtlasDisposable.value=(0,n.getDisposeArrayDisposable)([(0,p.forwardEvent)(H.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,p.forwardEvent)(H.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=H,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(H){this._model.clear(),H&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(const H of this._renderLayers)H.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(H){return-1}deregisterCharacterJoiner(H){return!1}renderRows(H,k){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const K of this._renderLayers)K.handleGridChanged(this._terminal,H,k);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(H,k),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new S.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(H,k){const K=this._core;let re,G,Y,X,j,$,B,P,J,se,ue,_e,Z,F,ae=this._workCell;H=O(H,K.rows-1,0),k=O(k,K.rows-1,0);const me=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,xe=me-K.buffer.ydisp,Ce=Math.min(this._terminal.buffer.active.cursorX,K.cols-1);let je=-1;const Ae=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let $e=!1;for(G=H;G<=k;G++)for(Y=G+K.buffer.ydisp,X=K.buffer.lines.get(Y),this._model.lineLengths[G]=0,j=this._characterJoinerService.getJoinedCharacters(Y),Z=0;Z<K.cols;Z++)if(re=this._cellColorResolver.result.bg,X.loadCell(Z,ae),Z===0&&(re=this._cellColorResolver.result.bg),$=!1,B=Z,j.length>0&&Z===j[0][0]&&($=!0,P=j.shift(),ae=new A(ae,X.translateToString(!0,P[0],P[1]),P[1]-P[0]),B=P[1]-1),J=ae.getChars(),se=ae.getCode(),_e=(G*K.cols+Z)*y.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(ae,Z,Y,this.dimensions.device.cell.width),Ae&&Y===me&&(Z===Ce&&(this._model.cursor={x:Ce,y:xe,width:ae.getWidth(),style:this._coreBrowserService.isFocused?K.options.cursorStyle||"block":K.options.cursorInactiveStyle,cursorWidth:K.options.cursorWidth,dpr:this._devicePixelRatio},je=Ce+ae.getWidth()-1),Z>=Ce&&Z<=je&&(this._coreBrowserService.isFocused&&(K.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&K.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),se!==c.NULL_CELL_CODE&&(this._model.lineLengths[G]=Z+1),(this._model.cells[_e]!==se||this._model.cells[_e+y.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[_e+y.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[_e+y.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&($e=!0,J.length>1&&(se|=y.COMBINED_CHAR_BIT_MASK),this._model.cells[_e]=se,this._model.cells[_e+y.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[_e+y.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[_e+y.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,ue=ae.getWidth(),this._glyphRenderer.value.updateCell(Z,G,se,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,J,ue,re),$))for(ae=this._workCell,Z++;Z<B;Z++)F=(G*K.cols+Z)*y.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(Z,G,c.NULL_CELL_CODE,0,0,0,c.NULL_CELL_CHAR,0,0),this._model.cells[F]=c.NULL_CELL_CODE,this._model.cells[F+y.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[F+y.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[F+y.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;$e&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(H,k){this._canvas.width===H&&this._canvas.height===k||(this._canvas.width=H,this._canvas.height=k,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const H=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:H,end:H})}}r.WebglRenderer=b;class A extends h.AttributeData{constructor(H,k,K){super(),this.content=0,this.combinedData="",this.fg=H.fg,this.bg=H.bg,this.combinedData=k,this._width=K}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(H){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function O(z,H,k=0){return Math.max(Math.min(z,H),k)}r.JoinedCellData=A},381:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.GLTexture=r.expandFloat32Array=r.createShader=r.createProgram=r.PROJECTION_MATRIX=void 0;const _=d(374);function v(o,S,C){const E=(0,_.throwIfFalsy)(o.createShader(S));if(o.shaderSource(E,C),o.compileShader(E),o.getShaderParameter(E,o.COMPILE_STATUS))return E;console.error(o.getShaderInfoLog(E)),o.deleteShader(E)}r.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),r.createProgram=function(o,S,C){const E=(0,_.throwIfFalsy)(o.createProgram());if(o.attachShader(E,(0,_.throwIfFalsy)(v(o,o.VERTEX_SHADER,S))),o.attachShader(E,(0,_.throwIfFalsy)(v(o,o.FRAGMENT_SHADER,C))),o.linkProgram(E),o.getProgramParameter(E,o.LINK_STATUS))return E;console.error(o.getProgramInfoLog(E)),o.deleteProgram(E)},r.createShader=v,r.expandFloat32Array=function(o,S){const C=Math.min(2*o.length,S),E=new Float32Array(C);for(let p=0;p<o.length;p++)E[p]=o[p];return E},r.GLTexture=class{constructor(o){this.texture=o,this.version=-1}}},592:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BaseRenderLayer=void 0;const _=d(627),v=d(237),o=d(374),S=d(859);class C extends S.Disposable{constructor(p,n,h,u,c,g,R,y){super(),this._container=n,this._alpha=c,this._coreBrowserService=g,this._optionsService=R,this._themeService=y,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${h}-layer`),this._canvas.style.zIndex=u.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((M=>{this._refreshCharAtlas(p,M),this.reset(p)}))),this.register((0,S.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,o.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(p){}handleFocus(p){}handleCursorMove(p){}handleGridChanged(p,n,h){}handleSelectionChanged(p,n,h,u=!1){}_setTransparency(p,n){if(n===this._alpha)return;const h=this._canvas;this._alpha=n,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,h),this._refreshCharAtlas(p,this._themeService.colors),this.handleGridChanged(p,0,p.rows-1)}_refreshCharAtlas(p,n){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,_.acquireTextureAtlas)(p,this._optionsService.rawOptions,n,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(p,n){this._deviceCellWidth=n.device.cell.width,this._deviceCellHeight=n.device.cell.height,this._deviceCharWidth=n.device.char.width,this._deviceCharHeight=n.device.char.height,this._deviceCharLeft=n.device.char.left,this._deviceCharTop=n.device.char.top,this._canvas.width=n.device.canvas.width,this._canvas.height=n.device.canvas.height,this._canvas.style.width=`${n.css.canvas.width}px`,this._canvas.style.height=`${n.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(p,this._themeService.colors)}_fillBottomLineAtCells(p,n,h=1){this._ctx.fillRect(p*this._deviceCellWidth,(n+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,h*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(p,n,h,u){this._alpha?this._ctx.clearRect(p*this._deviceCellWidth,n*this._deviceCellHeight,h*this._deviceCellWidth,u*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(p*this._deviceCellWidth,n*this._deviceCellHeight,h*this._deviceCellWidth,u*this._deviceCellHeight))}_fillCharTrueColor(p,n,h,u){this._ctx.font=this._getFont(p,!1,!1),this._ctx.textBaseline=v.TEXT_BASELINE,this._clipCell(h,u,n.getWidth()),this._ctx.fillText(n.getChars(),h*this._deviceCellWidth+this._deviceCharLeft,u*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(p,n,h){this._ctx.beginPath(),this._ctx.rect(p*this._deviceCellWidth,n*this._deviceCellHeight,h*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(p,n,h){return`${h?"italic":""} ${n?p.options.fontWeightBold:p.options.fontWeight} ${p.options.fontSize*this._coreBrowserService.dpr}px ${p.options.fontFamily}`}}r.BaseRenderLayer=C},733:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkRenderLayer=void 0;const _=d(197),v=d(237),o=d(592);class S extends o.BaseRenderLayer{constructor(E,p,n,h,u,c,g){super(n,E,"link",p,!0,u,c,g),this.register(h.onShowLinkUnderline((R=>this._handleShowLinkUnderline(R)))),this.register(h.onHideLinkUnderline((R=>this._handleHideLinkUnderline(R))))}resize(E,p){super.resize(E,p),this._state=void 0}reset(E){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const E=this._state.y2-this._state.y1-1;E>0&&this._clearCells(0,this._state.y1+1,this._state.cols,E),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(E){if(E.fg===v.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:E.fg!==void 0&&(0,_.is256Color)(E.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[E.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,E.y1===E.y2)this._fillBottomLineAtCells(E.x1,E.y1,E.x2-E.x1);else{this._fillBottomLineAtCells(E.x1,E.y1,E.cols-E.x1);for(let p=E.y1+1;p<E.y2;p++)this._fillBottomLineAtCells(0,p,E.cols);this._fillBottomLineAtCells(0,E.y2,E.x2)}this._state=E}_handleHideLinkUnderline(E){this._clearCurrentLink()}}r.LinkRenderLayer=S},820:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(d,_,v,o){d.addEventListener(_,v,o);let S=!1;return{dispose:()=>{S||(S=!0,d.removeEventListener(_,v,o))}}}},274:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellColorResolver=void 0;const _=d(855),v=d(160),o=d(374);let S,C=0,E=0,p=!1,n=!1,h=!1,u=0;r.CellColorResolver=class{constructor(c,g,R,y,M,b){this._terminal=c,this._optionService=g,this._selectionRenderModel=R,this._decorationService=y,this._coreBrowserService=M,this._themeService=b,this.result={fg:0,bg:0,ext:0}}resolve(c,g,R,y){if(this.result.bg=c.bg,this.result.fg=c.fg,this.result.ext=268435456&c.bg?c.extended.ext:0,E=0,C=0,n=!1,p=!1,h=!1,S=this._themeService.colors,u=0,c.getCode()!==_.NULL_CELL_CODE&&c.extended.underlineStyle===4){const M=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));u=g*y%(2*Math.round(M))}if(this._decorationService.forEachDecorationAtCell(g,R,"bottom",(M=>{M.backgroundColorRGB&&(E=M.backgroundColorRGB.rgba>>8&16777215,n=!0),M.foregroundColorRGB&&(C=M.foregroundColorRGB.rgba>>8&16777215,p=!0)})),h=this._selectionRenderModel.isCellSelected(this._terminal,g,R),h){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:E=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:E=(16777215&this.result.fg)<<8|255;break;default:E=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:E=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:E=(16777215&this.result.bg)<<8|255}E=v.rgba.blend(E,4294967040&(this._coreBrowserService.isFocused?S.selectionBackgroundOpaque:S.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else E=(this._coreBrowserService.isFocused?S.selectionBackgroundOpaque:S.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(n=!0,S.selectionForeground&&(C=S.selectionForeground.rgba>>8&16777215,p=!0),(0,o.treatGlyphAsBackgroundColor)(c.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)C=(this._coreBrowserService.isFocused?S.selectionBackgroundOpaque:S.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:C=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:C=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:C=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:C=(16777215&this.result.fg)<<8|255;break;default:C=this._themeService.colors.foreground.rgba}C=v.rgba.blend(C,4294967040&(this._coreBrowserService.isFocused?S.selectionBackgroundOpaque:S.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}p=!0}}this._decorationService.forEachDecorationAtCell(g,R,"top",(M=>{M.backgroundColorRGB&&(E=M.backgroundColorRGB.rgba>>8&16777215,n=!0),M.foregroundColorRGB&&(C=M.foregroundColorRGB.rgba>>8&16777215,p=!0)})),n&&(E=h?-16777216&c.bg&-134217729|E|50331648:-16777216&c.bg|E|50331648),p&&(C=-16777216&c.fg&-67108865|C|50331648),67108864&this.result.fg&&(n&&!p&&(C=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&S.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,p=!0),!n&&p&&(E=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&S.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,n=!0)),S=void 0,this.result.bg=n?E:this.result.bg,this.result.fg=p?C:this.result.fg,this.result.ext&=536870911,this.result.ext|=u<<29&3758096384}}},627:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.removeTerminalFromCache=r.acquireTextureAtlas=void 0;const _=d(509),v=d(197),o=[];r.acquireTextureAtlas=function(S,C,E,p,n,h,u,c){const g=(0,v.generateConfig)(p,n,h,u,C,E,c);for(let M=0;M<o.length;M++){const b=o[M],A=b.ownedBy.indexOf(S);if(A>=0){if((0,v.configEquals)(b.config,g))return b.atlas;b.ownedBy.length===1?(b.atlas.dispose(),o.splice(M,1)):b.ownedBy.splice(A,1);break}}for(let M=0;M<o.length;M++){const b=o[M];if((0,v.configEquals)(b.config,g))return b.ownedBy.push(S),b.atlas}const R=S._core,y={atlas:new _.TextureAtlas(document,g,R.unicodeService),config:g,ownedBy:[S]};return o.push(y),y.atlas},r.removeTerminalFromCache=function(S){for(let C=0;C<o.length;C++){const E=o[C].ownedBy.indexOf(S);if(E!==-1){o[C].ownedBy.length===1?(o[C].atlas.dispose(),o.splice(C,1)):o[C].ownedBy.splice(E,1);break}}}},197:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.is256Color=r.configEquals=r.generateConfig=void 0;const _=d(160);r.generateConfig=function(v,o,S,C,E,p,n){const h={foreground:p.foreground,background:p.background,cursor:_.NULL_COLOR,cursorAccent:_.NULL_COLOR,selectionForeground:_.NULL_COLOR,selectionBackgroundTransparent:_.NULL_COLOR,selectionBackgroundOpaque:_.NULL_COLOR,selectionInactiveBackgroundTransparent:_.NULL_COLOR,selectionInactiveBackgroundOpaque:_.NULL_COLOR,ansi:p.ansi.slice(),contrastCache:p.contrastCache,halfContrastCache:p.halfContrastCache};return{customGlyphs:E.customGlyphs,devicePixelRatio:n,letterSpacing:E.letterSpacing,lineHeight:E.lineHeight,deviceCellWidth:v,deviceCellHeight:o,deviceCharWidth:S,deviceCharHeight:C,fontFamily:E.fontFamily,fontSize:E.fontSize,fontWeight:E.fontWeight,fontWeightBold:E.fontWeightBold,allowTransparency:E.allowTransparency,drawBoldTextInBrightColors:E.drawBoldTextInBrightColors,minimumContrastRatio:E.minimumContrastRatio,colors:h}},r.configEquals=function(v,o){for(let S=0;S<v.colors.ansi.length;S++)if(v.colors.ansi[S].rgba!==o.colors.ansi[S].rgba)return!1;return v.devicePixelRatio===o.devicePixelRatio&&v.customGlyphs===o.customGlyphs&&v.lineHeight===o.lineHeight&&v.letterSpacing===o.letterSpacing&&v.fontFamily===o.fontFamily&&v.fontSize===o.fontSize&&v.fontWeight===o.fontWeight&&v.fontWeightBold===o.fontWeightBold&&v.allowTransparency===o.allowTransparency&&v.deviceCharWidth===o.deviceCharWidth&&v.deviceCharHeight===o.deviceCharHeight&&v.drawBoldTextInBrightColors===o.drawBoldTextInBrightColors&&v.minimumContrastRatio===o.minimumContrastRatio&&v.colors.foreground.rgba===o.colors.foreground.rgba&&v.colors.background.rgba===o.colors.background.rgba},r.is256Color=function(v){return(50331648&v)==16777216||(50331648&v)==33554432}},237:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const _=d(399);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=_.isFirefox||_.isLegacyEdge?"bottom":"ideographic"},457:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CursorBlinkStateManager=void 0,r.CursorBlinkStateManager=class{constructor(d,_){this._renderCallback=d,this._coreBrowserService=_,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(d=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const _=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,_>0)return void this._restartInterval(_)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const _=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(_)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),d)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tryDrawCustomChar=r.powerlineDefinitions=r.boxDrawingDefinitions=r.blockElementDefinitions=void 0;const _=d(374);r.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const v={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};r.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(p,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"║":{1:(p,n)=>`M${.5-p},0 L${.5-p},1 M${.5+p},0 L${.5+p},1`},"╒":{1:(p,n)=>`M.5,1 L.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╓":{1:(p,n)=>`M${.5-p},1 L${.5-p},.5 L1,.5 M${.5+p},.5 L${.5+p},1`},"╔":{1:(p,n)=>`M1,${.5-n} L${.5-p},${.5-n} L${.5-p},1 M1,${.5+n} L${.5+p},${.5+n} L${.5+p},1`},"╕":{1:(p,n)=>`M0,${.5-n} L.5,${.5-n} L.5,1 M0,${.5+n} L.5,${.5+n}`},"╖":{1:(p,n)=>`M${.5+p},1 L${.5+p},.5 L0,.5 M${.5-p},.5 L${.5-p},1`},"╗":{1:(p,n)=>`M0,${.5+n} L${.5-p},${.5+n} L${.5-p},1 M0,${.5-n} L${.5+p},${.5-n} L${.5+p},1`},"╘":{1:(p,n)=>`M.5,0 L.5,${.5+n} L1,${.5+n} M.5,${.5-n} L1,${.5-n}`},"╙":{1:(p,n)=>`M1,.5 L${.5-p},.5 L${.5-p},0 M${.5+p},.5 L${.5+p},0`},"╚":{1:(p,n)=>`M1,${.5-n} L${.5+p},${.5-n} L${.5+p},0 M1,${.5+n} L${.5-p},${.5+n} L${.5-p},0`},"╛":{1:(p,n)=>`M0,${.5+n} L.5,${.5+n} L.5,0 M0,${.5-n} L.5,${.5-n}`},"╜":{1:(p,n)=>`M0,.5 L${.5+p},.5 L${.5+p},0 M${.5-p},.5 L${.5-p},0`},"╝":{1:(p,n)=>`M0,${.5-n} L${.5-p},${.5-n} L${.5-p},0 M0,${.5+n} L${.5+p},${.5+n} L${.5+p},0`},"╞":{1:(p,n)=>`M.5,0 L.5,1 M.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╟":{1:(p,n)=>`M${.5-p},0 L${.5-p},1 M${.5+p},0 L${.5+p},1 M${.5+p},.5 L1,.5`},"╠":{1:(p,n)=>`M${.5-p},0 L${.5-p},1 M1,${.5+n} L${.5+p},${.5+n} L${.5+p},1 M1,${.5-n} L${.5+p},${.5-n} L${.5+p},0`},"╡":{1:(p,n)=>`M.5,0 L.5,1 M0,${.5-n} L.5,${.5-n} M0,${.5+n} L.5,${.5+n}`},"╢":{1:(p,n)=>`M0,.5 L${.5-p},.5 M${.5-p},0 L${.5-p},1 M${.5+p},0 L${.5+p},1`},"╣":{1:(p,n)=>`M${.5+p},0 L${.5+p},1 M0,${.5+n} L${.5-p},${.5+n} L${.5-p},1 M0,${.5-n} L${.5-p},${.5-n} L${.5-p},0`},"╤":{1:(p,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n} M.5,${.5+n} L.5,1`},"╥":{1:(p,n)=>`M0,.5 L1,.5 M${.5-p},.5 L${.5-p},1 M${.5+p},.5 L${.5+p},1`},"╦":{1:(p,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L${.5-p},${.5+n} L${.5-p},1 M1,${.5+n} L${.5+p},${.5+n} L${.5+p},1`},"╧":{1:(p,n)=>`M.5,0 L.5,${.5-n} M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╨":{1:(p,n)=>`M0,.5 L1,.5 M${.5-p},.5 L${.5-p},0 M${.5+p},.5 L${.5+p},0`},"╩":{1:(p,n)=>`M0,${.5+n} L1,${.5+n} M0,${.5-n} L${.5-p},${.5-n} L${.5-p},0 M1,${.5-n} L${.5+p},${.5-n} L${.5+p},0`},"╪":{1:(p,n)=>`M.5,0 L.5,1 M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╫":{1:(p,n)=>`M0,.5 L1,.5 M${.5-p},0 L${.5-p},1 M${.5+p},0 L${.5+p},1`},"╬":{1:(p,n)=>`M0,${.5+n} L${.5-p},${.5+n} L${.5-p},1 M1,${.5+n} L${.5+p},${.5+n} L${.5+p},1 M0,${.5-n} L${.5-p},${.5-n} L${.5-p},0 M1,${.5-n} L${.5+p},${.5-n} L${.5+p},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(p,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,1,.5`},"╮":{1:(p,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,0,.5`},"╯":{1:(p,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,0,.5`},"╰":{1:(p,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,1,.5`}},r.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},r.powerlineDefinitions[""]=r.powerlineDefinitions[""],r.powerlineDefinitions[""]=r.powerlineDefinitions[""],r.tryDrawCustomChar=function(p,n,h,u,c,g,R,y){const M=r.blockElementDefinitions[n];if(M)return(function(z,H,k,K,re,G){for(let Y=0;Y<H.length;Y++){const X=H[Y],j=re/8,$=G/8;z.fillRect(k+X.x*j,K+X.y*$,X.w*j,X.h*$)}})(p,M,h,u,c,g),!0;const b=v[n];if(b)return(function(z,H,k,K,re,G){let Y=o.get(H);Y||(Y=new Map,o.set(H,Y));const X=z.fillStyle;if(typeof X!="string")throw new Error(`Unexpected fillStyle type "${X}"`);let j=Y.get(X);if(!j){const $=H[0].length,B=H.length,P=z.canvas.ownerDocument.createElement("canvas");P.width=$,P.height=B;const J=(0,_.throwIfFalsy)(P.getContext("2d")),se=new ImageData($,B);let ue,_e,Z,F;if(X.startsWith("#"))ue=parseInt(X.slice(1,3),16),_e=parseInt(X.slice(3,5),16),Z=parseInt(X.slice(5,7),16),F=X.length>7&&parseInt(X.slice(7,9),16)||1;else{if(!X.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${X}" when drawing pattern glyph`);[ue,_e,Z,F]=X.substring(5,X.length-1).split(",").map((ae=>parseFloat(ae)))}for(let ae=0;ae<B;ae++)for(let me=0;me<$;me++)se.data[4*(ae*$+me)]=ue,se.data[4*(ae*$+me)+1]=_e,se.data[4*(ae*$+me)+2]=Z,se.data[4*(ae*$+me)+3]=H[ae][me]*(255*F);J.putImageData(se,0,0),j=(0,_.throwIfFalsy)(z.createPattern(P,null)),Y.set(X,j)}z.fillStyle=j,z.fillRect(k,K,re,G)})(p,b,h,u,c,g),!0;const A=r.boxDrawingDefinitions[n];if(A)return(function(z,H,k,K,re,G,Y){z.strokeStyle=z.fillStyle;for(const[X,j]of Object.entries(H)){let $;z.beginPath(),z.lineWidth=Y*Number.parseInt(X),$=typeof j=="function"?j(.15,.15/G*re):j;for(const B of $.split(" ")){const P=B[0],J=C[P];if(!J){console.error(`Could not find drawing instructions for "${P}"`);continue}const se=B.substring(1).split(",");se[0]&&se[1]&&J(z,E(se,re,G,k,K,!0,Y))}z.stroke(),z.closePath()}})(p,A,h,u,c,g,y),!0;const O=r.powerlineDefinitions[n];return!!O&&((function(z,H,k,K,re,G,Y,X){const j=new Path2D;j.rect(k,K,re,G),z.clip(j),z.beginPath();const $=Y/12;z.lineWidth=X*$;for(const B of H.d.split(" ")){const P=B[0],J=C[P];if(!J){console.error(`Could not find drawing instructions for "${P}"`);continue}const se=B.substring(1).split(",");se[0]&&se[1]&&J(z,E(se,re,G,k,K,!1,X,(H.leftPadding??0)*($/2),(H.rightPadding??0)*($/2)))}H.type===1?(z.strokeStyle=z.fillStyle,z.stroke()):z.fill(),z.closePath()})(p,O,h,u,c,g,R,y),!0)};const o=new Map;function S(p,n,h=0){return Math.max(Math.min(p,n),h)}const C={C:(p,n)=>p.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]),L:(p,n)=>p.lineTo(n[0],n[1]),M:(p,n)=>p.moveTo(n[0],n[1])};function E(p,n,h,u,c,g,R,y=0,M=0){const b=p.map((A=>parseFloat(A)||parseInt(A)));if(b.length<2)throw new Error("Too few arguments for instruction");for(let A=0;A<b.length;A+=2)b[A]*=n-y*R-M*R,g&&b[A]!==0&&(b[A]=S(Math.round(b[A]+.5)-.5,n,0)),b[A]+=u+y*R;for(let A=1;A<b.length;A+=2)b[A]*=h,g&&b[A]!==0&&(b[A]=S(Math.round(b[A]+.5)-.5,h,0)),b[A]+=c;return b}},56:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.observeDevicePixelDimensions=void 0;const _=d(859);r.observeDevicePixelDimensions=function(v,o,S){let C=new o.ResizeObserver((E=>{const p=E.find((u=>u.target===v));if(!p)return;if(!("devicePixelContentBoxSize"in p))return C?.disconnect(),void(C=void 0);const n=p.devicePixelContentBoxSize[0].inlineSize,h=p.devicePixelContentBoxSize[0].blockSize;n>0&&h>0&&S(n,h)}));try{C.observe(v,{box:["device-pixel-content-box"]})}catch{C.disconnect(),C=void 0}return(0,_.toDisposable)((()=>C?.disconnect()))}},374:(W,r)=>{function d(v){return 57508<=v&&v<=57558}function _(v){return v>=128512&&v<=128591||v>=127744&&v<=128511||v>=128640&&v<=128767||v>=9728&&v<=9983||v>=9984&&v<=10175||v>=65024&&v<=65039||v>=129280&&v<=129535||v>=127462&&v<=127487}Object.defineProperty(r,"__esModule",{value:!0}),r.computeNextVariantOffset=r.createRenderDimensions=r.treatGlyphAsBackgroundColor=r.allowRescaling=r.isEmoji=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(v){if(!v)throw new Error("value must not be falsy");return v},r.isPowerlineGlyph=d,r.isRestrictedPowerlineGlyph=function(v){return 57520<=v&&v<=57527},r.isEmoji=_,r.allowRescaling=function(v,o,S,C){return o===1&&S>Math.ceil(1.5*C)&&v!==void 0&&v>255&&!_(v)&&!d(v)&&!(function(E){return 57344<=E&&E<=63743})(v)},r.treatGlyphAsBackgroundColor=function(v){return d(v)||(function(o){return 9472<=o&&o<=9631})(v)},r.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}}}},r.computeNextVariantOffset=function(v,o,S=0){return(v-(2*Math.round(o)-S))%(2*Math.round(o))}},296:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createSelectionRenderModel=void 0;class d{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(v,o,S,C=!1){if(this.selectionStart=o,this.selectionEnd=S,!o||!S||o[0]===S[0]&&o[1]===S[1])return void this.clear();const E=v.buffers.active.ydisp,p=o[1]-E,n=S[1]-E,h=Math.max(p,0),u=Math.min(n,v.rows-1);h>=v.rows||u<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=C,this.viewportStartRow=p,this.viewportEndRow=n,this.viewportCappedStartRow=h,this.viewportCappedEndRow=u,this.startCol=o[0],this.endCol=S[0])}isCellSelected(v,o,S){return!!this.hasSelection&&(S-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?o>=this.startCol&&S>=this.viewportCappedStartRow&&o<this.endCol&&S<=this.viewportCappedEndRow:o<this.startCol&&S>=this.viewportCappedStartRow&&o>=this.endCol&&S<=this.viewportCappedEndRow:S>this.viewportStartRow&&S<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&S===this.viewportStartRow&&o>=this.startCol&&o<this.endCol||this.viewportStartRow<this.viewportEndRow&&S===this.viewportEndRow&&o<this.endCol||this.viewportStartRow<this.viewportEndRow&&S===this.viewportStartRow&&o>=this.startCol)}}r.createSelectionRenderModel=function(){return new d}},509:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TextureAtlas=void 0;const _=d(237),v=d(860),o=d(374),S=d(160),C=d(345),E=d(485),p=d(385),n=d(147),h=d(855),u={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let c;class g{get pages(){return this._pages}constructor(A,O,z){this._document=A,this._config=O,this._unicodeService=z,this._didWarmUp=!1,this._cacheMap=new E.FourKeyMap,this._cacheMapCombined=new E.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new n.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new C.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new C.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=M(A,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,o.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const A of this.pages)A.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const A=new p.IdleTaskQueue;for(let O=33;O<126;O++)A.enqueue((()=>{if(!this._cacheMap.get(O,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT)){const z=this._drawToCache(O,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT);this._cacheMap.set(O,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT,z)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const A of this._pages)A.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(g.maxAtlasPages&&this._pages.length>=Math.max(4,g.maxAtlasPages)){const O=this._pages.filter((Y=>2*Y.canvas.width<=(g.maxTextureSize||4096))).sort(((Y,X)=>X.canvas.width!==Y.canvas.width?X.canvas.width-Y.canvas.width:X.percentageUsed-Y.percentageUsed));let z=-1,H=0;for(let Y=0;Y<O.length;Y++)if(O[Y].canvas.width!==H)z=Y,H=O[Y].canvas.width;else if(Y-z==3)break;const k=O.slice(z,z+4),K=k.map((Y=>Y.glyphs[0].texturePage)).sort(((Y,X)=>Y>X?1:-1)),re=this.pages.length-k.length,G=this._mergePages(k,re);G.version++;for(let Y=K.length-1;Y>=0;Y--)this._deletePage(K[Y]);this.pages.push(G),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(G.canvas)}const A=new R(this._document,this._textureSize);return this._pages.push(A),this._activePages.push(A),this._onAddTextureAtlasCanvas.fire(A.canvas),A}_mergePages(A,O){const z=2*A[0].canvas.width,H=new R(this._document,z,A);for(const[k,K]of A.entries()){const re=k*K.canvas.width%z,G=Math.floor(k/2)*K.canvas.height;H.ctx.drawImage(K.canvas,re,G);for(const X of K.glyphs)X.texturePage=O,X.sizeClipSpace.x=X.size.x/z,X.sizeClipSpace.y=X.size.y/z,X.texturePosition.x+=re,X.texturePosition.y+=G,X.texturePositionClipSpace.x=X.texturePosition.x/z,X.texturePositionClipSpace.y=X.texturePosition.y/z;this._onRemoveTextureAtlasCanvas.fire(K.canvas);const Y=this._activePages.indexOf(K);Y!==-1&&this._activePages.splice(Y,1)}return H}_deletePage(A){this._pages.splice(A,1);for(let O=A;O<this._pages.length;O++){const z=this._pages[O];for(const H of z.glyphs)H.texturePage--;z.version++}}getRasterizedGlyphCombinedChar(A,O,z,H,k){return this._getFromCacheMap(this._cacheMapCombined,A,O,z,H,k)}getRasterizedGlyph(A,O,z,H,k){return this._getFromCacheMap(this._cacheMap,A,O,z,H,k)}_getFromCacheMap(A,O,z,H,k,K=!1){return c=A.get(O,z,H,k),c||(c=this._drawToCache(O,z,H,k,K),A.set(O,z,H,k,c)),c}_getColorFromAnsiIndex(A){if(A>=this._config.colors.ansi.length)throw new Error("No color found for idx "+A);return this._config.colors.ansi[A]}_getBackgroundColor(A,O,z,H){if(this._config.allowTransparency)return S.NULL_COLOR;let k;switch(A){case 16777216:case 33554432:k=this._getColorFromAnsiIndex(O);break;case 50331648:const K=n.AttributeData.toColorRGB(O);k=S.channels.toColor(K[0],K[1],K[2]);break;default:k=z?S.color.opaque(this._config.colors.foreground):this._config.colors.background}return k}_getForegroundColor(A,O,z,H,k,K,re,G,Y,X){const j=this._getMinimumContrastColor(A,O,z,H,k,K,re,Y,G,X);if(j)return j;let $;switch(k){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&Y&&K<8&&(K+=8),$=this._getColorFromAnsiIndex(K);break;case 50331648:const B=n.AttributeData.toColorRGB(K);$=S.channels.toColor(B[0],B[1],B[2]);break;default:$=re?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&($=S.color.opaque($)),G&&($=S.color.multiplyOpacity($,_.DIM_OPACITY)),$}_resolveBackgroundRgba(A,O,z){switch(A){case 16777216:case 33554432:return this._getColorFromAnsiIndex(O).rgba;case 50331648:return O<<8;default:return z?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(A,O,z,H){switch(A){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&H&&O<8&&(O+=8),this._getColorFromAnsiIndex(O).rgba;case 50331648:return O<<8;default:return z?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(A,O,z,H,k,K,re,G,Y,X){if(this._config.minimumContrastRatio===1||X)return;const j=this._getContrastCache(Y),$=j.getColor(A,H);if($!==void 0)return $||void 0;const B=this._resolveBackgroundRgba(O,z,re),P=this._resolveForegroundRgba(k,K,re,G),J=S.rgba.ensureContrastRatio(B,P,this._config.minimumContrastRatio/(Y?2:1));if(!J)return void j.setColor(A,H,null);const se=S.channels.toColor(J>>24&255,J>>16&255,J>>8&255);return j.setColor(A,H,se),se}_getContrastCache(A){return A?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(A,O,z,H,k=!1){const K=typeof A=="number"?String.fromCharCode(A):A,re=Math.min(this._config.deviceCellWidth*Math.max(K.length,2)+4,this._textureSize);this._tmpCanvas.width<re&&(this._tmpCanvas.width=re);const G=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<G&&(this._tmpCanvas.height=G),this._tmpCtx.save(),this._workAttributeData.fg=z,this._workAttributeData.bg=O,this._workAttributeData.extended.ext=H,this._workAttributeData.isInvisible())return u;const Y=!!this._workAttributeData.isBold(),X=!!this._workAttributeData.isInverse(),j=!!this._workAttributeData.isDim(),$=!!this._workAttributeData.isItalic(),B=!!this._workAttributeData.isUnderline(),P=!!this._workAttributeData.isStrikethrough(),J=!!this._workAttributeData.isOverline();let se=this._workAttributeData.getFgColor(),ue=this._workAttributeData.getFgColorMode(),_e=this._workAttributeData.getBgColor(),Z=this._workAttributeData.getBgColorMode();if(X){const ye=se;se=_e,_e=ye;const Re=ue;ue=Z,Z=Re}const F=this._getBackgroundColor(Z,_e,X,j);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=F.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const ae=Y?this._config.fontWeightBold:this._config.fontWeight,me=$?"italic":"";this._tmpCtx.font=`${me} ${ae} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=_.TEXT_BASELINE;const xe=K.length===1&&(0,o.isPowerlineGlyph)(K.charCodeAt(0)),Ce=K.length===1&&(0,o.isRestrictedPowerlineGlyph)(K.charCodeAt(0)),je=this._getForegroundColor(O,Z,_e,z,ue,se,X,j,Y,(0,o.treatGlyphAsBackgroundColor)(K.charCodeAt(0)));this._tmpCtx.fillStyle=je.css;const Ae=Ce?0:4;let $e=!1;this._config.customGlyphs!==!1&&($e=(0,v.tryDrawCustomChar)(this._tmpCtx,K,Ae,Ae,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let Xe,ke=!xe;if(Xe=typeof A=="number"?this._unicodeService.wcwidth(A):this._unicodeService.getStringCellWidth(A),B){this._tmpCtx.save();const ye=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Re=ye%2==1?.5:0;if(this._tmpCtx.lineWidth=ye,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())ke=!1,this._tmpCtx.strokeStyle=`rgb(${n.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{ke=!1;let tt=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&tt<8&&(tt+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(tt).css}this._tmpCtx.beginPath();const Ke=Ae,Be=Math.ceil(Ae+this._config.deviceCharHeight)-Re-(k?2*ye:0),st=Be+ye,ht=Be+2*ye;let kt=this._workAttributeData.getUnderlineVariantOffset();for(let tt=0;tt<Xe;tt++){this._tmpCtx.save();const Qe=Ke+tt*this._config.deviceCellWidth,He=Ke+(tt+1)*this._config.deviceCellWidth,Ci=Qe+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Qe,Be),this._tmpCtx.lineTo(He,Be),this._tmpCtx.moveTo(Qe,ht),this._tmpCtx.lineTo(He,ht);break;case 3:const Rt=ye<=1?ht:Math.ceil(Ae+this._config.deviceCharHeight-ye/2)-Re,Qt=ye<=1?Be:Math.ceil(Ae+this._config.deviceCharHeight+ye/2)-Re,zt=new Path2D;zt.rect(Qe,Be,this._config.deviceCellWidth,ht-Be),this._tmpCtx.clip(zt),this._tmpCtx.moveTo(Qe-this._config.deviceCellWidth/2,st),this._tmpCtx.bezierCurveTo(Qe-this._config.deviceCellWidth/2,Qt,Qe,Qt,Qe,st),this._tmpCtx.bezierCurveTo(Qe,Rt,Ci,Rt,Ci,st),this._tmpCtx.bezierCurveTo(Ci,Qt,He,Qt,He,st),this._tmpCtx.bezierCurveTo(He,Rt,He+this._config.deviceCellWidth/2,Rt,He+this._config.deviceCellWidth/2,st);break;case 4:const $s=kt===0?0:kt>=ye?2*ye-kt:ye-kt;kt>=ye||$s===0?(this._tmpCtx.setLineDash([Math.round(ye),Math.round(ye)]),this._tmpCtx.moveTo(Qe+$s,Be),this._tmpCtx.lineTo(He,Be)):(this._tmpCtx.setLineDash([Math.round(ye),Math.round(ye)]),this._tmpCtx.moveTo(Qe,Be),this._tmpCtx.lineTo(Qe+$s,Be),this._tmpCtx.moveTo(Qe+$s+ye,Be),this._tmpCtx.lineTo(He,Be)),kt=(0,o.computeNextVariantOffset)(He-Qe,ye,kt);break;case 5:const sn=.6,rn=.3,Je=He-Qe,yt=Math.floor(sn*Je),Ss=Math.floor(rn*Je),Jt=Je-yt-Ss;this._tmpCtx.setLineDash([yt,Ss,Jt]),this._tmpCtx.moveTo(Qe,Be),this._tmpCtx.lineTo(He,Be);break;default:this._tmpCtx.moveTo(Qe,Be),this._tmpCtx.lineTo(He,Be)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!$e&&this._config.fontSize>=12&&!this._config.allowTransparency&&K!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const tt=this._tmpCtx.measureText(K);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in tt&&tt.actualBoundingBoxDescent>0){this._tmpCtx.save();const Qe=new Path2D;Qe.rect(Ke,Be-Math.ceil(ye/2),this._config.deviceCellWidth*Xe,ht-Be+Math.ceil(ye/2)),this._tmpCtx.clip(Qe),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=F.css,this._tmpCtx.strokeText(K,Ae,Ae+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(J){const ye=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Re=ye%2==1?.5:0;this._tmpCtx.lineWidth=ye,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(Ae,Ae+Re),this._tmpCtx.lineTo(Ae+this._config.deviceCharWidth*Xe,Ae+Re),this._tmpCtx.stroke()}if($e||this._tmpCtx.fillText(K,Ae,Ae+this._config.deviceCharHeight),K==="_"&&!this._config.allowTransparency){let ye=y(this._tmpCtx.getImageData(Ae,Ae,this._config.deviceCellWidth,this._config.deviceCellHeight),F,je,ke);if(ye)for(let Re=1;Re<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=F.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(K,Ae,Ae+this._config.deviceCharHeight-Re),ye=y(this._tmpCtx.getImageData(Ae,Ae,this._config.deviceCellWidth,this._config.deviceCellHeight),F,je,ke),ye);Re++);}if(P){const ye=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),Re=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=ye,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(Ae,Ae+Math.floor(this._config.deviceCharHeight/2)-Re),this._tmpCtx.lineTo(Ae+this._config.deviceCharWidth*Xe,Ae+Math.floor(this._config.deviceCharHeight/2)-Re),this._tmpCtx.stroke()}this._tmpCtx.restore();const Ht=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let ge;if(ge=this._config.allowTransparency?(function(ye){for(let Re=0;Re<ye.data.length;Re+=4)if(ye.data[Re+3]>0)return!1;return!0})(Ht):y(Ht,F,je,ke),ge)return u;const de=this._findGlyphBoundingBox(Ht,this._workBoundingBox,re,Ce,$e,Ae);let Se,Ee;for(;;){if(this._activePages.length===0){const ye=this._createNewPage();Se=ye,Ee=ye.currentRow,Ee.height=de.size.y;break}Se=this._activePages[this._activePages.length-1],Ee=Se.currentRow;for(const ye of this._activePages)de.size.y<=ye.currentRow.height&&(Se=ye,Ee=ye.currentRow);for(let ye=this._activePages.length-1;ye>=0;ye--)for(const Re of this._activePages[ye].fixedRows)Re.height<=Ee.height&&de.size.y<=Re.height&&(Se=this._activePages[ye],Ee=Re);if(Ee.y+de.size.y>=Se.canvas.height||Ee.height>de.size.y+2){let ye=!1;if(Se.currentRow.y+Se.currentRow.height+de.size.y>=Se.canvas.height){let Re;for(const Ke of this._activePages)if(Ke.currentRow.y+Ke.currentRow.height+de.size.y<Ke.canvas.height){Re=Ke;break}if(Re)Se=Re;else if(g.maxAtlasPages&&this._pages.length>=g.maxAtlasPages&&Ee.y+de.size.y<=Se.canvas.height&&Ee.height>=de.size.y&&Ee.x+de.size.x<=Se.canvas.width)ye=!0;else{const Ke=this._createNewPage();Se=Ke,Ee=Ke.currentRow,Ee.height=de.size.y,ye=!0}}ye||(Se.currentRow.height>0&&Se.fixedRows.push(Se.currentRow),Ee={x:0,y:Se.currentRow.y+Se.currentRow.height,height:de.size.y},Se.fixedRows.push(Ee),Se.currentRow={x:0,y:Ee.y+Ee.height,height:0})}if(Ee.x+de.size.x<=Se.canvas.width)break;Ee===Se.currentRow?(Ee.x=0,Ee.y+=Ee.height,Ee.height=0):Se.fixedRows.splice(Se.fixedRows.indexOf(Ee),1)}return de.texturePage=this._pages.indexOf(Se),de.texturePosition.x=Ee.x,de.texturePosition.y=Ee.y,de.texturePositionClipSpace.x=Ee.x/Se.canvas.width,de.texturePositionClipSpace.y=Ee.y/Se.canvas.height,de.sizeClipSpace.x/=Se.canvas.width,de.sizeClipSpace.y/=Se.canvas.height,Ee.height=Math.max(Ee.height,de.size.y),Ee.x+=de.size.x,Se.ctx.putImageData(Ht,de.texturePosition.x-this._workBoundingBox.left,de.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,de.size.x,de.size.y),Se.addGlyph(de),Se.version++,de}_findGlyphBoundingBox(A,O,z,H,k,K){O.top=0;const re=H?this._config.deviceCellHeight:this._tmpCanvas.height,G=H?this._config.deviceCellWidth:z;let Y=!1;for(let X=0;X<re;X++){for(let j=0;j<G;j++){const $=X*this._tmpCanvas.width*4+4*j+3;if(A.data[$]!==0){O.top=X,Y=!0;break}}if(Y)break}O.left=0,Y=!1;for(let X=0;X<K+G;X++){for(let j=0;j<re;j++){const $=j*this._tmpCanvas.width*4+4*X+3;if(A.data[$]!==0){O.left=X,Y=!0;break}}if(Y)break}O.right=G,Y=!1;for(let X=K+G-1;X>=K;X--){for(let j=0;j<re;j++){const $=j*this._tmpCanvas.width*4+4*X+3;if(A.data[$]!==0){O.right=X,Y=!0;break}}if(Y)break}O.bottom=re,Y=!1;for(let X=re-1;X>=0;X--){for(let j=0;j<G;j++){const $=X*this._tmpCanvas.width*4+4*j+3;if(A.data[$]!==0){O.bottom=X,Y=!0;break}}if(Y)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:O.right-O.left+1,y:O.bottom-O.top+1},sizeClipSpace:{x:O.right-O.left+1,y:O.bottom-O.top+1},offset:{x:-O.left+K+(H||k?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-O.top+K+(H||k?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}r.TextureAtlas=g;class R{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(A){this._glyphs.push(A),this._usedPixels+=A.size.x*A.size.y}constructor(A,O,z){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],z)for(const H of z)this._glyphs.push(...H.glyphs),this._usedPixels+=H._usedPixels;this.canvas=M(A,O,O),this.ctx=(0,o.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function y(b,A,O,z){const H=A.rgba>>>24,k=A.rgba>>>16&255,K=A.rgba>>>8&255,re=O.rgba>>>24,G=O.rgba>>>16&255,Y=O.rgba>>>8&255,X=Math.floor((Math.abs(H-re)+Math.abs(k-G)+Math.abs(K-Y))/12);let j=!0;for(let $=0;$<b.data.length;$+=4)b.data[$]===H&&b.data[$+1]===k&&b.data[$+2]===K||z&&Math.abs(b.data[$]-H)+Math.abs(b.data[$+1]-k)+Math.abs(b.data[$+2]-K)<X?b.data[$+3]=0:j=!1;return j}function M(b,A,O){const z=b.createElement("canvas");return z.width=A,z.height=O,z}},160:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;let d=0,_=0,v=0,o=0;var S,C,E,p,n;function h(c){const g=c.toString(16);return g.length<2?"0"+g:g}function u(c,g){return c<g?(g+.05)/(c+.05):(c+.05)/(g+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},(function(c){c.toCss=function(g,R,y,M){return M!==void 0?`#${h(g)}${h(R)}${h(y)}${h(M)}`:`#${h(g)}${h(R)}${h(y)}`},c.toRgba=function(g,R,y,M=255){return(g<<24|R<<16|y<<8|M)>>>0},c.toColor=function(g,R,y,M){return{css:c.toCss(g,R,y,M),rgba:c.toRgba(g,R,y,M)}}})(S||(r.channels=S={})),(function(c){function g(R,y){return o=Math.round(255*y),[d,_,v]=n.toChannels(R.rgba),{css:S.toCss(d,_,v,o),rgba:S.toRgba(d,_,v,o)}}c.blend=function(R,y){if(o=(255&y.rgba)/255,o===1)return{css:y.css,rgba:y.rgba};const M=y.rgba>>24&255,b=y.rgba>>16&255,A=y.rgba>>8&255,O=R.rgba>>24&255,z=R.rgba>>16&255,H=R.rgba>>8&255;return d=O+Math.round((M-O)*o),_=z+Math.round((b-z)*o),v=H+Math.round((A-H)*o),{css:S.toCss(d,_,v),rgba:S.toRgba(d,_,v)}},c.isOpaque=function(R){return(255&R.rgba)==255},c.ensureContrastRatio=function(R,y,M){const b=n.ensureContrastRatio(R.rgba,y.rgba,M);if(b)return S.toColor(b>>24&255,b>>16&255,b>>8&255)},c.opaque=function(R){const y=(255|R.rgba)>>>0;return[d,_,v]=n.toChannels(y),{css:S.toCss(d,_,v),rgba:y}},c.opacity=g,c.multiplyOpacity=function(R,y){return o=255&R.rgba,g(R,o*y/255)},c.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(C||(r.color=C={})),(function(c){let g,R;try{const y=document.createElement("canvas");y.width=1,y.height=1;const M=y.getContext("2d",{willReadFrequently:!0});M&&(g=M,g.globalCompositeOperation="copy",R=g.createLinearGradient(0,0,1,1))}catch{}c.toColor=function(y){if(y.match(/#[\da-f]{3,8}/i))switch(y.length){case 4:return d=parseInt(y.slice(1,2).repeat(2),16),_=parseInt(y.slice(2,3).repeat(2),16),v=parseInt(y.slice(3,4).repeat(2),16),S.toColor(d,_,v);case 5:return d=parseInt(y.slice(1,2).repeat(2),16),_=parseInt(y.slice(2,3).repeat(2),16),v=parseInt(y.slice(3,4).repeat(2),16),o=parseInt(y.slice(4,5).repeat(2),16),S.toColor(d,_,v,o);case 7:return{css:y,rgba:(parseInt(y.slice(1),16)<<8|255)>>>0};case 9:return{css:y,rgba:parseInt(y.slice(1),16)>>>0}}const M=y.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(M)return d=parseInt(M[1]),_=parseInt(M[2]),v=parseInt(M[3]),o=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),S.toColor(d,_,v,o);if(!g||!R)throw new Error("css.toColor: Unsupported css format");if(g.fillStyle=R,g.fillStyle=y,typeof g.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(g.fillRect(0,0,1,1),[d,_,v,o]=g.getImageData(0,0,1,1).data,o!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:S.toRgba(d,_,v,o),css:y}}})(E||(r.css=E={})),(function(c){function g(R,y,M){const b=R/255,A=y/255,O=M/255;return .2126*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.7152*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}c.relativeLuminance=function(R){return g(R>>16&255,R>>8&255,255&R)},c.relativeLuminance2=g})(p||(r.rgb=p={})),(function(c){function g(y,M,b){const A=y>>24&255,O=y>>16&255,z=y>>8&255;let H=M>>24&255,k=M>>16&255,K=M>>8&255,re=u(p.relativeLuminance2(H,k,K),p.relativeLuminance2(A,O,z));for(;re<b&&(H>0||k>0||K>0);)H-=Math.max(0,Math.ceil(.1*H)),k-=Math.max(0,Math.ceil(.1*k)),K-=Math.max(0,Math.ceil(.1*K)),re=u(p.relativeLuminance2(H,k,K),p.relativeLuminance2(A,O,z));return(H<<24|k<<16|K<<8|255)>>>0}function R(y,M,b){const A=y>>24&255,O=y>>16&255,z=y>>8&255;let H=M>>24&255,k=M>>16&255,K=M>>8&255,re=u(p.relativeLuminance2(H,k,K),p.relativeLuminance2(A,O,z));for(;re<b&&(H<255||k<255||K<255);)H=Math.min(255,H+Math.ceil(.1*(255-H))),k=Math.min(255,k+Math.ceil(.1*(255-k))),K=Math.min(255,K+Math.ceil(.1*(255-K))),re=u(p.relativeLuminance2(H,k,K),p.relativeLuminance2(A,O,z));return(H<<24|k<<16|K<<8|255)>>>0}c.blend=function(y,M){if(o=(255&M)/255,o===1)return M;const b=M>>24&255,A=M>>16&255,O=M>>8&255,z=y>>24&255,H=y>>16&255,k=y>>8&255;return d=z+Math.round((b-z)*o),_=H+Math.round((A-H)*o),v=k+Math.round((O-k)*o),S.toRgba(d,_,v)},c.ensureContrastRatio=function(y,M,b){const A=p.relativeLuminance(y>>8),O=p.relativeLuminance(M>>8);if(u(A,O)<b){if(O<A){const k=g(y,M,b),K=u(A,p.relativeLuminance(k>>8));if(K<b){const re=R(y,M,b);return K>u(A,p.relativeLuminance(re>>8))?k:re}return k}const z=R(y,M,b),H=u(A,p.relativeLuminance(z>>8));if(H<b){const k=g(y,M,b);return H>u(A,p.relativeLuminance(k>>8))?z:k}return z}},c.reduceLuminance=g,c.increaseLuminance=R,c.toChannels=function(y){return[y>>24&255,y>>16&255,y>>8&255,255&y]}})(n||(r.rgba=n={})),r.toPaddedHex=h,r.contrastRatio=u},345:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.runAndSubscribe=r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=d=>(this._listeners.push(d),{dispose:()=>{if(!this._disposed){for(let _=0;_<this._listeners.length;_++)if(this._listeners[_]===d)return void this._listeners.splice(_,1)}}})),this._event}fire(d,_){const v=[];for(let o=0;o<this._listeners.length;o++)v.push(this._listeners[o]);for(let o=0;o<v.length;o++)v[o].call(void 0,d,_)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(d,_){return d((v=>_.fire(v)))},r.runAndSubscribe=function(d,_){return _(void 0),d((v=>_(v)))}},859:(W,r)=>{function d(_){for(const v of _)v.dispose();_.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const _ of this._disposables)_.dispose();this._disposables.length=0}register(_){return this._disposables.push(_),_}unregister(_){const v=this._disposables.indexOf(_);v!==-1&&this._disposables.splice(v,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(_){this._isDisposed||_===this._value||(this._value?.dispose(),this._value=_)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},r.toDisposable=function(_){return{dispose:_}},r.disposeArray=d,r.getDisposeArrayDisposable=function(_){return{dispose:()=>d(_)}}},485:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class d{constructor(){this._data={}}set(v,o,S){this._data[v]||(this._data[v]={}),this._data[v][o]=S}get(v,o){return this._data[v]?this._data[v][o]:void 0}clear(){this._data={}}}r.TwoKeyMap=d,r.FourKeyMap=class{constructor(){this._data=new d}set(_,v,o,S,C){this._data.get(_,v)||this._data.set(_,v,new d),this._data.get(_,v).set(o,S,C)}get(_,v,o,S){return this._data.get(_,v)?.get(o,S)}clear(){this._data.clear()}}},399:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof process<"u"&&"title"in process;const d=r.isNode?"node":navigator.userAgent,_=r.isNode?"node":navigator.platform;r.isFirefox=d.includes("Firefox"),r.isLegacyEdge=d.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(d),r.getSafariVersion=function(){if(!r.isSafari)return 0;const v=d.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(_),r.isIpad=_==="iPad",r.isIphone=_==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(_),r.isLinux=_.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(d)},385:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const _=d(399);class v{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 E=0,p=0,n=C.timeRemaining(),h=0;for(;this._i<this._tasks.length;){if(E=Date.now(),this._tasks[this._i]()||this._i++,E=Math.max(1,Date.now()-E),p=Math.max(E,p),h=C.timeRemaining(),1.5*p>h)return n-E<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-E))}ms`),void this._start();n=h}this.clear()}}class o extends v{_requestCallback(C){return setTimeout((()=>C(this._createDeadline(16))))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const E=Date.now()+C;return{timeRemaining:()=>Math.max(0,E-Date.now())}}}r.PriorityTaskQueue=o,r.IdleTaskQueue=!_.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(S){return requestIdleCallback(S)}_cancelCallback(S){cancelIdleCallback(S)}}:o,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(S){this._queue.clear(),this._queue.enqueue(S)}flush(){this._queue.flush()}}},147:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class d{constructor(){this.fg=0,this.bg=0,this.extended=new _}static toColorRGB(o){return[o>>>16&255,o>>>8&255,255&o]}static fromColorRGB(o){return(255&o[0])<<16|(255&o[1])<<8|255&o[2]}clone(){const o=new d;return o.fg=this.fg,o.bg=this.bg,o.extended=this.extended.clone(),o}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}}r.AttributeData=d;class _{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(o){this._ext=o}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(o){this._ext&=-469762049,this._ext|=o<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(o){this._ext&=-67108864,this._ext|=67108863&o}get urlId(){return this._urlId}set urlId(o){this._urlId=o}get underlineVariantOffset(){const o=(3758096384&this._ext)>>29;return o<0?4294967288^o:o}set underlineVariantOffset(o){this._ext&=536870911,this._ext|=o<<29&3758096384}constructor(o=0,S=0){this._ext=0,this._urlId=0,this._ext=o,this._urlId=S}clone(){return new _(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=_},782:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const _=d(133),v=d(855),o=d(147);class S extends o.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new o.ExtendedAttrs,this.combinedData=""}static fromCharData(E){const p=new S;return p.setFromCharData(E),p}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,_.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(E){this.fg=E[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let p=!1;if(E[v.CHAR_DATA_CHAR_INDEX].length>2)p=!0;else if(E[v.CHAR_DATA_CHAR_INDEX].length===2){const n=E[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const h=E[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(n-55296)+h-56320+65536|E[v.CHAR_DATA_WIDTH_INDEX]<<22:p=!0}else p=!0}else this.content=E[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|E[v.CHAR_DATA_WIDTH_INDEX]<<22;p&&(this.combinedData=E[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|E[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=S},855:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},133:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(d){return d>65535?(d-=65536,String.fromCharCode(55296+(d>>10))+String.fromCharCode(d%1024+56320)):String.fromCharCode(d)},r.utf32ToString=function(d,_=0,v=d.length){let o="";for(let S=_;S<v;++S){let C=d[S];C>65535?(C-=65536,o+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):o+=String.fromCharCode(C)}return o},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(d,_){const v=d.length;if(!v)return 0;let o=0,S=0;if(this._interim){const C=d.charCodeAt(S++);56320<=C&&C<=57343?_[o++]=1024*(this._interim-55296)+C-56320+65536:(_[o++]=this._interim,_[o++]=C),this._interim=0}for(let C=S;C<v;++C){const E=d.charCodeAt(C);if(55296<=E&&E<=56319){if(++C>=v)return this._interim=E,o;const p=d.charCodeAt(C);56320<=p&&p<=57343?_[o++]=1024*(E-55296)+p-56320+65536:(_[o++]=E,_[o++]=p)}else E!==65279&&(_[o++]=E)}return o}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(d,_){const v=d.length;if(!v)return 0;let o,S,C,E,p=0,n=0,h=0;if(this.interim[0]){let g=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let y,M=0;for(;(y=63&this.interim[++M])&&M<4;)R<<=6,R|=y;const b=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,A=b-M;for(;h<A;){if(h>=v)return 0;if(y=d[h++],(192&y)!=128){h--,g=!0;break}this.interim[M++]=y,R<<=6,R|=63&y}g||(b===2?R<128?h--:_[p++]=R:b===3?R<2048||R>=55296&&R<=57343||R===65279||(_[p++]=R):R<65536||R>1114111||(_[p++]=R)),this.interim.fill(0)}const u=v-4;let c=h;for(;c<v;){for(;!(!(c<u)||128&(o=d[c])||128&(S=d[c+1])||128&(C=d[c+2])||128&(E=d[c+3]));)_[p++]=o,_[p++]=S,_[p++]=C,_[p++]=E,c+=4;if(o=d[c++],o<128)_[p++]=o;else if((224&o)==192){if(c>=v)return this.interim[0]=o,p;if(S=d[c++],(192&S)!=128){c--;continue}if(n=(31&o)<<6|63&S,n<128){c--;continue}_[p++]=n}else if((240&o)==224){if(c>=v)return this.interim[0]=o,p;if(S=d[c++],(192&S)!=128){c--;continue}if(c>=v)return this.interim[0]=o,this.interim[1]=S,p;if(C=d[c++],(192&C)!=128){c--;continue}if(n=(15&o)<<12|(63&S)<<6|63&C,n<2048||n>=55296&&n<=57343||n===65279)continue;_[p++]=n}else if((248&o)==240){if(c>=v)return this.interim[0]=o,p;if(S=d[c++],(192&S)!=128){c--;continue}if(c>=v)return this.interim[0]=o,this.interim[1]=S,p;if(C=d[c++],(192&C)!=128){c--;continue}if(c>=v)return this.interim[0]=o,this.interim[1]=S,this.interim[2]=C,p;if(E=d[c++],(192&E)!=128){c--;continue}if(n=(7&o)<<18|(63&S)<<12|(63&C)<<6|63&E,n<65536||n>1114111)continue;_[p++]=n}}return p}}},776:function(W,r,d){var _=this&&this.__decorate||function(n,h,u,c){var g,R=arguments.length,y=R<3?h:c===null?c=Object.getOwnPropertyDescriptor(h,u):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(n,h,u,c);else for(var M=n.length-1;M>=0;M--)(g=n[M])&&(y=(R<3?g(y):R>3?g(h,u,y):g(h,u))||y);return R>3&&y&&Object.defineProperty(h,u,y),y},v=this&&this.__param||function(n,h){return function(u,c){h(u,c,n)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const o=d(859),S=d(97),C={trace:S.LogLevelEnum.TRACE,debug:S.LogLevelEnum.DEBUG,info:S.LogLevelEnum.INFO,warn:S.LogLevelEnum.WARN,error:S.LogLevelEnum.ERROR,off:S.LogLevelEnum.OFF};let E,p=r.LogService=class extends o.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=S.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),E=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let h=0;h<n.length;h++)typeof n[h]=="function"&&(n[h]=n[h]())}_log(n,h,u){this._evalLazyOptionalParams(u),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+h,...u)}trace(n,...h){this._logLevel<=S.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,n,h)}debug(n,...h){this._logLevel<=S.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,n,h)}info(n,...h){this._logLevel<=S.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,n,h)}warn(n,...h){this._logLevel<=S.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,n,h)}error(n,...h){this._logLevel<=S.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,n,h)}};r.LogService=p=_([v(0,S.IOptionsService)],p),r.setTraceLogger=function(n){E=n},r.traceCall=function(n,h,u){if(typeof u.value!="function")throw new Error("not supported");const c=u.value;u.value=function(...g){if(E.logLevel!==S.LogLevelEnum.TRACE)return c.apply(this,g);E.trace(`GlyphRenderer#${c.name}(${g.map((y=>JSON.stringify(y))).join(", ")})`);const R=c.apply(this,g);return E.trace(`GlyphRenderer#${c.name} return`,R),R}}},726:(W,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const d="di$target",_="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(v){return v[_]||[]},r.createDecorator=function(v){if(r.serviceRegistry.has(v))return r.serviceRegistry.get(v);const o=function(S,C,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(p,n,h){n[d]===n?n[_].push({id:p,index:h}):(n[_]=[{id:p,index:h}],n[d]=n)})(o,S,E)};return o.toString=()=>v,r.serviceRegistry.set(v,o),o}},97:(W,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const _=d(726);var v;r.IBufferService=(0,_.createDecorator)("BufferService"),r.ICoreMouseService=(0,_.createDecorator)("CoreMouseService"),r.ICoreService=(0,_.createDecorator)("CoreService"),r.ICharsetService=(0,_.createDecorator)("CharsetService"),r.IInstantiationService=(0,_.createDecorator)("InstantiationService"),(function(o){o[o.TRACE=0]="TRACE",o[o.DEBUG=1]="DEBUG",o[o.INFO=2]="INFO",o[o.WARN=3]="WARN",o[o.ERROR=4]="ERROR",o[o.OFF=5]="OFF"})(v||(r.LogLevelEnum=v={})),r.ILogService=(0,_.createDecorator)("LogService"),r.IOptionsService=(0,_.createDecorator)("OptionsService"),r.IOscLinkService=(0,_.createDecorator)("OscLinkService"),r.IUnicodeService=(0,_.createDecorator)("UnicodeService"),r.IDecorationService=(0,_.createDecorator)("DecorationService")}},T={};function N(W){var r=T[W];if(r!==void 0)return r.exports;var d=T[W]={exports:{}};return L[W].call(d.exports,d,d.exports,N),d.exports}var q={};return(()=>{var W=q;Object.defineProperty(W,"__esModule",{value:!0}),W.WebglAddon=void 0;const r=N(345),d=N(859),_=N(399),v=N(666),o=N(776);class S extends d.Disposable{constructor(E){if(_.isSafari&&(0,_.getSafariVersion)()<16){const p={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",p))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=E,this._onChangeTextureAtlas=this.register(new r.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new r.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new r.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new r.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(E){const p=E._core;if(!E.element)return void this.register(p.onWillOpen((()=>this.activate(E))));this._terminal=E;const n=p.coreService,h=p.optionsService,u=p,c=u._renderService,g=u._characterJoinerService,R=u._charSizeService,y=u._coreBrowserService,M=u._decorationService,b=u._logService,A=u._themeService;(0,o.setTraceLogger)(b),this._renderer=this.register(new v.WebglRenderer(E,g,R,y,n,M,h,A,this._preserveDrawingBuffer)),this.register((0,r.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,r.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,r.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,r.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),c.setRenderer(this._renderer),this.register((0,d.toDisposable)((()=>{const O=this._terminal._core._renderService;O.setRenderer(this._terminal._core._createRenderer()),O.handleResize(E.cols,E.rows)})))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}}W.WebglAddon=S})(),q})()))})(fu)),fu.exports}var Dv=Tv();const Yo=16e3,kv=.004,Ov=["audio/webm;codecs=opus","audio/webm","audio/mp4"];function xp(l){if(!l.length)return 0;let x=0;for(const L of l)x+=L*L;return Math.sqrt(x/l.length)}function F_(l,x=kv){return xp(l)<x}async function Bv(l){const x=new AudioContext;try{const L=await x.decodeAudioData(await l.arrayBuffer()),T=Math.max(1,Math.ceil(L.duration*Yo)),N=new OfflineAudioContext(1,T,Yo),q=N.createBufferSource();return q.buffer=L,q.connect(N.destination),q.start(),(await N.startRendering()).getChannelData(0)}finally{x.close()}}class W_{constructor(){this.stream=null,this.recorder=null,this.chunks=[]}async start(){this.stream=await navigator.mediaDevices.getUserMedia({audio:!0});const x=Ov.find(L=>MediaRecorder.isTypeSupported(L));this.recorder=new MediaRecorder(this.stream,x?{mimeType:x}:void 0),this.chunks=[],this.recorder.ondataavailable=L=>{L.data.size&&this.chunks.push(L.data)},this.recorder.start()}stop(){return new Promise(x=>{const L=this.recorder;if(!L||L.state==="inactive"){this.dispose(),x(null);return}L.onstop=()=>{const T=new Blob(this.chunks,{type:L.mimeType||"audio/webm"});if(this.dispose(),!T.size){x(null);return}Bv(T).then(x,()=>x(null))},L.stop()})}cancel(){const x=this.recorder;x&&x.state!=="inactive"&&(x.onstop=null,x.stop()),this.dispose()}dispose(){this.stream?.getTracks().forEach(x=>x.stop()),this.stream=null,this.recorder=null,this.chunks=[]}}function gs(l){const x=l.replace(/^.*@/,""),L=x.replace(/:\d+$/,"");return L.includes(":")?x:L}const Go="\x1B",q_="\x07",jv=new RegExp(Go+"\\][^"+q_+Go+"]*(?:"+q_+"|"+Go+"\\\\)","g"),Nv=new RegExp(Go+"\\[[0-9;?]*[A-Za-z]","g");function G_(l){return/[#$%>]\s*$/.test(l.replace(jv,"").replace(Nv,""))}const Hv=60,zv=200;function Uv(l){if(l.type!=="keydown"||!(l.ctrlKey||l.metaKey)||!l.shiftKey)return null;const x=l.key.toLowerCase();return x==="c"?"copy":x==="v"?"paste":null}function Xo(l){return l instanceof Error?l.message:String(l)}function Iv(l,x,L){if(x.mark(),typeof l.terminal.paste=="function"){l.terminal.paste(L);return}l.writeToPty?.(L)}function Ep(l=()=>Date.now()){let x=Number.NEGATIVE_INFINITY;return{mark(){x=l()},isDuplicate(){return l()-x<zv}}}function Pv(l,x){const L=T=>{x.isDuplicate()&&(T.preventDefault(),T.stopPropagation(),T.stopImmediatePropagation?.())};return l.addEventListener("paste",L,!0),()=>l.removeEventListener("paste",L,!0)}function $v(l,x=Ep()){return L=>{const T=Uv(L);if(!T)return!0;if(L.preventDefault(),L.stopPropagation(),T==="copy"){const N=l.terminal.getSelection();return N&&l.clipboard.copyText(N).catch(q=>{l.onError(Xo(q))}),!1}return l.clipboard.readText().then(N=>{N&&Iv(l,x,N)}).catch(N=>{l.onError(Xo(N))}),!1}}const Fv=new Set(["c","p","s"]);function Wv(l){return l?[...l].some(x=>Fv.has(x)):!0}function qv(l){const x=l.replace(/\s+/g,"");if(!/^[A-Za-z0-9+/]*={0,2}$/.test(x))return null;try{const L=atob(x),T=Uint8Array.from(L,N=>N.charCodeAt(0));return new TextDecoder().decode(T)}catch{return null}}function Gv(l){const x=l.indexOf(";");if(x===-1||!Wv(l.slice(0,x)))return null;const L=l.slice(x+1);return L==="?"||!L?null:qv(L)}function Kv(l){const x=l.terminal.parser;if(!x)return()=>{};const L=x.registerOscHandler(52,T=>{const N=Gv(T);return N!==null&&l.clipboard.copyText(N).catch(q=>{l.onError(Xo(q))}),!0});return()=>{L&&typeof L.dispose=="function"&&L.dispose()}}function Vv(l){const{terminal:x}=l;if(typeof x.onSelectionChange!="function")return()=>{};let L,T=null;const N=x.onSelectionChange(()=>{L&&clearTimeout(L),L=setTimeout(()=>{if(L=void 0,l.isCopyOnSelectEnabled&&!l.isCopyOnSelectEnabled())return;const q=x.getSelection();!q||q===T||(T=q,l.clipboard.copyText(q).catch(W=>{T=null,l.onError(Xo(W))}))},Hv)});return()=>{L&&clearTimeout(L),N&&typeof N.dispose=="function"&&N.dispose()}}function Yv(l){const x=Ep();l.terminal.attachCustomKeyEventHandler($v(l,x));const L=[Kv(l),Vv(l),l.pasteEventTarget?Pv(l.pasteEventTarget,x):()=>{}];return()=>{for(const T of L.reverse())T()}}function Xv(l){let x=!1;return{onMouseDown(L){x=L.target===L.currentTarget},onClick(L){const T=x&&L.target===L.currentTarget;x=!1,T&&l()}}}function yr(l){const x=ie.useRef(l);x.current=l;const L=ie.useRef(null);return L.current||(L.current=Xv(()=>x.current())),L.current}const Zv=250,Qv={setTimeout:(l,x)=>setTimeout(l,x),clearTimeout:l=>clearTimeout(l)};function Jv(l){const x=l.windowMs??Zv,L=l.timers??Qv;let T=null,N=null;const q=()=>{T!==null&&(L.clearTimeout(T),T=null)},W=()=>{N!==null&&L.clearTimeout(N),N=L.setTimeout(()=>{N=null},x)};return{onClick(){if(N!==null){W();return}q(),T=L.setTimeout(()=>{T=null,l.onSingleClick()},x)},onDoubleClick(){q(),W(),l.onDoubleClick()},cancel(){q(),N!==null&&(L.clearTimeout(N),N=null)}}}function Ap(l,x){const L=ie.useRef({onSingleClick:l,onDoubleClick:x});L.current={onSingleClick:l,onDoubleClick:x};const T=ie.useRef(null);T.current||(T.current=Jv({onSingleClick:()=>L.current.onSingleClick(),onDoubleClick:()=>L.current.onDoubleClick()}));const N=T.current;return ie.useEffect(()=>()=>N.cancel(),[N]),N}const Rp=25,Lp=85,Mp=60;function _u(l){return l.sessionIds.length+l.pending.length}const eg=4;function tg(l,x,L){const T=new Map(x.map(N=>[N.id,N]));return l.flatMap(N=>N.sessionIds.map(q=>T.get(q)).filter(q=>q!==void 0).slice(0,eg).map((q,W)=>({session:q,workspaceId:N.id,index:W,dormant:N.id!==L})))}function Jo(l){return{layout:l,lastSplit:l==="stack"?"split-v":l,maximizedSessionId:null}}function K_(l,x,L=[]){return{id:`ws-${crypto.randomUUID()}`,name:l,sessionIds:L,pending:[],view:Jo(x)}}function pu(l){return l<=1?"stack":l===2?"split-v":"grid"}function V_(l,x,L){return l.map(T=>{if(T.id!==x)return T;const N={...T.view,...typeof L=="function"?L(T.view):L};return{...T,view:N}})}function ig(l,x,L){return l.map(T=>T.id!==x?T.sessionIds.includes(L)?{...T,sessionIds:T.sessionIds.filter(N=>N!==L)}:T:T.sessionIds.includes(L)?T:{...T,sessionIds:[...T.sessionIds,L]})}function sg(l,x){return l.map(L=>{if(!L.sessionIds.includes(x))return L;const T=L.sessionIds.filter(N=>N!==x);return{...L,sessionIds:T,view:Au(L.view,Eu({...L,sessionIds:T}))}})}function Eu(l){return[...l.sessionIds,...l.pending.map(x=>x.sessionId)]}function Au(l,x){const L=new Set(x),T=l.activeSessionId&&L.has(l.activeSessionId)?l.activeSessionId:void 0,N=l.focusedSessionId&&L.has(l.focusedSessionId)?l.focusedSessionId:void 0,q=l.maximizedSessionId&&L.has(l.maximizedSessionId)?l.maximizedSessionId:null,W=rg(l.browsers,L);return T===l.activeSessionId&&N===l.focusedSessionId&&q===(l.maximizedSessionId??null)&&W===l.browsers?l:{...l,activeSessionId:T,focusedSessionId:N,maximizedSessionId:q,browsers:W}}function rg(l,x){if(!l)return l;const L=Object.keys(l),T=L.filter(N=>x.has(N));return T.length===L.length?l:Object.fromEntries(T.map(N=>[N,l[N]]))}function ng(l,x){const L=new Set(x.map(q=>q.id));let T=!1;const N=l.map(q=>{const W=q.sessionIds.filter(d=>L.has(d)),r=Au(q.view,Eu({...q,sessionIds:W}));return W.length===q.sessionIds.length&&r===q.view?q:(T=!0,{...q,sessionIds:W,view:r})});return T?N:l}const Ko="[A-Za-z0-9](?:[A-Za-z0-9_.]|-| ){0,48}",ag=new RegExp(`^(?:${Ko})$`);function Cu(l){return ag.test(l)}function Fo(l){let x=l.length+1;const L=new Set(l.map(T=>T.name.toLowerCase()));for(;L.has(`workspace ${x}`);)x+=1;return`Workspace ${x}`}function Y_(l,x,L){const T=L.trim();return Cu(T)?l.map(N=>N.id===x?{...N,name:T}:N):l}function lg(l,x,L,T,N=()=>`pending-${crypto.randomUUID()}`){const q=l.findIndex(C=>C.id===x);if(q<0)return{workspaces:l,created:null,copied:0,skipped:0};const W=l[q],r=new Map(L.map(C=>[C.id,C])),d=[...W.sessionIds.map(C=>r.get(C)).filter(C=>C!==void 0).map(Tp),...W.pending],_=d.filter(C=>C.kind==="ssh"),v=_.map(C=>{const{screenName:E,...p}=C;return{...p,sessionId:N()}}),o={id:`ws-${crypto.randomUUID()}`,name:T,sessionIds:[],pending:v,view:{...Jo(W.view.layout),lastSplit:W.view.lastSplit,maximizedSessionId:null}},S=[...l];return S.splice(q+1,0,o),{workspaces:S,created:o,copied:v.length,skipped:d.length-_.length}}function og(l,x){const L=x.filter(T=>l.sessionIds.includes(T.id));return L.some(T=>T.status==="connected")?"connected":L.length||l.pending.length?"detached":"empty"}function cg(l,x,L){const T=l.findIndex(d=>d.id===x),N={workspaces:l,activeWorkspaceId:L,releasedSessionIds:[]};if(T<0||l.length<2)return N;const q=l[T],W=l.filter(d=>d.id!==x),r=L===x?(W[Math.max(0,T-1)]??W[0]).id:L;return{workspaces:W,activeWorkspaceId:r,releasedSessionIds:[...q.sessionIds]}}function X_(l,x,L){return l.map(T=>{if(T.id!==x||!T.pending.some(q=>q.sessionId===L))return T;const N={...T,pending:T.pending.filter(q=>q.sessionId!==L)};return{...N,view:Au(N.view,Eu(N))}})}function hg(l,x){let L=!1;const T=l.map(N=>{if(!N.pending.length)return N;const q=[],W=[...N.sessionIds];let r=N.view,d=!1;for(const _ of N.pending){const v=x(_);if(!v){q.push(_);continue}W.includes(v)||W.push(v),r=ug(r,_.sessionId,v),d=!0}return d?(L=!0,{...N,sessionIds:W,pending:q,view:r}):N});return L?T:l}function ug(l,x,L){return l.activeSessionId!==x&&l.focusedSessionId!==x&&l.maximizedSessionId!==x?l:{...l,activeSessionId:l.activeSessionId===x?L:l.activeSessionId,focusedSessionId:l.focusedSessionId===x?L:l.focusedSessionId,maximizedSessionId:l.maximizedSessionId===x?L:l.maximizedSessionId}}const dg=1,fg=["stack","split-v","split-h","grid"],_g=["split-v","split-h","grid"];function pg(l,x,L){const T=new Map(L.map(N=>[N.id,N]));return{version:dg,activeWorkspaceId:x,workspaces:l.map(N=>({id:N.id,name:N.name,view:{layout:N.view.layout,lastSplit:N.view.lastSplit,activeSessionId:N.view.activeSessionId,focusedSessionId:N.view.focusedSessionId,maximizedSessionId:N.view.maximizedSessionId??null,browsers:N.view.browsers},members:[...N.sessionIds.map(q=>T.get(q)).filter(q=>q!==void 0).map(Tp),...N.pending]}))}}function Tp(l){const x={sessionId:l.id,kind:l.kind,name:l.name};return l.host&&(x.host=l.host),l.screenName&&(x.screenName=l.screenName),l.sshTarget&&(x.sshTarget=l.sshTarget),l.backend&&(x.backend=l.backend),x}function mg(l){if(!l||typeof l!="object"||Array.isArray(l))return;const x={};for(const[L,T]of Object.entries(l)){if(!L||!T||typeof T!="object")continue;const N=T;if(typeof N.open!="boolean")continue;const q=typeof N.ratio=="number"&&Number.isFinite(N.ratio)&&N.ratio>=Rp&&N.ratio<=Lp?N.ratio:void 0;x[L]=q===void 0?{open:N.open}:{open:N.open,ratio:q}}return Object.keys(x).length?x:void 0}function vg(l,x){const L=l.workspaces.map(N=>{const q=fg.find(r=>r===N.view?.layout)??x,W=Jo(q);return{id:N.id,name:N.name,sessionIds:[],pending:[...N.members??[]],view:{...W,lastSplit:_g.find(r=>r===N.view?.lastSplit)??W.lastSplit,activeSessionId:N.view?.activeSessionId,focusedSessionId:N.view?.focusedSessionId,maximizedSessionId:N.view?.maximizedSessionId??null,browsers:mg(N.view?.browsers)}}}),T=L.some(N=>N.id===l.activeWorkspaceId)?l.activeWorkspaceId:L[0]?.id;return{workspaces:L,activeWorkspaceId:T}}function Ie({name:l,className:x=""}){const L={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",className:`icon-svg ${x}`.trim(),"aria-hidden":!0};switch(l){case"plus":return m.jsx("svg",{...L,children:m.jsx("path",{d:"M12 5v14M5 12h14"})});case"panel-left":return m.jsxs("svg",{...L,children:[m.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),m.jsx("path",{d:"M9 4v16"})]});case"panel-left-open":return m.jsxs("svg",{...L,children:[m.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),m.jsx("path",{d:"M9 4v16M6 9l2 3-2 3"})]});case"grid":return m.jsxs("svg",{...L,children:[m.jsx("rect",{x:"4",y:"4",width:"7",height:"7",rx:"1"}),m.jsx("rect",{x:"13",y:"4",width:"7",height:"7",rx:"1"}),m.jsx("rect",{x:"4",y:"13",width:"7",height:"7",rx:"1"}),m.jsx("rect",{x:"13",y:"13",width:"7",height:"7",rx:"1"})]});case"sessions":return m.jsx("svg",{...L,children:m.jsx("path",{d:"M4 7h16M4 12h16M4 17h10"})});case"terminal":return m.jsxs("svg",{...L,children:[m.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),m.jsx("path",{d:"M7 9l3 3-3 3M13 15h4"})]});case"ssh":return m.jsx("svg",{...L,children:m.jsx("path",{d:"M7 17l5-5-5-5M12 17h7"})});case"history":return m.jsxs("svg",{...L,children:[m.jsx("path",{d:"M4 12a8 8 0 1 0 2.3-5.7L4 8.5M4 4v4.5h4.5"}),m.jsx("path",{d:"M12 7v5l3 2"})]});case"spark":return m.jsx("svg",{...L,children:m.jsx("path",{d:"M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8L12 3z"})});case"settings":return m.jsxs("svg",{...L,children:[m.jsx("circle",{cx:"12",cy:"12",r:"3"}),m.jsx("path",{d:"M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9c.3.6.9 1 1.6 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z"})]});case"sun":return m.jsxs("svg",{...L,children:[m.jsx("circle",{cx:"12",cy:"12",r:"4"}),m.jsx("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]});case"moon":return m.jsx("svg",{...L,children:m.jsx("path",{d:"M20.5 15.5A8.5 8.5 0 0 1 8.5 3.5 8.5 8.5 0 1 0 20.5 15.5z"})});case"stack":return m.jsx("svg",{...L,children:m.jsx("rect",{x:"5",y:"5",width:"14",height:"14",rx:"1.5"})});case"maximize":return m.jsx("svg",{...L,children:m.jsx("path",{d:"M8 4H4v4M16 4h4v4M4 16v4h4M20 16v4h-4"})});case"restore":return m.jsx("svg",{...L,children:m.jsx("path",{d:"M8 8h12v12H8zM4 16V4h12"})});case"chevron-left":return m.jsx("svg",{...L,children:m.jsx("path",{d:"M15 5l-7 7 7 7"})});case"chevron-right":return m.jsx("svg",{...L,children:m.jsx("path",{d:"M9 5l7 7-7 7"})});case"split-v":return m.jsxs("svg",{...L,children:[m.jsx("rect",{x:"4",y:"5",width:"7",height:"14",rx:"1"}),m.jsx("rect",{x:"13",y:"5",width:"7",height:"14",rx:"1"})]});case"split-h":return m.jsxs("svg",{...L,children:[m.jsx("rect",{x:"4",y:"4",width:"16",height:"7",rx:"1"}),m.jsx("rect",{x:"4",y:"13",width:"16",height:"7",rx:"1"})]});case"x":return m.jsx("svg",{...L,children:m.jsx("path",{d:"M6 6l12 12M18 6L6 18"})});case"mic":return m.jsxs("svg",{...L,children:[m.jsx("rect",{x:"9",y:"2.5",width:"6",height:"12",rx:"3"}),m.jsx("path",{d:"M5 11.5a7 7 0 0 0 14 0"}),m.jsx("path",{d:"M12 18.5V21"})]});case"check":return m.jsx("svg",{...L,children:m.jsx("path",{d:"M5 13l4.5 4.5L19 7"})});case"transfer":return m.jsxs("svg",{...L,children:[m.jsx("path",{d:"M8 20V6M8 6L4.5 9.5M8 6l3.5 3.5"}),m.jsx("path",{d:"M16 4v14M16 18l3.5-3.5M16 18l-3.5-3.5"})]});case"ports":return m.jsxs("svg",{...L,children:[m.jsx("rect",{x:"2.5",y:"8.5",width:"5",height:"7",rx:"1"}),m.jsx("rect",{x:"16.5",y:"8.5",width:"5",height:"7",rx:"1"}),m.jsx("path",{d:"M7.5 12h9M14 9.5l2.5 2.5L14 14.5"})]});case"port-plus":return m.jsxs("svg",{...L,children:[m.jsx("rect",{x:"2.5",y:"8.5",width:"5",height:"7",rx:"1"}),m.jsx("path",{d:"M7.5 12h7"}),m.jsx("path",{d:"M18.5 8v8M14.5 12h8"})]});case"folder":return m.jsx("svg",{...L,children:m.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6h4l2 2.5h7A1.5 1.5 0 0 1 19 10v7.5A1.5 1.5 0 0 1 17.5 19h-13A1.5 1.5 0 0 1 3 17.5z"})});case"file":return m.jsxs("svg",{...L,children:[m.jsx("path",{d:"M6 3.5h7L18 8v12.5H6z"}),m.jsx("path",{d:"M13 3.5V8h5"})]});case"link":return m.jsxs("svg",{...L,children:[m.jsx("path",{d:"M10 13a4 4 0 0 0 5.7 0l2.3-2.3a4 4 0 0 0-5.7-5.7L11 6.3"}),m.jsx("path",{d:"M14 11a4 4 0 0 0-5.7 0L6 13.3a4 4 0 0 0 5.7 5.7L13 17.7"})]});case"folder-plus":return m.jsxs("svg",{...L,children:[m.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6h4l2 2.5h7A1.5 1.5 0 0 1 19 10v7.5A1.5 1.5 0 0 1 17.5 19h-13A1.5 1.5 0 0 1 3 17.5z"}),m.jsx("path",{d:"M11 11v5M8.5 13.5h5"})]});case"trash":return m.jsx("svg",{...L,children:m.jsx("path",{d:"M4.5 7h15M9 7V4.5h6V7M6.5 7l1 13h9l1-13"})});case"pencil":return m.jsx("svg",{...L,children:m.jsx("path",{d:"M4 20h4L20 8l-4-4L4 16z"})});case"refresh":return m.jsx("svg",{...L,children:m.jsx("path",{d:"M20 12a8 8 0 1 1-2.3-5.7L20 8.5M20 4v4.5h-4.5"})});case"arrow-up":return m.jsx("svg",{...L,children:m.jsx("path",{d:"M12 20V4M12 4l-6 6M12 4l6 6"})});case"arrow-down":return m.jsx("svg",{...L,children:m.jsx("path",{d:"M12 4v16M12 20l-6-6M12 20l6-6"})});case"level-up":return m.jsxs("svg",{...L,children:[m.jsx("path",{d:"M5 12l7-7 7 7"}),m.jsx("path",{d:"M12 5v14"})]});case"help":return m.jsxs("svg",{...L,children:[m.jsx("circle",{cx:"12",cy:"12",r:"9"}),m.jsx("path",{d:"M9.4 9a2.7 2.7 0 1 1 3.9 2.4c-.8.5-1.3 1-1.3 1.9v.4"}),m.jsx("path",{d:"M12 17.2h.01"})]});case"copy":return m.jsxs("svg",{...L,children:[m.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),m.jsx("path",{d:"M15 5.5A1.5 1.5 0 0 0 13.5 4H5.5A1.5 1.5 0 0 0 4 5.5v8A1.5 1.5 0 0 0 5.5 15"})]});case"send-right":return m.jsxs("svg",{...L,children:[m.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),m.jsx("path",{d:"M8 12h7"}),m.jsx("path",{d:"M12.5 9l2.5 3-2.5 3"})]});case"info":return m.jsxs("svg",{...L,children:[m.jsx("circle",{cx:"12",cy:"12",r:"9"}),m.jsx("path",{d:"M12 11v5"}),m.jsx("path",{d:"M12 8h.01"})]});default:return m.jsx("span",{className:"icon","aria-hidden":"true",children:"•"})}}function Ru(l){if(!l||l.kind!=="ssh")return null;const x=l.sshTarget||l.host;return x&&x!=="local"?x:null}function gg(l){return l?Ru(l)?{available:!0,reason:`Transfer files with ${l.host}`}:{available:!1,reason:`${l.name} is a local session — SFTP needs an SSH connection`}:{available:!1,reason:"Open an SSH session to transfer files"}}function Jn(l){return l.kind==="directory"||l.kind==="symlink"}function Z_(l,x,L=!1){return l.filter(T=>x.has(T.name)&&(L||T.kind!=="directory"))}function Q_(l,x,L="file"){return x===0?l:`${l} ${x} ${x===1?L:`${L}s`}`}function J_(l,x,L,T,N){if(T&&N){const W=N.indexOf(T),r=N.indexOf(x);if(W>=0&&r>=0){const d=L?new Set(l):new Set,_=Math.min(W,r),v=Math.max(W,r);for(const o of N.slice(_,v+1))d.add(o);return d}}if(!L)return new Set([x]);const q=new Set(l);return q.has(x)?q.delete(x):q.add(x),q}const Dp=["\\\\wsl.localhost\\","\\\\wsl$\\"];function Sg(l){if(!l)return null;if(l.kind==="ssh")return"posix";switch(l.backend){case"powershell":case"pwsh":return"powershell";case"cmd":return"cmd";case"bash":case"zsh":case"fish":case"sh":case"wsl":case"screen":return"posix";default:return null}}function Lu(l){return!!(l&&l.kind==="local"&&l.backend==="wsl"&&l.wslDistribution)}function bg(l,x){const T=x.replace(/\/+$/,"").split("/").filter(Boolean),N=T.length?T.join("\\"):".";return`${Dp[0]}${l}\\${N}`}function yg(l,x){const L=x.replace(/\//g,"\\");for(const T of Dp){const N=`${T}${l}`;if(!L.toLowerCase().startsWith(N.toLowerCase()))continue;return`/${L.slice(N.length).replace(/^\\+/,"").split("\\").filter(r=>r&&r!==".").join("/")}`}return null}function Cg(l){return l?l.kind==="ssh"?"posix":Lu(l)?"unc":l.backend===void 0?null:l.host==="local"&&/^[A-Za-z]:/.test(l.cwd??"")?"windows":"posix":null}function ep(l,x){if(!l)return null;const L=xg(l.cwd,x);return L?Lu(l)?L.startsWith("/")?bg(l.wslDistribution,L):null:L:null}function wg(l,x){const L=ep(l,x);return L||(!l||!x?null:ep({...l,cwd:x},x))}function tp(l,x){return l?Lu(l)?yg(l.wslDistribution,x):x:null}function xg(l,x){return l?l==="~"?x??null:l.startsWith("~/")?x?`${x.replace(/\/+$/,"")}/${l.slice(2)}`:null:l:null}function Eg(l,x){if(x==="posix"){const r=l.replace(/\/+$/,"");if(!r||r==="")return null;const d=r.lastIndexOf("/");return d<0?null:d===0?"/":r.slice(0,d)}if(x==="windows"){const r=l.replace(/[\\/]+$/,"");if(/^[A-Za-z]:$/.test(r))return null;const d=Math.max(r.lastIndexOf("\\"),r.lastIndexOf("/"));if(d<0)return null;const _=r.slice(0,d);return/^[A-Za-z]:$/.test(_)?`${_}\\`:_}const T=l.replace(/\//g,"\\").replace(/\\+$/,"").match(/^(\\\\[^\\]+\\[^\\]+)(?:\\(.*))?$/);if(!T)return null;const[,N,q=""]=T,W=q.split("\\").filter(r=>r&&r!==".");return W.length?(W.pop(),W.length?`${N}\\${W.join("\\")}`:`${N}\\.`):null}const Ag=new RegExp(`[
|
|
75
|
+
\r]`);function Rg(l,x){return x?Ag.test(x)?{refused:"That directory name contains a line break, which cannot be typed safely."}:l==="posix"?{command:`cd '${x.split("'").join(String.raw`'\''`)}'`}:l==="powershell"?{command:`Set-Location -LiteralPath '${x.split("'").join("''")}'`}:x.includes('"')?{refused:"Command Prompt cannot quote a directory name containing a double quote."}:{command:`cd /d "${x}"`}:{refused:"That directory has no path."}}function Lg(l,x,L){return L==="posix"?l==="/"?`/${x}`:`${l.replace(/\/+$/,"")}/${x}`:`${l.replace(/\\\.$/,"").replace(/[\\/]+$/,"")}\\${x}`}function Mg({session:l,path:x,unanchored:L=!1,pathKind:T,shellPath:N,list:q,question:W,onOpen:r,onBrowse:d,onClose:_}){const[v,o]=ie.useState({phase:"idle"}),S=ie.useCallback(h=>{let u=!1;return o({phase:"loading",path:h??""}),q(h??void 0).then(c=>{u||o({phase:"ready",path:h??c.path,listing:c})}).catch(c=>{u||o({phase:"failed",path:h??"",message:c instanceof Error?c.message:String(c)})}),()=>{u=!0}},[q]);ie.useEffect(()=>{if(!x&&!L){o({phase:"idle"});return}return S(x)},[x,L,S]);const C=v.phase==="ready"?v.listing.path:x,E=C?Eg(C,T):null,n=[...v.phase==="ready"?v.listing.entries:[]].sort((h,u)=>{const c=Jn(h)?0:1,g=Jn(u)?0:1;return c===g?h.name.localeCompare(u.name):c-g});return m.jsxs("div",{className:"pane-browser","aria-label":`Directories on ${l.host}`,children:[m.jsxs("div",{className:"pane-browser-head",children:[m.jsx("span",{className:"pane-browser-path",title:C??"",children:N??C??"connecting…"}),m.jsxs("span",{className:"pane-browser-actions",children:[m.jsx("button",{type:"button",className:"pane-browser-icon",disabled:v.phase!=="ready"&&v.phase!=="failed",onClick:()=>S(C??x),title:"Refresh","aria-label":"Refresh",children:m.jsx(Ie,{name:"refresh"})}),m.jsx("button",{type:"button",className:"pane-browser-icon",onClick:_,title:"Close the browser","aria-label":"Close the browser",children:m.jsx(Ie,{name:"x"})})]})]}),m.jsx("div",{className:"pane-browser-list",children:W&&v.phase==="loading"?m.jsxs("p",{className:"pane-browser-note pane-browser-asking",children:[W,m.jsx("br",{}),"Answer it in the transfer panel (⇅), then refresh."]}):v.phase==="idle"?m.jsx("p",{className:"pane-browser-note",children:"This pane has not said where it is yet. Run a command, or add shell integration in Settings."}):v.phase==="failed"?m.jsx("p",{className:"pane-browser-note pane-browser-error",children:v.message}):m.jsxs(m.Fragment,{children:[E?m.jsx(ip,{label:"..",icon:"level-up",target:E,navigable:!0,className:"pane-browser-parent",onOpen:r,onBrowse:d},".."):null,n.map(h=>m.jsx(ip,{label:h.name,icon:Jn(h)?"folder":"file",target:Lg(C??"",h.name,T),navigable:Jn(h),link:h.kind==="symlink",onOpen:r,onBrowse:d},h.name)),v.phase==="ready"&&!n.length?m.jsx("p",{className:"pane-browser-note",children:"Nothing here."}):null,v.phase==="loading"?m.jsx("p",{className:"pane-browser-note",children:"Listing…"}):null]})}),m.jsxs("div",{className:"pane-browser-foot",children:[m.jsx("small",{children:"Double-click a folder to take the shell there."}),m.jsx("button",{type:"button",className:"pane-browser-send",disabled:!C,onClick:()=>C&&r(C),title:"Take the shell to this directory","aria-label":"Take the shell to this directory",children:m.jsx(Ie,{name:"send-right"})})]})]})}function ip({label:l,icon:x,target:L,navigable:T,link:N,className:q="",onOpen:W,onBrowse:r}){const d=Ap(()=>T&&r(L),()=>T&&W(L));return m.jsxs("button",{type:"button",className:`pane-browser-row ${T?"":"pane-browser-file"} ${q}`.trim(),disabled:!T,onClick:d.onClick,onDoubleClick:d.onDoubleClick,onKeyDown:_=>{_.key!=="Enter"||!T||(_.preventDefault(),d.cancel(),W(L))},title:T?`${l} — double-click to take the shell there`:l,children:[m.jsx(Ie,{name:x}),m.jsx("span",{className:"pane-browser-name",children:l}),N?m.jsx("span",{className:"pane-browser-kind",children:"link"}):null]})}const wr=[{action:"toggle-help",chord:"Ctrl+Shift+/",description:"this help panel"},{action:"new-terminal",chord:"Ctrl+Shift+T",description:"new local terminal in the current workspace"},{action:"new-workspace",chord:"Ctrl+Shift+N",description:"new workspace"},{action:"toggle-overview",chord:"Ctrl+Shift+O",description:"session overview"},{action:"toggle-layout",chord:"Ctrl+Shift+L",description:"fold to a single pane, or back to the last split"},{action:"toggle-sidebar",chord:"Ctrl+Shift+B",description:"toggle sessions sidebar"},{action:"history-palette",chord:"Ctrl+Shift+R",description:"ranked command history palette"},{action:"ask-ai",chord:"Ctrl+Shift+A",description:"ask the AI endpoint for a command"},{action:"toggle-settings",chord:"Ctrl+Shift+,",description:"settings"}],Mu=[{chord:"Ctrl+Shift+C",description:"copy the terminal selection",reason:"the terminal uses it to copy"},{chord:"Ctrl+Shift+V",description:"paste into the focused terminal",reason:"the terminal uses it to paste"}],Tg=[{chord:"Ctrl+Shift+O",owner:"Teams, for its camera toggle while a call is running"},{chord:"Ctrl+Shift+M",owner:"Teams, for mute while a call is running"}],Dg=[[/^Key([A-Z])$/,l=>l[1]],[/^Digit([0-9])$/,l=>l[1]],[/^F([1-9]|1[0-2])$/,l=>`F${l[1]}`],[/^Comma$/,()=>","],[/^Period$/,()=>"."],[/^Slash$/,()=>"/"],[/^Semicolon$/,()=>";"],[/^Quote$/,()=>"'"],[/^BracketLeft$/,()=>"["],[/^BracketRight$/,()=>"]"],[/^Minus$/,()=>"-"],[/^Equal$/,()=>"="],[/^Backquote$/,()=>"`"],[/^(Space|Enter|Tab|Backspace|Home|End|PageUp|PageDown|Insert|Delete)$/,l=>l[1]],[/^Arrow(Up|Down|Left|Right)$/,l=>l[1]]];function kg(l){for(const[x,L]of Dg){const T=x.exec(l);if(T)return L(T)}return null}function kp(l){const x=l.ctrlKey||l.metaKey,L=!!l.altKey;if(!x||!(l.shiftKey||L))return null;const T=kg(l.code);return T?["Ctrl",...L?["Alt"]:[],...l.shiftKey?["Shift"]:[],T].join("+"):null}const Og=/^([A-Z]|[0-9]|F([1-9]|1[0-2])|[,./;'\[\]\-=`]|Space|Enter|Tab|Backspace|Home|End|PageUp|PageDown|Insert|Delete|Up|Down|Left|Right)$/;function Op(l){if(typeof l!="string"||!l||l.length>40)return!1;const x=l.split("+"),L=x.pop();if(!Og.test(L)||x[0]!=="Ctrl")return!1;const T=x.slice(1).join("+");return T==="Shift"||T==="Alt"||T==="Alt+Shift"}const Zo=Object.freeze(Object.fromEntries(wr.map(l=>[l.action,l.chord]))),Bp=/^Ctrl\+Shift\+([1-9])$/;function jp(l,x,L={}){if(!Op(l))return"A shortcut needs Ctrl and at least one of Shift or Alt, so a shell keeps Ctrl+C and Ctrl+R for itself.";const T=Mu.find(q=>q.chord===l);if(T)return`${l} is reserved: ${T.reason}.`;if(Bp.test(l))return`${l} switches to a workspace by position.`;const N=L[l];if(N&&N!==x){const q=wr.find(W=>W.action===N)?.description??N;return`${l} is already ${q}.`}return null}function Tu(l={}){const x={...Zo},L=[],T=new Map;for(const{action:N}of wr){const q=l?.[N];if(typeof q!="string"||!q||q===x[N])continue;const W=jp(q,N);if(W){L.push({action:N,chord:q,reason:W});continue}T.set(N,q)}for(const[N,q]of T)x[N]=q;for(const{action:N}of[...wr].reverse()){const q=x[N],W=Object.entries(x).find(([d,_])=>d!==N&&_===q);if(!W||!T.has(N))continue;x[N]=Zo[N];const r=wr.find(d=>d.action===W[0])?.description??W[0];L.push({action:N,chord:q,reason:`${q} is already ${r}.`})}return{chords:x,rejected:L}}const ec=Tu();function yi(l,x=ec){return x.chords[l]??Zo[l]}function Bg(l,x=ec){return yi(l,x)!==Zo[l]}function jg(l,x=ec){if(l.inTextField)return null;const L=kp(l);if(!L)return null;const T=Bp.exec(L);if(T)return{action:"switch-workspace",position:Number(T[1])};for(const[N,q]of Object.entries(x.chords))if(q===L)return{action:N};return null}const Ng=["help","transfer","settings","voiceReview","overview","suggest","modal","palette","history"];function Hg(l){return Ng.find(x=>l[x])??null}function zg(l=ec){return[...wr.map(({action:x,description:L})=>({chord:yi(x,l),description:L})),{chord:"Ctrl+Shift+1 … 9",description:"switch to a workspace by position"},...Mu.map(x=>({chord:x.chord,description:x.description})),{chord:"Esc",description:"close whatever is open, or cancel a recording"}]}const Ug=40;function Np(l){if(typeof l!="string")return null;const x=l.trim();return!x||x.length>Ug?null:x.startsWith("v")||x.startsWith("V")?x:`v${x}`}function Hp(l){const x=Np(l);return x?`ZeroG Terminal ${x}`:"ZeroG Terminal"}const Ig=l=>[{title:"Workspaces",body:"The boxes beside the wordmark are workspaces, each holding its own panes, layout, focused terminal and maximized pane. Drag them to reorder, which also reorders what Ctrl+Shift+1 to 9 switch to, and right-click one for rename, duplicate, move and close. Duplicating copies the layout and brings each SSH pane across as one to reconnect; a local shell belongs to a process on this machine, so it is not copied. Switching to one restores the arrangement you left. They survive a relaunch: local terminals reattach, and SSH panes come back as ghost rows that reconnect when clicked."},{title:"Panes and layouts",body:"Up to four panes per workspace, as a stack, two splits, or a grid. Drag the dividers to resize, double-click one to even it up, and maximize a pane without losing the others."},{title:"Sessions",body:"Local shells — Bash, PowerShell, Command Prompt, WSL, Git Bash — and SSH hosts. Persistent sessions use screen where it is available, so a crash or a closed lid does not end the work. A WSL pane starts in the distribution’s own home directory."},{title:"The directory browser",body:"The folder button in a pane’s title bar splits that pane and lists where its shell is standing. Single-click to look, double-click to take the shell there, or use the button in the corner to send it to whatever is on screen. It works on SSH panes and local ones, WSL included, and follows a cd you type by hand."},{title:"Shared ports",body:"The Ports view on the rail forwards a port over SSH in either direction, VS Code style. Each tunnel is its own connection, so a host needs no terminal open first, and ports bind to loopback unless you widen them."},{title:"File transfer",body:"The ⇅ button above the panes opens SFTP for the active SSH session: this computer on the left, the host on the right, opening at the directory that shell is in. Upload, download, new folder, rename, delete."},{title:"Command history",body:`${yi("history-palette",l)} ranks the commands you have run by directory, host, recency, frequency and whether they worked. Off until you turn it on in Settings, and it refuses to store anything that looks like a credential.`},{title:"AI suggestions and voice",body:"Ask for a command in plain words and approve it before it runs, using any OpenAI-compatible endpoint you point at in Settings. The microphone in a pane’s title bar types what you say into that terminal without running it."},{title:"The proceed button",body:"The tick in a pane’s title bar sends a phrase you choose — “OK, proceed” by default — for waving an agent on without typing the same reply again."}];function Pg({version:l,bindings:x,onClose:L}){const T=Tg.filter(N=>Object.values(x.chords).includes(N.chord));return m.jsx("div",{className:"modal-layer",role:"dialog","aria-modal":"true","aria-label":"Help",children:m.jsxs("div",{className:"help-card",children:[m.jsxs("div",{className:"modal-head",children:[m.jsxs("div",{children:[m.jsx("span",{className:"eyebrow",children:"HELP"}),m.jsx("h2",{children:Hp(l)})]}),m.jsx("button",{type:"button",className:"close-button",onClick:L,children:"Esc"})]}),m.jsxs("div",{className:"help-body",children:[m.jsxs("section",{className:"help-keys","aria-label":"Keyboard shortcuts",children:[m.jsx("h3",{children:"Keyboard"}),m.jsx("table",{children:m.jsx("tbody",{children:zg(x).map(N=>m.jsxs("tr",{children:[m.jsx("th",{scope:"row",children:m.jsx("kbd",{children:N.chord})}),m.jsx("td",{children:N.description})]},N.chord))})}),m.jsxs("p",{className:"help-note",children:[m.jsx(Ie,{name:"info"}),m.jsxs("span",{children:["Only chords with Ctrl and Shift or Alt are claimed, so a shell keeps Ctrl+C, Ctrl+R, Ctrl+L and Ctrl+A for itself. If one of these does nothing, something outside ZeroG has taken it first — Windows uses Ctrl and Shift together to switch keyboard layout when more than one is installed",T.length?", and ":". ",T.map((N,q)=>m.jsxs(en.Fragment,{children:[q>0?"; ":"",m.jsx("kbd",{children:N.chord})," is also ",N.owner]},N.chord)),T.length?". ":"","Any of them can be moved in Settings, and every one has a button that does the same job."]})]})]}),m.jsxs("section",{className:"help-features","aria-label":"Features",children:[m.jsx("h3",{children:"What is here"}),m.jsx("dl",{children:Ig(x).map(N=>m.jsxs(en.Fragment,{children:[m.jsx("dt",{children:N.title}),m.jsx("dd",{children:N.body})]},N.title))})]})]}),m.jsx("small",{className:"help-foot",children:"The README covers all of this in more detail, including what is stored on this machine and what is refused."})]})})}function Cr(l,x){return x.startsWith("/")?x:l==="/"?`/${x}`:`${l.replace(/\/+$/,"")}/${x}`}function $g(l){const x=l.replace(/\/+$/,""),L=x.lastIndexOf("/");return L<=0?"/":x.slice(0,L)}function zp(l){return/^[A-Za-z]:/.test(l)||l.startsWith("\\\\")||l.includes("\\")}function Yn(l,x){const L=zp(l)?"\\":"/";return`${l.replace(/[\\/]+$/,"")}${L}${x}`}function Fg(l){const x=zp(l),L=l.replace(/[\\/]+$/,""),T=Math.max(L.lastIndexOf("/"),L.lastIndexOf("\\"));if(T<0)return l;if(!x)return T===0?"/":L.slice(0,T);const N=L.slice(0,T);return/^[A-Za-z]:$/.test(N)?`${N}\\`:N||"\\"}function Wg(l){const x=l.split(/[\\/]/).filter(Boolean);return x[x.length-1]??l}function qg(l){if(l.kind==="directory")return"—";const x=["B","KB","MB","GB","TB"];let L=l.size,T=0;for(;L>=1024&&T<x.length-1;)L/=1024,T+=1;return`${T===0?L:L.toFixed(L<10?1:0)} ${x[T]}`}function Gg(l){if(!l)return"";const x=l.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/);if(!x)return l;const[,L,T,N,q,W]=x;return`${L}-${T}-${N} ${q}:${W}`}const tn="\x1B",Qo="\x07",Kg=new RegExp(tn+"\\]7;([^"+Qo+tn+"]*)(?:"+Qo+"|"+tn+"\\\\)","g"),Vg=new RegExp(tn+"\\][^"+Qo+tn+"]*(?:"+Qo+"|"+tn+"\\\\)","g"),Yg=new RegExp(tn+"\\[[0-9;?]*[ -/]*[@-~]","g");function Xg(l){const x=l.match(/^file:\/\/[^/]*(\/.*)$/);if(!x)return null;try{const L=decodeURIComponent(x[1]);return L.includes("\0")?null:L}catch{return null}}function Zg(l){const L=l.replace(Vg,"").replace(Yg,"").replace(/\r/g,`
|
|
76
|
+
`).split(`
|
|
77
|
+
`).filter(W=>W.trim()),T=L[L.length-1];if(!T)return null;const N=T.match(/(?:^|[:\s])(~|~\/[^\s:]*|\/[^\s:]*)\s*[#$%>]\s*$/);return N?N[1].replace(/\/+$/,"")||"/":null}function Qg(l){let x=null;for(const T of l.matchAll(Kg))x=T[1];if(x){const T=Xg(x);if(T)return{path:T,source:"osc7"}}const L=Zg(l);return L?{path:L,source:"prompt"}:null}function Up(l){return!l||l==="~"||l==="~/"?{}:l.startsWith("/")?{absolute:l}:l.startsWith("~/")?{homeRelative:l.slice(2)}:{}}const Jg=/connection is closed|not connected|no such connection/i;function e0(l,x){const L=new Map,T=new Map,N=new Map;function q(){const _=l();if(!_)throw new Error("The terminal bridge is not available.");return _}async function W(_,v=!1){v&&(T.delete(_.id),N.delete(_.id));const o=T.get(_.id);if(o)return o;const S=N.get(_.id);if(S!==void 0)return S;const C=Ru(_);if(!C)throw new Error(`${_.name} has no SSH host to list.`);const E=q().sftpOpen(C).then(p=>{const n={handle:p.id,home:p.cwd};return T.set(_.id,n),x?.(_.id,p.cwd),n}).finally(()=>{N.delete(_.id)});return N.set(_.id,E),E}function r(_,v){if(!_)return;const o=Up(_);return o.absolute?o.absolute:o.homeRelative?Cr(v,o.homeRelative):v}async function d(_,v){const o=await W(_);try{return await q().sftpList(o.handle,r(v,o.home))}catch(S){const C=S instanceof Error?S.message:String(S);if(!Jg.test(C))throw S;const E=await W(_,!0);return await q().sftpList(E.handle,r(v,E.home))}}return{listerFor(_){const v=L.get(_.id);if(v)return v;const o=S=>_.kind==="ssh"?d(_,S):Promise.resolve().then(()=>q().listLocalDirectory(S));return L.set(_.id,o),o},homeFor(_){return T.get(_)?.home},async learnHome(_){if(_.kind!=="ssh")return;const v=T.get(_.id);return v?v.home:(await W(_)).home},forget(_){L.delete(_),T.delete(_),N.delete(_)}}}function t0(l,x){if(!l)return;const L=gs(l);if(L)return x.find(T=>gs(T.hostName??"")===L||T.alias===L)}function i0(l){return l.screenName?l.screenName:l.backend==="screen"?l.name:void 0}function s0(l,x,L){return L.find(T=>T.screenName===l&&T.kind===x)??L.find(T=>T.screenName===l)}function mu(l,x,L){if(l.id){const q=x.find(W=>W.id===l.id);if(q)return{kind:"attach",sessionId:q.id}}const T=i0(l);if(T){const q=s0(T,l.kind,x);if(q)return{kind:"attach",sessionId:q.id};if(l.kind==="local")return{kind:"unavailable",reason:`No local screen session named ${T} is running`};const W=t0(l.host,L);if(W)return{kind:"attach-remote-screen",connection:W,screenName:T,name:l.name};const r=l.sshTarget||l.host;return r?{kind:"create-ssh",target:r,name:l.name,screenCommand:`screen -x ${T}`}:{kind:"unavailable",reason:`No host recorded for ${l.name}`}}if(l.kind==="local")return{kind:"unavailable",reason:`${l.name} was not persistent and did not survive`};const N=l.sshTarget||l.host;return N?{kind:"create-ssh",target:N,name:l.name}:{kind:"unavailable",reason:`No host recorded for ${l.name}`}}function r0(l){const x=new Map;for(const L of l){const T=gs(L.target)||L.target,N=x.get(T)??{host:T,forwards:[]};N.forwards.push(L),x.set(T,N)}return[...x.values()]}function n0(l){return l.status==="open"?"connected":l.status==="error"?"error":l.status==="connecting"?"detached":""}function sp(l){const x=`${l.destinationHost||"localhost"}:${l.destinationPort}`;return l.direction==="local"?`${Qr(l)} → ${x}`:`${Qr(l)} → ${x} here`}function Qr(l){if(l.direction==="local")return`${l.bind==="all"?"0.0.0.0":"localhost"}:${l.listenPort}`;const x=gs(l.target)||l.target;return`${l.bind==="all"?`${x} (all)`:x}:${l.listenPort}`}function a0(l){return l.bind==="all"}function l0(l,x){const L=x.find(T=>T.id===l.id||T.listenPort!==l.listenPort||T.direction!==l.direction?!1:l.direction==="local"?!0:gs(T.target)===gs(l.target));return L?l.direction==="local"?`Port ${l.listenPort} is already shared from ${L.target}.`:`Port ${l.listenPort} is already shared to ${L.target}.`:null}function _l(l,x){const L=l.findIndex(N=>N.id===x.id);if(L<0)return[...l,x];const T=[...l];return T[L]=x,T}function o0(l){return{version:1,forwards:l.map(({status:x,message:L,...T})=>T)}}function c0(l){return l.forwards.map(x=>({...x,status:"idle"}))}function h0({session:l,target:x,api:L,onClose:T,backdrop:N}){const[q,W]=ie.useState(null),[r,d]=ie.useState(null),[_,v]=ie.useState(null),[o,S]=ie.useState({local:!0,remote:!0}),[C,E]=ie.useState({local:new Set,remote:new Set}),[p,n]=ie.useState({local:"",remote:""}),[h,u]=ie.useState("Connecting…"),[c,g]=ie.useState({}),[R,y]=ie.useState(null),[M,b]=ie.useState(null),[A,O]=ie.useState(""),[z,H]=ie.useState(null),[k,K]=ie.useState(null),[re,G]=ie.useState(null),Y=ie.useRef({local:null,remote:null}),X=ie.useRef(null),j=ie.useRef(void 0),$=ie.useRef(void 0);j.current=q?.path,$.current=r?.path;const B=ie.useRef(!0);ie.useEffect(()=>()=>{B.current=!1},[]);const P=ie.useCallback(ge=>{const de=ge instanceof Error?ge.message:String(ge);return u(de),de},[]),J=ie.useCallback(async ge=>{S(de=>({...de,local:!0}));try{const de=await L.listLocalDirectory(ge);if(!B.current)return;W(de),n(Se=>({...Se,local:de.path})),E(Se=>({...Se,local:new Set})),g(Se=>({...Se,local:void 0}))}catch(de){if(!B.current)return;g(Se=>({...Se,local:P(de)}))}finally{B.current&&S(de=>({...de,local:!1}))}},[L,P]),se=ie.useCallback(async ge=>{const de=X.current;if(de){S(Se=>({...Se,remote:!0}));try{const Se=await L.sftpList(de,ge);if(!B.current)return;d(Se),n(Ee=>({...Ee,remote:Se.path})),E(Ee=>({...Ee,remote:new Set})),g(Ee=>({...Ee,remote:void 0}))}catch(Se){if(!B.current)return;g(Ee=>({...Ee,remote:P(Se)}))}finally{B.current&&S(Se=>({...Se,remote:!1}))}}},[L,P]);ie.useEffect(()=>L.onSftpEvent?.(ge=>{if(!B.current)return;const de=X.current;if(ge.type==="prompt"){if(de&&ge.prompt.sessionId!==de)return;X.current=ge.prompt.sessionId,b(ge.prompt),O("");return}de&&ge.sessionId!==de||(ge.type==="progress"&&y({name:ge.name,percent:ge.percent,detail:ge.detail}),ge.type==="status"&&u(ge.message),ge.type==="closed"&&(X.current=null,v(null),g(Se=>({...Se,remote:ge.message})),u(ge.message)))}),[L]),ie.useEffect(()=>{J();const ge=Up(l.cwd);let de=!1;return(async()=>{try{const Se=await L.sftpOpen(x,ge.absolute);if(de||!B.current)return;X.current=Se.id,v(Se),b(null),u(`Connected to ${Se.target}`),await se(ge.homeRelative?Cr(Se.cwd,ge.homeRelative):void 0)}catch(Se){if(de||!B.current)return;b(null),S(Ee=>({...Ee,remote:!1})),g(Ee=>({...Ee,remote:P(Se)}))}})(),()=>{de=!0}},[]);const ue=ie.useCallback(ge=>ge==="local"?J(j.current):se($.current),[J,se]),_e=(ge,de)=>ge==="local"?J(de):se(de),Z=ie.useMemo(()=>Z_(q?.entries??[],C.local),[q,C.local]),F=ie.useMemo(()=>Z_(r?.entries??[],C.remote,!0),[r,C.remote]),ae=R!==null,me=async ge=>{const de=X.current;if(!de||!q||!r)return;const Se=ge==="upload"?Z:F;if(!Se.length)return;y({name:Se[0].name,percent:0,detail:"starting"});let Ee=0;try{for(const ye of Se)u(`${ge==="upload"?"Uploading":"Downloading"} ${ye.name}…`),ge==="upload"?await L.sftpUpload(de,Yn(q.path,ye.name),r.path):await L.sftpDownload(de,Cr(r.path,ye.name),q.path,ye.kind),Ee+=1;u(`${ge==="upload"?"Uploaded":"Downloaded"} ${Ee} ${Ee===1?"file":"files"}.`)}catch(ye){const Re=P(ye);u(`${Re} (${Ee} of ${Se.length} transferred)`)}finally{B.current&&(y(null),await ue(ge==="upload"?"remote":"local"))}},xe=async ge=>{if(ge.preventDefault(),!z)return;const de=z.value.trim(),Se=z.side;if(de)try{Se==="local"&&q?await L.createLocalDirectory(Yn(q.path,de)):Se==="remote"&&r&&X.current&&await L.sftpMkdir(X.current,Cr(r.path,de)),H(null),u(`Created ${de}`),await ue(Se)}catch(Ee){P(Ee)}},Ce=async ge=>{if(ge.preventDefault(),!k)return;const de=k.value.trim(),{side:Se,entry:Ee}=k;if(!de||de===Ee.name){K(null);return}try{Se==="local"&&q?await L.renameLocalEntry(Yn(q.path,Ee.name),Yn(q.path,de)):Se==="remote"&&r&&X.current&&await L.sftpRename(X.current,Cr(r.path,Ee.name),Cr(r.path,de)),K(null),u(`Renamed to ${de}`),await ue(Se)}catch(ye){P(ye)}},je=async()=>{if(!re)return;const{side:ge,entry:de}=re;try{ge==="local"&&q?await L.removeLocalEntry(Yn(q.path,de.name),de.kind):ge==="remote"&&r&&X.current&&await L.sftpRemove(X.current,Cr(r.path,de.name),de.kind),G(null),u(`Deleted ${de.name}`),await ue(ge)}catch(Se){P(Se)}},Ae=async ge=>{ge.preventDefault();const de=X.current;if(!de||!M)return;const Se=M.kind==="confirm"?"yes":A;b(null),O(""),u(M.kind==="confirm"?"Accepting host key…":"Authenticating…");try{await L.sftpAnswerPrompt(de,Se)}catch(Ee){P(Ee)}},$e=async ge=>{const de=X.current;if(b(null),O(""),u(ge==="confirm"?"Host key rejected.":"Cancelled. The transfer connection was closed."),!!de)try{ge==="confirm"?await L.sftpAnswerPrompt(de,"no"):await L.sftpClose(de)}catch{}},Xe=(ge,de)=>{if(!Jn(de))return;const Se=ge==="local"?q?.path:r?.path;Se&&_e(ge,ge==="local"?Yn(Se,de.name):Cr(Se,de.name))},ke=ge=>{const de=ge==="local"?C.local:C.remote,Se=(ge==="local"?q?.entries:r?.entries)??[];return de.size!==1?null:Se.find(Ee=>de.has(Ee.name))??null},Ht=ge=>{const de=ge==="local"?q:r,Se=ge==="local"?C.local:C.remote,Ee=ge==="local"?c.local:c.remote,ye=ge==="local"?o.local:o.remote,Re=ke(ge),Ke=ge==="remote"&&!_;return m.jsxs("section",{className:`sftp-pane sftp-pane-${ge}`,children:[m.jsxs("header",{className:"sftp-pane-head",children:[m.jsx("span",{className:"eyebrow",children:ge==="local"?"THIS COMPUTER":l.host.toUpperCase()}),m.jsxs("div",{className:"sftp-pane-tools",children:[m.jsx("button",{type:"button",title:"Parent folder","aria-label":`${ge} parent folder`,disabled:!de||ye,onClick:()=>de&&void _e(ge,ge==="local"?Fg(de.path):$g(de.path)),children:m.jsx(Ie,{name:"level-up"})}),m.jsx("button",{type:"button",title:"Refresh","aria-label":`Refresh ${ge}`,disabled:ye||Ke,onClick:()=>{ue(ge)},children:m.jsx(Ie,{name:"refresh"})}),m.jsx("button",{type:"button",title:"New folder","aria-label":`New folder on ${ge}`,disabled:!de||Ke,onClick:()=>H({side:ge,value:""}),children:m.jsx(Ie,{name:"folder-plus"})}),m.jsx("button",{type:"button",title:Re?`Rename ${Re.name}`:"Select one item to rename","aria-label":`Rename on ${ge}`,disabled:!Re||Ke,onClick:()=>Re&&K({side:ge,entry:Re,value:Re.name}),children:m.jsx(Ie,{name:"pencil"})}),m.jsx("button",{type:"button",className:"sftp-danger",title:Re?`Delete ${Re.name}`:"Select one item to delete","aria-label":`Delete on ${ge}`,disabled:!Re||Ke,onClick:()=>Re&&G({side:ge,entry:Re}),children:m.jsx(Ie,{name:"trash"})})]})]}),m.jsx("form",{className:"sftp-path",onSubmit:Be=>{Be.preventDefault();const st=(ge==="local"?p.local:p.remote).trim();st&&_e(ge,st)},children:m.jsx("input",{value:ge==="local"?p.local:p.remote,onChange:Be=>{const st=Be.target.value;n(ht=>ge==="local"?{...ht,local:st}:{...ht,remote:st})},spellCheck:!1,"aria-label":`${ge} path`,placeholder:ge==="local"?"Local folder":"Remote folder",disabled:Ke})}),m.jsx("div",{className:"sftp-list",role:"listbox","aria-label":`${ge} files`,"aria-busy":ye,children:Ee?m.jsxs("div",{className:"sftp-empty sftp-error",children:[m.jsx("b",{children:ge==="local"?"Cannot read this folder":"No remote listing"}),m.jsx("small",{children:Ee})]}):ye&&!de?m.jsxs("div",{className:"sftp-empty",children:[m.jsx("b",{children:ge==="remote"&&!_?"Connecting…":"Loading…"}),m.jsx("small",{children:ge==="remote"?`Opening SFTP to ${l.host}`:"Reading the local folder"})]}):de&&de.entries.length?de.entries.map(Be=>m.jsxs("button",{type:"button",role:"option","aria-selected":Se.has(Be.name),className:`sftp-row ${Se.has(Be.name)?"selected":""} ${Be.kind==="directory"?"is-directory":""}`,onClick:st=>{const ht=st.ctrlKey||st.metaKey,kt=Y.current[ge],tt=st.shiftKey&&kt?kt:void 0,Qe=de?.entries.map(He=>He.name);E(He=>ge==="local"?{...He,local:J_(He.local,Be.name,ht,tt,Qe)}:{...He,remote:J_(He.remote,Be.name,ht,tt,Qe)}),st.shiftKey||(Y.current[ge]=Be.name)},onDoubleClick:()=>Xe(ge,Be),onKeyDown:st=>{st.key!=="Enter"||!Jn(Be)||(st.preventDefault(),Xe(ge,Be))},title:Be.linkTarget?`${Be.name} → ${Be.linkTarget}`:Be.name,children:[m.jsx(Ie,{name:Be.kind==="directory"?"folder":Be.kind==="symlink"?"link":"file"}),m.jsx("span",{className:"sftp-name",children:Be.name}),m.jsx("span",{className:"sftp-size",children:qg(Be)}),m.jsx("span",{className:"sftp-modified",children:Gg(Be.modified)})]},Be.name)):m.jsxs("div",{className:"sftp-empty",children:[m.jsx("b",{children:"Empty folder"}),m.jsx("small",{children:"Nothing here to transfer."})]})}),m.jsxs("footer",{className:"sftp-pane-foot",children:[ge==="local"?m.jsxs("button",{type:"button",className:"primary-button",disabled:!Z.length||!_||ae,onClick:()=>{me("upload")},title:Z.length?`Copy to ${l.host}`:"Select files to upload",children:[m.jsx(Ie,{name:"arrow-up"})," ",Q_("Upload",Z.length)]}):m.jsxs("button",{type:"button",className:"primary-button",disabled:!F.length||!_||ae,onClick:()=>{me("download")},title:F.length?"Copy to this computer":"Select files to download",children:[m.jsx(Ie,{name:"arrow-down"})," ",Q_("Download",F.length,"item")]}),m.jsx("span",{className:"sftp-count",children:de?`${de.entries.length} items`:""})]})]})};return m.jsx("div",{className:"sftp-layer",role:"presentation",...N,children:m.jsxs("section",{className:"sftp-panel",role:"dialog","aria-label":"Transfer files",children:[m.jsxs("div",{className:"sftp-head",children:[m.jsxs("div",{children:[m.jsx("span",{className:"eyebrow",children:"TRANSFER FILES"}),m.jsxs("h2",{children:[l.name," · ",l.host]})]}),m.jsx("button",{type:"button",className:"close-button",onClick:T,children:"Esc"})]}),m.jsxs("div",{className:"sftp-body",children:[Ht("local"),Ht("remote")]}),M&&m.jsxs("form",{className:"sftp-prompt",onSubmit:Ae,children:[m.jsx("span",{className:"eyebrow warning-text",children:M.kind==="confirm"?"HOST KEY":"AUTHENTICATION"}),m.jsx("pre",{children:M.text}),M.kind==="confirm"?m.jsxs("div",{className:"modal-actions",children:[m.jsx("button",{type:"button",onClick:()=>{$e("confirm")},children:"Reject"}),m.jsx("button",{type:"submit",className:"primary-button",children:"Accept key"})]}):m.jsxs(m.Fragment,{children:[m.jsxs("label",{children:[M.kind==="passphrase"?"Key passphrase":"Password",m.jsx("input",{autoFocus:!0,type:"password",value:A,onChange:ge=>O(ge.target.value),autoComplete:"off"})]}),m.jsxs("div",{className:"modal-actions",children:[m.jsx("button",{type:"button",onClick:()=>{$e(M.kind)},children:"Cancel"}),m.jsx("button",{type:"submit",className:"primary-button",children:"Send"})]})]})]}),z&&m.jsxs("form",{className:"sftp-inline-form",onSubmit:xe,children:[m.jsxs("label",{children:["New folder in ",z.side==="local"?q?.path:r?.path,m.jsx("input",{autoFocus:!0,value:z.value,onChange:ge=>H({...z,value:ge.target.value}),required:!0})]}),m.jsxs("div",{className:"modal-actions",children:[m.jsx("button",{type:"button",onClick:()=>H(null),children:"Cancel"}),m.jsx("button",{type:"submit",className:"primary-button",children:"Create"})]})]}),k&&m.jsxs("form",{className:"sftp-inline-form",onSubmit:Ce,children:[m.jsxs("label",{children:["Rename ",k.entry.name,m.jsx("input",{autoFocus:!0,value:k.value,onChange:ge=>K({...k,value:ge.target.value}),required:!0})]}),m.jsxs("div",{className:"modal-actions",children:[m.jsx("button",{type:"button",onClick:()=>K(null),children:"Cancel"}),m.jsx("button",{type:"submit",className:"primary-button",children:"Rename"})]})]}),re&&m.jsxs("div",{className:"sftp-inline-form",children:[m.jsx("span",{className:"eyebrow warning-text",children:"CONFIRM DELETE"}),m.jsxs("p",{children:["Delete ",m.jsx("b",{children:re.entry.name})," from ",re.side==="local"?"this computer":l.host,"?",re.entry.kind==="directory"?" Only an empty folder can be deleted here.":""]}),m.jsxs("div",{className:"modal-actions",children:[m.jsx("button",{type:"button",autoFocus:!0,onClick:()=>G(null),children:"Cancel"}),m.jsx("button",{type:"button",className:"primary-button sftp-danger-button",onClick:()=>{je()},children:"Delete"})]})]}),m.jsxs("footer",{className:"sftp-foot",children:[R?m.jsxs("div",{className:"sftp-progress",role:"progressbar","aria-valuenow":R.percent,"aria-valuemin":0,"aria-valuemax":100,"aria-label":`Transferring ${R.name}`,children:[m.jsx("div",{className:"sftp-progress-fill",style:{width:`${R.percent}%`}}),m.jsxs("span",{children:[Wg(R.name)," · ",R.percent,"% · ",R.detail]})]}):m.jsx("span",{className:"sftp-notice",children:h}),m.jsx("span",{className:"sftp-hint",children:"Double-click a folder to open · Ctrl-click to select several · Esc closes"})]})]})})}const rp={q4:96,q8:41,fp16:76,fp32:152},np={q4:142,q8:77,fp16:146,fp32:291},ap={q4:299,q8:249,fp16:485,fp32:968},Du=[{id:"onnx-community/whisper-tiny.en",label:"Whisper tiny · English",family:"tiny",multilingual:!1,downloadMb:rp},{id:"onnx-community/whisper-base.en",label:"Whisper base · English",family:"base",multilingual:!1,downloadMb:np},{id:"onnx-community/whisper-small.en",label:"Whisper small · English",family:"small",multilingual:!1,downloadMb:ap},{id:"onnx-community/whisper-tiny",label:"Whisper tiny · multilingual",family:"tiny",multilingual:!0,downloadMb:rp},{id:"onnx-community/whisper-base",label:"Whisper base · multilingual",family:"base",multilingual:!0,downloadMb:np},{id:"onnx-community/whisper-small",label:"Whisper small · multilingual",family:"small",multilingual:!0,downloadMb:ap}],u0="onnx-community/whisper-tiny.en",lp=[{value:"q8",label:"q8 · quantized",detail:"Smallest download, fastest on CPU"},{value:"q4",label:"q4",detail:"Smaller weights, some accuracy loss"},{value:"fp16",label:"fp16",detail:"Half precision; needs WebGPU to pay off"},{value:"fp32",label:"fp32 · full",detail:"Most accurate, largest download"}],Ip=[{value:"auto",label:"Detect automatically"},{value:"en",label:"English"},{value:"es",label:"Spanish"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"it",label:"Italian"},{value:"pt",label:"Portuguese"},{value:"nl",label:"Dutch"},{value:"pl",label:"Polish"},{value:"sv",label:"Swedish"},{value:"da",label:"Danish"},{value:"no",label:"Norwegian"},{value:"fi",label:"Finnish"},{value:"cs",label:"Czech"},{value:"el",label:"Greek"},{value:"tr",label:"Turkish"},{value:"ru",label:"Russian"},{value:"uk",label:"Ukrainian"},{value:"he",label:"Hebrew"},{value:"ar",label:"Arabic"},{value:"hi",label:"Hindi"},{value:"zh",label:"Chinese"},{value:"ja",label:"Japanese"},{value:"ko",label:"Korean"},{value:"id",label:"Indonesian"},{value:"th",label:"Thai"},{value:"vi",label:"Vietnamese"}];function tc(l){return Du.find(x=>x.id===l)}function d0(l){return tc(l)?.multilingual??!1}function f0(l,x){return tc(l)?.downloadMb[x]??null}function _0(l,x){const L=f0(l,x);return L===null?"Download size unknown":`≈${L} MB download, cached after first use`}const p0={bash:"bash",zsh:"zsh",fish:"fish",sh:"sh",powershell:"Windows PowerShell",pwsh:"PowerShell 7",cmd:"Command Prompt",wsl:"WSL"};function Pp(l){return p0[l]??l}const $p="zerog-settings",Fp="zerog-theme",ze={shortcuts:{},appearance:{theme:"dark",font:"system",fontSize:13,lineHeight:1.2,letterSpacing:0},terminal:{scrollback:1e4,cursorStyle:"block",cursorBlink:!0,copyOnSelect:!0},sessions:{defaultBackend:"bash",defaultWslDistribution:"",defaultLayout:"stack",startSidebarCollapsed:!1,sidebarWidth:238,splitColumnRatio:.5,splitRowRatio:.5},ai:{requireApproval:!0,voiceInsert:"type",proceedPhrase:"OK, proceed",recordCommands:!1,baseUrl:"http://127.0.0.1:11434/v1",model:"",includeOutput:!1,outputChars:2e3},speech:{engine:"builtin",model:u0,precision:"q8",device:"wasm",language:"auto",task:"transcribe",maxUtteranceSeconds:30,silenceThreshold:.004,serverUrl:"http://127.0.0.1:8080/v1/audio/transcriptions",serverModel:"Qwen3-ASR-0.6B"}},bt={fontSize:{min:8,max:32},lineHeight:{min:1,max:2},letterSpacing:{min:-2,max:4},scrollback:{min:200,max:2e5},maxUtteranceSeconds:{min:5,max:120},outputChars:{min:200,max:8e3},silenceThreshold:{min:5e-4,max:.05},sidebarWidth:{min:180,max:520},splitRatio:{min:.15,max:.85}},op={system:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',jetbrains:'"JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace',cascadia:'"Cascadia Code", "Cascadia Mono", ui-monospace, Consolas, "Liberation Mono", monospace',consolas:'Consolas, "Liberation Mono", ui-monospace, monospace',fira:'"Fira Code", "Fira Mono", ui-monospace, Consolas, "Liberation Mono", monospace',menlo:'Menlo, Monaco, ui-monospace, Consolas, "Liberation Mono", monospace'},m0=[{value:"system",label:"System monospace"},{value:"jetbrains",label:"JetBrains Mono"},{value:"cascadia",label:"Cascadia Code"},{value:"consolas",label:"Consolas"},{value:"fira",label:"Fira Code"},{value:"menlo",label:"Menlo"}];function wu(l){return op[l]??op.system}function v0(l){const x={};for(const{action:L}of wr){const T=l[L];Op(T)&&(x[L]=T)}return x}function Vr(l){return typeof l=="object"&&l!==null}function ki(l,x,L){return typeof l=="string"&&x.includes(l)?l:L}function Xn(l,x){return typeof l=="boolean"?l:x}function ms(l,x,L){return typeof l!="number"||!Number.isFinite(l)?L:Math.min(x.max,Math.max(x.min,l))}function pl(l,x,L=512){return typeof l!="string"?x:l.slice(0,L)}function g0(l,x,L=200){return typeof l!="string"?x:Array.from(l.slice(0,L),T=>{const N=T.codePointAt(0)??0;return N<32||N===127?" ":T}).join("")}function cp(l){return l.proceedPhrase.trim()||ze.ai.proceedPhrase}const hp=["dark","light"],S0=["stack","split-v","split-h","grid"],Wp=["bash","zsh","fish","sh","powershell","pwsh","cmd","wsl"],b0=["block","underline","bar"],y0=["system","jetbrains","cascadia","consolas","fira","menlo"],C0=["builtin","server"],w0=["wasm","webgpu"],x0=["q4","q8","fp16","fp32"],E0=["transcribe","translate"],A0=["type","review"];function Jr(l,x){const L=Vr(l)?l:{},T=Vr(L.appearance)?L.appearance:{},N=Vr(L.terminal)?L.terminal:{},q=Vr(L.sessions)?L.sessions:{},W=Vr(L.ai)?L.ai:{},r=Vr(L.speech)?L.speech:{},d=Vr(L.shortcuts)?L.shortcuts:{},_=ki(x,hp,ze.appearance.theme),v=ki(r.engine,C0,ze.speech.engine),o=ki(r.model,Du.map(C=>C.id),ze.speech.model),S=v==="server"||tc(o)?.multilingual?ki(r.language,Ip.map(C=>C.value),ze.speech.language):"auto";return{shortcuts:v0(d),appearance:{theme:ki(T.theme,hp,_),font:ki(T.font,y0,ze.appearance.font),fontSize:Math.round(ms(T.fontSize,bt.fontSize,ze.appearance.fontSize)),lineHeight:ms(T.lineHeight,bt.lineHeight,ze.appearance.lineHeight),letterSpacing:ms(T.letterSpacing,bt.letterSpacing,ze.appearance.letterSpacing)},terminal:{scrollback:Math.round(ms(N.scrollback,bt.scrollback,ze.terminal.scrollback)),cursorStyle:ki(N.cursorStyle,b0,ze.terminal.cursorStyle),cursorBlink:Xn(N.cursorBlink,ze.terminal.cursorBlink),copyOnSelect:Xn(N.copyOnSelect,ze.terminal.copyOnSelect)},sessions:{defaultBackend:ki(q.defaultBackend,Wp,ze.sessions.defaultBackend),defaultWslDistribution:pl(q.defaultWslDistribution,ze.sessions.defaultWslDistribution,64),defaultLayout:ki(q.defaultLayout,S0,ze.sessions.defaultLayout),startSidebarCollapsed:Xn(q.startSidebarCollapsed,ze.sessions.startSidebarCollapsed),sidebarWidth:Math.round(ms(q.sidebarWidth,bt.sidebarWidth,ze.sessions.sidebarWidth)),splitColumnRatio:ms(q.splitColumnRatio,bt.splitRatio,ze.sessions.splitColumnRatio),splitRowRatio:ms(q.splitRowRatio,bt.splitRatio,ze.sessions.splitRowRatio)},ai:{requireApproval:Xn(W.requireApproval,ze.ai.requireApproval),voiceInsert:ki(W.voiceInsert,A0,ze.ai.voiceInsert),proceedPhrase:g0(W.proceedPhrase,ze.ai.proceedPhrase),recordCommands:Xn(W.recordCommands,ze.ai.recordCommands),baseUrl:pl(W.baseUrl,ze.ai.baseUrl,512),model:pl(W.model,ze.ai.model,200),includeOutput:Xn(W.includeOutput,ze.ai.includeOutput),outputChars:Math.round(ms(W.outputChars,bt.outputChars,ze.ai.outputChars))},speech:{engine:v,model:o,precision:ki(r.precision,x0,ze.speech.precision),device:ki(r.device,w0,ze.speech.device),language:S,task:ki(r.task,E0,ze.speech.task),maxUtteranceSeconds:Math.round(ms(r.maxUtteranceSeconds,bt.maxUtteranceSeconds,ze.speech.maxUtteranceSeconds)),silenceThreshold:ms(r.silenceThreshold,bt.silenceThreshold,ze.speech.silenceThreshold),serverUrl:pl(r.serverUrl,ze.speech.serverUrl,512),serverModel:pl(r.serverModel,ze.speech.serverModel,128)}}}function R0(l){if(!l)return Jr(void 0);let x=null,L=null;try{x=l.getItem($p),L=l.getItem(Fp)}catch{return Jr(void 0)}if(!x)return Jr(void 0,L);try{return Jr(JSON.parse(x),L)}catch{return Jr(void 0,L)}}function up(l,x){if(l)try{l.setItem($p,JSON.stringify(x)),l.setItem(Fp,x.appearance.theme)}catch{}}function dp(l,x,L){return Jr({...l,[x]:{...l[x],...L}})}function qp(l,x){if(x.some(T=>T.backend===l))return l;const L=x[0]?.backend;return L&&Wp.includes(L)?L:l}function L0(l){const x=l.engine==="builtin",L=tc(l.model)?.multilingual??!1;return{model:x,precision:x,device:x,language:x?L:!0,task:x&&L,server:!x}}function M0(l,x){return Jr({...l,[x]:ze[x]})}const T0=new Set(["127.0.0.1","localhost","::1","[::1]"]);function Gp(l){try{const x=new URL(l);return x.protocol!=="http:"&&x.protocol!=="https:"||!x.hostname?null:x}catch{return null}}function Kp(l){const x=Gp(l);return x===null?null:x.hostname.toLowerCase()}function ku(l){return Kp(l)!==null}function ic(l){const x=Kp(l);return x===null?!1:T0.has(x)||x.endsWith(".localhost")}function D0(l){const x=Gp(l);return x===null?!1:x.protocol==="http:"&&!ic(l)}const k0=12e4,O0=300;function Wo(l,x,L){for(let T=0;T<L.length;T+=1)l.setUint8(x+T,L.charCodeAt(T))}function B0(l,x=Yo){const T=l.length*2,N=new ArrayBuffer(44+T),q=new DataView(N);Wo(q,0,"RIFF"),q.setUint32(4,36+T,!0),Wo(q,8,"WAVE"),Wo(q,12,"fmt "),q.setUint32(16,16,!0),q.setUint16(20,1,!0),q.setUint16(22,1,!0),q.setUint32(24,x,!0),q.setUint32(28,x*2,!0),q.setUint16(32,2,!0),q.setUint16(34,16,!0),Wo(q,36,"data"),q.setUint32(40,T,!0);for(let W=0;W<l.length;W+=1){const r=Math.max(-1,Math.min(1,l[W]));q.setInt16(44+W*2,Math.round(r*32767),!0)}return N}function j0(l){if(typeof l=="string"){const T=l.trim();return T||null}if(typeof l!="object"||l===null)return null;const x=l;if(typeof x.text=="string"&&x.text.trim())return x.text.trim();const L=x.segments;if(Array.isArray(L)){const T=L.map(N=>typeof N=="object"&&N!==null?N.text:null).filter(N=>typeof N=="string").join(" ").trim();if(T)return T}if(typeof x.error=="string")throw new Error(x.error);return null}function N0(l){const x=B0(l.audio,l.sampleRate??Yo),L=new FormData;return L.set("file",new Blob([x],{type:"audio/wav"}),"utterance.wav"),L.set("model",l.model),L.set("response_format","json"),l.language&&l.language!=="auto"&&L.set("language",l.language),L}function H0(){return typeof AbortSignal<"u"&&typeof AbortSignal.timeout=="function"?AbortSignal.timeout(k0):void 0}async function z0(l,x=fetch){if(!ku(l.url))throw new Error("Speech server URL must be an http:// or https:// address, e.g. http://10.0.10.46:8888/v1/audio/transcriptions");if(!l.model.trim())throw new Error("Speech server model name is required");const L=l.apiKey?.trim(),T=await x(l.url,{method:"POST",headers:L?{Authorization:`Bearer ${L}`}:void 0,body:N0(l),signal:H0()}),N=await T.text();if(!T.ok){const r=N.slice(0,O0).trim(),d=!L&&(T.status===401||T.status===403)?" — this server wants an API key":"";throw new Error(`Speech server returned ${T.status}${r?`: ${r}`:""}${d}`)}let q=N;try{q=JSON.parse(N)}catch{}const W=j0(q);if(W===null)throw new Error("Speech server returned no transcript");return W}const Vp=[{id:"bash",label:"bash",file:"~/.bashrc"},{id:"zsh",label:"zsh",file:"~/.zshrc"},{id:"fish",label:"fish",file:"~/.config/fish/config.fish"},{id:"powershell",label:"PowerShell",file:"$PROFILE"}],U0=`# ZeroG shell integration — reports prompt and command marks (OSC 133).
|
|
78
|
+
__zerog_at_prompt=1
|
|
79
|
+
__zerog_preexec() {
|
|
80
|
+
[ -n "\${COMP_LINE-}" ] && return
|
|
81
|
+
[ -z "\${__zerog_at_prompt-}" ] && return
|
|
82
|
+
__zerog_at_prompt=
|
|
83
|
+
printf '\\033]133;C\\007'
|
|
84
|
+
}
|
|
85
|
+
__zerog_precmd() {
|
|
86
|
+
local status=$?
|
|
87
|
+
printf '\\033]133;D;%s\\007' "$status"
|
|
88
|
+
printf '\\033]7;file://%s%s\\007' "$HOSTNAME" "$PWD"
|
|
89
|
+
__zerog_at_prompt=1
|
|
90
|
+
printf '\\033]133;A\\007'
|
|
91
|
+
}
|
|
92
|
+
trap '__zerog_preexec' DEBUG
|
|
93
|
+
PROMPT_COMMAND="__zerog_precmd\${PROMPT_COMMAND:+;$PROMPT_COMMAND}"
|
|
94
|
+
PS1="\\[\\033]133;A\\007\\]$PS1\\[\\033]133;B\\007\\]"`,I0=`# ZeroG shell integration — reports prompt and command marks (OSC 133).
|
|
95
|
+
autoload -Uz add-zsh-hook
|
|
96
|
+
__zerog_preexec() { printf '\\033]133;C\\007' }
|
|
97
|
+
__zerog_precmd() {
|
|
98
|
+
printf '\\033]133;D;%s\\007' "$?"
|
|
99
|
+
printf '\\033]7;file://%s%s\\007' "$HOST" "$PWD"
|
|
100
|
+
}
|
|
101
|
+
add-zsh-hook preexec __zerog_preexec
|
|
102
|
+
add-zsh-hook precmd __zerog_precmd
|
|
103
|
+
PS1=$'%{\\033]133;A\\007%}'$PS1$'%{\\033]133;B\\007%}'`,P0=`# ZeroG shell integration — reports prompt and command marks (OSC 133).
|
|
104
|
+
# Add this at the end of config.fish, after your prompt is defined.
|
|
105
|
+
if not functions -q __zerog_inner_prompt
|
|
106
|
+
functions --copy fish_prompt __zerog_inner_prompt
|
|
107
|
+
end
|
|
108
|
+
function fish_prompt
|
|
109
|
+
printf '\\033]133;A\\007'
|
|
110
|
+
printf '\\033]7;file://%s%s\\007' (hostname) "$PWD"
|
|
111
|
+
__zerog_inner_prompt
|
|
112
|
+
printf '\\033]133;B\\007'
|
|
113
|
+
end
|
|
114
|
+
function __zerog_preexec --on-event fish_preexec
|
|
115
|
+
printf '\\033]133;C\\007'
|
|
116
|
+
end
|
|
117
|
+
function __zerog_postexec --on-event fish_postexec
|
|
118
|
+
printf '\\033]133;D;%s\\007' $status
|
|
119
|
+
end`,$0=`# ZeroG shell integration — reports prompt and command marks (OSC 133).
|
|
120
|
+
$global:__zerogPrompt = $function:prompt
|
|
121
|
+
function prompt {
|
|
122
|
+
$status = if ($?) { 0 } else { 1 }
|
|
123
|
+
[Console]::Write("\`e]133;D;$status\`a")
|
|
124
|
+
[Console]::Write("\`e]7;file://$env:COMPUTERNAME$($PWD.Path)\`a")
|
|
125
|
+
[Console]::Write("\`e]133;A\`a")
|
|
126
|
+
$text = & $global:__zerogPrompt
|
|
127
|
+
[Console]::Write("\`e]133;B\`a")
|
|
128
|
+
return $text
|
|
129
|
+
}
|
|
130
|
+
try {
|
|
131
|
+
Set-PSReadLineKeyHandler -Chord Enter -ScriptBlock {
|
|
132
|
+
[Console]::Write("\`e]133;C\`a")
|
|
133
|
+
[Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine()
|
|
134
|
+
}
|
|
135
|
+
} catch {
|
|
136
|
+
# PSReadLine is absent, so the command text cannot be marked. The prompt
|
|
137
|
+
# marks and the exit status still report.
|
|
138
|
+
}`,F0={bash:U0,zsh:I0,fish:P0,powershell:$0};function W0(l){return F0[l]}function q0(l){return Vp.find(x=>x.id===l)?.file??""}const vu=[{id:"appearance",label:"Appearance",hint:"Theme, font",blurb:"How the workspace and terminal text look."},{id:"shortcuts",label:"Shortcuts",hint:"Keyboard",blurb:"Which keys do what, for when something else on the machine has taken one."},{id:"terminal",label:"Terminal",hint:"Scrollback, cursor",blurb:"Behaviour of every terminal pane."},{id:"sessions",label:"Sessions",hint:"Defaults, layout",blurb:"What new terminals and new windows start as."},{id:"ai",label:"AI & voice",hint:"Approval, insert",blurb:"How AI suggestions and transcripts reach a terminal."},{id:"speech",label:"Speech recognition",hint:"Engine, model",blurb:"Which recogniser runs, and how it is tuned."}];function G0({action:l,description:x,chord:L,moved:T,taken:N,onSet:q,onReset:W}){const[r,d]=en.useState(!1),[_,v]=en.useState(null);return en.useEffect(()=>{if(!r)return;const o=S=>{if(S.preventDefault(),S.stopPropagation(),S.key==="Escape"){d(!1),v(null);return}if(["Control","Shift","Alt","Meta","OS"].includes(S.key))return;const C=kp({key:S.key,code:S.code,ctrlKey:S.ctrlKey,metaKey:S.metaKey,shiftKey:S.shiftKey,altKey:S.altKey}),E=C?jp(C,l,N):"A shortcut needs Ctrl and at least one of Shift or Alt, so a shell keeps Ctrl+C and Ctrl+R for itself.";if(!C||E){v(E);return}q(C),v(null),d(!1)};return window.addEventListener("keydown",o,!0),()=>window.removeEventListener("keydown",o,!0)},[r,l,N,q]),m.jsxs("div",{className:_?"shortcut-row invalid":"shortcut-row",children:[m.jsx("span",{className:"shortcut-what",children:x}),m.jsx("button",{type:"button",className:r?"shortcut-chord capturing":"shortcut-chord",onClick:()=>{v(null),d(o=>!o)},"aria-label":r?`Press a new shortcut for ${x}`:`Change the shortcut for ${x}`,children:r?m.jsx("span",{className:"shortcut-prompt",children:"press a chord · Esc"}):m.jsx("kbd",{children:L})}),m.jsx("button",{type:"button",className:"shortcut-reset",onClick:()=>{v(null),d(!1),W()},disabled:!T,title:T?"Back to the shortcut this shipped with":"This is the shortcut it shipped with",children:"Reset"}),_?m.jsx("small",{className:"shortcut-problem",children:_}):null]})}function vs({label:l,hint:x,children:L}){return m.jsxs("label",{className:"settings-field",children:[m.jsx("span",{className:"settings-field-label",children:l}),L,x?m.jsx("small",{children:x}):null]})}function K0(l){const x="OpenAI-compatible: POST to {base}/chat/completions. Ollama, LM Studio, llama.cpp, vLLM and OpenRouter all serve this.";return ku(l)?ic(l)?`On this machine, so nothing leaves it. ${x}`:`Off this machine. ${x}`:`Any http:// or https:// address ending in /v1. ${x}`}function V0(l){const x="OpenAI-compatible: POST multipart audio to /v1/audio/transcriptions.";return ku(l)?ic(l)?`On this machine. ${x}`:`Off this machine — recorded audio is sent to this host. ${x}`:`Any http:// or https:// address. ${x}`}function fp({label:l="Server API key",state:x,url:L,onSave:T,onClear:N}){const[q,W]=ie.useState(""),r=x.status==="saving",d=q.trim(),_=x.encryptionAvailable?D0(L)?"Sent as a Bearer token. This endpoint is plain http to another host, so the key travels in the clear.":"Sent as a Bearer token. Stored encrypted by this system, never in the settings file.":"This system has no secret store, so a key can only be held until the app closes.";return m.jsxs(vs,{label:l,hint:_,children:[m.jsxs("div",{className:"settings-key-row",children:[m.jsx("input",{type:"password",value:q,placeholder:x.stored||x.sessionOnly?"•••••••• (a key is set)":"Leave empty if the server needs none",autoComplete:"off",spellCheck:!1,onChange:v=>W(v.target.value),onKeyDown:v=>{v.key!=="Enter"||!d||r||(v.preventDefault(),T(d),W(""))}}),m.jsx("button",{type:"button",disabled:!d||r,onClick:()=>{T(d),W("")},children:r?"Saving…":"Save"}),x.stored||x.sessionOnly?m.jsx("button",{type:"button",disabled:r,onClick:N,children:"Clear"}):null]}),x.error?m.jsx("small",{className:"settings-key-error",children:x.error}):null,!x.error&&x.notice?m.jsx("small",{className:"settings-key-notice",children:x.notice}):null]})}function Y0({enabled:l,state:x,bindings:L,onToggle:T,onCopySnippet:N,onClear:q}){const[W,r]=ie.useState("bash"),d=W0(W),_=yi("history-palette",L);return m.jsxs(m.Fragment,{children:[m.jsx(Qn,{label:"Remember commands for the history palette",hint:l?`Commands you run are stored on this machine, with their directory and exit status, so ${_} can rank them. Anything that looks like it carries a secret is refused rather than stored.`:"Off. Nothing about what you type is written anywhere. Turning this on stores commands on this machine so the history palette has something to search.",checked:l,onChange:T}),l?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"settings-note",children:x.panesOpen===0?"No panes open, so nothing is reporting yet.":x.panesReporting===0?`None of your ${x.panesOpen} open pane${x.panesOpen===1?"":"s"} is reporting prompt marks. Add the snippet below to that shell — including on a remote host, where it has to be installed there.`:`${x.panesReporting} of ${x.panesOpen} open pane${x.panesOpen===1?"":"s"} reporting prompt marks. ${x.entries} command${x.entries===1?"":"s"} remembered.`}),m.jsx(vs,{label:"Shell integration",hint:`Paste this into ${q0(W)} on whichever machine the shell runs on. It emits the standard OSC 133 marks — if you already have shell integration from VS Code, kitty or an oh-my-zsh plugin, you need none of this.`,children:m.jsxs("div",{className:"settings-key-row",children:[m.jsx("select",{value:W,onChange:v=>r(v.target.value),children:Vp.map(v=>m.jsx("option",{value:v.id,children:v.label},v.id))}),m.jsx("button",{type:"button",onClick:()=>N(d),children:"Copy snippet"})]})}),m.jsx("pre",{className:"settings-snippet",children:d}),m.jsxs("div",{className:"settings-test",children:[m.jsx("button",{type:"button",onClick:q,children:"Forget all remembered commands"}),m.jsx("small",{className:"settings-hint",children:"Removes the stored history and the file it lives in."})]})]}):null]})}function X0({state:l,onRun:x}){const L=l.status==="testing";return m.jsxs("div",{className:"settings-test",children:[m.jsx("button",{type:"button",className:"primary-button",disabled:L,onClick:x,children:L?"Testing…":"Test connection"}),l.message?m.jsx("small",{className:l.ok?"settings-key-notice":"settings-key-error",children:l.message}):null]})}function ts({label:l,hint:x,value:L,options:T,onChange:N}){return m.jsx(vs,{label:l,hint:x,children:m.jsx("select",{value:L,onChange:q=>N(q.target.value),children:T.map(q=>m.jsx("option",{value:q.value,children:q.label},q.value))})})}function Yr({label:l,hint:x,value:L,min:T,max:N,step:q,format:W,onChange:r}){return m.jsx(vs,{label:l,hint:x,children:m.jsxs("span",{className:"settings-range",children:[m.jsx("input",{type:"range",min:T,max:N,step:q,value:L,onChange:d=>r(Number(d.target.value)),"aria-label":l}),m.jsx("output",{children:W(L)})]})})}function Qn({label:l,hint:x,checked:L,disabled:T=!1,onChange:N}){return m.jsxs("label",{className:`settings-toggle ${T?"settings-toggle-fixed":""}`,children:[m.jsx("input",{type:"checkbox",checked:L,disabled:T,onChange:q=>N(q.target.checked)}),m.jsxs("span",{children:[m.jsx("b",{children:l}),x?m.jsx("small",{children:x}):null]})]})}function Z0({value:l,onChange:x}){const L=[{id:"builtin",title:"Built-in",detail:"Whisper ONNX in this app, downloaded once and cached. No other software needed."},{id:"server",title:"Server",detail:"Post audio to a transcription server — on this machine, on the LAN, or hosted — the way to use a GGUF model such as Qwen3-ASR through llama.cpp, LM Studio or Unsloth Studio."}];return m.jsx("div",{className:"settings-engines",role:"radiogroup","aria-label":"Speech engine",children:L.map(T=>m.jsxs("button",{type:"button",role:"radio","aria-checked":l===T.id,className:`settings-engine ${l===T.id?"active":""}`,onClick:()=>x(T.id),children:[m.jsx("b",{children:T.title}),m.jsx("small",{children:T.detail})]},T.id))})}function Q0({state:l,onRun:x}){const L=l.status!=="idle",T=l.status==="recording"?"Stop and transcribe":l.status==="transcribing"?"Transcribing…":"Test recognition";return m.jsxs("div",{className:"settings-test",children:[m.jsxs("div",{className:"settings-test-head",children:[m.jsxs("div",{children:[m.jsx("b",{children:"Try it"}),m.jsx("small",{children:"Records a phrase and transcribes it here, without typing into a terminal."})]}),m.jsx("button",{type:"button",className:l.status==="recording"?"settings-test-button recording":"settings-test-button",onClick:x,disabled:l.status==="transcribing",children:T})]}),l.message?m.jsx("p",{className:"settings-test-status",children:l.message}):null,l.error?m.jsx("p",{className:"settings-test-error",children:l.error}):null,l.transcript!==null&&l.transcript!==void 0?m.jsx("output",{className:"settings-test-transcript",children:l.transcript||"(nothing transcribed)"}):null,!L&&(l.elapsedMs!=null||l.level!=null)?m.jsxs("p",{className:"settings-test-metrics",children:[l.elapsedMs!=null?`${(l.elapsedMs/1e3).toFixed(1)}s`:null,l.elapsedMs!=null&&l.level!=null?" · ":null,l.level!=null?`level ${l.level.toFixed(4)} RMS`:null]}):null]})}function J0({settings:l,onChange:x,onReset:L,onClose:T,backdrop:N,backends:q,wslDistributions:W,speechTest:r,onSpeechTest:d,speechKey:_,onSpeechKeySave:v,onSpeechKeyClear:o,commandHistory:S,onCopySnippet:C,onClearCommandHistory:E,aiKey:p,onAiKeySave:n,onAiKeyClear:h,aiModels:u,onAiModelsRefresh:c,aiTest:g,onAiTest:R}){const[y,M]=ie.useState("appearance"),b=ie.useMemo(()=>Tu(l.shortcuts),[l.shortcuts]),A=ie.useMemo(()=>Object.fromEntries(Object.entries(b.chords).map(([k,K])=>[K,k])),[b]),O=vu.find(k=>k.id===y)??vu[0],z=L0(l.speech),H=q.length?q.map(k=>({value:k.backend,label:k.label})):[{value:l.sessions.defaultBackend,label:l.sessions.defaultBackend}];return m.jsx("div",{className:"modal-layer settings-layer",role:"presentation",...N,children:m.jsxs("section",{className:"settings-card",role:"dialog","aria-modal":"true","aria-label":"Settings",children:[m.jsxs("div",{className:"modal-head",children:[m.jsxs("div",{children:[m.jsx("span",{className:"eyebrow",children:"SETTINGS"}),m.jsx("h2",{children:O.label})]}),m.jsx("button",{type:"button",className:"close-button",onClick:T,children:"Esc"})]}),m.jsxs("div",{className:"settings-body",children:[m.jsx("nav",{className:"settings-nav","aria-label":"Settings pages",children:vu.map(k=>m.jsxs("button",{type:"button",className:`settings-nav-item ${k.id===y?"active":""}`,"aria-current":k.id===y,onClick:()=>M(k.id),children:[m.jsx("b",{children:k.label}),m.jsx("small",{children:k.hint})]},k.id))}),m.jsxs("div",{className:"settings-page",children:[m.jsx("p",{className:"settings-blurb",children:O.blurb}),y==="shortcuts"&&m.jsxs(m.Fragment,{children:[b.rejected.length?m.jsxs("p",{className:"settings-warning",children:[b.rejected.map(k=>k.reason).join(" ")," The default is in use instead."]}):null,m.jsx("div",{className:"shortcut-list",children:wr.map(k=>m.jsx(G0,{action:k.action,description:k.description,chord:yi(k.action,b),moved:Bg(k.action,b),taken:A,onSet:K=>x("shortcuts",{[k.action]:K}),onReset:()=>x("shortcuts",{[k.action]:void 0})},k.action))}),m.jsxs("p",{children:["A shortcut needs Ctrl and at least one of Shift or Alt: a bare Ctrl+key belongs to the shell, which keeps Ctrl+C, Ctrl+R, Ctrl+L and Ctrl+A in every pane. Ctrl+Shift+1 to 9 switch workspaces by position and cannot be moved, and the terminal keeps",Mu.map((k,K)=>m.jsxs(en.Fragment,{children:[K?" and ":" ",m.jsx("kbd",{children:k.chord})]},k.chord)),"."]}),m.jsx("p",{children:"Worth knowing if a chord seems to do nothing: nothing here can outrank the operating system. Windows uses Ctrl and Shift together to switch keyboard layout when more than one is installed, and some applications register chords globally while they are running. Moving ours out of the way is the fix, and Ctrl+Alt is usually clear — though on some layouts it behaves as AltGr, so a chord you would type in a terminal is worth avoiding."})]}),y==="appearance"&&m.jsxs(m.Fragment,{children:[m.jsx(ts,{label:"Theme",value:l.appearance.theme,options:[{value:"dark",label:"Dark"},{value:"light",label:"Light"}],onChange:k=>x("appearance",{theme:k})}),m.jsx(ts,{label:"Terminal font",hint:"Falls back to another monospace face when the font is not installed.",value:l.appearance.font,options:m0,onChange:k=>x("appearance",{font:k})}),m.jsx(Yr,{label:"Font size",value:l.appearance.fontSize,min:bt.fontSize.min,max:bt.fontSize.max,step:1,format:k=>`${k} px`,onChange:k=>x("appearance",{fontSize:k})}),m.jsx(Yr,{label:"Line height",value:l.appearance.lineHeight,min:bt.lineHeight.min,max:bt.lineHeight.max,step:.05,format:k=>k.toFixed(2),onChange:k=>x("appearance",{lineHeight:k})}),m.jsx(Yr,{label:"Letter spacing",value:l.appearance.letterSpacing,min:bt.letterSpacing.min,max:bt.letterSpacing.max,step:.1,format:k=>`${k.toFixed(1)} px`,onChange:k=>x("appearance",{letterSpacing:k})}),m.jsxs("div",{className:"settings-preview",style:{fontFamily:wu(l.appearance.font),fontSize:`${l.appearance.fontSize}px`,lineHeight:l.appearance.lineHeight,letterSpacing:`${l.appearance.letterSpacing}px`},children:[m.jsx("span",{children:"user@host:~$ git status --short"}),m.jsx("span",{children:" M src/renderer/settings.ts"})]})]}),y==="terminal"&&m.jsxs(m.Fragment,{children:[m.jsx(Yr,{label:"Scrollback",hint:"Lines kept per pane. Larger scrollback costs memory in every open pane.",value:l.terminal.scrollback,min:bt.scrollback.min,max:5e4,step:200,format:k=>`${k.toLocaleString()} lines`,onChange:k=>x("terminal",{scrollback:k})}),m.jsx(ts,{label:"Cursor",value:l.terminal.cursorStyle,options:[{value:"block",label:"Block"},{value:"underline",label:"Underline"},{value:"bar",label:"Bar"}],onChange:k=>x("terminal",{cursorStyle:k})}),m.jsx(Qn,{label:"Blink the cursor",checked:l.terminal.cursorBlink,onChange:k=>x("terminal",{cursorBlink:k})}),m.jsx(Qn,{label:"Copy on selection",hint:"Selecting text with the mouse puts it on the clipboard. Ctrl+Shift+C copies regardless.",checked:l.terminal.copyOnSelect,onChange:k=>x("terminal",{copyOnSelect:k})})]}),y==="sessions"&&m.jsxs(m.Fragment,{children:[m.jsx(ts,{label:"Default shell",hint:"Pre-selected when opening a new local terminal.",value:qp(l.sessions.defaultBackend,q),options:H,onChange:k=>x("sessions",{defaultBackend:k})}),m.jsxs(vs,{label:"Default WSL distribution",hint:"Used when the default shell is WSL.",children:[m.jsx("input",{list:"settings-wsl-distributions",value:l.sessions.defaultWslDistribution,placeholder:"Ubuntu",onChange:k=>x("sessions",{defaultWslDistribution:k.target.value})}),m.jsx("datalist",{id:"settings-wsl-distributions",children:W.map(k=>m.jsx("option",{value:k},k))})]}),m.jsx(ts,{label:"Layout at startup",value:l.sessions.defaultLayout,options:[{value:"stack",label:"Single pane"},{value:"split-v",label:"Split vertically"},{value:"split-h",label:"Split horizontally"},{value:"grid",label:"Grid of four"}],onChange:k=>x("sessions",{defaultLayout:k})}),m.jsx(Qn,{label:"Start with the sidebar collapsed",checked:l.sessions.startSidebarCollapsed,onChange:k=>x("sessions",{startSidebarCollapsed:k})})]}),y==="ai"&&m.jsxs(m.Fragment,{children:[m.jsx(vs,{label:"Endpoint",hint:K0(l.ai.baseUrl),children:m.jsx("input",{value:l.ai.baseUrl,placeholder:ze.ai.baseUrl,spellCheck:!1,onChange:k=>x("ai",{baseUrl:k.target.value})})}),m.jsx(vs,{label:"Model",hint:"Any model the endpoint serves. Refresh lists what it reports having.",children:m.jsxs("div",{className:"settings-key-row",children:[m.jsx("input",{value:l.ai.model,list:"ai-models",placeholder:"qwen2.5-coder",spellCheck:!1,onChange:k=>x("ai",{model:k.target.value})}),m.jsx("datalist",{id:"ai-models",children:u.map(k=>m.jsx("option",{value:k},k))}),m.jsx("button",{type:"button",onClick:c,children:"Refresh"})]})}),m.jsx(fp,{label:"Endpoint API key",state:p,url:l.ai.baseUrl,onSave:n,onClear:h}),m.jsx(X0,{state:g,onRun:R}),m.jsx(Qn,{label:"Send recent terminal output",hint:l.ai.includeOutput?ic(l.ai.baseUrl)?"Sent to an endpoint on this machine, so the output does not leave it. Suggestions can read the error you are looking at.":"The output of the focused pane is sent to this endpoint, which is not on this machine. Anything on screen goes with it.":"Off, so only the shell, directory and host are sent. Suggestions cannot see the error you are looking at.",checked:l.ai.includeOutput,onChange:k=>x("ai",{includeOutput:k})}),l.ai.includeOutput?m.jsx(Yr,{label:"How much output",hint:"The tail of the pane, on whole lines. Enough for a stack trace is usually enough.",value:l.ai.outputChars,min:bt.outputChars.min,max:bt.outputChars.max,step:200,format:k=>`${k} characters`,onChange:k=>x("ai",{outputChars:k})}):null,m.jsx(Qn,{label:"Ask before running an AI suggestion",hint:l.ai.includeOutput?"Always on while terminal output is being sent: output can come from a remote host, and a command chosen from it must not run unseen.":"Off means a suggested command is sent to the terminal as soon as it arrives.",checked:l.ai.includeOutput||l.ai.requireApproval,disabled:l.ai.includeOutput,onChange:k=>x("ai",{requireApproval:k})}),m.jsx(ts,{label:"Voice transcripts",hint:"Neither option presses Enter for you.",value:l.ai.voiceInsert,options:[{value:"type",label:"Type into the terminal"},{value:"review",label:"Show for review first"}],onChange:k=>x("ai",{voiceInsert:k})}),m.jsx(vs,{label:"Proceed phrase",hint:"What a pane's tick button sends. Unlike the options above, this one does press Enter — it is for telling an agent already waiting in the pane to carry on.",children:m.jsx("input",{value:l.ai.proceedPhrase,placeholder:ze.ai.proceedPhrase,onChange:k=>x("ai",{proceedPhrase:k.target.value})})}),m.jsx(Y0,{enabled:l.ai.recordCommands,state:S,bindings:b,onToggle:k=>x("ai",{recordCommands:k}),onCopySnippet:C,onClear:E})]}),y==="speech"&&m.jsxs(m.Fragment,{children:[m.jsx(Z0,{value:l.speech.engine,onChange:k=>x("speech",{engine:k})}),z.model?m.jsx(ts,{label:"Model",hint:_0(l.speech.model,l.speech.precision),value:l.speech.model,options:Du.map(k=>({value:k.id,label:k.label})),onChange:k=>x("speech",{model:k})}):null,z.precision?m.jsx(ts,{label:"Precision",hint:lp.find(k=>k.value===l.speech.precision)?.detail,value:l.speech.precision,options:lp.map(k=>({value:k.value,label:k.label})),onChange:k=>x("speech",{precision:k})}):null,z.device?m.jsx(ts,{label:"Compute",hint:"WebGPU is faster where it works; the app falls back to WASM when it does not.",value:l.speech.device,options:[{value:"wasm",label:"CPU (WASM)"},{value:"webgpu",label:"GPU (WebGPU)"}],onChange:k=>x("speech",{device:k})}):null,z.language?m.jsx(ts,{label:"Language",value:l.speech.language,options:Ip,onChange:k=>x("speech",{language:k})}):null,z.task?m.jsx(ts,{label:"Task",hint:"Translate produces English text from another language.",value:l.speech.task,options:[{value:"transcribe",label:"Transcribe"},{value:"translate",label:"Translate to English"}],onChange:k=>x("speech",{task:k})}):null,z.server?m.jsxs(m.Fragment,{children:[m.jsx(vs,{label:"Server URL",hint:V0(l.speech.serverUrl),children:m.jsx("input",{value:l.speech.serverUrl,placeholder:"http://127.0.0.1:8080/v1/audio/transcriptions",onChange:k=>x("speech",{serverUrl:k.target.value})})}),m.jsx(vs,{label:"Server model",hint:"The model name the server expects, e.g. Qwen3-ASR-0.6B.",children:m.jsx("input",{value:l.speech.serverModel,placeholder:"Qwen3-ASR-0.6B",onChange:k=>x("speech",{serverModel:k.target.value})})}),m.jsx(fp,{state:_,url:l.speech.serverUrl,onSave:v,onClear:o})]}):null,m.jsx(Yr,{label:"Maximum utterance",hint:"Recording stops itself at this length so a stuck microphone cannot queue forever.",value:l.speech.maxUtteranceSeconds,min:bt.maxUtteranceSeconds.min,max:bt.maxUtteranceSeconds.max,step:5,format:k=>`${k} s`,onChange:k=>x("speech",{maxUtteranceSeconds:k})}),m.jsx(Yr,{label:"Silence threshold",hint:"Recordings quieter than this are discarded without transcribing. Raise it for a noisy room, lower it for a quiet microphone.",value:l.speech.silenceThreshold,min:bt.silenceThreshold.min,max:bt.silenceThreshold.max,step:5e-4,format:k=>k.toFixed(4),onChange:k=>x("speech",{silenceThreshold:k})}),m.jsx(Q0,{state:r,onRun:d})]}),m.jsxs("div",{className:"settings-foot",children:[m.jsx("span",{className:"settings-hint",children:"Changes apply immediately and are remembered."}),m.jsxs("button",{type:"button",onClick:()=>L(y),children:["Reset ",O.label.toLowerCase()]})]})]})]})]})})}const Zr=[{kind:"local",label:"Local terminal",hint:"Shell on this machine"},{kind:"ssh",label:"SSH",hint:"Remote host"}];function _p(l){return l==="local"||l==="ssh"}const eS={workspace:{eyebrow:"WORKSPACE",title:"New workspace",submit:"Create workspace"},rename:{eyebrow:"WORKSPACE",title:"Rename workspace",submit:"Rename"},local:{eyebrow:"NEW SESSION",title:"Start a session",submit:"Open terminal"},ssh:{eyebrow:"NEW SESSION",title:"Start a session",submit:"Connect"},forward:{eyebrow:"SHARED PORT",title:"Share a port",submit:"Share port"}};function gu(l){return eS[l]}function tS(l,x){const L=Zr.findIndex(N=>N.kind===l);if(L===-1)return null;const T=Zr.length;switch(x){case"ArrowRight":case"ArrowDown":return Zr[(L+1)%T].kind;case"ArrowLeft":case"ArrowUp":return Zr[(L-1+T)%T].kind;case"Home":return Zr[0].kind;case"End":return Zr[T-1].kind;default:return null}}const Yp={"split-v":"Vertical split","split-h":"Horizontal split",grid:"Four-pane grid"},iS=[{layout:"split-v",icon:"split-v"},{layout:"split-h",icon:"split-h"},{layout:"grid",icon:"grid"}];function Xp(l){return l==="split-v"?["column"]:l==="split-h"?["row"]:l==="grid"?["column","row"]:[]}function Zp(l,x){return Xp(l).some(L=>{const T=L==="column"?x.columnRatio:x.rowRatio,N=L==="column"?ze.sessions.splitColumnRatio:ze.sessions.splitRowRatio;return Math.abs(T-N)>.005})}function sS(l){const x=Xp(l);return{...x.includes("column")?{splitColumnRatio:ze.sessions.splitColumnRatio}:{},...x.includes("row")?{splitRowRatio:ze.sessions.splitRowRatio}:{}}}function Qp(l){return l.maximized?{kind:"restore"}:l.layout==="stack"?{kind:"show",layout:l.lastSplit}:l.sessionCount>1?{kind:"maximize"}:{kind:"show",layout:"stack"}}function rS(l,x){return x.layout!==l||x.maximized?{kind:"show",layout:l}:Zp(l,x)?{kind:"reset-splits",ratios:sS(l)}:Qp(x)}function nS(l,x){return x.layout!==l||x.maximized?Yp[l]:Zp(l,x)?"Reset pane sizes":x.sessionCount>1?"Maximize focused pane":"Single pane"}function aS(l){return l.maximized||l.layout==="stack"?`Back to ${Yp[l.lastSplit].toLowerCase()}`:l.sessionCount>1?"Maximize focused pane":"Single pane"}function pp(l){return typeof l=="object"&&l!==null}class lS{constructor(x){this.options=x,this.worker=null,this.pending=new Map,this.nextId=1}async transcribe(x,L,T){if(L.engine==="server"){const q=this.options.now??(()=>Date.now()),W=q(),r=await this.options.resolveApiKey?.().catch(()=>null)??void 0;return{text:await z0({url:L.serverUrl,model:L.serverModel,language:L.language,audio:x,apiKey:r},this.options.fetchImpl),elapsedMs:q()-W,engine:"server"}}return{...await this.transcribeInWorker(x,L,T),engine:"builtin"}}transcribeInWorker(x,L,T){const N=this.ensureWorker(),q=this.nextId++;return new Promise((W,r)=>{this.pending.set(q,{resolve:W,reject:r,onProgress:T}),N.postMessage({type:"transcribe",id:q,audio:x,config:{model:L.model,precision:L.precision,device:L.device,language:L.language,task:L.task,multilingual:d0(L.model)}},[x.buffer])})}ensureWorker(){if(this.worker)return this.worker;const x=this.options.createWorker();return x.onmessage=L=>this.handleMessage(L.data),x.onerror=L=>{const T=pp(L)&&typeof L.message=="string"?L.message:"Speech worker failed";this.failAll(new Error(T)),this.worker=null},this.worker=x,x}handleMessage(x){if(!pp(x)||typeof x.id!="number")return;const L=this.pending.get(x.id);if(L){if(x.type==="loading"){L.onProgress?.({kind:"loading",progress:typeof x.progress=="number"?x.progress:null});return}if(x.type==="notice"){L.onProgress?.({kind:"notice",message:String(x.message)});return}if(x.type==="result"){this.pending.delete(x.id),L.resolve({text:typeof x.text=="string"?x.text:"",elapsedMs:typeof x.elapsedMs=="number"?x.elapsedMs:0});return}x.type==="error"&&(this.pending.delete(x.id),L.reject(new Error(typeof x.message=="string"?x.message:"Transcription failed")))}}failAll(x){for(const L of this.pending.values())L.reject(x);this.pending.clear()}dispose(){this.failAll(new Error("Speech client disposed")),this.worker?.terminate(),this.worker=null}}const oS=5;function cS(l,x,L=oS){return Math.abs(x-l)>=L}function hS(l,x){if(!l.length)return 0;for(let L=0;L<l.length;L+=1){const T=l[L];if(x<T.left+T.width/2)return L}return l.length-1}function mp(l,x,L){if(x===L||x<0||x>=l.length)return l;const T=Math.min(Math.max(L,0),l.length-1);if(T===x)return l;const N=[...l],[q]=N.splice(x,1);return N.splice(T,0,q),N}function Su(l,x){return x?l.findIndex(L=>L.id===x):-1}const uS=6;function dS(l,x,L,T=uS){return{x:vp(l.x,x.width,L.width,T),y:vp(l.y,x.height,L.height,T)}}function vp(l,x,L,T){return l+x+T<=L?Math.max(T,l):l-x-T>=0?l-x:Math.max(T,L-x-T)}function fS({at:l,items:x,label:L,onClose:T}){const N=ie.useRef(null),[q,W]=ie.useState(l);return ie.useLayoutEffect(()=>{const r=N.current?.getBoundingClientRect();r&&W(dS(l,{width:r.width,height:r.height},{width:window.innerWidth,height:window.innerHeight}))},[l,x.length]),ie.useEffect(()=>{const r=_=>{_.key==="Escape"&&(_.preventDefault(),_.stopPropagation(),T())},d=()=>T();return window.addEventListener("keydown",r,!0),window.addEventListener("pointerdown",d,!0),window.addEventListener("blur",d),window.addEventListener("wheel",d,{passive:!0}),()=>{window.removeEventListener("keydown",r,!0),window.removeEventListener("pointerdown",d,!0),window.removeEventListener("blur",d),window.removeEventListener("wheel",d)}},[T]),m.jsx("div",{className:"context-menu",role:"menu","aria-label":L,ref:N,style:{left:q.x,top:q.y},onPointerDown:r=>r.stopPropagation(),children:x.map(r=>m.jsxs("button",{type:"button",role:"menuitem",className:`context-menu-item ${r.danger?"danger":""}`.trim(),disabled:r.disabled||!r.onSelect,title:r.hint??"",onClick:()=>{T(),r.onSelect?.()},children:[r.icon?m.jsx(Ie,{name:r.icon}):m.jsx("span",{className:"context-menu-gap"}),m.jsx("span",{children:r.label})]},r.label))})}function _S(l,x){let L=null,T=null,N=!1;return{handle(q){const W=q.charAt(0);if(N=!0,W==="A")return L=null,!0;if(W==="B")return L=l.cursor(),!0;if(W==="C"){if(!L)return!0;const r=l.read(L,l.cursor()).trim();return L=null,r&&(T={command:r,startedAt:l.now()}),!0}if(W==="D"){const r=T;if(T=null,!r)return!0;const d=pS(q);return x({command:r.command,...d===void 0?{}:{exitCode:d},durationMs:Math.max(0,l.now()-r.startedAt)}),!0}return!0},hasMarks(){return N},atPrompt(){return L!==null&&T===null},reset(){L=null,T=null}}}function pS(l){const x=l.split(";");if(x.length<2)return;const L=x[1].trim();if(!/^\d+$/.test(L))return;const T=Number(L);return T<=255?T:void 0}function mS(l,x,L){if(L.row<x.row||L.row===x.row&&L.col<=x.col)return"";const T=[];for(let N=x.row;N<=L.row;N+=1){const q=l(N)??"",W=N===x.row?x.col:0,r=N===L.row?L.col:q.length;T.push(q.slice(W,r))}return T.join("").replace(/\s+$/,"")}const gp="TOKEN|KEY|SECRET|PASSWORD|PASSWD|PASSPHRASE|CREDENTIAL|AUTH|APIKEY|ACCESS_KEY|PRIVATE",vS=[{reason:"secret-assignment",pattern:new RegExp(String.raw`(?:^|[\s;&|(])(?:export\s+|set\s+(?:-x\s+)?|env\s+|declare\s+(?:-x\s+)?)?`+String.raw`[A-Za-z0-9_]*(?:${gp})[A-Za-z0-9_]*\s*=\s*\S`,"i")},{reason:"secret-assignment",pattern:new RegExp(String.raw`(?:${gp})[A-Za-z0-9_]*\s*=\s*\S`,"i")},{reason:"credential-flag",pattern:new RegExp(String.raw`(?:^|\s)--?(?:pass|password|passwd|passphrase|token|api[-_]?key|secret|auth[-_]?token|credential|bearer)`+String.raw`(?:=|\s+)\S`,"i")},{reason:"credential-flag",pattern:/\bmysql(?:dump|admin)?\b[^\r\n]*\s-p\S/i},{reason:"url-credentials",pattern:/[a-z][a-z0-9+.-]*:\/\/[^\s/@:]+:[^\s/@]+@/i},{reason:"auth-header",pattern:/(?:-H|--header)\s*["']?\s*(?:authorization|proxy-authorization|x-api-key|x-auth-token)\s*:/i},{reason:"basic-auth",pattern:/\b(?:curl|wget|http|https)\b[^\r\n]*\s-u\s*\S+:\S/i},{reason:"known-token",pattern:new RegExp([String.raw`gh[pousr]_[A-Za-z0-9]{16,}`,String.raw`github_pat_[A-Za-z0-9_]{20,}`,String.raw`sk-(?:ant-)?[A-Za-z0-9_-]{16,}`,String.raw`xox[baprs]-[A-Za-z0-9-]{10,}`,String.raw`AKIA[0-9A-Z]{16}`,String.raw`ASIA[0-9A-Z]{16}`,String.raw`AIza[0-9A-Za-z_-]{30,}`,String.raw`glpat-[A-Za-z0-9_-]{16,}`,String.raw`npm_[A-Za-z0-9]{30,}`,String.raw`dop_v1_[a-f0-9]{60,}`,String.raw`eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.`].join("|"))},{reason:"openssl-pass",pattern:/-pass(?:in|out)\s+(?:pass|env|file):/i}],gS=24;function SS(l){return l.length<gS||/[/\\]/.test(l)||!/^[A-Za-z0-9+/=_-]+$/.test(l)||/^[0-9a-f]+$/i.test(l)?!1:/[a-z]/.test(l)&&/[A-Z]/.test(l)&&/[0-9]/.test(l)}function bS(l){const x=l.trim();if(!x)return null;for(const{reason:L,pattern:T}of vS)if(T.test(x))return L;for(const L of x.split(/[\s=:,'"`]+/))if(SS(L))return"high-entropy";return null}const yS=4320*60*1e3,Xr={cwd:50,host:12,recency:30,frequency:10,pick:25,failed:-20,match:40};function CS(l,x){if(!x)return[];const L=l.toLowerCase(),T=x.toLowerCase(),N=[];let q=0;for(const W of T){if(W===" ")continue;const r=L.indexOf(W,q);if(r<0)return null;N.push(r),q=r+1}return N}function wS(l,x){if(!x.length)return .5;const L=x[0],N=x[x.length-1]-L+1,q=x.length/N,W=1/(1+L),r=L===0||/\s/.test(l.charAt(L-1))?1:0;return .45*q+.35*W+.2*r}function xS(l,x){const L=x-Date.parse(l);return Number.isFinite(L)?L<=0?1:Math.pow(.5,L/yS):0}function ES(l,x,L){let T=Xr.match*wS(l.command,x);return L.cwd&&l.cwd===L.cwd&&(T+=Xr.cwd),L.host&&l.host===L.host&&(T+=Xr.host),T+=Xr.recency*xS(l.lastRun,L.now),T+=Xr.frequency*Math.log1p(l.runs),T+=Xr.pick*Math.log1p(l.picks),l.exitCode!==void 0&&l.exitCode!==0&&(T+=Xr.failed),T}function AS(l,x){const L=new Map;for(const N of l){const q=CS(N.command,x.query);if(q===null)continue;const W={entry:N,score:ES(N,q,x),matched:q},r=L.get(N.command);(!r||W.score>r.score)&&L.set(N.command,W)}const T=[...L.values()].sort((N,q)=>q.score!==N.score?q.score-N.score:q.entry.lastRun.localeCompare(N.entry.lastRun));return x.limit===void 0?T:T.slice(0,x.limit)}function bu(l){return{phase:"asking",sessionId:l,prompt:""}}function RS(l,x,L){return!L.trim()||x||l.includeOutput?!1:!l.requireApproval}function Sp(l){return!!(l.baseUrl.trim()&&l.model.trim())}function LS(l,x){const L=l.replace(/\s+$/,"");if(x<=0)return"";if(L.length<=x)return L;const T=L.slice(-x),N=T.indexOf(`
|
|
139
|
+
`);return N>=0&&N<T.length-1?T.slice(N+1):T}const MS=150,TS=3e3,bp=400;function Zn(l){return(l instanceof Error?l.message:String(l)).replace(/^Error invoking remote method '[^']*':\s*/,"").replace(/^(?:Error|TypeError):\s*/,"")}function yp(l){return{id:l.sessionId,name:l.name,kind:l.kind,host:l.host,screenName:l.screenName,sshTarget:l.sshTarget,backend:l.backend}}const De=()=>window.zerog;function yu(){try{return window.localStorage}catch{return null}}function qo({session:l,active:x=!1,ghosted:L=!1,onClick:T}){const N=l.kind==="ssh"?`SSH · ${l.host}`:l.backend==="wsl"?`WSL${l.wslDistribution?` · ${l.wslDistribution}`:""} · ${l.cwd}`:l.backend&&l.backend!=="screen"?`${Pp(l.backend)} · ${l.cwd}`:l.persistence==="screen"?`screen · ${l.cwd}`:`local · process only · ${l.cwd}`;return m.jsxs("button",{type:"button",className:`session-row ${x?"active":""} ${L?"session-ghosted":""}`,onClick:T,children:[m.jsx("span",{className:`status-dot ${l.status}`}),m.jsxs("span",{className:"session-copy",children:[m.jsx("b",{children:l.name}),m.jsx("small",{children:N})]}),m.jsx("span",{className:"session-state",children:L?"↗":l.status==="connected"?"●":"○"})]})}function DS({member:l,onClick:x}){const L=l.kind==="ssh"?`SSH · ${l.host??l.sshTarget??"saved host"}`:l.screenName?`screen · ${l.screenName}`:"local";return m.jsxs("button",{type:"button",className:"session-row session-ghosted",title:`Reconnect ${l.name}`,onClick:x,children:[m.jsx("span",{className:"status-dot"}),m.jsxs("span",{className:"session-copy",children:[m.jsx("b",{children:l.name}),m.jsxs("small",{children:[L," · not connected"]})]}),m.jsx("span",{className:"session-state",children:"↻"})]})}function kS({connection:l,onConfigure:x,onConnect:L}){const T=Ap(x,L),N=l.hostName?`${l.user??""}${l.user?"@":""}${l.hostName}${l.port?`:${l.port}`:""}`:"Saved SSH connection";return m.jsxs("button",{type:"button",className:"session-row",title:`Double-click to connect ${l.alias} in a new pane`,onClick:T.onClick,onDoubleClick:T.onDoubleClick,children:[m.jsx("span",{className:"status-dot"}),m.jsxs("span",{className:"session-copy",children:[m.jsx("b",{children:l.alias}),m.jsx("small",{children:N})]}),m.jsx("span",{className:"session-state",children:"→"})]})}function OS(l,x=200){if(!l)return"";const L=l.buffer.active,T=L.length,N=Math.max(0,T-x),q=[];for(let W=N;W<T;W+=1)q.push(L.getLine(W)?.translateToString(!0)??"");return q.join(`
|
|
140
|
+
`)}const BS=120,jS=1e4,NS=200;function HS(){if(!(typeof PerformanceObserver>"u"))try{new PerformanceObserver(x=>{for(const L of x.getEntries())L.duration>=NS&&console.warn(`[zerog] renderer blocked for ${Math.round(L.duration)}ms`)}).observe({entryTypes:["longtask"]})}catch{}}HS();function zS({sessionId:l,focused:x,dormant:L=!1,onStatus:T,appearance:N,terminalSettings:q,registerFocus:W,registerCapture:r,onCommand:d,registerRead:_}){const v=ie.useRef(null),o=ie.useRef(null),S=ie.useRef(T);S.current=T;const C=ie.useRef(N);C.current=N;const E=ie.useRef(q);E.current=q;const p=ie.useRef(null),n=ie.useRef(null),h=ie.useRef({}),u=ie.useRef(d);return u.current=d,ie.useEffect(()=>{if(!v.current)return;const c=v.current,g=new Rv.Terminal({cursorBlink:E.current.cursorBlink,cursorStyle:E.current.cursorStyle,fontFamily:wu(C.current.font),fontSize:C.current.fontSize,lineHeight:C.current.lineHeight,letterSpacing:C.current.letterSpacing,scrollback:E.current.scrollback,allowProposedApi:!0,theme:Cp(C.current.theme),linkHandler:{activate:(se,ue)=>{const _e=De();_e?.openExternal&&(S.current(`Opening ${ue}`),_e.openExternal(ue).catch(Z=>{S.current(Z instanceof Error?Z.message:String(Z))}))},hover:(se,ue)=>S.current(`Link: ${ue}`),leave:()=>S.current("Ready")}});h.current={theme:C.current.theme,font:C.current.font,fontSize:C.current.fontSize,lineHeight:C.current.lineHeight,letterSpacing:C.current.letterSpacing,scrollback:E.current.scrollback,cursorStyle:E.current.cursorStyle,cursorBlink:E.current.cursorBlink};const R=new Mv.FitAddon;g.loadAddon(R),g.open(c),o.current=g;const y=De();let M=!1,b=0,A=0,O=0,z=!1,H=0;const k=()=>{if(M||!c.isConnected||c.clientWidth<20||c.clientHeight<20)return!1;try{R.fit()}catch{return!1}return g.cols>0&&g.rows>0},K=()=>{!z||!y||!l||g.cols===A&&g.rows===O||(window.clearTimeout(H),H=window.setTimeout(()=>{M||!l||g.cols===A&&g.rows===O||(A=g.cols,O=g.rows,y.resize(l,A,O))},BS))},re=()=>{k()&&K()},G=()=>{cancelAnimationFrame(b),b=requestAnimationFrame(()=>{re(),b=requestAnimationFrame(re)})};if(p.current=G,!y)return G(),g.writeln("\x1B[90mZeroG Terminal\x1B[0m"),g.writeln("\x1B[31mPreload API unavailable. Rebuild the app.\x1B[0m"),S.current("Preload API unavailable"),()=>{M=!0,cancelAnimationFrame(b),o.current=null,n.current=null,g.dispose()};const Y=y.onData((se,ue)=>{se===l&&g.write(ue)}),X=y.onStatus((se,ue)=>{se===l&&(S.current(ue),G())}),j=g.onData(se=>{l&&y.write(l,se)}),$=Yv({terminal:g,clipboard:y,onError:se=>S.current(se),writeToPty:se=>{l&&y.write(l,se)},pasteEventTarget:c,isCopyOnSelectEnabled:()=>E.current.copyOnSelect}),B=_S({cursor:()=>({row:g.buffer.active.baseY+g.buffer.active.cursorY,col:g.buffer.active.cursorX}),read:(se,ue)=>mS(_e=>g.buffer.active.getLine(_e)?.translateToString(!0),se,ue),now:()=>Date.now()},se=>{l&&u.current?.(l,se)}),P=g.parser.registerOscHandler(133,se=>B.handle(se));l&&r?.(l,B);const J=new ResizeObserver(()=>G());if(J.observe(c),window.addEventListener("resize",G),document.fonts?.ready?.then(()=>{M||G()}).catch(()=>{}),G(),!l)g.writeln("\x1B[90mZeroG Terminal\x1B[0m"),g.writeln("\x1B[90mSelect a session or create a local/SSH connection.\x1B[0m");else{const se=k()?{cols:g.cols,rows:g.rows}:void 0;se&&(A=se.cols,O=se.rows),y.attachSession(l,se).then(ue=>{z=!0,ue.persistence==="process"?S.current(`${ue.host} · ${ue.name} · process only (install screen for persistence)`):S.current(`${ue.host} · ${ue.name}`),G()}).catch(ue=>{S.current(ue instanceof Error?ue.message:String(ue))})}return()=>{M=!0,cancelAnimationFrame(b),window.clearTimeout(H),$(),j.dispose(),Y(),X(),J.disconnect(),P.dispose(),l&&r?.(l,null),window.removeEventListener("resize",G),p.current=null,o.current=null,n.current=null,g.dispose()}},[l]),ie.useEffect(()=>{const c=o.current;if(!c)return;if(L){const y=window.setTimeout(()=>{const M=n.current;n.current=null,M?.dispose()},jS);return()=>window.clearTimeout(y)}if(n.current)return;let g;try{g=new Dv.WebglAddon}catch(y){console.warn("[zerog] pane fell back to the DOM renderer",y);return}const R=g.onContextLoss(()=>{n.current===g&&(n.current=null),g.dispose()});try{c.loadAddon(g)}catch{g.dispose();return}return n.current=g,()=>R.dispose()},[l,L]),ie.useEffect(()=>{if(L)return;const c=o.current;if(!c)return;p.current?.();const g=requestAnimationFrame(()=>{c.rows>0&&c.refresh(0,c.rows-1)});return()=>cancelAnimationFrame(g)},[L]),ie.useEffect(()=>{const c=o.current;if(!c||L)return;const g=h.current;let R=!1;g.theme!==N.theme&&(g.theme=N.theme,c.options.theme=Cp(N.theme)),g.font!==N.font&&(g.font=N.font,c.options.fontFamily=wu(N.font),R=!0),g.fontSize!==N.fontSize&&(g.fontSize=N.fontSize,c.options.fontSize=N.fontSize,R=!0),g.lineHeight!==N.lineHeight&&(g.lineHeight=N.lineHeight,c.options.lineHeight=N.lineHeight,R=!0),g.letterSpacing!==N.letterSpacing&&(g.letterSpacing=N.letterSpacing,c.options.letterSpacing=N.letterSpacing,R=!0),g.scrollback!==q.scrollback&&(g.scrollback=q.scrollback,c.options.scrollback=q.scrollback),g.cursorStyle!==q.cursorStyle&&(g.cursorStyle=q.cursorStyle,c.options.cursorStyle=q.cursorStyle),g.cursorBlink!==q.cursorBlink&&(g.cursorBlink=q.cursorBlink,c.options.cursorBlink=q.cursorBlink),R&&p.current?.()},[N,q,L]),ie.useEffect(()=>{x&&o.current?.focus()},[x]),ie.useEffect(()=>{if(!(!l||!W))return W(l,()=>o.current?.focus()),()=>W(l,null)},[l,W]),ie.useEffect(()=>{if(!(!l||!_))return _(l,()=>OS(o.current)),()=>_(l,null)},[l,_]),m.jsx("div",{className:"terminal",ref:v,onMouseDownCapture:c=>c.preventDefault()})}function US({open:l,ratio:x,browser:L,onRatio:T,children:N}){const q=ie.useRef(null),[W,r]=ie.useState(null),d=W??x,_=v=>Math.min(Lp,Math.max(Rp,Math.round(v)));return m.jsxs("div",{className:l?"pane-body pane-body-split":"pane-body",ref:q,style:l?{gridTemplateColumns:`${d}fr ${100-d}fr`}:void 0,children:[N,l?m.jsxs(m.Fragment,{children:[m.jsx(Vo,{orientation:"vertical",className:"pane-resizer pane-browser-resizer",label:"Directory browser split",valuePercent:d,style:{left:`calc((100% - 1px) * ${d/100} + 0.5px)`},onDrag:v=>{const o=q.current?.getBoundingClientRect();!o||o.width<=0||r(_((v.clientX-o.left)/o.width*100))},onCommit:()=>{W!==null&&T(W),r(null)},onNudge:v=>T(_(d+v*2)),onReset:()=>T(Mp)}),L]}):null]})}function Vo({orientation:l,className:x,label:L,valuePercent:T,style:N,onDrag:q,onCommit:W,onNudge:r,onReset:d}){const[_,v]=ie.useState(!1),o=l==="vertical"?"ArrowLeft":"ArrowUp",S=l==="vertical"?"ArrowRight":"ArrowDown";return m.jsx("div",{role:"separator","aria-orientation":l,"aria-label":L,"aria-valuenow":Math.round(T),"aria-valuemin":0,"aria-valuemax":100,tabIndex:0,className:`${x} ${_?"dragging":""}`.trim(),style:N,title:`${L} — drag, arrow keys, or double-click to reset`,onPointerDown:C=>{C.button===0&&(C.preventDefault(),C.currentTarget.setPointerCapture(C.pointerId),v(!0))},onPointerMove:C=>{C.currentTarget.hasPointerCapture(C.pointerId)&&q(C)},onPointerUp:C=>{C.currentTarget.hasPointerCapture(C.pointerId)&&(C.currentTarget.releasePointerCapture(C.pointerId),v(!1),W())},onPointerCancel:()=>v(!1),onDoubleClick:d,onKeyDown:C=>{C.key===o?(C.preventDefault(),r(-1)):C.key===S?(C.preventDefault(),r(1)):(C.key==="Enter"||C.key==="Home")&&(C.preventDefault(),d())}})}function IS({index:l,onCreate:x}){return m.jsxs("article",{className:"pane empty-pane",children:[m.jsxs("div",{className:"pane-title",children:[m.jsxs("span",{children:["PANE ",l]}),m.jsx("span",{className:"pane-dim",children:"EMPTY"})]}),m.jsxs("div",{className:"empty-pane-body",children:[m.jsx("span",{className:"empty-glyph",children:"+"}),m.jsx("strong",{children:"Split ready"}),m.jsx("small",{children:"Open another terminal here"}),m.jsx("button",{type:"button",onClick:x,children:"Choose session"})]})]})}function PS(){const[l,x]=ie.useState(()=>R0(yu())),L=l.appearance.theme,[T,N]=ie.useState([]),[q,W]=ie.useState(()=>[K_("Workspace",l.sessions.defaultLayout)]),[r,d]=ie.useState(()=>q[0]?.id??""),[_,v]=ie.useState("Ready"),[o,S]=ie.useState(!1),[C,E]=ie.useState(l.sessions.startSidebarCollapsed),[p,n]=ie.useState("terminals"),[h,u]=ie.useState("sessions"),[c,g]=ie.useState([]),[R,y]=ie.useState(!1),[M,b]=ie.useState(null),[A,O]=ie.useState(""),[z,H]=ie.useState("local"),[k,K]=ie.useState("loopback"),[re,G]=ie.useState(""),[Y,X]=ie.useState(""),[j,$]=ie.useState(""),[B,P]=ie.useState(!1),[J,se]=ie.useState(!1),[ue,_e]=ie.useState(!1),[Z,F]=ie.useState(!1),ae=ie.useMemo(()=>Tu(l.shortcuts),[l.shortcuts]),[me,xe]=ie.useState(""),[Ce,je]=ie.useState(0),[Ae,$e]=ie.useState([]),[Xe,ke]=ie.useState(!0),[Ht,ge]=ie.useState(null),[de,Se]=ie.useState(null),[Ee,ye]=ie.useState(!1),[Re,Ke]=ie.useState("Workspace"),[Be,st]=ie.useState(!1),[ht,kt]=ie.useState(""),[tt,Qe]=ie.useState(!1),[He,Ci]=ie.useState([]),[Rt,Qt]=ie.useState("term"),[zt,$s]=ie.useState(""),[sn,rn]=ie.useState(""),[Je,yt]=ie.useState(null),[Ss,Jt]=ie.useState({status:"idle",stored:!1,encryptionAvailable:!0,sessionOnly:!1}),[nn,Fs]=ie.useState([]),[sc,ea]=ie.useState({status:"idle"}),[hi,Oi]=ie.useState({status:"idle",sessionId:null}),[is,ta]=ie.useState(null),bs=ie.useRef(null),an=ie.useRef(null),qi=ie.useRef(null),ys=ie.useRef(void 0),[Cs,Gi]=ie.useState(!1),[ri,Ct]=ie.useState(!1),[Ut,ni]=ie.useState({status:"idle"}),Ws=ie.useRef(null),ln=ie.useRef(void 0),[rc,ss]=ie.useState({status:"idle",stored:!1,encryptionAvailable:!0,sessionOnly:!1}),rs=ie.useRef(null),[qs,ws]=ie.useState([]),[wi,Gs]=ie.useState(l.sessions.defaultBackend),[xs,xt]=ie.useState(l.sessions.defaultWslDistribution),[ml,on]=ie.useState([]),[ns,Ki]=ie.useState([]),[Bi,ia]=ie.useState([]),[sa,ra]=ie.useState([]),[na,xr]=ie.useState(!1),xi=ie.useRef(new Map),ui=ie.useCallback((w,U)=>{U?xi.current.set(w,U):xi.current.delete(w)},[]),Er=ie.useRef(new Map),nc=ie.useCallback((w,U)=>{U?Er.current.set(w,U):Er.current.delete(w)},[]),Ks=ie.useRef(new Map),vl=ie.useCallback((w,U)=>{U?Ks.current.set(w,U):Ks.current.delete(w)},[]),[cn,hn]=ie.useState({}),[ei,aa]=ie.useState({}),Ar=ie.useRef(e0(De,(w,U)=>oa(V=>V[w]===U?V:{...V,[w]:U}))).current,la=Ar.listerFor,[as,oa]=ie.useState({}),[gl,Es]=ie.useState(null),[un,Sl]=ie.useState(null);ie.useEffect(()=>{De()?.appVersion?.().then(w=>Sl(Np(w))).catch(()=>{})},[]),ie.useEffect(()=>De()?.onSftpEvent?.(U=>{U.type==="prompt"?Es(U.prompt.text.trim().split(`
|
|
141
|
+
`).pop()??null):Es(null)}),[]);const ca=ie.useRef(new Set),dn=ie.useCallback(w=>{ca.current.has(w.id)||(ca.current.add(w.id),Ar.learnHome(w).then(U=>{U&&oa(V=>({...V,[w.id]:U}))}).catch(()=>{}))},[Ar]),bl=ie.useRef(new Set),yl=ie.useCallback(w=>{if(bl.current.has(w))return;bl.current.add(w);const U=De();U&&U.wslHome(w).then(V=>{V&&aa(ee=>({...ee,[w]:V}))}).catch(()=>{})},[]),ti=ie.useCallback(w=>{w&&(di(w),requestAnimationFrame(()=>xi.current.get(w)?.()))},[]),Vi=yr(()=>Se(null)),ha=yr(()=>{De()?.cancelAiRequest?.(),yt(null)}),ua=yr(()=>ye(!1)),Vs=yr(()=>se(!1)),Ys=yr(()=>_e(!1)),Cl=yr(()=>Gi(!1)),da=yr(()=>Ai()),wl=yr(()=>Ct(!1)),ii=ie.useCallback((w,U)=>{x(V=>{const ee=dp(V,w,U);return up(yu(),ee),ee})},[]),ji=ie.useCallback((w,U)=>{x(V=>dp(V,w,U))},[]),fa=ie.useCallback(w=>{x(U=>{const V=M0(U,w);return up(yu(),V),V})},[]);ie.useEffect(()=>{document.documentElement.dataset.theme=L},[L]);const it=ie.useMemo(()=>q.find(w=>w.id===r)??q[0]??null,[q,r]),$t=it?.view??Jo(l.sessions.defaultLayout),wt=$t.layout,qt=$t.focusedSessionId,_a=$t.maximizedSessionId??null,et=ie.useMemo(()=>$t.activeSessionId?T.find(w=>w.id===$t.activeSessionId)??null:null,[$t.activeSessionId,T]),Ft=ie.useCallback((w,U)=>{W(V=>V_(V,U??r,w))},[r]),As=ie.useCallback(w=>Ft({activeSessionId:w?.id}),[Ft]),It=ie.useCallback(w=>Ft(U=>({layout:typeof w=="function"?w(U.layout):w})),[Ft]),di=ie.useCallback(w=>Ft({focusedSessionId:w}),[Ft]),Ni=ie.useCallback(w=>Ft({maximizedSessionId:w}),[Ft]),lt=ie.useMemo(()=>{if(!it)return T;const w=new Set(it.sessionIds);return T.filter(U=>w.has(U.id))},[it,T]),xl=it?.pending??[],ls=ie.useCallback(async()=>{const w=De();if(ke(!0),ge(null),!w){ge("Preload API unavailable"),v("Preload API unavailable"),ke(!1);return}try{const U=await w.listSessions();N(U),v(U.length?`${U.length} session${U.length===1?"":"s"}`:"No sessions")}catch(U){const V=U instanceof Error?U.message:String(U);ge(V),v(V)}finally{ke(!1)}},[]);ie.useEffect(()=>{ls()},[ls]),ie.useEffect(()=>{const w=De();w&&w.listBackends?.().then(ws).catch(()=>ws([]))},[]),ie.useEffect(()=>{if(wi!=="wsl"){on([]),xt("");return}const w=De();w&&w.listWslDistributions?.().then(on).catch(()=>on([]))},[wi]),ie.useEffect(()=>{if(!J){Ki([]);return}const w=De();w&&w.listHistory?.().then(Ki).catch(()=>Ki([]))},[J]),ie.useEffect(()=>{const w=De(),U=gs((et?.kind==="ssh"?et.host:"")||(qt?T.find(ee=>ee.id===qt)?.host:"")||""),V=U?Bi.filter(ee=>gs(ee.hostName??"")===U||ee.alias===U):[];if(V.length===0){ra([]);return}w?.discoverRemoteScreens&&(xr(!0),Promise.allSettled(V.map(ee=>w.discoverRemoteScreens(ee))).then(ee=>{const be=[];ee.forEach((we,Me)=>{we.status==="fulfilled"&&Array.isArray(we.value)&&we.value.forEach(Pe=>{be.push({session:Pe,connection:V[Me]})})}),ra(be)}).catch(()=>ra([])).finally(()=>xr(!1)))},[Bi,et?.host,T,qt]),ie.useEffect(()=>{const w=De();w&&w.listKnownConnections?.().then(ia).catch(()=>ia([]))},[]),ie.useEffect(()=>{l.ai.recordCommands&&De()?.listCommandHistory?.().then($e).catch(()=>{})},[l.ai.recordCommands]),ie.useEffect(()=>{const w=De();w?.speechApiKeyStatus&&w.speechApiKeyStatus().then(U=>ss(V=>({...V,stored:U.stored,encryptionAvailable:U.encryptionAvailable}))).catch(()=>{})},[]),ie.useEffect(()=>{const w=De();w?.aiApiKeyStatus&&w.aiApiKeyStatus().then(U=>Jt(V=>({...V,stored:U.stored,encryptionAvailable:U.encryptionAvailable}))).catch(()=>{})},[]),ie.useEffect(()=>{Xe||!tt||W(w=>ng(w,T))},[T,Xe,tt]),ie.useEffect(()=>{const w=De();if(!w?.loadWorkspaces){Qe(!0);return}let U=!1;return w.loadWorkspaces().then(V=>{if(U)return;const ee=vg(V,l.sessions.defaultLayout);ee.workspaces.length&&(W(ee.workspaces),ee.activeWorkspaceId&&d(ee.activeWorkspaceId))}).catch(()=>{}).finally(()=>{U||Qe(!0)}),()=>{U=!0}},[]),ie.useEffect(()=>{Xe||!tt||W(w=>hg(w,U=>{const V=mu(yp(U),T,Bi);return V.kind==="attach"?V.sessionId:void 0}))},[T,Xe,tt,Bi]),ie.useEffect(()=>{const w=De();if(w?.onForwardEvent)return w.onForwardEvent(U=>{if(U.type==="status"){g(V=>_l(V,U.forward));return}if(U.type==="prompt"){b({forwardId:U.forwardId,kind:U.prompt.kind,text:U.prompt.text});return}g(V=>V.map(ee=>ee.id===U.forwardId&&ee.status!=="error"?{...ee,status:"idle"}:ee))})},[]),ie.useEffect(()=>{const w=De();if(!w?.loadForwards){y(!0);return}let U=!1;return Promise.all([w.loadForwards(),w.listForwards?.()??[]]).then(([V,ee])=>{if(U)return;const be=c0(V);g(ee.reduce((we,Me)=>_l(we,Me),be))}).catch(()=>{}).finally(()=>{U||y(!0)}),()=>{U=!0}},[]),ie.useEffect(()=>{if(!R)return;const w=De();if(!w?.saveForwards)return;const U=setTimeout(()=>{w.saveForwards(o0(c)).catch(()=>{})},bp);return()=>clearTimeout(U)},[c,R]),ie.useEffect(()=>{if(!tt||Xe)return;const w=De();if(!w?.saveWorkspaces)return;const U=setTimeout(()=>{w.saveWorkspaces(pg(q,r,T)).catch(()=>{})},bp);return()=>clearTimeout(U)},[q,r,T,tt,Xe]),ie.useEffect(()=>{r&&Ci(w=>w.includes(r)?w:[...w,r])},[r]),ie.useEffect(()=>{!et&<.length&&As(lt[0])},[et,lt,As]),ie.useEffect(()=>De()?.onLinkRefused?.(U=>v(U)),[]);const fn=ie.useRef(new Map);ie.useEffect(()=>{const w=De();if(w)return w.onData((U,V)=>{const ee=((fn.current.get(U)??"")+V).slice(-2048);fn.current.set(U,ee);const be=Qg(ee);be&&N(we=>{const Me=we.find(Pe=>Pe.id===U);return!Me||Me.cwd===be.path?we:we.map(Pe=>Pe.id===U?{...Pe,cwd:be.path}:Pe)})})},[]),ie.useEffect(()=>{const w=U=>{if(U.key==="Escape"){if(Hi.current){U.preventDefault(),wa();return}const ee=Hg({help:Z,transfer:ri,settings:Cs,voiceReview:!!is,overview:Ee,suggest:!!Je,modal:!!de,palette:ue,history:J});if(!ee)return;U.preventDefault(),ee==="help"&&F(!1),ee==="transfer"&&Ct(!1),ee==="settings"&&Gi(!1),ee==="voiceReview"&&Ai(),ee==="overview"&&ye(!1),ee==="suggest"&&(De()?.cancelAiRequest?.(),yt(null)),ee==="modal"&&Se(null),ee==="palette"&&_e(!1),ee==="history"&&se(!1);return}const V=jg({key:U.key,code:U.code,ctrlKey:U.ctrlKey,metaKey:U.metaKey,shiftKey:U.shiftKey,altKey:U.altKey,inTextField:U.target instanceof HTMLInputElement},ae);if(V){if(U.preventDefault(),V.action==="switch-workspace"){const ee=q[V.position-1];ee&&xa(ee.id);return}V.action==="toggle-help"&&F(ee=>!ee),V.action==="toggle-overview"&&ye(ee=>!ee),V.action==="new-workspace"&&(Ke(Fo(q)),Se("workspace")),V.action==="new-terminal"&&Ei("local"),V.action==="ask-ai"&&Rl(),V.action==="toggle-layout"&&Ft(ee=>({maximizedSessionId:null,layout:ee.layout==="stack"?ee.lastSplit:"stack"})),V.action==="toggle-sidebar"&&E(ee=>!ee),V.action==="toggle-settings"&&Gi(ee=>!ee),V.action==="history-palette"&&vc()}};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[Ee,Je,de,ue,J,Cs,ri,Z,is,hi.status,q,r,it,lt,T]);const Xs=cp(l.ai),Rs=Ru(et),pa=gg(et),_n=wt==="stack"?1:wt==="grid"?4:2,El=ie.useMemo(()=>new Set([...He,r]),[He,r]),ma=ie.useMemo(()=>tg(q.filter(w=>El.has(w.id)),T,r),[q,T,r,El]),Yi=ie.useMemo(()=>ma.filter(w=>w.workspaceId===r).map(w=>w.session),[ma,r]),ac=Math.max(_n,Yi.length),Gt=Yi.some(w=>w.id===_a)?_a:null,lc=Yi.find(w=>w.id===et?.id)?.id??Yi[0]?.id,oc=(w,U)=>wt==="stack"?w.id===lc:U<_n;ie.useEffect(()=>{ri&&!Rs&&Ct(!1)},[ri,Rs]),ie.useEffect(()=>{wt==="stack"||$t.lastSplit===wt||Ft({lastSplit:wt})},[wt,$t.lastSplit,Ft]);const Xi=async w=>{As(w),di(w.id);const U=Yi.findIndex(V=>V.id===w.id);Gt?Ni(w.id):U>=_n&&wt!=="stack"&&It("grid"),v(w.persistence==="process"?`${w.host} · ${w.name} · process only (install screen for persistence)`:`${w.host} · ${w.name}`),ye(!1)},os=(w,U=r)=>{W(V=>ig(V,U,w.id))},cc=async w=>{w.preventDefault();const U=Re.trim()||Fo(q),V=K_(U,l.sessions.defaultLayout);W(ee=>[...ee,V]),d(V.id),As(null),Se(null),v(`Workspace “${U}” ready`)},hc=async w=>{w.preventDefault();const U=De();if(U){if((it?_u(it):lt.length)>=4){v("This workspace supports up to 4 sessions."),Se(null);return}S(!0);try{const V=await U.createLocalSession({name:Rt,backend:wi,wslDistribution:wi==="wsl"?xs:void 0});N(ee=>[...ee.filter(be=>be.id!==V.id),V]),os(V),di(V.id),Ni(null),It(pu(lt.length+1)),Se(null),await Xi(V)}catch(V){v(V instanceof Error?V.message:String(V))}finally{S(!1)}}},va=async(w,U,V)=>{const ee=De();if(!ee||o)return null;const be=it?_u(it):lt.length;if(!V?.replacingPane&&be>=4)return v("This workspace supports up to 4 sessions."),Se(null),null;S(!0);try{const we=await ee.createSshSession({name:U||void 0,target:w});return N(Me=>[...Me.filter(Pe=>Pe.id!==we.id),we]),os(we),di(we.id),Ni(null),It(pu(V?.replacingPane?Math.max(be,1):be+1)),Se(null),await Xi(we),we}catch(we){return v(we instanceof Error?we.message:String(we)),null}finally{S(!1)}},uc=async w=>{w.preventDefault(),await va(sn,zt)},pn=async(w,U)=>{const V=De();if(!V)return null;if(w.kind==="unavailable")return v(w.reason),null;if(w.kind==="attach"){const be=T.find(we=>we.id===w.sessionId);return be?(os(be),await Xi(be),be):null}if(w.kind==="attach-remote-screen")return _c(w.name,w.screenName,w.connection);const ee=await va(w.target,w.name,U);return!ee||!w.screenCommand||(await V.attachSession(ee.id),await mn(V,ee.id),V.write(ee.id,`${w.screenCommand}\r`)),ee},dc=async w=>{const U=mu(yp(w),T,Bi);if(U.kind==="unavailable"){W(ee=>X_(ee,r,w.sessionId)),v(U.reason);return}v(`Reconnecting ${w.name}…`),await pn(U,{replacingPane:!0})&&W(ee=>X_(ee,r,w.sessionId))},fc=w=>{v(`Connecting to ${w.alias}…`),va(w.hostName??w.alias,w.alias.slice(0,48))},_c=async(w,U,V)=>{try{const ee=De();if(!ee)return null;v(`Attaching to ${w} on ${V.alias}…`);const we=(await ee.buildRemoteScreenAttach?.(V,U))?.args,Me=Array.isArray(we)?we.indexOf("--"):-1,Pe=Me>0?we[Me-1]:V.hostName??V.alias,Lt={...await ee.createSshSession({target:Pe,name:w}),screenName:U,persistence:"screen",backend:"screen"};N(Mt=>Mt.some(mt=>mt.id===Lt.id)?Mt.map(mt=>mt.id===Lt.id?Lt:mt):[...Mt,Lt]),os(Lt),await Xi(Lt),await ee.attachSession(Lt.id);const zi=we&&Me>0?we.slice(Me+1).join(" "):`screen -x ${U}`;return await mn(ee,Lt.id),ee.write(Lt.id,`${zi}\r`),await ls(),v(`Connected to ${w} on ${V.alias}`),Lt}catch(ee){return v(ee instanceof Error?ee.message:String(ee)),null}},mn=(w,U)=>new Promise(V=>{let ee=!1,be="",we,Me;const Pe=()=>{ee||(ee=!0,clearTimeout(we),clearTimeout(pt),Me?.(),V())},pt=setTimeout(Pe,TS);Me=w.onData((Lt,zi)=>{if(Lt===U){if(be=(be+zi).slice(-512),G_(be)){Pe();return}clearTimeout(we),we=setTimeout(Pe,MS)}})}),pc=ie.useCallback((w,U)=>{if(!l.ai.recordCommands)return;const V=bS(U.command);if(V){v(`Command not remembered — it looks like it carries a credential (${V}).`);return}const ee=De();if(!ee?.recordCommand)return;const be=T.find(we=>we.id===w);ee.recordCommand({command:U.command,...be?.cwd?{cwd:be.cwd}:{},...be?.host?{host:be.host}:{},...be?.kind?{kind:be.kind}:{},...U.exitCode===void 0?{}:{exitCode:U.exitCode}}).then(we=>{we&&$e(Me=>[...Me.filter(Pe=>Pe.id!==we.id),we])}).catch(()=>{})},[l.ai.recordCommands,T]),mc=ie.useMemo(()=>{const w=[...Er.current.values()];return{entries:Ae.length,panesReporting:w.filter(U=>U.hasMarks()).length,panesOpen:w.length}},[Ae,Cs,T]),vc=()=>{xe(""),je(0),_e(!0),De()?.listCommandHistory?.().then($e).catch(()=>{})},vn=ie.useMemo(()=>{if(!ue)return[];const w=T.find(U=>U.id===(qt??et?.id));return AS(Ae,{query:me,...w?.cwd?{cwd:w.cwd}:{},...w?.host?{host:w.host}:{},now:Date.now(),limit:40})},[ue,Ae,me,T,qt,et?.id]),Al=w=>{const U=qt??et?.id;if(_e(!1),!U){v("No terminal selected for the command");return}De()?.write(U,w.entry.command),De()?.pickCommand?.(w.entry.id).catch(()=>{}),v(`On the prompt: ${w.entry.command}`),ti(U)},gc=async()=>{await De()?.clearCommandHistory?.().catch(()=>{}),$e([]),v("Remembered commands forgotten.")},Rl=()=>{if(!Sp(l.ai)){Gi(!0),v("Set an AI endpoint and model in Settings first.");return}yt(bu(et?.id??qt))},Sc=async w=>{const U=De(),V=Je;if(!U?.requestAiCommand||!V)return;const ee=V.sessionId,be=ee?T.find(Pe=>Pe.id===ee):void 0,we=l.ai.includeOutput&&!!ee,Me=we&&ee?LS(Ks.current.get(ee)?.()??"",l.ai.outputChars):"";yt({phase:"thinking",sessionId:ee,prompt:w,usedOutput:we&&!!Me});try{const Pe=await U.requestAiCommand({baseUrl:l.ai.baseUrl,model:l.ai.model},{prompt:w,...ee?{sessionId:ee}:{},context:{...be?.backend?{shell:Pp(be.backend)}:{},...be?.cwd?{cwd:be.cwd}:{},...be?.host?{host:be.host}:{},...be?.kind?{kind:be.kind}:{},...Me?{output:Me}:{}}}),pt=we&&!!Me;if(RS(l.ai,pt,Pe.command)&&ee){U.write(ee,`${Pe.command}\r`),yt(null),v(`Ran suggestion: ${Pe.command}`);return}yt({phase:"reviewing",sessionId:ee,prompt:w,usedOutput:pt,suggestion:Pe})}catch(Pe){yt({phase:"failed",sessionId:ee,prompt:w,message:Zn(Pe)})}},bc=()=>{if(Je?.phase!=="reviewing")return;const{sessionId:w,suggestion:U}=Je;yt(null),!(!w||!U.command)&&(De()?.write(w,`${U.command}\r`),v(`Sent: ${U.command}`),ti(w))},ga=async()=>{const w=De();if(w?.listAiModels)try{Fs(await w.listAiModels(l.ai.baseUrl))}catch(U){Fs([]),v(Zn(U))}},Rr=async()=>{const w=De();if(!w?.testAiEndpoint)return;ea({status:"testing",message:null});const U=await w.testAiEndpoint({baseUrl:l.ai.baseUrl,model:l.ai.model});ea({status:"idle",ok:U.ok,message:U.message})},Ll=ie.useMemo(()=>{const w=new Set;for(const U of T)U.kind==="ssh"&&U.host&&w.add(U.host);for(const U of Bi)w.add(U.hostName??U.alias);return[...w]},[T,Bi]),gn=()=>{O(w=>w||(et?.kind==="ssh"?et.host:Ll[0])||""),P(!1),Se("forward")},Sa=async w=>{const U=De();if(!U?.openForward)return;const V=l0(w,c);if(V){v(V);return}u("ports"),g(ee=>_l(ee,{...w,status:"connecting"}));try{const ee=await U.openForward(w);g(be=>_l(be,ee)),v(`Sharing ${sp(ee)}`)}catch(ee){const be=Zn(ee);g(we=>_l(we,{...w,status:"error",message:be})),v(be)}},Ml=async w=>{w.preventDefault();const U=Number(re),V=Number(Y||re);if([U,V].some(be=>!Number.isInteger(be)||be<1||be>65535)){v("A port must be a whole number between 1 and 65535.");return}Se(null),await Sa({id:`forward:${crypto.randomUUID()}`,target:A.trim(),direction:z,bind:k,listenPort:U,destinationPort:V,...j.trim()?{destinationHost:j.trim()}:{}})},Tl=async w=>{const U=De();g(V=>V.filter(ee=>ee.id!==w.id)),v(`Stopped sharing ${Qr(w)}`);try{await U?.closeForward?.(w.id)}catch{}},ba=w=>it?.view.browsers?.[w],cs=w=>!!ba(w)?.open,yc=w=>ba(w)?.ratio??Mp,Dl=(w,U)=>{Ft(V=>({browsers:{...V.browsers,[w]:{open:!1,...V.browsers?.[w],...U}}}))},kl=w=>{const U=!cs(w);Dl(w,{open:U}),U||hn(V=>({...V,[w]:""}))},Ol=w=>cn[w.id]||wg(w,Bl(w)),Bl=w=>w.kind==="ssh"?as[w.id]:w.wslDistribution?ei[w.wslDistribution]:void 0,Lr=(w,U)=>{const V=De();if(!V)return;const ee=Sg(w);if(!ee){v(`ZeroG does not know how ${w.name} quotes a path, so it will not type one.`);return}const be=tp(w,U);if(!be){v(`That directory is outside what ${w.name} can reach.`);return}if(!Mr(w)){v(`${w.name} is running something, so its directory was left alone.`);return}const we=Rg(ee,be);if("refused"in we){v(we.refused);return}V.write(w.id,we.command+"\r"),hn(Me=>({...Me,[w.id]:U})),v(`${w.name}: ${we.command}`),ti(w.id)},Mr=w=>{const U=Er.current.get(w.id);if(U?.hasMarks())return U.atPrompt();const V=Ks.current.get(w.id);if(!V)return!1;const ee=V().trimEnd().split(`
|
|
142
|
+
`);return G_(ee[ee.length-1]??"")},ya=ie.useRef(new Map);ie.useEffect(()=>{const w=[];for(const U of T)ya.current.has(U.id)&&ya.current.get(U.id)!==U.cwd&&w.push(U.id),ya.current.set(U.id,U.cwd);w.length&&hn(U=>{const V={...U};let ee=!1;for(const be of w)V[be]&&(delete V[be],ee=!0);return ee?V:U})},[T]),ie.useEffect(()=>{for(const w of T){if(!cs(w.id))continue;const U=!w.cwd||w.cwd.startsWith("~");if(w.kind==="ssh"){as[w.id]||dn(w);continue}!w.wslDistribution||!U||ei[w.wslDistribution]||yl(w.wslDistribution)}},[T,it?.view.browsers,ei,as,yl,dn]);const Hi=ie.useRef(null),[jl,Sn]=ie.useState(null),[Tr,bn]=ie.useState(null),[Nl,Ca]=ie.useState(null),Dr=ie.useRef(!1),Cc=()=>[...document.querySelectorAll(".workspace-tab-slot")].map(w=>{const U=w.getBoundingClientRect();return{id:w.dataset.workspaceId??"",left:U.left,width:U.width}}),wc=(w,U)=>{U.button===0&&(U.target.closest(".workspace-tab-close")||(Hi.current={id:w.id,pointerId:U.pointerId,startX:U.clientX,dragging:!1,original:q},U.currentTarget.setPointerCapture?.(U.pointerId)))},xc=w=>{const U=Hi.current;if(!U||U.pointerId!==w.pointerId)return;if(!U.dragging){if(!cS(U.startX,w.clientX))return;U.dragging=!0,Dr.current=!0,Sn(U.id)}const V=Cc();if(V.findIndex(we=>we.id===U.id)<0)return;const be=hS(V,w.clientX);W(we=>{const Me=Su(we,U.id);return Me<0?we:mp(we,Me,be)})},Ec=w=>{const U=Hi.current;!U||U.pointerId!==w.pointerId||(w.currentTarget.releasePointerCapture?.(w.pointerId),Hi.current=null,Sn(null),U.dragging&&window.setTimeout(()=>{Dr.current=!1},0))},wa=()=>{const w=Hi.current;w&&(Hi.current=null,Sn(null),w.dragging&&W(w.original),Dr.current=!1)},ai=w=>{const U=Su(q,w.id),V=q.length-1,ee=be=>W(we=>mp(we,Su(we,w.id),be));return[{label:"Rename…",icon:"pencil",onSelect:()=>{Ca(w.id),Ke(w.name),Se("rename")}},{label:"Duplicate",icon:"copy",hint:"Copies the layout, and each SSH pane as one to reconnect",onSelect:()=>kr(w)},{label:"Move left",icon:"chevron-left",disabled:U<=0,onSelect:()=>ee(U-1)},{label:"Move right",icon:"chevron-right",disabled:U<0||U>=V,onSelect:()=>ee(U+1)},{label:"Close workspace",icon:"x",danger:!0,disabled:q.length<2,hint:q.length<2?"The last workspace cannot be closed":"Its terminals keep running",onSelect:()=>Ea(w.id)}]},kr=w=>{const U=Fo(q),V=lg(q,w.id,T,U);if(!V.created)return;W(V.workspaces),d(V.created.id),As(null);const ee=[`Workspace “${U}” copies ${w.name}`];V.copied&&ee.push(`${V.copied} SSH ${V.copied===1?"pane":"panes"} to reconnect`),V.skipped&&ee.push(`${V.skipped} local ${V.skipped===1?"pane":"panes"} not copied`),v(ee.join(" · "))},Hl=async w=>{w.preventDefault();const U=Nl,V=Re.trim();if(Se(null),Ca(null),!U||!Cu(V))return;const ee=q.find(be=>be.id===U)?.name;V!==ee&&(W(be=>Y_(be,U,V)),v(`Workspace “${ee}” is now “${V}”`))},yn=()=>{Ke(Fo(q)),Se("workspace")},xa=w=>{if(w===r)return;const U=q.find(V=>V.id===w);U&&(st(!1),d(w),v(`Workspace “${U.name}”`))},Ea=w=>{const U=q.find(be=>be.id===w),V=cg(q,w,r);if(V.workspaces===q)return;st(!1),W(V.workspaces),d(V.activeWorkspaceId);const ee=V.releasedSessionIds.length;v(ee?`Closed workspace “${U?.name}” · ${ee} session${ee===1?"":"s"} still running`:`Closed workspace “${U?.name}”`)},Aa=()=>{it&&(kt(it.name),st(!0))},zl=()=>{if(st(!1),!it)return;const w=ht.trim();!Cu(w)||w===it.name||(W(U=>Y_(U,it.id,w)),v(`Workspace renamed to “${w}”`))},Ei=(w,U)=>{Qt(FS(it?.name??"term",lt)),Gs(qp(l.sessions.defaultBackend,qs)),xt(l.sessions.defaultWslDistribution),U?.sshTarget!==void 0&&rn(U.sshTarget),Se(w)},Zs=()=>Ei("local"),Or=()=>c.length?m.jsx("div",{className:"session-list",children:r0(c).map(w=>m.jsxs(en.Fragment,{children:[m.jsx("div",{className:"session-group-label",children:w.host}),w.forwards.map(U=>m.jsxs("div",{className:`session-row forward-row ${U.status==="idle"?"session-ghosted":""}`,children:[m.jsx("span",{className:`status-dot ${n0(U)}`}),m.jsx("button",{type:"button",className:"forward-open",onClick:()=>U.status==="idle"||U.status==="error"?void Sa(U):void 0,title:U.status==="idle"||U.status==="error"?`Reconnect ${Qr(U)}`:sp(U),children:m.jsxs("span",{className:"session-copy",children:[m.jsx("b",{children:Qr(U)}),m.jsxs("small",{children:[U.direction==="local"?"←":"→"," ",U.destinationHost||"localhost",":",U.destinationPort,U.status==="connecting"?" · connecting…":"",U.status==="idle"?" · not connected":"",U.status==="error"?` · ${U.message??"failed"}`:""]})]})}),a0(U)&&m.jsx("span",{className:"forward-badge",title:"Reachable from your network, not just this machine",children:"LAN"}),m.jsx("button",{type:"button",className:"forward-close",onClick:()=>{Tl(U)},title:`Stop sharing ${Qr(U)}`,"aria-label":`Stop sharing ${Qr(U)}`,children:"×"})]},U.id))]},w.host))}):m.jsx("div",{className:"session-list",children:m.jsxs("div",{className:"session-empty",children:[m.jsx("b",{children:"No shared ports"}),m.jsx("small",{children:"Share a port to reach a service on a remote host from this machine, or the other way round."}),m.jsx("button",{type:"button",onClick:gn,children:"Share a port"})]})}),Ra=()=>{const w=gs((et?.kind==="ssh"?et.host:"")||(qt?T.find(Me=>Me.id===qt)?.host:"")||""),U=w?sa.filter(Me=>gs(Me.connection.hostName??"")===w||Me.connection.alias===w).reduce((Me,Pe)=>{const pt=Pe.connection.hostName||Pe.connection.alias;return(Me[pt]=Me[pt]||[]).push(Pe),Me},{}):{},V=T.filter(Me=>Me.persistence==="screen"&&!lt.some(Pe=>Pe.id===Me.id)),ee=Object.keys(U).length>0,be=V.length>0;if(!ee&&!be)return m.jsxs("div",{className:"session-empty",children:[m.jsx("b",{children:"No screens"}),m.jsx("small",{children:w?"No remote screens found for this host.":"Open a remote session to discover screens, or start a local screen."})]});const we=[];if(ee)for(const[Me,Pe]of Object.entries(U)){const pt=Pe,Lt=m.jsx("div",{className:"session-group-label",children:Me},`${Me}-label`),zi=pt.map(({session:Mt})=>{const Qi=pt.find(mt=>mt.session.id===Mt.id)?.connection;return m.jsx(qo,{session:Mt,ghosted:!0,onClick:async()=>{if(!Qi)return;v(`Attaching ${Mt.name}…`);const mt=De();if(mt)try{const pi=(await mt.buildRemoteScreenAttach?.(Qi,Mt.screenName??Mt.name))?.args,oi=Array.isArray(pi)?pi.indexOf("--"):-1,Ui=oi>0?pi[oi-1]:Qi.hostName??Qi.alias,Ii={...await mt.createSshSession({target:Ui,name:Mt.name}),screenName:Mt.screenName??Mt.name,persistence:"screen",backend:"screen"};N(jr=>jr.some(Nr=>Nr.id===Ii.id)?jr.map(Nr=>Nr.id===Ii.id?Ii:Nr):[...jr,Ii]),os(Ii),await Xi(Ii),await mt.attachSession(Ii.id);const Ba=pi&&oi>0?pi.slice(oi+1).join(" "):`screen -x ${Mt.screenName??Mt.name}`;await mn(mt,Ii.id),mt.write(Ii.id,`${Ba}\r`),await ls(),v(`Connected to ${Mt.name}`)}catch(Kt){v(Kt instanceof Error?Kt.message:String(Kt))}}},Mt.id)});we.push(Lt,...zi)}return be&&!ee&&(we.push(m.jsx("div",{className:"session-group-label",children:"local"},"local-label")),V.forEach(Me=>{we.push(m.jsx(qo,{session:Me,ghosted:!0,onClick:()=>{os(Me),Xi(Me),v(`Reconnecting to ${Me.name}…`)}},Me.id))})),m.jsx(m.Fragment,{children:we})},Ul=wt==="split-v"?"pane-grid split-v":wt==="split-h"?"pane-grid split-h":wt==="grid"?"pane-grid grid":"pane-grid",hs=!Gt&&(wt==="split-v"||wt==="grid"),Ls=!Gt&&(wt==="split-h"||wt==="grid"),Zi=l.sessions.splitColumnRatio,us=l.sessions.splitRowRatio,ds=ie.useRef(null),Il=Gt?void 0:{...hs?{gridTemplateColumns:`${Zi}fr ${1-Zi}fr`}:{},...Ls?{gridTemplateRows:`${us}fr ${1-us}fr`}:{}},La=(w,U)=>{const V=ds.current?.getBoundingClientRect();if(!V)return;const ee=w==="column"?(U.clientX-V.left)/V.width:(U.clientY-V.top)/V.height;Number.isFinite(ee)&&ji("sessions",w==="column"?{splitColumnRatio:ee}:{splitRowRatio:ee})},Ma=(w,U)=>{const ee=(w==="column"?Zi:us)+U*.02;ii("sessions",w==="column"?{splitColumnRatio:ee}:{splitRowRatio:ee})},Pl=w=>{ii("sessions",w==="column"?{splitColumnRatio:ze.sessions.splitColumnRatio}:{splitRowRatio:ze.sessions.splitRowRatio})},Cn={layout:wt,maximized:!!Gt,columnRatio:Zi,rowRatio:us,sessionCount:lt.length,lastSplit:$t.lastSplit},$l=ie.useRef(null),Fl=w=>{const U=$l.current?.getBoundingClientRect();U&&ji("sessions",{sidebarWidth:Math.round(w.clientX-U.left)})},Wl=w=>{Ft(U=>({focusedSessionId:w,maximizedSessionId:U.maximizedSessionId===w?null:w}))},wn=w=>{if(w.kind==="restore"){Ni(null);return}if(w.kind==="show"){Ni(null),It(w.layout);return}if(w.kind==="reset-splits"){ii("sessions",w.ratios);return}const U=qt??et?.id??lt[0]?.id;U&&Ni(U)},fi=w=>{if(!Gt||lt.length<2)return;const V=(lt.findIndex(be=>be.id===Gt)+w+lt.length)%lt.length,ee=lt[V];di(ee.id),As(ee),Ni(ee.id)},Br=()=>(an.current??=new lS({createWorker:()=>new Worker(new URL(""+new URL("voice-worker-DoNT0zEM.js",import.meta.url).href,import.meta.url),{type:"module"}),resolveApiKey:async()=>rs.current??await window.zerog?.readSpeechApiKey()??null}),an.current),_i=async w=>{const U=De();if(U?.saveSpeechApiKey){ss(V=>({...V,status:"saving",error:null,notice:null}));try{const V=await U.saveSpeechApiKey(w);rs.current=null,ss({status:"idle",stored:V.stored,encryptionAvailable:V.encryptionAvailable,sessionOnly:!1,notice:V.stored?"Key saved, encrypted by this system.":"Key cleared."})}catch(V){rs.current=w,ss(ee=>({...ee,status:"idle",stored:!1,encryptionAvailable:!1,sessionOnly:!0,notice:"Kept for this session only — it could not be stored safely, so it is gone when ZeroG closes.",error:null})),v(V instanceof Error?V.message:String(V))}}},Qs=async()=>{const w=De();if(rs.current=null,!w?.clearSpeechApiKey){ss(U=>({...U,stored:!1,sessionOnly:!1,notice:"Key cleared.",error:null}));return}try{const U=await w.clearSpeechApiKey();ss(V=>({...V,status:"idle",stored:U.stored,sessionOnly:!1,notice:"Key cleared.",error:null}))}catch(U){ss(V=>({...V,status:"idle",sessionOnly:!1,error:U instanceof Error?U.message:String(U)}))}},Ta=async w=>{const U=De();if(U?.saveAiApiKey){Jt(V=>({...V,status:"saving",error:null,notice:null}));try{const V=await U.saveAiApiKey(w);Jt({status:"idle",stored:V.stored,encryptionAvailable:V.encryptionAvailable,sessionOnly:!1,notice:V.stored?"Key saved, encrypted by this system.":"Key cleared."})}catch(V){Jt(ee=>({...ee,status:"idle",error:Zn(V)}))}}},xn=async()=>{const w=De();if(w?.clearAiApiKey)try{const U=await w.clearAiApiKey();Jt(V=>({...V,status:"idle",stored:U.stored,notice:"Key cleared.",error:null}))}catch(U){Jt(V=>({...V,status:"idle",error:Zn(U)}))}},En=w=>{if(w.kind==="notice"){v(w.message);return}w.progress!==null&&v(`Loading speech model… ${Math.round(w.progress)}%`)},Da=()=>{const w=qi.current;window.clearTimeout(ys.current),bs.current?.cancel(),bs.current=null,qi.current=null,Oi({status:"idle",sessionId:null}),ti(w)},Ai=()=>{const w=is?.sessionId;ta(null),ti(w)},ka=async()=>{const w=bs.current,U=qi.current;if(!w||!U)return;window.clearTimeout(ys.current),bs.current=null,Oi({status:"transcribing",sessionId:U}),v("Transcribing…");const V=await w.stop();if(!V||F_(V,l.speech.silenceThreshold)){qi.current=null,Oi({status:"idle",sessionId:null}),v("Voice: no speech detected — lower the silence threshold in Settings if this is wrong"),ti(U);return}try{const ee=await Br().transcribe(V,l.speech,En);if(qi.current=null,Oi({status:"idle",sessionId:null}),!ee.text){v("Voice: nothing transcribed"),ti(U);return}if(l.ai.voiceInsert==="review"){ta({sessionId:U,text:ee.text}),v(`Voice: review "${ee.text}"`);return}De()?.write(U,ee.text),v(`Voice: "${ee.text}"`),ti(U)}catch(ee){qi.current=null,Oi({status:"idle",sessionId:null}),v(`Voice error: ${ee instanceof Error?ee.message:String(ee)}`),ti(U)}},An=async w=>{if(hi.status==="listening"&&hi.sessionId===w.id){await ka();return}if(hi.status!=="idle")return;if(Ut.status!=="idle"){v("The speech test in Settings is using the microphone");return}const U=new W_;try{await U.start()}catch(V){v(`Microphone unavailable: ${V instanceof Error?V.message:String(V)}`);return}bs.current=U,qi.current=w.id,Oi({status:"listening",sessionId:w.id}),ti(w.id),window.clearTimeout(ys.current),ys.current=window.setTimeout(()=>{ka()},l.speech.maxUtteranceSeconds*1e3),v(`Listening on ${w.name}… click the mic again to transcribe, Esc to discard`)},Js=w=>{const U=De();if(!U)return;const V=cp(l.ai);U.write(w.id,`${V}\r`),v(`Sent "${V}" to ${w.name}`),ti(w.id)},ql=async()=>{const w=Ws.current;if(!w)return;window.clearTimeout(ln.current),Ws.current=null,ni({status:"transcribing",message:"Transcribing…",transcript:null,error:null});const U=await w.stop();if(!U){ni({status:"idle",error:"Nothing was recorded."});return}const V=xp(U),ee=F_(U,l.speech.silenceThreshold);try{const be=await Br().transcribe(U,l.speech,we=>{ni(Me=>({...Me,message:we.kind==="notice"?we.message:we.progress!==null?`Loading speech model… ${Math.round(we.progress)}%`:"Loading speech model…"}))});ni({status:"idle",transcript:be.text,elapsedMs:be.elapsedMs,level:V,message:ee?"Below the silence threshold — a real recording at this level would have been discarded.":be.engine==="server"?"Transcribed by the server.":"Transcribed by the built-in engine.",error:null})}catch(be){ni({status:"idle",level:V,error:be instanceof Error?be.message:String(be)})}},li=async()=>{if(Ut.status==="recording"){await ql();return}if(Ut.status==="transcribing")return;if(hi.status!=="idle"){ni({status:"idle",error:"A terminal pane is recording — stop that first."});return}const w=new W_;try{await w.start()}catch(U){ni({status:"idle",error:`Microphone unavailable: ${U instanceof Error?U.message:String(U)}`});return}Ws.current=w,ni({status:"recording",message:"Listening… say a command, then stop.",transcript:null,error:null}),window.clearTimeout(ln.current),ln.current=window.setTimeout(()=>{ql()},l.speech.maxUtteranceSeconds*1e3)};ie.useEffect(()=>()=>{window.clearTimeout(ys.current),window.clearTimeout(ln.current),bs.current?.cancel(),Ws.current?.cancel(),an.current?.dispose()},[]);const Oa=async w=>{hi.sessionId===w.id&&Da(),Ar.forget(w.id);const U=lt.filter(ee=>ee.id!==w.id);W(ee=>{const be=sg(ee,w.id);return V_(be,r,we=>({activeSessionId:we.activeSessionId??U[0]?.id,focusedSessionId:we.focusedSessionId??U[0]?.id,layout:pu(U.length)}))});const V=De();if(V)try{await V.closeSession(w.id)}catch(ee){v(ee instanceof Error?ee.message:String(ee));return}v(w.persistence==="screen"?`Closed ${w.name} · screen session survives`:w.kind==="ssh"?`Closed ${w.name} · SSH connection ended`:`Closed ${w.name} · process ended`),ls()};return m.jsxs("main",{className:`app-shell ${C?"drawer-collapsed":""}`,children:[m.jsxs("header",{className:"window-bar",children:[m.jsxs("div",{className:"window-brand",title:Hp(un),children:[m.jsx("span",{className:"brand-mark",children:"ZG"}),m.jsx("span",{className:"brand-name",children:"ZeroG"}),un&&m.jsx("span",{className:"brand-version",children:un})]}),m.jsx("div",{className:"workspace-tabs",children:q.map((w,U)=>{const V=q.length>1,ee=og(w,T);return m.jsxs("span",{className:`workspace-tab-slot ${V?"closable":""} ${jl===w.id?"dragging":""}`,"data-workspace-id":w.id,children:[m.jsxs("button",{type:"button",className:`workspace-tab ${w.id===it?.id?"active":""}`,title:`Switch to ${w.name}${U<9?` (Ctrl+Shift+${U+1})`:""} · drag to reorder`,onPointerDown:be=>wc(w,be),onContextMenu:be=>{be.preventDefault(),wa(),bn({id:w.id,at:{x:be.clientX,y:be.clientY}})},onPointerMove:xc,onPointerUp:Ec,onPointerCancel:wa,onClick:()=>{Dr.current||xa(w.id)},children:[m.jsx("span",{className:`status-dot ${ee==="empty"?"":ee}`}),w.name,m.jsx("span",{className:"tab-meta",children:_u(w)})]}),V&&m.jsx("button",{type:"button",className:"workspace-tab-close",title:`Close ${w.name} · its terminals keep running`,"aria-label":`Close workspace ${w.name}`,onClick:()=>Ea(w.id),children:"×"})]},w.id)})}),m.jsxs("div",{className:"window-actions",children:[m.jsxs("button",{type:"button",className:"bar-button",onClick:()=>ye(w=>!w),title:`Session overview (${yi("toggle-overview",ae)})`,children:[m.jsx(Ie,{name:"grid"}),m.jsx("span",{children:"Overview"})]}),m.jsxs("button",{type:"button",className:"bar-button",onClick:yn,title:`New workspace (${yi("new-workspace",ae)})`,children:[m.jsx(Ie,{name:"plus"}),m.jsx("span",{children:"Workspace"})]}),m.jsxs("button",{type:"button",className:"bar-button",onClick:Rl,title:Sp(l.ai)?`Ask for a command (${yi("ask-ai",ae)})`:"Set an AI endpoint in Settings first",children:[m.jsx(Ie,{name:"spark"}),m.jsx("span",{children:"Suggest"})]}),m.jsx("button",{type:"button",className:"bar-button theme-button",onClick:()=>ii("appearance",{theme:L==="dark"?"light":"dark"}),title:`Switch to ${L==="dark"?"light":"dark"} theme`,"aria-label":`Switch to ${L==="dark"?"light":"dark"} theme`,"aria-pressed":L==="light",children:m.jsx(Ie,{name:L==="dark"?"sun":"moon"})}),m.jsx("button",{type:"button",className:Z?"bar-button active":"bar-button",onClick:()=>F(w=>!w),title:`Features and keyboard shortcuts (${yi("toggle-help",ae)})`,"aria-label":"Help","aria-pressed":Z,children:m.jsx(Ie,{name:"help"})})]})]}),m.jsxs("div",{className:"body-shell",children:[m.jsxs("nav",{className:"rail","aria-label":"Workspace navigation",children:[m.jsx("button",{type:"button",className:"rail-button",title:`${C?"Show":"Hide"} sessions sidebar (${yi("toggle-sidebar",ae)})`,onClick:()=>E(w=>!w),children:m.jsx(Ie,{name:C?"panel-left-open":"panel-left"})}),m.jsx("button",{type:"button",className:`rail-button ${!C&&h==="sessions"?"active":""}`,title:"Sessions",onClick:()=>{u("sessions"),E(!1)},children:m.jsx(Ie,{name:"sessions"})}),m.jsx("button",{type:"button",className:"rail-button",onClick:()=>ye(!0),title:"Overview",children:m.jsx(Ie,{name:"grid"})}),m.jsx("button",{type:"button",className:`rail-button ${!C&&h==="ports"?"active":""}`,title:"Shared ports","aria-label":"Shared ports",onClick:()=>{u("ports"),E(!1)},children:m.jsx(Ie,{name:"ports"})}),m.jsx("span",{className:"rail-spacer"}),m.jsx("button",{type:"button",className:"rail-button",onClick:gn,title:"Share a port over SSH","aria-label":"Share a port",children:m.jsx(Ie,{name:"port-plus"})}),m.jsx("button",{type:"button",className:"rail-button",onClick:Zs,title:`New local terminal (${yi("new-terminal",ae)})`,"aria-label":"New local terminal",children:m.jsx(Ie,{name:"terminal"})}),m.jsx("button",{type:"button",className:"rail-button",onClick:()=>Ei("ssh"),title:"Connect SSH",children:m.jsx(Ie,{name:"ssh"})}),m.jsx("button",{type:"button",className:`rail-button ${Cs?"active":""}`,title:`Settings (${yi("toggle-settings",ae)})`,"aria-label":"Settings","aria-expanded":Cs,onClick:()=>Gi(w=>!w),children:m.jsx(Ie,{name:"settings"})})]}),!C&&m.jsxs("aside",{className:"session-drawer",ref:$l,style:{width:l.sessions.sidebarWidth},children:[m.jsxs("div",{className:"drawer-head",children:[m.jsxs("div",{className:"drawer-head-name",children:[m.jsx("span",{className:"eyebrow",children:h==="ports"?"SHARED PORTS":"WORKSPACE"}),h==="ports"?m.jsx("h1",{children:"Ports"}):Be&&it?m.jsx("input",{className:"workspace-rename",autoFocus:!0,"aria-label":"Workspace name",value:ht,pattern:Ko,onChange:w=>kt(w.target.value),onBlur:zl,onKeyDown:w=>{w.key==="Enter"&&(w.preventDefault(),w.stopPropagation(),zl()),w.key==="Escape"&&(w.preventDefault(),w.stopPropagation(),st(!1))}}):m.jsx("h1",{onDoubleClick:Aa,title:it?"Double-click to rename this workspace":void 0,children:it?.name??"Sessions"})]}),m.jsxs("div",{className:"drawer-head-actions",children:[m.jsx("button",{type:"button",className:"square-button",onClick:()=>E(!0),title:"Hide sessions sidebar",children:m.jsx(Ie,{name:"panel-left"})}),m.jsx("button",{type:"button",className:"square-button history-button",onClick:()=>se(w=>!w),title:"Session history","aria-label":"Open session history","aria-expanded":J,children:m.jsx(Ie,{name:"history"})}),m.jsx("button",{type:"button",className:"square-button",onClick:yn,title:`New workspace (${yi("new-workspace",ae)})`,"aria-label":"New workspace",children:m.jsx(Ie,{name:"plus"})})]})]}),h==="ports"?Or():m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"drawer-tools",role:"tablist","aria-label":"Session inventory",children:["terminals","screens","connections"].map(w=>{const U={terminals:"Terminals",screens:"Screens",connections:"Connections"},V=w==="terminals"?lt.length:w==="screens"?T.filter(ee=>(ee.persistence==="screen"||ee.screenName)&&!lt.some(be=>be.id===ee.id)).length+sa.length:T.filter(ee=>ee.kind==="ssh").length;return m.jsxs("button",{type:"button",role:"tab","aria-selected":p===w,className:`drawer-tool ${p===w?"active":""}`,onClick:()=>n(w),children:[U[w]," ",m.jsx("span",{children:V})]},w)})}),m.jsx("div",{className:"session-list",role:"tabpanel",children:Xe?m.jsxs("div",{className:"session-empty",children:[m.jsx("b",{children:"Loading sessions…"}),m.jsx("small",{children:"Checking available terminals and durable sessions."})]}):Ht?m.jsxs("div",{className:"session-empty session-error",children:[m.jsx("b",{children:"Session inventory unavailable"}),m.jsx("small",{children:Ht}),m.jsx("button",{type:"button",onClick:()=>{ls()},children:"Retry"})]}):p==="terminals"?lt.length||xl.length?m.jsxs(m.Fragment,{children:[lt.map(w=>m.jsx(qo,{session:w,active:et?.id===w.id,onClick:()=>{Xi(w)}},w.id)),xl.map(w=>m.jsx(DS,{member:w,onClick:()=>{dc(w)}},w.sessionId))]}):m.jsxs("div",{className:"session-empty",children:[m.jsx("b",{children:"No terminals yet"}),m.jsx("small",{children:"Add a local terminal or SSH connection to this workspace."})]}):p==="screens"?Ra():p==="connections"?Bi.length?Bi.map(w=>m.jsx(kS,{connection:w,onConfigure:()=>Ei("ssh",{sshTarget:w.hostName??w.alias}),onConnect:()=>fc(w)},w.alias)):m.jsxs("div",{className:"session-empty",children:[m.jsx("b",{children:"No saved connections"}),m.jsx("small",{children:"Add Host entries to ~/.ssh/config to populate connections."})]}):T.filter(w=>w.kind==="ssh"&&w.scope==="remote"&&w.source==="discovered").length?T.filter(w=>w.kind==="ssh"&&w.scope==="remote"&&w.source==="discovered").map(w=>m.jsx(qo,{session:w,ghosted:!0,onClick:async()=>{v(`Attaching remote screen ${w.name}…`);const U=De();if(U)try{const ee=(await U.buildRemoteScreenAttach?.({alias:w.host,hostName:w.host},w.screenName??w.name))?.args?.find(we=>we.includes("@")||!we.startsWith("-"))??w.host,be=await U.createSshSession({target:ee,name:w.name});N(we=>we.map(Me=>Me.id===w.id?be:Me)),os(be),await Xi(be)}catch(V){v(V instanceof Error?V.message:String(V))}}},w.id)):m.jsxs("div",{className:"session-empty",children:[m.jsx("b",{children:"No remote screens"}),m.jsx("small",{children:"Remote screen sessions will appear here after discovery."})]})})]}),m.jsxs("div",{className:"drawer-bottom",children:[m.jsxs("button",{type:"button",className:"drawer-action",onClick:gn,children:[m.jsx(Ie,{name:"port-plus"})," Share port"]}),m.jsxs("button",{type:"button",className:"drawer-action",onClick:Zs,children:[m.jsx(Ie,{name:"plus"})," Local terminal ",m.jsx("kbd",{children:"⌘⇧T"})]}),m.jsxs("button",{type:"button",className:"drawer-action",onClick:()=>Ei("ssh"),children:[m.jsx(Ie,{name:"ssh"})," Connect SSH"]}),m.jsxs("div",{className:"drawer-status",children:[m.jsx("span",{className:"status-dot connected"}),_]})]})]}),!C&&m.jsx(Vo,{orientation:"vertical",className:"sidebar-resizer",label:"Sidebar width",valuePercent:l.sessions.sidebarWidth/bt.sidebarWidth.max*100,onDrag:Fl,onCommit:()=>ii("sessions",{sidebarWidth:l.sessions.sidebarWidth}),onNudge:w=>ii("sessions",{sidebarWidth:l.sessions.sidebarWidth+w*16}),onReset:()=>ii("sessions",{sidebarWidth:ze.sessions.sidebarWidth})}),m.jsxs("section",{className:"workspace",children:[m.jsxs("div",{className:"workspace-head",children:[m.jsxs("div",{className:"location",children:[C&&m.jsx("button",{type:"button",className:"inline-restore",onClick:()=>E(!1),title:"Show sessions sidebar",children:m.jsx(Ie,{name:"panel-left-open"})}),m.jsx("span",{className:"connection-dot"}),m.jsx("span",{children:et?.host??"local"}),m.jsx("span",{className:"slash",children:"/"}),m.jsx("span",{children:et?.cwd??"~"}),m.jsx("span",{className:"slash",children:"/"}),m.jsx("span",{className:"muted-text",children:et?.name??it?.name??"no session"})]}),m.jsxs("div",{className:"head-controls",children:[m.jsxs("div",{className:"layout-controls",children:[m.jsx("span",{className:"control-label",children:"SFTP"}),m.jsx("button",{type:"button",className:ri?"layout-button active":"layout-button",onClick:()=>Ct(w=>!w),disabled:!pa.available||!De()?.sftpOpen,title:pa.reason,"aria-label":"Transfer files over SFTP",children:m.jsx(Ie,{name:"transfer"})})]}),m.jsxs("div",{className:"layout-controls",children:[m.jsx("span",{className:"control-label",children:"LAYOUT"}),m.jsx("button",{type:"button",className:wt==="stack"||Gt?"layout-button active":"layout-button",onClick:()=>wn(Qp(Cn)),title:`${aS(Cn)} (${yi("toggle-layout",ae)})`,children:m.jsx(Ie,{name:"stack"})}),iS.map(({layout:w,icon:U})=>m.jsx("button",{type:"button",className:wt===w&&!Gt?"layout-button active":"layout-button",onClick:()=>wn(rS(w,Cn)),title:nS(w,Cn),children:m.jsx(Ie,{name:U})},w))]})]})]}),m.jsxs("div",{className:`${Ul} ${Gt?"maximized-pane-grid":""}`,ref:ds,style:Il,children:[hs&&m.jsx(Vo,{orientation:"vertical",className:"pane-resizer pane-resizer-column",label:"Pane column split",valuePercent:Zi*100,style:{left:`calc((100% - 1px) * ${Zi} + 0.5px)`},onDrag:w=>La("column",w),onCommit:()=>ii("sessions",{splitColumnRatio:Zi}),onNudge:w=>Ma("column",w),onReset:()=>Pl("column")}),Ls&&m.jsx(Vo,{orientation:"horizontal",className:"pane-resizer pane-resizer-row",label:"Pane row split",valuePercent:us*100,style:{top:`calc((100% - 1px) * ${us} + 0.5px)`},onDrag:w=>La("row",w),onCommit:()=>ii("sessions",{splitRowRatio:us}),onNudge:w=>Ma("row",w),onReset:()=>Pl("row")}),ma.map(({session:w,index:U,dormant:V})=>{const ee=hi.sessionId===w.id&&hi.status!=="idle"?hi.status:null,be=Cg(w),we=!!be&&cs(w.id),Me=we?Ol(w):null;return m.jsxs("article",{className:`pane terminal-pane ${V?"dormant-pane":""} ${!V&&qt===w.id?"focused":""} ${!V&&Gt===w.id?"maximized-pane":""} ${V||oc(w,U)?"":"overflow-pane"}`,onMouseDown:()=>di(w.id),children:[m.jsxs("div",{className:"pane-title",children:[m.jsxs("span",{children:[m.jsx("span",{className:"pane-live"})," ",w.name]}),m.jsxs("span",{className:"pane-actions",children:[Gt&&m.jsxs(m.Fragment,{children:[m.jsx("button",{type:"button",className:"pane-nav",onClick:()=>fi(-1),title:"Previous session",children:m.jsx(Ie,{name:"chevron-left"})}),m.jsx("button",{type:"button",className:"pane-nav",onClick:()=>fi(1),title:"Next session",children:m.jsx(Ie,{name:"chevron-right"})})]}),o?"connecting…":ee?`${ee}…`:w.kind==="ssh"?"ssh":"bash",m.jsx("button",{type:"button",className:we?"pane-browse active":"pane-browse",onClick:()=>kl(w.id),disabled:!be,title:be?we?"Hide the directory browser":"Browse directories":"ZeroG cannot tell what kind of paths this pane uses","aria-label":`${we?"Hide":"Show"} the directory browser for ${w.name}`,"aria-pressed":we,children:m.jsx(Ie,{name:"folder"})}),m.jsx("button",{type:"button",className:"pane-proceed",onClick:()=>Js(w),title:`Send "${Xs}" and press Enter`,"aria-label":`Send "${Xs}" to ${w.name}`,children:m.jsx(Ie,{name:"check"})}),m.jsx("button",{type:"button",className:ee?`pane-mic ${ee}`:"pane-mic",onClick:()=>{An(w)},disabled:hi.status!=="idle"&&!ee,title:ee==="listening"?"Stop and transcribe":ee==="transcribing"?"Transcribing…":"Voice input","aria-label":ee==="listening"?`Stop recording ${w.name}`:`Voice input for ${w.name}`,children:m.jsx(Ie,{name:"mic"})}),m.jsx("button",{type:"button",className:"pane-maximize",onClick:()=>Wl(w.id),title:Gt?"Restore pane":"Maximize pane",children:m.jsx(Ie,{name:Gt?"restore":"maximize"})}),m.jsx("button",{type:"button",className:"pane-close",onClick:()=>{Oa(w)},title:"Close pane","aria-label":`Close ${w.name}`,children:m.jsx(Ie,{name:"x"})})]})]}),m.jsx(US,{open:we,ratio:yc(w.id),onRatio:Pe=>Dl(w.id,{ratio:Pe}),browser:be?m.jsx(Mg,{session:w,path:Me,unanchored:w.kind==="ssh",pathKind:be,shellPath:Me?tp(w,Me):null,list:la(w),question:w.kind==="ssh"?gl:null,onOpen:Pe=>Lr(w,Pe),onBrowse:Pe=>hn(pt=>({...pt,[w.id]:Pe})),onClose:()=>kl(w.id)}):null,children:m.jsx(zS,{sessionId:w.id,focused:!V&&qt===w.id,dormant:V,onStatus:v,appearance:l.appearance,terminalSettings:l.terminal,registerFocus:ui,registerCapture:nc,onCommand:pc,registerRead:vl})})]},w.id)}),Array.from({length:Math.max(0,ac-Yi.length)},(w,U)=>m.jsx(IS,{index:Yi.length+U+1,onCreate:Zs},`placeholder-${U}`))]}),m.jsxs("footer",{className:"status-bar",children:[m.jsx("span",{children:"ZeroG"}),m.jsx("span",{className:"status-separator"}),m.jsx("span",{children:it?.name??"Workspace"}),m.jsx("span",{className:"status-separator"}),m.jsx("span",{children:Gt?"maximized pane":wt==="stack"?"1 pane":`${_n} panes`}),m.jsx("span",{className:"status-separator"}),m.jsx("span",{children:"Esc closes overlays · ⌘⇧B sidebar"}),m.jsx("span",{className:"status-spacer"}),m.jsx("span",{children:et?`${et.kind==="ssh"?"SSH":et.persistence==="process"?"PROCESS":"SCREEN"} · ${et.persistence==="process"?"non-persistent":"persistent"}`:"no connection"})]})]})]}),Tr&&(()=>{const w=q.find(U=>U.id===Tr.id);return w?m.jsx(fS,{at:Tr.at,label:`${w.name} options`,items:ai(w),onClose:()=>bn(null)}):null})(),Z&&m.jsx(Pg,{version:un,bindings:ae,onClose:()=>F(!1)}),Ee&&m.jsx("div",{className:"overview-layer",role:"presentation",...ua,children:m.jsxs("section",{className:"overview",children:[m.jsxs("div",{className:"overview-head",children:[m.jsxs("div",{children:[m.jsx("span",{className:"eyebrow",children:"WORKSPACE OVERVIEW"}),m.jsx("h2",{children:it?.name??"Choose a session"})]}),m.jsx("button",{type:"button",className:"close-button",onClick:()=>ye(!1),children:"Esc"})]}),m.jsx("div",{className:"thumbnail-grid",children:lt.length?lt.map(w=>m.jsxs("button",{type:"button",className:`thumbnail ${et?.id===w.id?"active":""}`,onClick:()=>{Xi(w)},children:[m.jsxs("div",{className:"thumbnail-preview",children:[m.jsx("span",{className:"thumbnail-line cyan"}),m.jsx("span",{className:"thumbnail-line short"}),m.jsx("span",{className:"thumbnail-line green"}),m.jsx("span",{className:"thumbnail-cursor"})]}),m.jsxs("div",{className:"thumbnail-label",children:[m.jsx("b",{children:w.name}),m.jsxs("small",{children:[w.kind==="ssh"?w.host:"local screen"," · ",w.status]})]})]},w.id)):m.jsxs("div",{className:"overview-empty",children:[m.jsx("span",{children:"▦"}),m.jsx("b",{children:"No terminals in this workspace"}),m.jsx("small",{children:"Create a local terminal or connect over SSH."})]})}),m.jsxs("div",{className:"overview-foot",children:[m.jsx("button",{type:"button",onClick:()=>{ye(!1),Zs()},children:"+ Local terminal"}),m.jsx("button",{type:"button",onClick:()=>{ye(!1),Ei("ssh")},children:"Connect SSH"}),m.jsx("button",{type:"button",onClick:()=>{ye(!1),yn()},children:"+ Workspace"}),m.jsx("span",{className:"overview-hint",children:"Press Esc to close"})]})]})}),ue&&m.jsx("div",{className:"palette-layer",role:"presentation",...Ys,children:m.jsxs("div",{className:"palette",role:"dialog","aria-label":"Command history",children:[m.jsx("input",{autoFocus:!0,className:"palette-query",value:me,placeholder:"Search commands you have run","aria-label":"Search commands you have run",onChange:w=>{xe(w.target.value),je(0)},onKeyDown:w=>{if(w.key==="ArrowDown")w.preventDefault(),je(U=>Math.min(U+1,Math.max(0,vn.length-1)));else if(w.key==="ArrowUp")w.preventDefault(),je(U=>Math.max(0,U-1));else if(w.key==="Enter"){w.preventDefault();const U=vn[Ce];U&&Al(U)}}}),l.ai.recordCommands?Ae.length?vn.length?m.jsx("div",{className:"palette-list",children:vn.map((w,U)=>m.jsxs("button",{type:"button",className:`palette-row ${U===Ce?"active":""}`,onMouseEnter:()=>je(U),onClick:()=>Al(w),children:[m.jsx("span",{className:"palette-command",children:$S(w.entry.command,w.matched)}),m.jsxs("span",{className:"palette-meta",children:[w.entry.exitCode!==void 0&&w.entry.exitCode!==0?m.jsx("span",{className:"palette-failed",title:`Exited ${w.entry.exitCode}`,children:"failed"}):null,w.entry.cwd?m.jsx("span",{className:"palette-cwd",children:w.entry.cwd}):null]})]},w.entry.id))}):m.jsxs("div",{className:"palette-empty",children:[m.jsx("b",{children:"No match"}),m.jsxs("small",{children:[Ae.length," commands remembered, none matching that."]})]}):m.jsxs("div",{className:"palette-empty",children:[m.jsx("b",{children:"Nothing remembered yet"}),m.jsx("small",{children:"Commands are recorded from panes whose shell reports prompt marks. Settings has a snippet to paste into your shell — and onto a remote host, where it has to be installed there."}),m.jsx("button",{type:"button",onClick:()=>{_e(!1),Gi(!0)},children:"Open settings"})]}):m.jsxs("div",{className:"palette-empty",children:[m.jsx("b",{children:"Commands are not being remembered"}),m.jsx("small",{children:"Turn on “Remember commands” in Settings under AI & voice. Nothing about what you type is stored until you do."}),m.jsx("button",{type:"button",onClick:()=>{_e(!1),Gi(!0)},children:"Open settings"})]}),m.jsx("small",{className:"palette-note",children:"Enter puts the command on the prompt without running it. ↑↓ to choose, Esc to close."})]})}),J&&m.jsx("div",{className:"history-layer",role:"presentation",...Vs,children:m.jsxs("div",{className:"history-popover",role:"dialog","aria-label":"Session history",children:[m.jsxs("div",{className:"history-head",children:[m.jsx("b",{children:"History"}),m.jsx("button",{type:"button",onClick:()=>se(!1),"aria-label":"Close history",children:"×"})]}),ns.length?ns.slice().sort((w,U)=>U.timestamp.localeCompare(w.timestamp)).map(w=>m.jsxs("button",{type:"button",className:"history-item",onClick:async()=>{se(!1);const U=mu(w.session,T,Bi);n(w.session.screenName||w.session.backend==="screen"?"screens":"terminals");const V=await pn(U);V&&v(`Reconnected ${V.name}`)},children:[m.jsxs("span",{className:"history-main",children:[m.jsx("span",{className:"history-kind",children:w.event.toUpperCase()}),m.jsxs("span",{className:"history-text",children:[m.jsx("b",{children:w.session.name}),m.jsxs("small",{children:[w.session.host," · ",w.available?"available":"unavailable"]})]})]}),m.jsx("button",{type:"button",className:"history-remove","aria-label":"Remove history entry",onClick:U=>{U.stopPropagation(),De()?.removeHistory(w.id).then(()=>Ki(V=>V.filter(ee=>ee.id!==w.id))).catch(()=>{})},children:"×"})]},w.id)):m.jsx("p",{className:"history-empty",children:"No history entries yet."}),m.jsx("small",{className:"history-note",children:"Persisted session lifecycle from the main process."})]})}),de&&m.jsx("div",{className:"modal-layer",role:"presentation",...Vi,children:m.jsxs("form",{className:"modal-card",onSubmit:de==="workspace"?cc:de==="rename"?Hl:de==="forward"?Ml:de==="local"?hc:uc,children:[m.jsxs("div",{className:"modal-head",children:[m.jsxs("div",{children:[m.jsx("span",{className:"eyebrow",children:gu(de).eyebrow}),m.jsx("h2",{children:gu(de).title})]}),m.jsx("button",{type:"button",className:"close-button",onClick:()=>Se(null),children:"Esc"})]}),_p(de)&&m.jsx("div",{className:"dialog-tabs",role:"tablist","aria-label":"Session type",children:Zr.map(w=>m.jsxs("button",{type:"button",id:`session-tab-${w.kind}`,role:"tab","aria-selected":de===w.kind,"aria-controls":"session-dialog-panel",tabIndex:de===w.kind?0:-1,disabled:o,className:`dialog-tab ${de===w.kind?"active":""}`,onClick:()=>Se(w.kind),onKeyDown:U=>{const V=tS(w.kind,U.key);V&&(U.preventDefault(),Se(V),document.getElementById(`session-tab-${V}`)?.focus())},children:[m.jsx("b",{children:w.label}),m.jsx("small",{children:w.hint})]},w.kind))}),de==="rename"&&m.jsxs(m.Fragment,{children:[m.jsx("p",{children:"Rename this workspace. Its panes, layout and shortcuts position are unaffected."}),m.jsxs("label",{children:["Workspace name",m.jsx("input",{autoFocus:!0,value:Re,pattern:Ko,onChange:w=>Ke(w.target.value)})]})]}),de==="workspace"&&m.jsxs(m.Fragment,{children:[m.jsx("p",{children:"Create a separate workspace for a project or host group. Terminals stay scoped to the active workspace."}),m.jsxs("label",{children:["Workspace name",m.jsx("input",{autoFocus:!0,value:Re,onChange:w=>Ke(w.target.value),pattern:Ko,required:!0})]})]}),de==="forward"&&m.jsxs(m.Fragment,{children:[m.jsx("p",{children:"Reach a port on a remote host from this machine, over SSH. The tunnel is its own connection, so the host does not need a terminal open."}),m.jsxs("label",{children:["SSH host",m.jsx("input",{autoFocus:!0,list:"forward-hosts",value:A,onChange:w=>O(w.target.value),placeholder:"user@server",required:!0}),m.jsx("datalist",{id:"forward-hosts",children:Ll.map(w=>m.jsx("option",{value:w},w))})]}),m.jsxs("label",{children:["Port",m.jsx("input",{value:re,onChange:w=>G(w.target.value),inputMode:"numeric",pattern:"[0-9]{1,5}",placeholder:"3000",required:!0})]}),m.jsx("button",{type:"button",className:"dialog-disclosure",onClick:()=>P(w=>!w),"aria-expanded":B,children:B?"Fewer options":"More options"}),B&&m.jsxs(m.Fragment,{children:[m.jsxs("label",{children:["Direction",m.jsxs("select",{value:z,onChange:w=>H(w.target.value),children:[m.jsx("option",{value:"local",children:"Remote port, reachable here"}),m.jsx("option",{value:"remote",children:"Port here, reachable on the remote"})]})]}),m.jsxs("label",{children:["Forward to ",m.jsx("span",{className:"muted-text",children:"optional"}),m.jsx("input",{value:j,onChange:w=>$(w.target.value),placeholder:"localhost"})]}),m.jsxs("label",{children:["Port on that side ",m.jsx("span",{className:"muted-text",children:"defaults to the same"}),m.jsx("input",{value:Y,onChange:w=>X(w.target.value),inputMode:"numeric",pattern:"[0-9]{1,5}",placeholder:re||"3000"})]}),m.jsxs("label",{className:"dialog-check",children:[m.jsx("input",{type:"checkbox",checked:k==="all",onChange:w=>K(w.target.checked?"all":"loopback")}),"Share on my network, not just this machine"]}),k==="all"&&m.jsxs("p",{className:"dialog-warning",children:["Anything on the network this machine is attached to will be able to reach",z==="local"?" the remote service":" the service running here","."]})]})]}),_p(de)&&m.jsxs("div",{id:"session-dialog-panel",role:"tabpanel","aria-labelledby":`session-tab-${de}`,children:[de==="local"&&m.jsxs(m.Fragment,{children:[m.jsxs("p",{children:["Start a local session inside “",it?.name??"this workspace","”."]}),m.jsxs("label",{children:["Terminal name",m.jsx("input",{autoFocus:!0,value:Rt,onChange:w=>Qt(w.target.value),pattern:"[A-Za-z0-9](?:[A-Za-z0-9_.]|-){0,48}",required:!0})]}),m.jsxs("label",{children:["Shell backend",m.jsx("select",{value:wi,onChange:w=>{const U=w.target.value;Gs(U)},children:qs.length?qs.map(w=>m.jsx("option",{value:w.backend,children:w.label},w.backend)):m.jsx("option",{value:"bash",children:"bash"})})]}),wi==="wsl"&&m.jsxs("label",{children:["WSL distribution",m.jsx("input",{value:xs,onChange:w=>xt(w.target.value),placeholder:"Ubuntu"})]})]}),de==="ssh"&&m.jsxs(m.Fragment,{children:[m.jsxs("p",{children:["Connect a remote host into “",it?.name??"this workspace","”."]}),m.jsxs("label",{children:["SSH target",m.jsx("input",{autoFocus:!0,value:sn,onChange:w=>rn(w.target.value),placeholder:"user@server:22",required:!0})]}),m.jsxs("label",{children:["Session label ",m.jsx("span",{className:"muted-text",children:"optional"}),m.jsx("input",{value:zt,onChange:w=>$s(w.target.value),placeholder:"server"})]})]})]}),m.jsxs("div",{className:"modal-actions",children:[m.jsx("button",{type:"button",onClick:()=>Se(null),children:"Cancel"}),m.jsx("button",{className:"primary-button",disabled:o,type:"submit",children:o?"Working…":gu(de).submit})]})]})}),ri&&et&&Rs&&De()&&m.jsx(h0,{session:et,target:Rs,api:De(),onClose:()=>Ct(!1),backdrop:wl},et.id),Cs&&m.jsx(J0,{settings:l,onChange:ii,onReset:fa,onClose:()=>Gi(!1),backdrop:Cl,backends:qs,wslDistributions:ml,speechTest:Ut,onSpeechTest:()=>{li()},speechKey:rc,onSpeechKeySave:w=>{_i(w)},onSpeechKeyClear:()=>{Qs()},commandHistory:mc,onCopySnippet:w=>{De()?.copyText?.(w).then(()=>v("Shell integration snippet copied.")).catch(()=>{})},onClearCommandHistory:()=>{gc()},aiKey:Ss,onAiKeySave:w=>{Ta(w)},onAiKeyClear:()=>{xn()},aiModels:nn,onAiModelsRefresh:()=>{ga()},aiTest:sc,onAiTest:()=>{Rr()}}),is&&m.jsx("div",{className:"modal-layer",role:"presentation",...da,children:m.jsxs("div",{className:"modal-card approval-card",children:[m.jsxs("div",{className:"modal-head",children:[m.jsxs("div",{children:[m.jsx("span",{className:"eyebrow",children:"VOICE"}),m.jsx("h2",{children:"Insert transcript?"})]}),m.jsx("button",{type:"button",className:"close-button",onClick:()=>Ai(),children:"Esc"})]}),m.jsx("p",{children:"Review mode is on, so nothing has been typed yet. Inserting does not press Enter."}),m.jsx("code",{children:is.text}),m.jsxs("div",{className:"modal-actions",children:[m.jsx("button",{type:"button",onClick:()=>Ai(),children:"Discard"}),m.jsx("button",{type:"button",className:"primary-button",onClick:()=>{De()?.write(is.sessionId,is.text),v(`Voice: "${is.text}"`),Ai()},children:"Insert"})]})]})}),M&&m.jsx("div",{className:"modal-layer",role:"presentation",children:m.jsxs("form",{className:"modal-card approval-card",onSubmit:w=>{w.preventDefault();const U=new FormData(w.currentTarget).get("answer"),V=De();b(null),V?.answerForwardPrompt?.(M.forwardId,String(U??"")).catch(ee=>{v(Zn(ee))})},children:[m.jsx("div",{className:"modal-head",children:m.jsxs("div",{children:[m.jsx("span",{className:"eyebrow",children:"SHARED PORT"}),m.jsx("h2",{children:M.kind==="confirm"?"Accept this host key?":"The host is asking"})]})}),m.jsx("code",{children:M.text}),m.jsxs("label",{children:[M.kind==="confirm"?"Type yes, no, or the fingerprint":"Answer",m.jsx("input",{autoFocus:!0,name:"answer",type:M.kind==="confirm"?"text":"password",autoComplete:"off"})]}),m.jsxs("div",{className:"modal-actions",children:[m.jsx("button",{type:"button",onClick:()=>{const w=M.forwardId;b(null),De()?.closeForward?.(w).catch(()=>{}),g(U=>U.map(V=>V.id===w?{...V,status:"idle"}:V))},children:"Cancel"}),m.jsx("button",{className:"primary-button",type:"submit",children:"Send"})]})]})}),Je&&m.jsx("div",{className:"modal-layer",role:"presentation",...ha,children:m.jsxs("div",{className:"modal-card approval-card",children:[m.jsxs("div",{className:"modal-head",children:[m.jsxs("div",{children:[m.jsx("span",{className:Je.phase==="reviewing"?"eyebrow warning-text":"eyebrow",children:Je.phase==="reviewing"?"APPROVAL REQUIRED":"AI SUGGESTION"}),m.jsx("h2",{children:Je.phase==="asking"?"What would you like to do?":Je.phase==="thinking"?"Asking the model…":Je.phase==="failed"?"No suggestion":"Run this command?"})]}),m.jsx("button",{type:"button",className:"close-button",onClick:()=>{De()?.cancelAiRequest?.(),yt(null)},children:"Esc"})]}),Je.phase==="asking"&&m.jsxs("form",{onSubmit:w=>{w.preventDefault();const U=String(new FormData(w.currentTarget).get("prompt")??"").trim();U&&Sc(U)},children:[m.jsxs("p",{children:[l.ai.model," at ",l.ai.baseUrl,"."," ",l.ai.includeOutput?"The last of this pane’s output is sent with your request.":"Only the shell, directory and host are sent."]}),m.jsxs("label",{children:["Request",m.jsx("input",{autoFocus:!0,name:"prompt",placeholder:"fix that error",autoComplete:"off"})]}),m.jsxs("div",{className:"modal-actions",children:[m.jsx("button",{type:"button",onClick:()=>yt(null),children:"Cancel"}),m.jsx("button",{className:"primary-button",type:"submit",children:"Ask"})]})]}),Je.phase==="thinking"&&m.jsxs(m.Fragment,{children:[m.jsx("p",{children:Je.prompt}),m.jsx("p",{className:"muted-text",children:Je.usedOutput?"Sent with recent output from this pane.":"Sent without terminal output."}),m.jsx("div",{className:"modal-actions",children:m.jsx("button",{type:"button",onClick:()=>{De()?.cancelAiRequest?.(),yt(null)},children:"Cancel"})})]}),Je.phase==="reviewing"&&m.jsxs(m.Fragment,{children:[m.jsx("p",{children:Je.suggestion.explanation}),Je.suggestion.command?m.jsx("code",{children:Je.suggestion.command}):null,Je.usedOutput?m.jsx("p",{className:"dialog-warning",children:"This was suggested from output in the pane, which can come from a remote host. Read the command before running it."}):null,m.jsxs("div",{className:"modal-actions",children:[m.jsx("button",{type:"button",onClick:()=>yt(null),children:"Cancel"}),Je.suggestion.command?m.jsx("button",{type:"button",className:"primary-button",onClick:bc,children:"Run"}):m.jsx("button",{type:"button",onClick:()=>yt(bu(Je.sessionId)),children:"Ask again"})]})]}),Je.phase==="failed"&&m.jsxs(m.Fragment,{children:[m.jsx("p",{children:Je.message}),m.jsxs("div",{className:"modal-actions",children:[m.jsx("button",{type:"button",onClick:()=>yt(null),children:"Close"}),m.jsx("button",{type:"button",className:"primary-button",onClick:()=>yt(bu(Je.sessionId)),children:"Try again"})]})]})]})})]})}function $S(l,x){if(!x.length)return l;const L=new Set(x),T=[];let N="",q=L.has(0);for(let W=0;W<l.length;W+=1){const r=L.has(W);r!==q&&N&&(T.push(q?m.jsx("b",{children:N},W):N),N=""),q=r,N+=l.charAt(W)}return N&&T.push(q?m.jsx("b",{children:N},"tail"):N),T}function Cp(l){return l==="light"?{background:"#f7f9fc",foreground:"#253044",cursor:"#16803c",selectionBackground:"#cbdcf5",green:"#16803c",yellow:"#a15c00",red:"#c53030",blue:"#2459a6",cyan:"#087f8c"}:{background:"#0a0c10",foreground:"#d8dee9",cursor:"#9ece6a",selectionBackground:"#334155",green:"#9ece6a",yellow:"#e0af68",red:"#f7768e",blue:"#7aa2f7",cyan:"#7dcfff"}}function FS(l,x){const L=l.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,24)||"term",T=new Set(x.map(q=>q.name.toLowerCase()));if(!T.has(L))return L;let N=2;for(;T.has(`${L}-${N}`);)N+=1;return`${L}-${N}`}Ev.createRoot(document.getElementById("root")).render(m.jsx(PS,{}));
|