zerogterm 0.8.0-alpha → 0.9.0-alpha.1
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/LICENSE +21 -21
- package/README.md +2 -1
- package/dist/main/main/main.js +295 -1
- package/dist/main/main/mcp-audit.js +12 -0
- package/dist/main/main/mcp-control.js +95 -0
- package/dist/main/main/mcp-execution-broker.js +126 -0
- package/dist/main/main/mcp-execution-policy.js +43 -0
- package/dist/main/main/mcp-protocol.js +51 -0
- package/dist/main/main/mcp-server.js +221 -0
- package/dist/main/main/preload.cjs +28 -0
- package/dist/main/main/prompt-classifier.js +14 -0
- package/dist/main/main/workspace-store.js +3 -0
- package/dist/manifest.json +1 -0
- package/dist/renderer/assets/index-BovKjPi0.css +1 -0
- package/dist/renderer/assets/index-DYB0NFWF.js +142 -0
- package/dist/renderer/index.html +2 -2
- package/package.json +11 -6
- package/dist/renderer/assets/index-BPS6JAQV.js +0 -142
- package/dist/renderer/assets/index-p0gJDyuE.css +0 -1
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
(function(){const w=document.createElement("link").relList;if(w&&w.supports&&w.supports("modulepreload"))return;for(const j of document.querySelectorAll('link[rel="modulepreload"]'))M(j);new MutationObserver(j=>{for(const G of j)if(G.type==="childList")for(const q of G.addedNodes)q.tagName==="LINK"&&q.rel==="modulepreload"&&M(q)}).observe(document,{childList:!0,subtree:!0});function A(j){const G={};return j.integrity&&(G.integrity=j.integrity),j.referrerPolicy&&(G.referrerPolicy=j.referrerPolicy),j.crossOrigin==="use-credentials"?G.credentials="include":j.crossOrigin==="anonymous"?G.credentials="omit":G.credentials="same-origin",G}function M(j){if(j.ep)return;j.ep=!0;const G=A(j);fetch(j.href,G)}})();function bv(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var nu={exports:{}},fo={};var D_;function yv(){if(D_)return fo;D_=1;var a=Symbol.for("react.transitional.element"),w=Symbol.for("react.fragment");function A(M,j,G){var q=null;if(G!==void 0&&(q=""+G),j.key!==void 0&&(q=""+j.key),"key"in j){G={};for(var r in j)r!=="key"&&(G[r]=j[r])}else G=j;return j=G.ref,{$$typeof:a,type:M,key:q,ref:j!==void 0?j:null,props:G}}return fo.Fragment=w,fo.jsx=A,fo.jsxs=A,fo}var k_;function Cv(){return k_||(k_=1,nu.exports=yv()),nu.exports}var p=Cv(),au={exports:{}},We={};var O_;function wv(){if(O_)return We;O_=1;var a=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),q=Symbol.for("react.context"),r=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),_=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),l=Symbol.for("react.activity"),g=Symbol.iterator;function x(O){return O===null||typeof O!="object"?null:(O=g&&O[g]||O["@@iterator"],typeof O=="function"?O:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,n={};function h(O,$,te){this.props=O,this.context=$,this.refs=n,this.updater=te||E}h.prototype.isReactComponent={},h.prototype.setState=function(O,$){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,$,"setState")},h.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function u(){}u.prototype=h.prototype;function c(O,$,te){this.props=O,this.context=$,this.refs=n,this.updater=te||E}var S=c.prototype=new u;S.constructor=c,m(S,h.prototype),S.isPureReactComponent=!0;var L=Array.isArray;function y(){}var T={H:null,A:null,T:null,S:null},b=Object.prototype.hasOwnProperty;function R(O,$,te){var se=te.ref;return{$$typeof:a,type:O,key:$,ref:se!==void 0?se:null,props:te}}function k(O,$){return R(O.type,$,O.props)}function U(O){return typeof O=="object"&&O!==null&&O.$$typeof===a}function H(O){var $={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(te){return $[te]})}var z=/\/+/g;function V(O,$){return typeof O=="object"&&O!==null&&O.key!=null?H(""+O.key):$.toString(36)}function re(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(y,y):(O.status="pending",O.then(function($){O.status==="pending"&&(O.status="fulfilled",O.value=$)},function($){O.status==="pending"&&(O.status="rejected",O.reason=$)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function K(O,$,te,se,ue){var me=typeof O;(me==="undefined"||me==="boolean")&&(O=null);var Z=!1;if(O===null)Z=!0;else switch(me){case"bigint":case"string":case"number":Z=!0;break;case"object":switch(O.$$typeof){case a:case w:Z=!0;break;case v:return Z=O._init,K(Z(O._payload),$,te,se,ue)}}if(Z)return ue=ue(O),Z=se===""?"."+V(O,0):se,L(ue)?(te="",Z!=null&&(te=Z.replace(z,"$&/")+"/"),K(ue,$,te,"",function(fe){return fe})):ue!=null&&(U(ue)&&(ue=k(ue,te+(ue.key==null||O&&O.key===ue.key?"":(""+ue.key).replace(z,"$&/")+"/")+Z)),$.push(ue)),1;Z=0;var W=se===""?".":se+":";if(L(O))for(var ae=0;ae<O.length;ae++)se=O[ae],me=W+V(se,ae),Z+=K(se,$,te,me,ue);else if(ae=x(O),typeof ae=="function")for(O=ae.call(O),ae=0;!(se=O.next()).done;)se=se.value,me=W+V(se,ae++),Z+=K(se,$,te,me,ue);else if(me==="object"){if(typeof O.then=="function")return K(re(O),$,te,se,ue);throw $=String(O),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return Z}function X(O,$,te){if(O==null)return O;var se=[],ue=0;return K(O,se,"","",function(me){return $.call(te,me,ue++)}),se}function I(O){if(O._status===-1){var $=O._result;$=$(),$.then(function(te){(O._status===0||O._status===-1)&&(O._status=1,O._result=te)},function(te){(O._status===0||O._status===-1)&&(O._status=2,O._result=te)}),O._status===-1&&(O._status=0,O._result=$)}if(O._status===1)return O._result.default;throw O._result}var B=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},F={map:X,forEach:function(O,$,te){X(O,function(){$.apply(this,arguments)},te)},count:function(O){var $=0;return X(O,function(){$++}),$},toArray:function(O){return X(O,function($){return $})||[]},only:function(O){if(!U(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return We.Activity=l,We.Children=F,We.Component=h,We.Fragment=A,We.Profiler=j,We.PureComponent=c,We.StrictMode=M,We.Suspense=d,We.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,We.__COMPILER_RUNTIME={__proto__:null,c:function(O){return T.H.useMemoCache(O)}},We.cache=function(O){return function(){return O.apply(null,arguments)}},We.cacheSignal=function(){return null},We.cloneElement=function(O,$,te){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var se=m({},O.props),ue=O.key;if($!=null)for(me in $.key!==void 0&&(ue=""+$.key),$)!b.call($,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&$.ref===void 0||(se[me]=$[me]);var me=arguments.length-2;if(me===1)se.children=te;else if(1<me){for(var Z=Array(me),W=0;W<me;W++)Z[W]=arguments[W+2];se.children=Z}return R(O.type,ue,se)},We.createContext=function(O){return O={$$typeof:q,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:G,_context:O},O},We.createElement=function(O,$,te){var se,ue={},me=null;if($!=null)for(se in $.key!==void 0&&(me=""+$.key),$)b.call($,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(ue[se]=$[se]);var Z=arguments.length-2;if(Z===1)ue.children=te;else if(1<Z){for(var W=Array(Z),ae=0;ae<Z;ae++)W[ae]=arguments[ae+2];ue.children=W}if(O&&O.defaultProps)for(se in Z=O.defaultProps,Z)ue[se]===void 0&&(ue[se]=Z[se]);return R(O,me,ue)},We.createRef=function(){return{current:null}},We.forwardRef=function(O){return{$$typeof:r,render:O}},We.isValidElement=U,We.lazy=function(O){return{$$typeof:v,_payload:{_status:-1,_result:O},_init:I}},We.memo=function(O,$){return{$$typeof:_,type:O,compare:$===void 0?null:$}},We.startTransition=function(O){var $=T.T,te={};T.T=te;try{var se=O(),ue=T.S;ue!==null&&ue(te,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(y,B)}catch(me){B(me)}finally{$!==null&&te.types!==null&&($.types=te.types),T.T=$}},We.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},We.use=function(O){return T.H.use(O)},We.useActionState=function(O,$,te){return T.H.useActionState(O,$,te)},We.useCallback=function(O,$){return T.H.useCallback(O,$)},We.useContext=function(O){return T.H.useContext(O)},We.useDebugValue=function(){},We.useDeferredValue=function(O,$){return T.H.useDeferredValue(O,$)},We.useEffect=function(O,$){return T.H.useEffect(O,$)},We.useEffectEvent=function(O){return T.H.useEffectEvent(O)},We.useId=function(){return T.H.useId()},We.useImperativeHandle=function(O,$,te){return T.H.useImperativeHandle(O,$,te)},We.useInsertionEffect=function(O,$){return T.H.useInsertionEffect(O,$)},We.useLayoutEffect=function(O,$){return T.H.useLayoutEffect(O,$)},We.useMemo=function(O,$){return T.H.useMemo(O,$)},We.useOptimistic=function(O,$){return T.H.useOptimistic(O,$)},We.useReducer=function(O,$,te){return T.H.useReducer(O,$,te)},We.useRef=function(O){return T.H.useRef(O)},We.useState=function(O){return T.H.useState(O)},We.useSyncExternalStore=function(O,$,te){return T.H.useSyncExternalStore(O,$,te)},We.useTransition=function(){return T.H.useTransition()},We.version="19.2.8",We}var B_;function xu(){return B_||(B_=1,au.exports=wv()),au.exports}var ee=xu();const cn=bv(ee);var ou={exports:{}},_o={},lu={exports:{}},cu={};var j_;function xv(){return j_||(j_=1,(function(a){function w(K,X){var I=K.length;K.push(X);e:for(;0<I;){var B=I-1>>>1,F=K[B];if(0<j(F,X))K[B]=X,K[I]=F,I=B;else break e}}function A(K){return K.length===0?null:K[0]}function M(K){if(K.length===0)return null;var X=K[0],I=K.pop();if(I!==X){K[0]=I;e:for(var B=0,F=K.length,O=F>>>1;B<O;){var $=2*(B+1)-1,te=K[$],se=$+1,ue=K[se];if(0>j(te,I))se<F&&0>j(ue,te)?(K[B]=ue,K[se]=I,B=se):(K[B]=te,K[$]=I,B=$);else if(se<F&&0>j(ue,I))K[B]=ue,K[se]=I,B=se;else break e}}return X}function j(K,X){var I=K.sortIndex-X.sortIndex;return I!==0?I:K.id-X.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var G=performance;a.unstable_now=function(){return G.now()}}else{var q=Date,r=q.now();a.unstable_now=function(){return q.now()-r}}var d=[],_=[],v=1,l=null,g=3,x=!1,E=!1,m=!1,n=!1,h=typeof setTimeout=="function"?setTimeout:null,u=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;function S(K){for(var X=A(_);X!==null;){if(X.callback===null)M(_);else if(X.startTime<=K)M(_),X.sortIndex=X.expirationTime,w(d,X);else break;X=A(_)}}function L(K){if(m=!1,S(K),!E)if(A(d)!==null)E=!0,y||(y=!0,H());else{var X=A(_);X!==null&&re(L,X.startTime-K)}}var y=!1,T=-1,b=5,R=-1;function k(){return n?!0:!(a.unstable_now()-R<b)}function U(){if(n=!1,y){var K=a.unstable_now();R=K;var X=!0;try{e:{E=!1,m&&(m=!1,u(T),T=-1),x=!0;var I=g;try{t:{for(S(K),l=A(d);l!==null&&!(l.expirationTime>K&&k());){var B=l.callback;if(typeof B=="function"){l.callback=null,g=l.priorityLevel;var F=B(l.expirationTime<=K);if(K=a.unstable_now(),typeof F=="function"){l.callback=F,S(K),X=!0;break t}l===A(d)&&M(d),S(K)}else M(d);l=A(d)}if(l!==null)X=!0;else{var O=A(_);O!==null&&re(L,O.startTime-K),X=!1}}break e}finally{l=null,g=I,x=!1}X=void 0}}finally{X?H():y=!1}}}var H;if(typeof c=="function")H=function(){c(U)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,V=z.port2;z.port1.onmessage=U,H=function(){V.postMessage(null)}}else H=function(){h(U,0)};function re(K,X){T=h(function(){K(a.unstable_now())},X)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(K){K.callback=null},a.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<K?Math.floor(1e3/K):5},a.unstable_getCurrentPriorityLevel=function(){return g},a.unstable_next=function(K){switch(g){case 1:case 2:case 3:var X=3;break;default:X=g}var I=g;g=X;try{return K()}finally{g=I}},a.unstable_requestPaint=function(){n=!0},a.unstable_runWithPriority=function(K,X){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var I=g;g=K;try{return X()}finally{g=I}},a.unstable_scheduleCallback=function(K,X,I){var B=a.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?B+I:B):I=B,K){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=I+F,K={id:v++,callback:X,priorityLevel:K,startTime:I,expirationTime:F,sortIndex:-1},I>B?(K.sortIndex=I,w(_,K),A(d)===null&&K===A(_)&&(m?(u(T),T=-1):m=!0,re(L,I-B))):(K.sortIndex=F,w(d,K),E||x||(E=!0,y||(y=!0,H()))),K},a.unstable_shouldYield=k,a.unstable_wrapCallback=function(K){var X=g;return function(){var I=g;g=X;try{return K.apply(this,arguments)}finally{g=I}}}})(cu)),cu}var N_;function Ev(){return N_||(N_=1,lu.exports=xv()),lu.exports}var hu={exports:{}},ti={};var H_;function Av(){if(H_)return ti;H_=1;var a=xu();function w(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 A(){}var M={d:{f:A,r:function(){throw Error(w(522))},D:A,C:A,L:A,m:A,X:A,S:A,M:A},p:0,findDOMNode:null},j=Symbol.for("react.portal");function G(d,_,v){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:j,key:l==null?null:""+l,children:d,containerInfo:_,implementation:v}}var q=a.__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 ti.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,ti.createPortal=function(d,_){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_||_.nodeType!==1&&_.nodeType!==9&&_.nodeType!==11)throw Error(w(299));return G(d,_,null,v)},ti.flushSync=function(d){var _=q.T,v=M.p;try{if(q.T=null,M.p=2,d)return d()}finally{q.T=_,M.p=v,M.d.f()}},ti.preconnect=function(d,_){typeof d=="string"&&(_?(_=_.crossOrigin,_=typeof _=="string"?_==="use-credentials"?_:"":void 0):_=null,M.d.C(d,_))},ti.prefetchDNS=function(d){typeof d=="string"&&M.d.D(d)},ti.preinit=function(d,_){if(typeof d=="string"&&_&&typeof _.as=="string"){var v=_.as,l=r(v,_.crossOrigin),g=typeof _.integrity=="string"?_.integrity:void 0,x=typeof _.fetchPriority=="string"?_.fetchPriority:void 0;v==="style"?M.d.S(d,typeof _.precedence=="string"?_.precedence:void 0,{crossOrigin:l,integrity:g,fetchPriority:x}):v==="script"&&M.d.X(d,{crossOrigin:l,integrity:g,fetchPriority:x,nonce:typeof _.nonce=="string"?_.nonce:void 0})}},ti.preinitModule=function(d,_){if(typeof d=="string")if(typeof _=="object"&&_!==null){if(_.as==null||_.as==="script"){var v=r(_.as,_.crossOrigin);M.d.M(d,{crossOrigin:v,integrity:typeof _.integrity=="string"?_.integrity:void 0,nonce:typeof _.nonce=="string"?_.nonce:void 0})}}else _==null&&M.d.M(d)},ti.preload=function(d,_){if(typeof d=="string"&&typeof _=="object"&&_!==null&&typeof _.as=="string"){var v=_.as,l=r(v,_.crossOrigin);M.d.L(d,v,{crossOrigin:l,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})}},ti.preloadModule=function(d,_){if(typeof d=="string")if(_){var v=r(_.as,_.crossOrigin);M.d.m(d,{as:typeof _.as=="string"&&_.as!=="script"?_.as:void 0,crossOrigin:v,integrity:typeof _.integrity=="string"?_.integrity:void 0})}else M.d.m(d)},ti.requestFormReset=function(d){M.d.r(d)},ti.unstable_batchedUpdates=function(d,_){return d(_)},ti.useFormState=function(d,_,v){return q.H.useFormState(d,_,v)},ti.useFormStatus=function(){return q.H.useHostTransitionStatus()},ti.version="19.2.8",ti}var z_;function Rv(){if(z_)return hu.exports;z_=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(w){console.error(w)}}return a(),hu.exports=Av(),hu.exports}var U_;function Lv(){if(U_)return _o;U_=1;var a=Ev(),w=xu(),A=Rv();function M(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 j(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function G(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 q(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(G(e)!==e)throw Error(M(188))}function _(e){var t=e.alternate;if(!t){if(t=G(e),t===null)throw Error(M(188));return t!==e?null:e}for(var i=e,s=t;;){var o=i.return;if(o===null)break;var f=o.alternate;if(f===null){if(s=o.return,s!==null){i=s;continue}break}if(o.child===f.child){for(f=o.child;f;){if(f===i)return d(o),e;if(f===s)return d(o),t;f=f.sibling}throw Error(M(188))}if(i.return!==s.return)i=o,s=f;else{for(var D=!1,P=o.child;P;){if(P===i){D=!0,i=o,s=f;break}if(P===s){D=!0,s=o,i=f;break}P=P.sibling}if(!D){for(P=f.child;P;){if(P===i){D=!0,i=f,s=o;break}if(P===s){D=!0,s=f,i=o;break}P=P.sibling}if(!D)throw Error(M(189))}}if(i.alternate!==s)throw Error(M(190))}if(i.tag!==3)throw Error(M(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 l=Object.assign,g=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),m=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"),S=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),k=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function H(e){return e===null||typeof e!="object"?null:(e=U&&e[U]||e["@@iterator"],typeof e=="function"?e:null)}var z=Symbol.for("react.client.reference");function V(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===z?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case m:return"Fragment";case h:return"Profiler";case n:return"StrictMode";case L:return"Suspense";case y:return"SuspenseList";case R: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 S:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case T:return t=e.displayName||null,t!==null?t:V(e.type)||"Memo";case b:t=e._payload,e=e._init;try{return V(e(t))}catch{}}return null}var re=Array.isArray,K=w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=A.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},B=[],F=-1;function O(e){return{current:e}}function $(e){0>F||(e.current=B[F],B[F]=null,F--)}function te(e,t){F++,B[F]=e.current,e.current=t}var se=O(null),ue=O(null),me=O(null),Z=O(null);function W(e,t){switch(te(me,t),te(ue,e),te(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?e_(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=e_(t),e=t_(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(se),te(se,e)}function ae(){$(se),$(ue),$(me)}function fe(e){e.memoizedState!==null&&te(Z,e);var t=se.current,i=t_(t,e.type);t!==i&&(te(ue,e),te(se,i))}function we(e){ue.current===e&&($(se),$(ue)),Z.current===e&&($(Z),lo._currentValue=I)}var Ce,Ne;function Le(e){if(Ce===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);Ce=t&&t[1]||"",Ne=-1<i.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+Ce+e+Ne}var ze=!1;function rt(e,t){if(!e||ze)return"";ze=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(he){var ce=he}Reflect.construct(e,[],ge)}else{try{ge.call()}catch(he){ce=he}e.call(ge.prototype)}}else{try{throw Error()}catch(he){ce=he}(ge=e())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(he){if(he&&ce&&typeof he.stack=="string")return[he.stack,ce.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=s.DetermineComponentFrameRoot(),D=f[0],P=f[1];if(D&&P){var Q=D.split(`
|
|
4
|
+
`),le=P.split(`
|
|
5
|
+
`);for(o=s=0;s<Q.length&&!Q[s].includes("DetermineComponentFrameRoot");)s++;for(;o<le.length&&!le[o].includes("DetermineComponentFrameRoot");)o++;if(s===Q.length||o===le.length)for(s=Q.length-1,o=le.length-1;1<=s&&0<=o&&Q[s]!==le[o];)o--;for(;1<=s&&0<=o;s--,o--)if(Q[s]!==le[o]){if(s!==1||o!==1)do if(s--,o--,0>o||Q[s]!==le[o]){var de=`
|
|
6
|
+
`+Q[s].replace(" at new "," at ");return e.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",e.displayName)),de}while(1<=s&&0<=o);break}}}finally{ze=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?Le(i):""}function Be(e,t){switch(e.tag){case 26:case 27:case 5:return Le(e.type);case 16:return Le("Lazy");case 13:return e.child!==t&&t!==null?Le("Suspense Fallback"):Le("Suspense");case 19:return Le("SuspenseList");case 0:case 15:return rt(e.type,!1);case 11:return rt(e.type.render,!1);case 1:return rt(e.type,!0);case 31:return Le("Activity");default:return""}}function It(e){try{var t="",i=null;do t+=Be(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
|
|
7
|
+
Error generating stack: `+s.message+`
|
|
8
|
+
`+s.stack}}var ve=Object.prototype.hasOwnProperty,pe=a.unstable_scheduleCallback,be=a.unstable_cancelCallback,Ee=a.unstable_shouldYield,xe=a.unstable_requestPaint,ke=a.unstable_now,Je=a.unstable_getCurrentPriorityLevel,Ae=a.unstable_ImmediatePriority,Ie=a.unstable_UserBlockingPriority,ot=a.unstable_NormalPriority,ut=a.unstable_LowPriority,nt=a.unstable_IdlePriority,Ke=a.log,Ue=a.unstable_setDisableYieldValue,Gt=null,Mt=null;function Qt(e){if(typeof Ke=="function"&&Ue(e),Mt&&typeof Mt.setStrictMode=="function")try{Mt.setStrictMode(Gt,e)}catch{}}var xt=Math.clz32?Math.clz32:ra,fs=Math.log,un=Math.LN2;function ra(e){return e>>>=0,e===0?32:31-(fs(e)/un|0)|0}var Ii=256,Xi=262144,Zi=4194304;function Pi(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 Mr(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var o=0,f=e.suspendedLanes,D=e.pingedLanes;e=e.warmLanes;var P=s&134217727;return P!==0?(s=P&~f,s!==0?o=Pi(s):(D&=P,D!==0?o=Pi(D):i||(i=P&~e,i!==0&&(o=Pi(i))))):(P=s&~f,P!==0?o=Pi(P):D!==0?o=Pi(D):i||(i=s&~e,i!==0&&(o=Pi(i)))),o===0?0:t!==0&&t!==o&&(t&f)===0&&(f=o&-o,i=t&-t,f>=i||f===32&&(i&4194048)!==0)?t:o}function $s(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function mt(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 Ft(){var e=Zi;return Zi<<=1,(Zi&62914560)===0&&(Zi=4194304),e}function na(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Mi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function oc(e,t,i,s,o,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 P=e.entanglements,Q=e.expirationTimes,le=e.hiddenUpdates;for(i=D&~i;0<i;){var de=31-xt(i),ge=1<<de;P[de]=0,Q[de]=-1;var ce=le[de];if(ce!==null)for(le[de]=null,de=0;de<ce.length;de++){var he=ce[de];he!==null&&(he.lane&=-536870913)}i&=~ge}s!==0&&aa(e,s,0),f!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=f&~(D&~t))}function aa(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-xt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function go(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-xt(i),o=1<<s;o&t|e[s]&t&&(e[s]|=t),i&=~o}}function oa(e,t){var i=t&-t;return i=(i&42)!==0?1:hi(i),(i&(e.suspendedLanes|t))!==0?0:i}function hi(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 Qi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function $i(){var e=X.p;return e!==0?e:(e=window.event,e===void 0?32:x_(e.type))}function la(e,t){var i=X.p;try{return X.p=e,t()}finally{X.p=i}}var ii=Math.random().toString(36).slice(2),Tt="__reactFiber$"+ii,At="__reactProps$"+ii,Ti="__reactContainer$"+ii,Ji="__reactEvents$"+ii,es="__reactListeners$"+ii,Fs="__reactHandles$"+ii,Ws="__reactResources$"+ii,ts="__reactMarker$"+ii;function Di(e){delete e[Tt],delete e[At],delete e[Ji],delete e[es],delete e[Fs]}function Fi(e){var t=e[Tt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Ti]||i[Tt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=l_(e);e!==null;){if(i=e[Tt])return i;e=l_(e)}return t}e=i,i=e.parentNode}return null}function Wi(e){if(e=e[Tt]||e[Ti]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Tr(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(M(33))}function ui(e){var t=e[Ws];return t||(t=e[Ws]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Et(e){e[ts]=!0}var Dr=new Set,ca={};function di(e,t){_s(e,t),_s(e+"Capture",t)}function _s(e,t){for(ca[e]=t,e=0;e<t.length;e++)Dr.add(t[e])}var So=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]*$"),dn={},bo={};function ha(e){return ve.call(bo,e)?!0:ve.call(dn,e)?!1:So.test(e)?bo[e]=!0:(dn[e]=!0,!1)}function kr(e,t,i){if(ha(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 ps(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 Bt(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 si(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ua(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function da(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 o=s.get,f=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.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 yo(e){if(!e._valueTracker){var t=ua(e)?"checked":"value";e._valueTracker=da(e,t,""+e[t])}}function fa(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=ua(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}function qs(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 lc=/[\n"\\]/g;function Kt(e){return e.replace(lc,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function _a(e,t,i,s,o,f,D,P){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=""+si(t)):e.value!==""+si(t)&&(e.value=""+si(t)):D!=="submit"&&D!=="reset"||e.removeAttribute("value"),t!=null?pa(e,D,si(t)):i!=null?pa(e,D,si(i)):s!=null&&e.removeAttribute("value"),o==null&&f!=null&&(e.defaultChecked=!!f),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?e.name=""+si(P):e.removeAttribute("name")}function Or(e,t,i,s,o,f,D,P){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)){yo(e);return}i=i!=null?""+si(i):"",t=t!=null?""+si(t):i,P||t===e.value||(e.value=t),e.defaultValue=t}s=s??o,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=P?e.checked:!!s,e.defaultChecked=!!s,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(e.name=D),yo(e)}function pa(e,t,i){t==="number"&&qs(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Gs(e,t,i,s){if(e=e.options,t){t={};for(var o=0;o<i.length;o++)t["$"+i[o]]=!0;for(i=0;i<e.length;i++)o=t.hasOwnProperty("$"+e[i].value),e[i].selected!==o&&(e[i].selected=o),o&&s&&(e[i].defaultSelected=!0)}else{for(i=""+si(i),t=null,o=0;o<e.length;o++){if(e[o].value===i){e[o].selected=!0,s&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Br(e,t,i){if(t!=null&&(t=""+si(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+si(i):""}function fn(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(M(92));if(re(s)){if(1<s.length)throw Error(M(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=si(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),yo(e)}function Ks(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var _n=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 Co(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||_n.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function pn(e,t,i){if(t!=null&&typeof t!="object")throw Error(M(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 o in t)s=t[o],t.hasOwnProperty(o)&&i[o]!==s&&Co(e,o,s)}else for(var f in t)t.hasOwnProperty(f)&&Co(e,f,t[f])}function mn(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 cc=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"]]),wo=/^[\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 ms(e){return wo.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function qi(){}var vn=null;function gn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vs=null,gs=null;function fi(e){var t=Wi(e);if(t&&(e=t.stateNode)){var i=e[At]||null;e:switch(e=t.stateNode,t.type){case"input":if(_a(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="'+Kt(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var o=s[At]||null;if(!o)throw Error(M(90));_a(s,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&fa(s)}break e;case"textarea":Br(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Gs(e,!!i.multiple,t,!1)}}}var ma=!1;function xo(e,t,i){if(ma)return e(t,i);ma=!0;try{var s=e(t);return s}finally{if(ma=!1,(vs!==null||gs!==null)&&(Rl(),vs&&(t=vs,e=gs,gs=vs=null,fi(t),e)))for(t=0;t<e.length;t++)fi(e[t])}}function jr(e,t){var i=e.stateNode;if(i===null)return null;var s=i[At]||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(M(231,t,typeof i));return i}var Gi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),va=!1;if(Gi)try{var Nr={};Object.defineProperty(Nr,"passive",{get:function(){va=!0}}),window.addEventListener("test",Nr,Nr),window.removeEventListener("test",Nr,Nr)}catch{va=!1}var is=null,ga=null,ri=null;function Sa(){if(ri)return ri;var e,t=ga,i=t.length,s,o="value"in is?is.value:is.textContent,f=o.length;for(e=0;e<i&&t[e]===o[e];e++);var D=i-e;for(s=1;s<=D&&t[i-s]===o[f-s];s++);return ri=o.slice(e,1<s?1-s:void 0)}function Sn(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 tt(){return!0}function ki(){return!1}function et(e){function t(i,s,o,f,D){this._reactName=i,this._targetInst=o,this.type=s,this.nativeEvent=f,this.target=D,this.currentTarget=null;for(var P in e)e.hasOwnProperty(P)&&(i=e[P],this[P]=i?i(f):f[P]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?tt:ki,this.isPropagationStopped=ki,this}return l(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=tt)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=tt)},persist:function(){},isPersistent:tt}),t}var jt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hr=et(jt),Qe=l({},jt,{view:0,detail:0}),ni=et(Qe),ss,Vs,Oi,Bi=l({},Qe,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yi,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!==Oi&&(Oi&&e.type==="mousemove"?(ss=e.screenX-Oi.screenX,Vs=e.screenY-Oi.screenY):Vs=ss=0,Oi=e),ss)},movementY:function(e){return"movementY"in e?e.movementY:Vs}}),St=et(Bi),Eo=l({},Bi,{dataTransfer:0}),Ys=et(Eo),Ao=l({},Qe,{relatedTarget:0}),bn=et(Ao),yn=l({},jt,{animationName:0,elapsedTime:0,pseudoElement:0}),Ro=et(yn),Cn=l({},jt,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Lo=et(Cn),ba=l({},jt,{data:0}),rs=et(ba),hc={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vt={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"},uc={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dc(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=uc[e])?!!t[e]:!1}function yi(){return dc}var Ss=l({},Qe,{key:function(e){if(e.key){var t=hc[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Sn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Vt[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yi,charCode:function(e){return e.type==="keypress"?Sn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Sn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),fc=et(Ss),_c=l({},Bi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wn=et(_c),pc=l({},Qe,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yi}),Mo=et(pc),mc=l({},jt,{propertyName:0,elapsedTime:0,pseudoElement:0}),vc=et(mc),gc=l({},Bi,{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}),ya=et(gc),Sc=l({},jt,{newState:0,oldState:0}),bc=et(Sc),yc=[9,13,27,32],Xs=Gi&&"CompositionEvent"in window,Zs=null;Gi&&"documentMode"in document&&(Zs=document.documentMode);var Cc=Gi&&"TextEvent"in window&&!Zs,Ca=Gi&&(!Xs||Zs&&8<Zs&&11>=Zs),To=" ",Do=!1;function ko(e,t){switch(e){case"keyup":return yc.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Oo(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var bs=!1;function wa(e,t){switch(e){case"compositionend":return Oo(t);case"keypress":return t.which!==32?null:(Do=!0,To);case"textInput":return e=t.data,e===To&&Do?null:e;default:return null}}function Bo(e,t){if(bs)return e==="compositionend"||!Xs&&ko(e,t)?(e=Sa(),ri=ga=is=null,bs=!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 Ca&&t.locale!=="ko"?null:t.data;default:return null}}var wc={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 jo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!wc[e.type]:t==="textarea"}function xa(e,t,i,s){vs?gs?gs.push(s):gs=[s]:vs=s,t=Bl(t,"onChange"),0<t.length&&(i=new Hr("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var ys=null,zr=null;function No(e){Vf(e,0)}function Ur(e){var t=Tr(e);if(fa(t))return e}function Ho(e,t){if(e==="change")return t}var zo=!1;if(Gi){var Ea;if(Gi){var Aa="oninput"in document;if(!Aa){var xn=document.createElement("div");xn.setAttribute("oninput","return;"),Aa=typeof xn.oninput=="function"}Ea=Aa}else Ea=!1;zo=Ea&&(!document.documentMode||9<document.documentMode)}function ns(){ys&&(ys.detachEvent("onpropertychange",Uo),zr=ys=null)}function Uo(e){if(e.propertyName==="value"&&Ur(zr)){var t=[];xa(t,zr,e,gn(e)),xo(No,t)}}function Ra(e,t,i){e==="focusin"?(ns(),ys=t,zr=i,ys.attachEvent("onpropertychange",Uo)):e==="focusout"&&ns()}function La(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ur(zr)}function Io(e,t){if(e==="click")return Ur(t)}function xc(e,t){if(e==="input"||e==="change")return Ur(t)}function Po(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Wt=typeof Object.is=="function"?Object.is:Po;function Ir(e,t){if(Wt(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 o=i[s];if(!ve.call(t,o)||!Wt(e[o],t[o]))return!1}return!0}function $o(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Fo(e,t){var i=$o(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=$o(i)}}function Wo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Wo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function En(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qs(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=qs(e.document)}return t}function Ma(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 Ec=Gi&&"documentMode"in document&&11>=document.documentMode,Qs=null,Pr=null,Js=null,An=!1;function qo(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;An||Qs==null||Qs!==qs(s)||(s=Qs,"selectionStart"in s&&Ma(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}),Js&&Ir(Js,s)||(Js=s,s=Bl(Pr,"onSelect"),0<s.length&&(t=new Hr("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=Qs)))}function as(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Ci={animationend:as("Animation","AnimationEnd"),animationiteration:as("Animation","AnimationIteration"),animationstart:as("Animation","AnimationStart"),transitionrun:as("Transition","TransitionRun"),transitionstart:as("Transition","TransitionStart"),transitioncancel:as("Transition","TransitionCancel"),transitionend:as("Transition","TransitionEnd")},er={},Go={};Gi&&(Go=document.createElement("div").style,"AnimationEvent"in window||(delete Ci.animationend.animation,delete Ci.animationiteration.animation,delete Ci.animationstart.animation),"TransitionEvent"in window||delete Ci.transitionend.transition);function Cs(e){if(er[e])return er[e];if(!Ci[e])return e;var t=Ci[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Go)return er[e]=t[i];return e}var Ko=Cs("animationend"),Ta=Cs("animationiteration"),Da=Cs("animationstart"),ws=Cs("transitionrun"),xs=Cs("transitionstart"),Vo=Cs("transitioncancel"),Yo=Cs("transitionend"),ka=new Map,Rn="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(" ");Rn.push("scrollEnd");function _i(e,t){ka.set(e,t),di(t,[e])}var Es=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)},ai=[],tr=0,Oa=0;function $r(){for(var e=tr,t=Oa=tr=0;t<e;){var i=ai[t];ai[t++]=null;var s=ai[t];ai[t++]=null;var o=ai[t];ai[t++]=null;var f=ai[t];if(ai[t++]=null,s!==null&&o!==null){var D=s.pending;D===null?o.next=o:(o.next=D.next,D.next=o),s.pending=o}f!==0&&Xo(i,o,f)}}function Fr(e,t,i,s){ai[tr++]=e,ai[tr++]=t,ai[tr++]=i,ai[tr++]=s,Oa|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Ln(e,t,i,s){return Fr(e,t,i,s),Mn(e)}function As(e,t){return Fr(e,null,null,t),Mn(e)}function Xo(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var o=!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||(o=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,o&&t!==null&&(o=31-xt(i),e=f.hiddenUpdates,s=e[o],s===null?e[o]=[t]:s.push(t),t.lane=i|536870912),f):null}function Mn(e){if(50<to)throw to=0,Mh=null,Error(M(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ir={};function Ac(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 oi(e,t,i,s){return new Ac(e,t,i,s)}function Rs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ji(e,t){var i=e.alternate;return i===null?(i=oi(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 Zo(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 Tn(e,t,i,s,o,f){var D=0;if(s=e,typeof e=="function")Rs(e)&&(D=1);else if(typeof e=="string")D=lv(e,i,se.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case R:return e=oi(31,i,t,o),e.elementType=R,e.lanes=f,e;case m:return os(i.children,o,f,t);case n:D=8,o|=24;break;case h:return e=oi(12,i,t,o|2),e.elementType=h,e.lanes=f,e;case L:return e=oi(13,i,t,o),e.elementType=L,e.lanes=f,e;case y:return e=oi(19,i,t,o),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 S:D=11;break e;case T:D=14;break e;case b:D=16,s=null;break e}D=29,i=Error(M(130,e===null?"null":typeof e,"")),s=null}return t=oi(D,i,t,o),t.elementType=e,t.type=s,t.lanes=f,t}function os(e,t,i,s){return e=oi(7,e,s,t),e.lanes=i,e}function Ba(e,t,i){return e=oi(6,e,null,t),e.lanes=i,e}function Qo(e){var t=oi(18,null,null,0);return t.stateNode=e,t}function C(e,t,i){return t=oi(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var N=new WeakMap;function Y(e,t){if(typeof e=="object"&&e!==null){var i=N.get(e);return i!==void 0?i:(t={value:e,source:t,stack:It(t)},N.set(e,t),t)}return{value:e,source:t,stack:It(t)}}var J=[],Se=0,ye=null,Me=0,Te=[],dt=0,lt=null,Dt=1,vt="";function li(e,t){J[Se++]=Me,J[Se++]=ye,ye=e,Me=t}function Jt(e,t,i){Te[dt++]=Dt,Te[dt++]=vt,Te[dt++]=lt,lt=e;var s=Dt;e=vt;var o=32-xt(s)-1;s&=~(1<<o),i+=1;var f=32-xt(t)+o;if(30<f){var D=o-o%5;f=(s&(1<<D)-1).toString(32),s>>=D,o-=D,Dt=1<<32-xt(t)+o|i<<o|s,vt=f+e}else Dt=1<<f|i<<o|s,vt=e}function sr(e){e.return!==null&&(li(e,1),Jt(e,1,0))}function Ls(e){for(;e===ye;)ye=J[--Se],J[Se]=null,Me=J[--Se],J[Se]=null;for(;e===lt;)lt=Te[--dt],Te[dt]=null,vt=Te[--dt],Te[dt]=null,Dt=Te[--dt],Te[dt]=null}function Wr(e,t){Te[dt++]=Dt,Te[dt++]=vt,Te[dt++]=lt,Dt=t.id,vt=t.overflow,lt=e}var Pt=null,bt=null,Pe=!1,ls=null,ei=!1,rr=Error(M(519));function nr(e){var t=Error(M(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ja(Y(t,e)),rr}function Bu(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[Tt]=e,t[At]=s,i){case"dialog":Ye("cancel",t),Ye("close",t);break;case"iframe":case"object":case"embed":Ye("load",t);break;case"video":case"audio":for(i=0;i<so.length;i++)Ye(so[i],t);break;case"source":Ye("error",t);break;case"img":case"image":case"link":Ye("error",t),Ye("load",t);break;case"details":Ye("toggle",t);break;case"input":Ye("invalid",t),Or(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Ye("invalid",t);break;case"textarea":Ye("invalid",t),fn(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||Qf(t.textContent,i)?(s.popover!=null&&(Ye("beforetoggle",t),Ye("toggle",t)),s.onScroll!=null&&Ye("scroll",t),s.onScrollEnd!=null&&Ye("scrollend",t),s.onClick!=null&&(t.onclick=qi),t=!0):t=!1,t||nr(e,!0)}function ju(e){for(Pt=e.return;Pt;)switch(Pt.tag){case 5:case 31:case 13:ei=!1;return;case 27:case 3:ei=!0;return;default:Pt=Pt.return}}function Dn(e){if(e!==Pt)return!1;if(!Pe)return ju(e),Pe=!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&&bt&&nr(e),ju(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(M(317));bt=o_(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(M(317));bt=o_(e)}else t===27?(t=bt,Sr(e.type)?(e=Yh,Yh=null,bt=e):bt=t):bt=Pt?Hi(e.stateNode.nextSibling):null;return!0}function qr(){bt=Pt=null,Pe=!1}function Rc(){var e=ls;return e!==null&&(gi===null?gi=e:gi.push.apply(gi,e),ls=null),e}function ja(e){ls===null?ls=[e]:ls.push(e)}var Lc=O(null),Gr=null,Ms=null;function ar(e,t,i){te(Lc,t._currentValue),t._currentValue=i}function Ts(e){e._currentValue=Lc.current,$(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 o=e.child;for(o!==null&&(o.return=e);o!==null;){var f=o.dependencies;if(f!==null){var D=o.child;f=f.firstContext;e:for(;f!==null;){var P=f;f=o;for(var Q=0;Q<t.length;Q++)if(P.context===t[Q]){f.lanes|=i,P=f.alternate,P!==null&&(P.lanes|=i),Mc(f.return,i,e),s||(D=null);break e}f=P.next}}else if(o.tag===18){if(D=o.return,D===null)throw Error(M(341));D.lanes|=i,f=D.alternate,f!==null&&(f.lanes|=i),Mc(D,i,e),D=null}else D=o.child;if(D!==null)D.return=o;else for(D=o;D!==null;){if(D===e){D=null;break}if(o=D.sibling,o!==null){o.return=D.return,D=o;break}D=D.return}o=D}}function kn(e,t,i,s){e=null;for(var o=t,f=!1;o!==null;){if(!f){if((o.flags&524288)!==0)f=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var D=o.alternate;if(D===null)throw Error(M(387));if(D=D.memoizedProps,D!==null){var P=o.type;Wt(o.pendingProps.value,D.value)||(e!==null?e.push(P):e=[P])}}else if(o===Z.current){if(D=o.alternate,D===null)throw Error(M(387));D.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(lo):e=[lo])}o=o.return}e!==null&&Tc(t,e,i,s),t.flags|=262144}function Jo(e){for(e=e.firstContext;e!==null;){if(!Wt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Kr(e){Gr=e,Ms=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yt(e){return Nu(Gr,e)}function el(e,t){return Gr===null&&Kr(e),Nu(e,t)}function Nu(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Ms===null){if(e===null)throw Error(M(308));Ms=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ms=Ms.next=t;return i}var rm=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()})}},nm=a.unstable_scheduleCallback,am=a.unstable_NormalPriority,Nt={$$typeof:c,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Dc(){return{controller:new rm,data:new Map,refCount:0}}function Na(e){e.refCount--,e.refCount===0&&nm(am,function(){e.controller.abort()})}var Ha=null,kc=0,On=0,Bn=null;function om(e,t){if(Ha===null){var i=Ha=[];kc=0,On=jh(),Bn={status:"pending",value:void 0,then:function(s){i.push(s)}}}return kc++,t.then(Hu,Hu),t}function Hu(){if(--kc===0&&Ha!==null){Bn!==null&&(Bn.status="fulfilled");var e=Ha;Ha=null,On=0,Bn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function lm(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(o){i.push(o)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var o=0;o<i.length;o++)(0,i[o])(t)},function(o){for(s.status="rejected",s.reason=o,o=0;o<i.length;o++)(0,i[o])(void 0)}),s}var zu=K.S;K.S=function(e,t){Cf=ke(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&om(e,t),zu!==null&&zu(e,t)};var Vr=O(null);function Oc(){var e=Vr.current;return e!==null?e:gt.pooledCache}function tl(e,t){t===null?te(Vr,Vr.current):te(Vr,t.pool)}function Uu(){var e=Oc();return e===null?null:{parent:Nt._currentValue,pool:e}}var jn=Error(M(460)),Bc=Error(M(474)),il=Error(M(542)),sl={then:function(){}};function Iu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Pu(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(qi,qi),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Fu(e),e;default:if(typeof t.status=="string")t.then(qi,qi);else{if(e=gt,e!==null&&100<e.shellSuspendCounter)throw Error(M(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=s}},function(s){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Fu(e),e}throw Xr=t,jn}}function Yr(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Xr=i,jn):i}}var Xr=null;function $u(){if(Xr===null)throw Error(M(459));var e=Xr;return Xr=null,e}function Fu(e){if(e===jn||e===il)throw Error(M(483))}var Nn=null,za=0;function rl(e){var t=za;return za+=1,Nn===null&&(Nn=[]),Pu(Nn,e,t)}function Ua(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function nl(e,t){throw t.$$typeof===g?Error(M(525)):(e=Object.prototype.toString.call(t),Error(M(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Wu(e){function t(ne,ie){if(e){var oe=ne.deletions;oe===null?(ne.deletions=[ie],ne.flags|=16):oe.push(ie)}}function i(ne,ie){if(!e)return null;for(;ie!==null;)t(ne,ie),ie=ie.sibling;return null}function s(ne){for(var ie=new Map;ne!==null;)ne.key!==null?ie.set(ne.key,ne):ie.set(ne.index,ne),ne=ne.sibling;return ie}function o(ne,ie){return ne=ji(ne,ie),ne.index=0,ne.sibling=null,ne}function f(ne,ie,oe){return ne.index=oe,e?(oe=ne.alternate,oe!==null?(oe=oe.index,oe<ie?(ne.flags|=67108866,ie):oe):(ne.flags|=67108866,ie)):(ne.flags|=1048576,ie)}function D(ne){return e&&ne.alternate===null&&(ne.flags|=67108866),ne}function P(ne,ie,oe,_e){return ie===null||ie.tag!==6?(ie=Ba(oe,ne.mode,_e),ie.return=ne,ie):(ie=o(ie,oe),ie.return=ne,ie)}function Q(ne,ie,oe,_e){var je=oe.type;return je===m?de(ne,ie,oe.props.children,_e,oe.key):ie!==null&&(ie.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===b&&Yr(je)===ie.type)?(ie=o(ie,oe.props),Ua(ie,oe),ie.return=ne,ie):(ie=Tn(oe.type,oe.key,oe.props,null,ne.mode,_e),Ua(ie,oe),ie.return=ne,ie)}function le(ne,ie,oe,_e){return ie===null||ie.tag!==4||ie.stateNode.containerInfo!==oe.containerInfo||ie.stateNode.implementation!==oe.implementation?(ie=C(oe,ne.mode,_e),ie.return=ne,ie):(ie=o(ie,oe.children||[]),ie.return=ne,ie)}function de(ne,ie,oe,_e,je){return ie===null||ie.tag!==7?(ie=os(oe,ne.mode,_e,je),ie.return=ne,ie):(ie=o(ie,oe),ie.return=ne,ie)}function ge(ne,ie,oe){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return ie=Ba(""+ie,ne.mode,oe),ie.return=ne,ie;if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case x:return oe=Tn(ie.type,ie.key,ie.props,null,ne.mode,oe),Ua(oe,ie),oe.return=ne,oe;case E:return ie=C(ie,ne.mode,oe),ie.return=ne,ie;case b:return ie=Yr(ie),ge(ne,ie,oe)}if(re(ie)||H(ie))return ie=os(ie,ne.mode,oe,null),ie.return=ne,ie;if(typeof ie.then=="function")return ge(ne,rl(ie),oe);if(ie.$$typeof===c)return ge(ne,el(ne,ie),oe);nl(ne,ie)}return null}function ce(ne,ie,oe,_e){var je=ie!==null?ie.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return je!==null?null:P(ne,ie,""+oe,_e);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case x:return oe.key===je?Q(ne,ie,oe,_e):null;case E:return oe.key===je?le(ne,ie,oe,_e):null;case b:return oe=Yr(oe),ce(ne,ie,oe,_e)}if(re(oe)||H(oe))return je!==null?null:de(ne,ie,oe,_e,null);if(typeof oe.then=="function")return ce(ne,ie,rl(oe),_e);if(oe.$$typeof===c)return ce(ne,ie,el(ne,oe),_e);nl(ne,oe)}return null}function he(ne,ie,oe,_e,je){if(typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint")return ne=ne.get(oe)||null,P(ie,ne,""+_e,je);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case x:return ne=ne.get(_e.key===null?oe:_e.key)||null,Q(ie,ne,_e,je);case E:return ne=ne.get(_e.key===null?oe:_e.key)||null,le(ie,ne,_e,je);case b:return _e=Yr(_e),he(ne,ie,oe,_e,je)}if(re(_e)||H(_e))return ne=ne.get(oe)||null,de(ie,ne,_e,je,null);if(typeof _e.then=="function")return he(ne,ie,oe,rl(_e),je);if(_e.$$typeof===c)return he(ne,ie,oe,el(ie,_e),je);nl(ie,_e)}return null}function De(ne,ie,oe,_e){for(var je=null,it=null,Oe=ie,Ge=ie=0,Ze=null;Oe!==null&&Ge<oe.length;Ge++){Oe.index>Ge?(Ze=Oe,Oe=null):Ze=Oe.sibling;var st=ce(ne,Oe,oe[Ge],_e);if(st===null){Oe===null&&(Oe=Ze);break}e&&Oe&&st.alternate===null&&t(ne,Oe),ie=f(st,ie,Ge),it===null?je=st:it.sibling=st,it=st,Oe=Ze}if(Ge===oe.length)return i(ne,Oe),Pe&&li(ne,Ge),je;if(Oe===null){for(;Ge<oe.length;Ge++)Oe=ge(ne,oe[Ge],_e),Oe!==null&&(ie=f(Oe,ie,Ge),it===null?je=Oe:it.sibling=Oe,it=Oe);return Pe&&li(ne,Ge),je}for(Oe=s(Oe);Ge<oe.length;Ge++)Ze=he(Oe,ne,Ge,oe[Ge],_e),Ze!==null&&(e&&Ze.alternate!==null&&Oe.delete(Ze.key===null?Ge:Ze.key),ie=f(Ze,ie,Ge),it===null?je=Ze:it.sibling=Ze,it=Ze);return e&&Oe.forEach(function(xr){return t(ne,xr)}),Pe&&li(ne,Ge),je}function He(ne,ie,oe,_e){if(oe==null)throw Error(M(151));for(var je=null,it=null,Oe=ie,Ge=ie=0,Ze=null,st=oe.next();Oe!==null&&!st.done;Ge++,st=oe.next()){Oe.index>Ge?(Ze=Oe,Oe=null):Ze=Oe.sibling;var xr=ce(ne,Oe,st.value,_e);if(xr===null){Oe===null&&(Oe=Ze);break}e&&Oe&&xr.alternate===null&&t(ne,Oe),ie=f(xr,ie,Ge),it===null?je=xr:it.sibling=xr,it=xr,Oe=Ze}if(st.done)return i(ne,Oe),Pe&&li(ne,Ge),je;if(Oe===null){for(;!st.done;Ge++,st=oe.next())st=ge(ne,st.value,_e),st!==null&&(ie=f(st,ie,Ge),it===null?je=st:it.sibling=st,it=st);return Pe&&li(ne,Ge),je}for(Oe=s(Oe);!st.done;Ge++,st=oe.next())st=he(Oe,ne,Ge,st.value,_e),st!==null&&(e&&st.alternate!==null&&Oe.delete(st.key===null?Ge:st.key),ie=f(st,ie,Ge),it===null?je=st:it.sibling=st,it=st);return e&&Oe.forEach(function(Sv){return t(ne,Sv)}),Pe&&li(ne,Ge),je}function pt(ne,ie,oe,_e){if(typeof oe=="object"&&oe!==null&&oe.type===m&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case x:e:{for(var je=oe.key;ie!==null;){if(ie.key===je){if(je=oe.type,je===m){if(ie.tag===7){i(ne,ie.sibling),_e=o(ie,oe.props.children),_e.return=ne,ne=_e;break e}}else if(ie.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===b&&Yr(je)===ie.type){i(ne,ie.sibling),_e=o(ie,oe.props),Ua(_e,oe),_e.return=ne,ne=_e;break e}i(ne,ie);break}else t(ne,ie);ie=ie.sibling}oe.type===m?(_e=os(oe.props.children,ne.mode,_e,oe.key),_e.return=ne,ne=_e):(_e=Tn(oe.type,oe.key,oe.props,null,ne.mode,_e),Ua(_e,oe),_e.return=ne,ne=_e)}return D(ne);case E:e:{for(je=oe.key;ie!==null;){if(ie.key===je)if(ie.tag===4&&ie.stateNode.containerInfo===oe.containerInfo&&ie.stateNode.implementation===oe.implementation){i(ne,ie.sibling),_e=o(ie,oe.children||[]),_e.return=ne,ne=_e;break e}else{i(ne,ie);break}else t(ne,ie);ie=ie.sibling}_e=C(oe,ne.mode,_e),_e.return=ne,ne=_e}return D(ne);case b:return oe=Yr(oe),pt(ne,ie,oe,_e)}if(re(oe))return De(ne,ie,oe,_e);if(H(oe)){if(je=H(oe),typeof je!="function")throw Error(M(150));return oe=je.call(oe),He(ne,ie,oe,_e)}if(typeof oe.then=="function")return pt(ne,ie,rl(oe),_e);if(oe.$$typeof===c)return pt(ne,ie,el(ne,oe),_e);nl(ne,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,ie!==null&&ie.tag===6?(i(ne,ie.sibling),_e=o(ie,oe),_e.return=ne,ne=_e):(i(ne,ie),_e=Ba(oe,ne.mode,_e),_e.return=ne,ne=_e),D(ne)):i(ne,ie)}return function(ne,ie,oe,_e){try{za=0;var je=pt(ne,ie,oe,_e);return Nn=null,je}catch(Oe){if(Oe===jn||Oe===il)throw Oe;var it=oi(29,Oe,null,ne.mode);return it.lanes=_e,it.return=ne,it}}}var Zr=Wu(!0),qu=Wu(!1),or=!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 lr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function cr(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(at&2)!==0){var o=s.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),s.pending=t,t=Mn(e),Xo(e,null,i),t}return Fr(e,s,t,i),Mn(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,go(e,i)}}function Hc(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var o=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?o=f=D:f=f.next=D,i=i.next}while(i!==null);f===null?o=f=t:f=f.next=t}else o=f=t;i={baseState:s.baseState,firstBaseUpdate:o,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=Bn;if(e!==null)throw e}}function $a(e,t,i,s){zc=!1;var o=e.updateQueue;or=!1;var f=o.firstBaseUpdate,D=o.lastBaseUpdate,P=o.shared.pending;if(P!==null){o.shared.pending=null;var Q=P,le=Q.next;Q.next=null,D===null?f=le:D.next=le,D=Q;var de=e.alternate;de!==null&&(de=de.updateQueue,P=de.lastBaseUpdate,P!==D&&(P===null?de.firstBaseUpdate=le:P.next=le,de.lastBaseUpdate=Q))}if(f!==null){var ge=o.baseState;D=0,de=le=Q=null,P=f;do{var ce=P.lane&-536870913,he=ce!==P.lane;if(he?(Xe&ce)===ce:(s&ce)===ce){ce!==0&&ce===On&&(zc=!0),de!==null&&(de=de.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var De=e,He=P;ce=t;var pt=i;switch(He.tag){case 1:if(De=He.payload,typeof De=="function"){ge=De.call(pt,ge,ce);break e}ge=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=He.payload,ce=typeof De=="function"?De.call(pt,ge,ce):De,ce==null)break e;ge=l({},ge,ce);break e;case 2:or=!0}}ce=P.callback,ce!==null&&(e.flags|=64,he&&(e.flags|=8192),he=o.callbacks,he===null?o.callbacks=[ce]:he.push(ce))}else he={lane:ce,tag:P.tag,payload:P.payload,callback:P.callback,next:null},de===null?(le=de=he,Q=ge):de=de.next=he,D|=ce;if(P=P.next,P===null){if(P=o.shared.pending,P===null)break;he=P,P=he.next,he.next=null,o.lastBaseUpdate=he,o.shared.pending=null}}while(!0);de===null&&(Q=ge),o.baseState=Q,o.firstBaseUpdate=le,o.lastBaseUpdate=de,f===null&&(o.shared.lanes=0),_r|=D,e.lanes=D,e.memoizedState=ge}}function Gu(e,t){if(typeof e!="function")throw Error(M(191,e));e.call(t)}function Ku(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Gu(i[e],t)}var Hn=O(null),al=O(0);function Vu(e,t){e=Us,te(al,e),te(Hn,t),Us=e|t.baseLanes}function Uc(){te(al,Us),te(Hn,Hn.current)}function Ic(){Us=al.current,$(Hn),$(al)}var wi=O(null),Ni=null;function hr(e){var t=e.alternate;te(kt,kt.current&1),te(wi,e),Ni===null&&(t===null||Hn.current!==null||t.memoizedState!==null)&&(Ni=e)}function Pc(e){te(kt,kt.current),te(wi,e),Ni===null&&(Ni=e)}function Yu(e){e.tag===22?(te(kt,kt.current),te(wi,e),Ni===null&&(Ni=e)):ur()}function ur(){te(kt,kt.current),te(wi,wi.current)}function xi(e){$(wi),Ni===e&&(Ni=null),$(kt)}var kt=O(0);function ol(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,qe=null,ft=null,Ht=null,ll=!1,zn=!1,Qr=!1,cl=0,Fa=0,Un=null,cm=0;function Rt(){throw Error(M(321))}function $c(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Wt(e[i],t[i]))return!1;return!0}function Fc(e,t,i,s,o,f){return Ds=f,qe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,K.H=e===null||e.memoizedState===null?kd:rh,Qr=!1,f=i(s,o),Qr=!1,zn&&(f=Zu(t,i,s,o)),Xu(e),f}function Xu(e){K.H=Ga;var t=ft!==null&&ft.next!==null;if(Ds=0,Ht=ft=qe=null,ll=!1,Fa=0,Un=null,t)throw Error(M(300));e===null||zt||(e=e.dependencies,e!==null&&Jo(e)&&(zt=!0))}function Zu(e,t,i,s){qe=e;var o=0;do{if(zn&&(Un=null),Fa=0,zn=!1,25<=o)throw Error(M(301));if(o+=1,Ht=ft=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}K.H=Od,f=t(i,s)}while(zn);return f}function hm(){var e=K.H,t=e.useState()[0];return t=typeof t.then=="function"?Wa(t):t,e=e.useState()[0],(ft!==null?ft.memoizedState:null)!==e&&(qe.flags|=1024),t}function Wc(){var e=cl!==0;return cl=0,e}function qc(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function Gc(e){if(ll){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ll=!1}Ds=0,Ht=ft=qe=null,zn=!1,Fa=cl=0,Un=null}function ci(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ht===null?qe.memoizedState=Ht=e:Ht=Ht.next=e,Ht}function Ot(){if(ft===null){var e=qe.alternate;e=e!==null?e.memoizedState:null}else e=ft.next;var t=Ht===null?qe.memoizedState:Ht.next;if(t!==null)Ht=t,ft=e;else{if(e===null)throw qe.alternate===null?Error(M(467)):Error(M(310));ft=e,e={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},Ht===null?qe.memoizedState=Ht=e:Ht=Ht.next=e}return Ht}function hl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Wa(e){var t=Fa;return Fa+=1,Un===null&&(Un=[]),e=Pu(Un,e,t),t=qe,(Ht===null?t.memoizedState:Ht.next)===null&&(t=t.alternate,K.H=t===null||t.memoizedState===null?kd:rh),e}function ul(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Wa(e);if(e.$$typeof===c)return Yt(e)}throw Error(M(438,String(e)))}function Kc(e){var t=null,i=qe.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=qe.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=hl(),qe.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]=k;return t.index++,i}function ks(e,t){return typeof t=="function"?t(e):t}function dl(e){var t=Ot();return Vc(t,ft,e)}function Vc(e,t,i){var s=e.queue;if(s===null)throw Error(M(311));s.lastRenderedReducer=i;var o=e.baseQueue,f=s.pending;if(f!==null){if(o!==null){var D=o.next;o.next=f.next,f.next=D}t.baseQueue=o=f,s.pending=null}if(f=e.baseState,o===null)e.memoizedState=f;else{t=o.next;var P=D=null,Q=null,le=t,de=!1;do{var ge=le.lane&-536870913;if(ge!==le.lane?(Xe&ge)===ge:(Ds&ge)===ge){var ce=le.revertLane;if(ce===0)Q!==null&&(Q=Q.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),ge===On&&(de=!0);else if((Ds&ce)===ce){le=le.next,ce===On&&(de=!0);continue}else ge={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},Q===null?(P=Q=ge,D=f):Q=Q.next=ge,qe.lanes|=ce,_r|=ce;ge=le.action,Qr&&i(f,ge),f=le.hasEagerState?le.eagerState:i(f,ge)}else ce={lane:ge,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},Q===null?(P=Q=ce,D=f):Q=Q.next=ce,qe.lanes|=ge,_r|=ge;le=le.next}while(le!==null&&le!==t);if(Q===null?D=f:Q.next=P,!Wt(f,e.memoizedState)&&(zt=!0,de&&(i=Bn,i!==null)))throw i;e.memoizedState=f,e.baseState=D,e.baseQueue=Q,s.lastRenderedState=f}return o===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Yc(e){var t=Ot(),i=t.queue;if(i===null)throw Error(M(311));i.lastRenderedReducer=e;var s=i.dispatch,o=i.pending,f=t.memoizedState;if(o!==null){i.pending=null;var D=o=o.next;do f=e(f,D.action),D=D.next;while(D!==o);Wt(f,t.memoizedState)||(zt=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),i.lastRenderedState=f}return[f,s]}function Qu(e,t,i){var s=qe,o=Ot(),f=Pe;if(f){if(i===void 0)throw Error(M(407));i=i()}else i=t();var D=!Wt((ft||o).memoizedState,i);if(D&&(o.memoizedState=i,zt=!0),o=o.queue,Qc(td.bind(null,s,o,e),[e]),o.getSnapshot!==t||D||Ht!==null&&Ht.memoizedState.tag&1){if(s.flags|=2048,In(9,{destroy:void 0},ed.bind(null,s,o,i,t),null),gt===null)throw Error(M(349));f||(Ds&127)!==0||Ju(s,t,i)}return i}function Ju(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=qe.updateQueue,t===null?(t=hl(),qe.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function ed(e,t,i,s){t.value=i,t.getSnapshot=s,id(t)&&sd(e)}function td(e,t,i){return i(function(){id(t)&&sd(e)})}function id(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Wt(e,i)}catch{return!0}}function sd(e){var t=As(e,2);t!==null&&Si(t,e,2)}function Xc(e){var t=ci();if(typeof e=="function"){var i=e;if(e=i(),Qr){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 rd(e,t,i,s){return e.baseState=i,Vc(e,ft,typeof s=="function"?s:ks)}function um(e,t,i,s,o){if(pl(e))throw Error(M(485));if(e=t.action,e!==null){var f={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){f.listeners.push(D)}};K.T!==null?i(!0):f.isTransition=!1,s(f),i=t.pending,i===null?(f.next=t.pending=f,nd(t,f)):(f.next=i.next,t.pending=i.next=f)}}function nd(e,t){var i=t.action,s=t.payload,o=e.state;if(t.isTransition){var f=K.T,D={};K.T=D;try{var P=i(o,s),Q=K.S;Q!==null&&Q(D,P),ad(e,t,P)}catch(le){Zc(e,t,le)}finally{f!==null&&D.types!==null&&(f.types=D.types),K.T=f}}else try{f=i(o,s),ad(e,t,f)}catch(le){Zc(e,t,le)}}function ad(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){od(e,t,s)},function(s){return Zc(e,t,s)}):od(e,t,i)}function od(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,nd(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 cd(e,t){return t}function hd(e,t){if(Pe){var i=gt.formState;if(i!==null){e:{var s=qe;if(Pe){if(bt){t:{for(var o=bt,f=ei;o.nodeType!==8;){if(!f){o=null;break t}if(o=Hi(o.nextSibling),o===null){o=null;break t}}f=o.data,o=f==="F!"||f==="F"?o:null}if(o){bt=Hi(o.nextSibling),s=o.data==="F!";break e}}nr(s)}s=!1}s&&(t=i[0])}}return i=ci(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cd,lastRenderedState:t},i.queue=s,i=Md.bind(null,qe,s),s.dispatch=i,s=Xc(!1),f=sh.bind(null,qe,!1,s.queue),s=ci(),o={state:t,dispatch:null,action:e,pending:null},s.queue=o,i=um.bind(null,qe,o,f,i),o.dispatch=i,s.memoizedState=e,[t,i,!1]}function ud(e){var t=Ot();return dd(t,ft,e)}function dd(e,t,i){if(t=Vc(e,t,cd)[0],e=dl(ks)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Wa(t)}catch(D){throw D===jn?il:D}else s=t;t=Ot();var o=t.queue,f=o.dispatch;return i!==t.memoizedState&&(qe.flags|=2048,In(9,{destroy:void 0},dm.bind(null,o,i),null)),[s,f,e]}function dm(e,t){e.action=t}function fd(e){var t=Ot(),i=ft;if(i!==null)return dd(t,i,e);Ot(),t=t.memoizedState,i=Ot();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function In(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=qe.updateQueue,t===null&&(t=hl(),qe.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 _d(){return Ot().memoizedState}function fl(e,t,i,s){var o=ci();qe.flags|=e,o.memoizedState=In(1|t,{destroy:void 0},i,s===void 0?null:s)}function _l(e,t,i,s){var o=Ot();s=s===void 0?null:s;var f=o.memoizedState.inst;ft!==null&&s!==null&&$c(s,ft.memoizedState.deps)?o.memoizedState=In(t,f,i,s):(qe.flags|=e,o.memoizedState=In(1|t,f,i,s))}function pd(e,t){fl(8390656,8,e,t)}function Qc(e,t){_l(2048,8,e,t)}function fm(e){qe.flags|=4;var t=qe.updateQueue;if(t===null)t=hl(),qe.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function md(e){var t=Ot().memoizedState;return fm({ref:t,nextImpl:e}),function(){if((at&2)!==0)throw Error(M(440));return t.impl.apply(void 0,arguments)}}function vd(e,t){return _l(4,2,e,t)}function gd(e,t){return _l(4,4,e,t)}function Sd(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 bd(e,t,i){i=i!=null?i.concat([e]):null,_l(4,4,Sd.bind(null,t,e),i)}function Jc(){}function yd(e,t){var i=Ot();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 Cd(e,t){var i=Ot();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&$c(t,s[1]))return s[0];if(s=e(),Qr){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&&(Xe&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=xf(),qe.lanes|=e,_r|=e,i)}function wd(e,t,i,s){return Wt(i,t)?i:Hn.current!==null?(e=eh(e,i,s),Wt(e,t)||(zt=!0),e):(Ds&42)===0||(Ds&1073741824)!==0&&(Xe&261930)===0?(zt=!0,e.memoizedState=i):(e=xf(),qe.lanes|=e,_r|=e,t)}function xd(e,t,i,s,o){var f=X.p;X.p=f!==0&&8>f?f:8;var D=K.T,P={};K.T=P,sh(e,!1,t,i);try{var Q=o(),le=K.S;if(le!==null&&le(P,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var de=lm(Q,s);qa(e,t,de,Ri(e))}else qa(e,t,s,Ri(e))}catch(ge){qa(e,t,{then:function(){},status:"rejected",reason:ge},Ri())}finally{X.p=f,D!==null&&P.types!==null&&(D.types=P.types),K.T=D}}function _m(){}function th(e,t,i,s){if(e.tag!==5)throw Error(M(476));var o=Ed(e).queue;xd(e,o,t,I,i===null?_m:function(){return Ad(e),i(s)})}function Ed(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ks,lastRenderedState:I},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 Ad(e){var t=Ed(e);t.next===null&&(t=e.alternate.memoizedState),qa(e,t.next.queue,{},Ri())}function ih(){return Yt(lo)}function Rd(){return Ot().memoizedState}function Ld(){return Ot().memoizedState}function pm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Ri();e=lr(i);var s=cr(t,e,i);s!==null&&(Si(s,t,i),Ia(s,t,i)),t={cache:Dc()},e.payload=t;return}t=t.return}}function mm(e,t,i){var s=Ri();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},pl(e)?Td(t,i):(i=Ln(e,t,i,s),i!==null&&(Si(i,e,s),Dd(i,t,s)))}function Md(e,t,i){var s=Ri();qa(e,t,i,s)}function qa(e,t,i,s){var o={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(pl(e))Td(t,o);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var D=t.lastRenderedState,P=f(D,i);if(o.hasEagerState=!0,o.eagerState=P,Wt(P,D))return Fr(e,t,o,0),gt===null&&$r(),!1}catch{}if(i=Ln(e,t,o,s),i!==null)return Si(i,e,s),Dd(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},pl(e)){if(t)throw Error(M(479))}else t=Ln(e,i,s,2),t!==null&&Si(t,e,2)}function pl(e){var t=e.alternate;return e===qe||t!==null&&t===qe}function Td(e,t){zn=ll=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Dd(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,go(e,i)}}var Ga={readContext:Yt,use:ul,useCallback:Rt,useContext:Rt,useEffect:Rt,useImperativeHandle:Rt,useLayoutEffect:Rt,useInsertionEffect:Rt,useMemo:Rt,useReducer:Rt,useRef:Rt,useState:Rt,useDebugValue:Rt,useDeferredValue:Rt,useTransition:Rt,useSyncExternalStore:Rt,useId:Rt,useHostTransitionStatus:Rt,useFormState:Rt,useActionState:Rt,useOptimistic:Rt,useMemoCache:Rt,useCacheRefresh:Rt};Ga.useEffectEvent=Rt;var kd={readContext:Yt,use:ul,useCallback:function(e,t){return ci().memoizedState=[e,t===void 0?null:t],e},useContext:Yt,useEffect:pd,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,fl(4194308,4,Sd.bind(null,t,e),i)},useLayoutEffect:function(e,t){return fl(4194308,4,e,t)},useInsertionEffect:function(e,t){fl(4,2,e,t)},useMemo:function(e,t){var i=ci();t=t===void 0?null:t;var s=e();if(Qr){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 o=i(t);if(Qr){Qt(!0);try{i(t)}finally{Qt(!1)}}}else o=t;return s.memoizedState=s.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},s.queue=e,e=e.dispatch=mm.bind(null,qe,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=Md.bind(null,qe,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=xd.bind(null,qe,e.queue,!0,!1),ci().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=qe,o=ci();if(Pe){if(i===void 0)throw Error(M(407));i=i()}else{if(i=t(),gt===null)throw Error(M(349));(Xe&127)!==0||Ju(s,t,i)}o.memoizedState=i;var f={value:i,getSnapshot:t};return o.queue=f,pd(td.bind(null,s,f,e),[e]),s.flags|=2048,In(9,{destroy:void 0},ed.bind(null,s,f,i,t),null),i},useId:function(){var e=ci(),t=gt.identifierPrefix;if(Pe){var i=vt,s=Dt;i=(s&~(1<<32-xt(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=cl++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=cm++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:ih,useFormState:hd,useActionState:hd,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,qe,!0,i),i.dispatch=t,[e,t]},useMemoCache:Kc,useCacheRefresh:function(){return ci().memoizedState=pm.bind(null,qe)},useEffectEvent:function(e){var t=ci(),i={impl:e};return t.memoizedState=i,function(){if((at&2)!==0)throw Error(M(440));return i.impl.apply(void 0,arguments)}}},rh={readContext:Yt,use:ul,useCallback:yd,useContext:Yt,useEffect:Qc,useImperativeHandle:bd,useInsertionEffect:vd,useLayoutEffect:gd,useMemo:Cd,useReducer:dl,useRef:_d,useState:function(){return dl(ks)},useDebugValue:Jc,useDeferredValue:function(e,t){var i=Ot();return wd(i,ft.memoizedState,e,t)},useTransition:function(){var e=dl(ks)[0],t=Ot().memoizedState;return[typeof e=="boolean"?e:Wa(e),t]},useSyncExternalStore:Qu,useId:Rd,useHostTransitionStatus:ih,useFormState:ud,useActionState:ud,useOptimistic:function(e,t){var i=Ot();return rd(i,ft,e,t)},useMemoCache:Kc,useCacheRefresh:Ld};rh.useEffectEvent=md;var Od={readContext:Yt,use:ul,useCallback:yd,useContext:Yt,useEffect:Qc,useImperativeHandle:bd,useInsertionEffect:vd,useLayoutEffect:gd,useMemo:Cd,useReducer:Yc,useRef:_d,useState:function(){return Yc(ks)},useDebugValue:Jc,useDeferredValue:function(e,t){var i=Ot();return ft===null?eh(i,e,t):wd(i,ft.memoizedState,e,t)},useTransition:function(){var e=Yc(ks)[0],t=Ot().memoizedState;return[typeof e=="boolean"?e:Wa(e),t]},useSyncExternalStore:Qu,useId:Rd,useHostTransitionStatus:ih,useFormState:fd,useActionState:fd,useOptimistic:function(e,t){var i=Ot();return ft!==null?rd(i,ft,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Kc,useCacheRefresh:Ld};Od.useEffectEvent=md;function nh(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:l({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var ah={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=Ri(),o=lr(s);o.payload=t,i!=null&&(o.callback=i),t=cr(e,o,s),t!==null&&(Si(t,e,s),Ia(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=Ri(),o=lr(s);o.tag=1,o.payload=t,i!=null&&(o.callback=i),t=cr(e,o,s),t!==null&&(Si(t,e,s),Ia(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Ri(),s=lr(i);s.tag=2,t!=null&&(s.callback=t),t=cr(e,s,i),t!==null&&(Si(t,e,i),Ia(t,e,i))}};function Bd(e,t,i,s,o,f,D){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,f,D):t.prototype&&t.prototype.isPureReactComponent?!Ir(i,s)||!Ir(o,f):!0}function jd(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 Jr(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=l({},i));for(var o in e)i[o]===void 0&&(i[o]=e[o])}return i}function Nd(e){Es(e)}function Hd(e){console.error(e)}function zd(e){Es(e)}function ml(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Ud(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function oh(e,t,i){return i=lr(i),i.tag=3,i.payload={element:null},i.callback=function(){ml(e,t)},i}function Id(e){return e=lr(e),e.tag=3,e}function Pd(e,t,i,s){var o=i.type.getDerivedStateFromError;if(typeof o=="function"){var f=s.value;e.payload=function(){return o(f)},e.callback=function(){Ud(t,i,s)}}var D=i.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(e.callback=function(){Ud(t,i,s),typeof o!="function"&&(pr===null?pr=new Set([this]):pr.add(this));var P=s.stack;this.componentDidCatch(s.value,{componentStack:P!==null?P:""})})}function vm(e,t,i,s,o){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&kn(t,i,o,!0),i=wi.current,i!==null){switch(i.tag){case 31:case 13:return Ni===null?Ll():i.alternate===null&&Lt===0&&(Lt=3),i.flags&=-257,i.flags|=65536,i.lanes=o,s===sl?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),kh(e,s,o)),!1;case 22:return i.flags|=65536,s===sl?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,o)),!1}throw Error(M(435,i.tag))}return kh(e,s,o),Ll(),!1}if(Pe)return t=wi.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,s!==rr&&(e=Error(M(422),{cause:s}),ja(Y(e,i)))):(s!==rr&&(t=Error(M(423),{cause:s}),ja(Y(t,i))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,s=Y(s,i),o=oh(e.stateNode,s,o),Hc(e,o),Lt!==4&&(Lt=2)),!1;var f=Error(M(520),{cause:s});if(f=Y(f,i),eo===null?eo=[f]:eo.push(f),Lt!==4&&(Lt=2),t===null)return!0;s=Y(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=o&-o,i.lanes|=e,e=oh(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"&&(pr===null||!pr.has(f))))return i.flags|=65536,o&=-o,i.lanes|=o,o=Id(o),Pd(o,e,i,s),Hc(i,o),!1}i=i.return}while(i!==null);return!1}var lh=Error(M(461)),zt=!1;function Xt(e,t,i,s){t.child=e===null?qu(t,null,i,s):Zr(t,e.child,i,s)}function $d(e,t,i,s,o){i=i.render;var f=t.ref;if("ref"in s){var D={};for(var P in s)P!=="ref"&&(D[P]=s[P])}else D=s;return Kr(t),s=Fc(e,t,i,D,f,o),P=Wc(),e!==null&&!zt?(qc(e,t,o),Os(e,t,o)):(Pe&&P&&sr(t),t.flags|=1,Xt(e,t,s,o),t.child)}function Fd(e,t,i,s,o){if(e===null){var f=i.type;return typeof f=="function"&&!Rs(f)&&f.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=f,Wd(e,t,f,s,o)):(e=Tn(i.type,null,s,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!mh(e,o)){var D=f.memoizedProps;if(i=i.compare,i=i!==null?i:Ir,i(D,s)&&e.ref===t.ref)return Os(e,t,o)}return t.flags|=1,e=ji(f,s),e.ref=t.ref,e.return=t,t.child=e}function Wd(e,t,i,s,o){if(e!==null){var f=e.memoizedProps;if(Ir(f,s)&&e.ref===t.ref)if(zt=!1,t.pendingProps=s=f,mh(e,o))(e.flags&131072)!==0&&(zt=!0);else return t.lanes=e.lanes,Os(e,t,o)}return ch(e,t,i,s,o)}function qd(e,t,i,s){var o=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,o=0;s!==null;)o=o|s.lanes|s.childLanes,s=s.sibling;s=o&~f}else s=0,t.child=null;return Gd(e,t,f,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&tl(t,f!==null?f.cachePool:null),f!==null?Vu(t,f):Uc(),Yu(t);else return s=t.lanes=536870912,Gd(e,t,f!==null?f.baseLanes|i:i,i,s)}else f!==null?(tl(t,f.cachePool),Vu(t,f),ur(),t.memoizedState=null):(e!==null&&tl(t,null),Uc(),ur());return Xt(e,t,o,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 Gd(e,t,i,s,o){var f=Oc();return f=f===null?null:{parent:Nt._currentValue,pool:f},t.memoizedState={baseLanes:i,cachePool:f},e!==null&&tl(t,null),Uc(),Yu(t),e!==null&&kn(e,t,s,!0),t.childLanes=o,null}function vl(e,t){return t=Sl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Kd(e,t,i){return Zr(t,e.child,null,i),e=vl(t,t.pendingProps),e.flags|=2,xi(t),t.memoizedState=null,e}function gm(e,t,i){var s=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Pe){if(s.mode==="hidden")return e=vl(t,s),t.lanes=536870912,Ka(null,e);if(Pc(t),(e=bt)?(e=a_(e,ei),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:lt!==null?{id:Dt,overflow:vt}:null,retryLane:536870912,hydrationErrors:null},i=Qo(e),i.return=t,t.child=i,Pt=t,bt=null)):e=null,e===null)throw nr(t);return t.lanes=536870912,null}return vl(t,s)}var f=e.memoizedState;if(f!==null){var D=f.dehydrated;if(Pc(t),o)if(t.flags&256)t.flags&=-257,t=Kd(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(M(558));else if(zt||kn(e,t,i,!1),o=(i&e.childLanes)!==0,zt||o){if(s=gt,s!==null&&(D=oa(s,i),D!==0&&D!==f.retryLane))throw f.retryLane=D,As(e,D),Si(s,e,D),lh;Ll(),t=Kd(e,t,i)}else e=f.treeContext,bt=Hi(D.nextSibling),Pt=t,Pe=!0,ls=null,ei=!1,e!==null&&Wr(t,e),t=vl(t,s),t.flags|=4096;return t}return e=ji(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function gl(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(M(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function ch(e,t,i,s,o){return Kr(t),i=Fc(e,t,i,s,void 0,o),s=Wc(),e!==null&&!zt?(qc(e,t,o),Os(e,t,o)):(Pe&&s&&sr(t),t.flags|=1,Xt(e,t,i,o),t.child)}function Vd(e,t,i,s,o,f){return Kr(t),t.updateQueue=null,i=Zu(t,s,i,o),Xu(e),s=Wc(),e!==null&&!zt?(qc(e,t,f),Os(e,t,f)):(Pe&&s&&sr(t),t.flags|=1,Xt(e,t,i,f),t.child)}function Yd(e,t,i,s,o){if(Kr(t),t.stateNode===null){var f=ir,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):ir,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,o),Pa(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){f=t.stateNode;var P=t.memoizedProps,Q=Jr(i,P);f.props=Q;var le=f.context,de=i.contextType;D=ir,typeof de=="object"&&de!==null&&(D=Yt(de));var ge=i.getDerivedStateFromProps;de=typeof ge=="function"||typeof f.getSnapshotBeforeUpdate=="function",P=t.pendingProps!==P,de||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(P||le!==D)&&jd(t,f,s,D),or=!1;var ce=t.memoizedState;f.state=ce,$a(t,s,f,o),Pa(),le=t.memoizedState,P||ce!==le||or?(typeof ge=="function"&&(nh(t,i,ge,s),le=t.memoizedState),(Q=or||Bd(t,i,Q,s,ce,le,D))?(de||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=le),f.props=s,f.state=le,f.context=D,s=Q):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{f=t.stateNode,Nc(e,t),D=t.memoizedProps,de=Jr(i,D),f.props=de,ge=t.pendingProps,ce=f.context,le=i.contextType,Q=ir,typeof le=="object"&&le!==null&&(Q=Yt(le)),P=i.getDerivedStateFromProps,(le=typeof P=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(D!==ge||ce!==Q)&&jd(t,f,s,Q),or=!1,ce=t.memoizedState,f.state=ce,$a(t,s,f,o),Pa();var he=t.memoizedState;D!==ge||ce!==he||or||e!==null&&e.dependencies!==null&&Jo(e.dependencies)?(typeof P=="function"&&(nh(t,i,P,s),he=t.memoizedState),(de=or||Bd(t,i,de,s,ce,he,Q)||e!==null&&e.dependencies!==null&&Jo(e.dependencies))?(le||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=de):(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,gl(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=Zr(t,e.child,null,o),t.child=Zr(t,null,i,o)):Xt(e,t,i,o),t.memoizedState=f.state,e=t.child):e=Os(e,t,o),e}function Xd(e,t,i,s){return qr(),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:Uu()}}function dh(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Ai),e}function Zd(e,t,i){var s=t.pendingProps,o=!1,f=(t.flags&128)!==0,D;if((D=f)||(D=e!==null&&e.memoizedState===null?!1:(kt.current&2)!==0),D&&(o=!0,t.flags&=-129),D=(t.flags&32)!==0,t.flags&=-33,e===null){if(Pe){if(o?hr(t):ur(),(e=bt)?(e=a_(e,ei),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:lt!==null?{id:Dt,overflow:vt}:null,retryLane:536870912,hydrationErrors:null},i=Qo(e),i.return=t,t.child=i,Pt=t,bt=null)):e=null,e===null)throw nr(t);return Vh(e)?t.lanes=32:t.lanes=536870912,null}var P=s.children;return s=s.fallback,o?(ur(),o=t.mode,P=Sl({mode:"hidden",children:P},o),s=os(s,o,i,null),P.return=t,s.return=t,P.sibling=s,t.child=P,s=t.child,s.memoizedState=uh(i),s.childLanes=dh(e,D,i),t.memoizedState=hh,Ka(null,s)):(hr(t),fh(t,P))}var Q=e.memoizedState;if(Q!==null&&(P=Q.dehydrated,P!==null)){if(f)t.flags&256?(hr(t),t.flags&=-257,t=_h(e,t,i)):t.memoizedState!==null?(ur(),t.child=e.child,t.flags|=128,t=null):(ur(),P=s.fallback,o=t.mode,s=Sl({mode:"visible",children:s.children},o),P=os(P,o,i,null),P.flags|=2,s.return=t,P.return=t,s.sibling=P,t.child=s,Zr(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(hr(t),Vh(P)){if(D=P.nextSibling&&P.nextSibling.dataset,D)var le=D.dgst;D=le,s=Error(M(419)),s.stack="",s.digest=D,ja({value:s,source:null,stack:null}),t=_h(e,t,i)}else if(zt||kn(e,t,i,!1),D=(i&e.childLanes)!==0,zt||D){if(D=gt,D!==null&&(s=oa(D,i),s!==0&&s!==Q.retryLane))throw Q.retryLane=s,As(e,s),Si(D,e,s),lh;Kh(P)||Ll(),t=_h(e,t,i)}else Kh(P)?(t.flags|=192,t.child=e.child,t=null):(e=Q.treeContext,bt=Hi(P.nextSibling),Pt=t,Pe=!0,ls=null,ei=!1,e!==null&&Wr(t,e),t=fh(t,s.children),t.flags|=4096);return t}return o?(ur(),P=s.fallback,o=t.mode,Q=e.child,le=Q.sibling,s=ji(Q,{mode:"hidden",children:s.children}),s.subtreeFlags=Q.subtreeFlags&65011712,le!==null?P=ji(le,P):(P=os(P,o,i,null),P.flags|=2),P.return=t,s.return=t,s.sibling=P,t.child=s,Ka(null,s),s=t.child,P=e.child.memoizedState,P===null?P=uh(i):(o=P.cachePool,o!==null?(Q=Nt._currentValue,o=o.parent!==Q?{parent:Q,pool:Q}:o):o=Uu(),P={baseLanes:P.baseLanes|i,cachePool:o}),s.memoizedState=P,s.childLanes=dh(e,D,i),t.memoizedState=hh,Ka(e.child,s)):(hr(t),i=e.child,e=i.sibling,i=ji(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=Sl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Sl(e,t){return e=oi(22,e,null,t),e.lanes=0,e}function _h(e,t,i){return Zr(t,e.child,null,i),e=fh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Qd(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,o,f){var D=e.memoizedState;D===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:o,treeForkCount:f}:(D.isBackwards=t,D.rendering=null,D.renderingStartTime=0,D.last=s,D.tail=i,D.tailMode=o,D.treeForkCount=f)}function Jd(e,t,i){var s=t.pendingProps,o=s.revealOrder,f=s.tail;s=s.children;var D=kt.current,P=(D&2)!==0;if(P?(D=D&1|2,t.flags|=128):D&=1,te(kt,D),Xt(e,t,s,i),s=Pe?Me:0,!P&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qd(e,i,t);else if(e.tag===19)Qd(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(o){case"forwards":for(i=t.child,o=null;i!==null;)e=i.alternate,e!==null&&ol(e)===null&&(o=i),i=i.sibling;i=o,i===null?(o=t.child,t.child=null):(o=i.sibling,i.sibling=null),ph(t,!1,o,i,f,s);break;case"backwards":case"unstable_legacy-backwards":for(i=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&ol(e)===null){t.child=o;break}e=o.sibling,o.sibling=i,i=o,o=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),_r|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(kn(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(M(153));if(t.child!==null){for(e=t.child,i=ji(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=ji(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&&Jo(e)))}function Sm(e,t,i){switch(t.tag){case 3:W(t,t.stateNode.containerInfo),ar(t,Nt,e.memoizedState.cache),qr();break;case 27:case 5:fe(t);break;case 4:W(t,t.stateNode.containerInfo);break;case 10:ar(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?(hr(t),t.flags|=128,null):(i&t.child.childLanes)!==0?Zd(e,t,i):(hr(t),e=Os(e,t,i),e!==null?e.sibling:null);hr(t);break;case 19:var o=(e.flags&128)!==0;if(s=(i&t.childLanes)!==0,s||(kn(e,t,i,!1),s=(i&t.childLanes)!==0),o){if(s)return Jd(e,t,i);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),te(kt,kt.current),s)break;return null;case 22:return t.lanes=0,qd(e,t,i,t.pendingProps);case 24:ar(t,Nt,e.memoizedState.cache)}return Os(e,t,i)}function ef(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)zt=!0;else{if(!mh(e,i)&&(t.flags&128)===0)return zt=!1,Sm(e,t,i);zt=(e.flags&131072)!==0}else zt=!1,Pe&&(t.flags&1048576)!==0&&Jt(t,Me,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=Yr(t.elementType),t.type=e,typeof e=="function")Rs(e)?(s=Jr(e,s),t.tag=1,t=Yd(null,t,e,s,i)):(t.tag=0,t=ch(null,t,e,s,i));else{if(e!=null){var o=e.$$typeof;if(o===S){t.tag=11,t=$d(null,t,e,s,i);break e}else if(o===T){t.tag=14,t=Fd(null,t,e,s,i);break e}}throw t=V(e)||e,Error(M(306,t,""))}}return t;case 0:return ch(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,o=Jr(s,t.pendingProps),Yd(e,t,s,o,i);case 3:e:{if(W(t,t.stateNode.containerInfo),e===null)throw Error(M(387));s=t.pendingProps;var f=t.memoizedState;o=f.element,Nc(e,t),$a(t,s,null,i);var D=t.memoizedState;if(s=D.cache,ar(t,Nt,s),s!==f.cache&&Tc(t,[Nt],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=Xd(e,t,s,i);break e}else if(s!==o){o=Y(Error(M(424)),t),ja(o),t=Xd(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,bt=Hi(e.firstChild),Pt=t,Pe=!0,ls=null,ei=!0,i=qu(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(qr(),s===o){t=Os(e,t,i);break e}Xt(e,t,s,i)}t=t.child}return t;case 26:return gl(e,t),e===null?(i=d_(t.type,null,t.pendingProps,null))?t.memoizedState=i:Pe||(i=t.type,e=t.pendingProps,s=jl(me.current).createElement(i),s[Tt]=t,s[At]=e,Zt(s,i,e),Et(s),t.stateNode=s):t.memoizedState=d_(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return fe(t),e===null&&Pe&&(s=t.stateNode=c_(t.type,t.pendingProps,me.current),Pt=t,ei=!0,o=bt,Sr(t.type)?(Yh=o,bt=Hi(s.firstChild)):bt=o),Xt(e,t,t.pendingProps.children,i),gl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Pe&&((o=s=bt)&&(s=Ym(s,t.type,t.pendingProps,ei),s!==null?(t.stateNode=s,Pt=t,bt=Hi(s.firstChild),ei=!1,o=!0):o=!1),o||nr(t)),fe(t),o=t.type,f=t.pendingProps,D=e!==null?e.memoizedProps:null,s=f.children,Wh(o,f)?s=null:D!==null&&Wh(o,D)&&(t.flags|=32),t.memoizedState!==null&&(o=Fc(e,t,hm,null,null,i),lo._currentValue=o),gl(e,t),Xt(e,t,s,i),t.child;case 6:return e===null&&Pe&&((e=i=bt)&&(i=Xm(i,t.pendingProps,ei),i!==null?(t.stateNode=i,Pt=t,bt=null,e=!0):e=!1),e||nr(t)),null;case 13:return Zd(e,t,i);case 4:return W(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Zr(t,null,s,i):Xt(e,t,s,i),t.child;case 11:return $d(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,ar(t,t.type,s.value),Xt(e,t,s.children,i),t.child;case 9:return o=t.type._context,s=t.pendingProps.children,Kr(t),o=Yt(o),s=s(o),t.flags|=1,Xt(e,t,s,i),t.child;case 14:return Fd(e,t,t.type,t.pendingProps,i);case 15:return Wd(e,t,t.type,t.pendingProps,i);case 19:return Jd(e,t,i);case 31:return gm(e,t,i);case 22:return qd(e,t,i,t.pendingProps);case 24:return Kr(t),s=Yt(Nt),e===null?(o=Oc(),o===null&&(o=gt,f=Dc(),o.pooledCache=f,f.refCount++,f!==null&&(o.pooledCacheLanes|=i),o=f),t.memoizedState={parent:s,cache:o},jc(t),ar(t,Nt,o)):((e.lanes&i)!==0&&(Nc(e,t),$a(t,null,null,i),Pa()),o=e.memoizedState,f=t.memoizedState,o.parent!==s?(o={parent:s,cache:s},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),ar(t,Nt,s)):(s=f.cache,ar(t,Nt,s),s!==o.cache&&Tc(t,[Nt],i,!0))),Xt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(M(156,t.tag))}function Bs(e){e.flags|=4}function vh(e,t,i,s,o){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(Lf())e.flags|=8192;else throw Xr=sl,Bc}else e.flags&=-16777217}function tf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!v_(t))if(Lf())e.flags|=8192;else throw Xr=sl,Bc}function bl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ft():536870912,e.lanes|=t,Wn|=t)}function Va(e,t){if(!Pe)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 yt(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var o=e.child;o!==null;)i|=o.lanes|o.childLanes,s|=o.subtreeFlags&65011712,s|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)i|=o.lanes|o.childLanes,s|=o.subtreeFlags,s|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function bm(e,t,i){var s=t.pendingProps;switch(Ls(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yt(t),null;case 1:return yt(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Ts(Nt),ae(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Dn(t)?Bs(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Rc())),yt(t),null;case 26:var o=t.type,f=t.memoizedState;return e===null?(Bs(t),f!==null?(yt(t),tf(t,f)):(yt(t),vh(t,o,null,s,i))):f?f!==e.memoizedState?(Bs(t),yt(t),tf(t,f)):(yt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Bs(t),yt(t),vh(t,o,e,s,i)),null;case 27:if(we(t),i=me.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Bs(t);else{if(!s){if(t.stateNode===null)throw Error(M(166));return yt(t),null}e=se.current,Dn(t)?Bu(t):(e=c_(o,s,i),t.stateNode=e,Bs(t))}return yt(t),null;case 5:if(we(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Bs(t);else{if(!s){if(t.stateNode===null)throw Error(M(166));return yt(t),null}if(f=se.current,Dn(t))Bu(t);else{var D=jl(me.current);switch(f){case 1:f=D.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:f=D.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":f=D.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":f=D.createElementNS("http://www.w3.org/1998/Math/MathML",o);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(o,{is:s.is}):D.createElement(o)}}f[Tt]=t,f[At]=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,o,s),o){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 yt(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(M(166));if(e=me.current,Dn(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,o=Pt,o!==null)switch(o.tag){case 27:case 5:s=o.memoizedProps}e[Tt]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||Qf(e.nodeValue,i)),e||nr(t,!0)}else e=jl(e).createTextNode(s),e[Tt]=t,t.stateNode=e}return yt(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=Dn(t),i!==null){if(e===null){if(!s)throw Error(M(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(M(557));e[Tt]=t}else qr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;yt(t),e=!1}else i=Rc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(xi(t),t):(xi(t),null);if((t.flags&128)!==0)throw Error(M(558))}return yt(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=Dn(t),s!==null&&s.dehydrated!==null){if(e===null){if(!o)throw Error(M(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(M(317));o[Tt]=t}else qr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;yt(t),o=!1}else o=Rc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(xi(t),t):(xi(t),null)}return xi(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,o=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(o=s.alternate.memoizedState.cachePool.pool),f=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),f!==o&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),bl(t,t.updateQueue),yt(t),null);case 4:return ae(),e===null&&Uh(t.stateNode.containerInfo),yt(t),null;case 10:return Ts(t.type),yt(t),null;case 19:if($(kt),s=t.memoizedState,s===null)return yt(t),null;if(o=(t.flags&128)!==0,f=s.rendering,f===null)if(o)Va(s,!1);else{if(Lt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=ol(e),f!==null){for(t.flags|=128,Va(s,!1),e=f.updateQueue,t.updateQueue=e,bl(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)Zo(i,e),i=i.sibling;return te(kt,kt.current&1|2),Pe&&li(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&ke()>El&&(t.flags|=128,o=!0,Va(s,!1),t.lanes=4194304)}else{if(!o)if(e=ol(f),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,bl(t,e),Va(s,!0),s.tail===null&&s.tailMode==="hidden"&&!f.alternate&&!Pe)return yt(t),null}else 2*ke()-s.renderingStartTime>El&&i!==536870912&&(t.flags|=128,o=!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=ke(),e.sibling=null,i=kt.current,te(kt,o?i&1|2:i&1),Pe&&li(t,s.treeForkCount),e):(yt(t),null);case 22:case 23:return xi(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&&(yt(t),t.subtreeFlags&6&&(t.flags|=8192)):yt(t),i=t.updateQueue,i!==null&&bl(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&&$(Vr),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Ts(Nt),yt(t),null;case 25:return null;case 30:return null}throw Error(M(156,t.tag))}function ym(e,t){switch(Ls(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ts(Nt),ae(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return we(t),null;case 31:if(t.memoizedState!==null){if(xi(t),t.alternate===null)throw Error(M(340));qr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(xi(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(M(340));qr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $(kt),null;case 4:return ae(),null;case 10:return Ts(t.type),null;case 22:case 23:return xi(t),Ic(),e!==null&&$(Vr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ts(Nt),null;case 25:return null;default:return null}}function sf(e,t){switch(Ls(t),t.tag){case 3:Ts(Nt),ae();break;case 26:case 27:case 5:we(t);break;case 4:ae();break;case 31:t.memoizedState!==null&&xi(t);break;case 13:xi(t);break;case 19:$(kt);break;case 10:Ts(t.type);break;case 22:case 23:xi(t),Ic(),e!==null&&$(Vr);break;case 24:Ts(Nt)}}function Ya(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var o=s.next;i=o;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!==o)}}catch(P){ht(t,t.return,P)}}function dr(e,t,i){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var f=o.next;s=f;do{if((s.tag&e)===e){var D=s.inst,P=D.destroy;if(P!==void 0){D.destroy=void 0,o=t;var Q=i,le=P;try{le()}catch(de){ht(o,Q,de)}}}s=s.next}while(s!==f)}}catch(de){ht(t,t.return,de)}}function rf(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Ku(t,i)}catch(s){ht(e,e.return,s)}}}function nf(e,t,i){i.props=Jr(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){ht(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(o){ht(e,t,o)}}function cs(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(o){ht(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(o){ht(e,t,o)}else i.current=null}function af(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(o){ht(e,e.return,o)}}function gh(e,t,i){try{var s=e.stateNode;Fm(s,e.type,i,t),s[At]=t}catch(o){ht(e,e.return,o)}}function of(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sr(e.type)||e.tag===4}function Sh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||of(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&&Sr(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=qi));else if(s!==4&&(s===27&&Sr(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 yl(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&&Sr(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(yl(e,t,i),e=e.sibling;e!==null;)yl(e,t,i),e=e.sibling}function lf(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);Zt(t,s,i),t[Tt]=e,t[At]=i}catch(f){ht(e,e.return,f)}}var js=!1,Ut=!1,yh=!1,cf=typeof WeakSet=="function"?WeakSet:Set,qt=null;function Cm(e,t){if(e=e.containerInfo,$h=$l,e=En(e),Ma(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 o=s.anchorOffset,f=s.focusNode;s=s.focusOffset;try{i.nodeType,f.nodeType}catch{i=null;break e}var D=0,P=-1,Q=-1,le=0,de=0,ge=e,ce=null;t:for(;;){for(var he;ge!==i||o!==0&&ge.nodeType!==3||(P=D+o),ge!==f||s!==0&&ge.nodeType!==3||(Q=D+s),ge.nodeType===3&&(D+=ge.nodeValue.length),(he=ge.firstChild)!==null;)ce=ge,ge=he;for(;;){if(ge===e)break t;if(ce===i&&++le===o&&(P=D),ce===f&&++de===s&&(Q=D),(he=ge.nextSibling)!==null)break;ge=ce,ce=ge.parentNode}ge=he}i=P===-1||Q===-1?null:{start:P,end:Q}}else i=null}i=i||{start:0,end:0}}else i=null;for(Fh={focusedElem:e,selectionRange:i},$l=!1,qt=t;qt!==null;)if(t=qt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,qt=e;else for(;qt!==null;){switch(t=qt,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++)o=e[i],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,i=t,o=f.memoizedProps,f=f.memoizedState,s=i.stateNode;try{var De=Jr(i.type,o);e=s.getSnapshotBeforeUpdate(De,f),s.__reactInternalSnapshotBeforeUpdate=e}catch(He){ht(i,i.return,He)}}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(M(163))}if(e=t.sibling,e!==null){e.return=t.return,qt=e;break}qt=t.return}}function hf(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){ht(i,i.return,D)}else{var o=Jr(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(D){ht(i,i.return,D)}}s&64&&rf(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{Ku(e,t)}catch(D){ht(i,i.return,D)}}break;case 27:t===null&&s&4&&lf(i);case 26:case 5:Hs(e,i),t===null&&s&4&&af(i),s&512&&Xa(i,i.return);break;case 12:Hs(e,i);break;case 31:Hs(e,i),s&4&&ff(e,i);break;case 13:Hs(e,i),s&4&&_f(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=Dm.bind(null,i),Zm(e,i))));break;case 22:if(s=i.memoizedState!==null||js,!s){t=t!==null&&t.memoizedState!==null||Ut,o=js;var f=Ut;js=s,(Ut=t)&&!f?zs(e,i,(i.subtreeFlags&8772)!==0):Hs(e,i),js=o,Ut=f}break;case 30:break;default:Hs(e,i)}}function uf(e){var t=e.alternate;t!==null&&(e.alternate=null,uf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Di(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 Ct=null,pi=!1;function Ns(e,t,i){for(i=i.child;i!==null;)df(e,t,i),i=i.sibling}function df(e,t,i){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(Gt,i)}catch{}switch(i.tag){case 26:Ut||cs(i,t),Ns(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Ut||cs(i,t);var s=Ct,o=pi;Sr(i.type)&&(Ct=i.stateNode,pi=!1),Ns(e,t,i),no(i.stateNode),Ct=s,pi=o;break;case 5:Ut||cs(i,t);case 6:if(s=Ct,o=pi,Ct=null,Ns(e,t,i),Ct=s,pi=o,Ct!==null)if(pi)try{(Ct.nodeType===9?Ct.body:Ct.nodeName==="HTML"?Ct.ownerDocument.body:Ct).removeChild(i.stateNode)}catch(f){ht(i,t,f)}else try{Ct.removeChild(i.stateNode)}catch(f){ht(i,t,f)}break;case 18:Ct!==null&&(pi?(e=Ct,r_(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Qn(e)):r_(Ct,i.stateNode));break;case 4:s=Ct,o=pi,Ct=i.stateNode.containerInfo,pi=!0,Ns(e,t,i),Ct=s,pi=o;break;case 0:case 11:case 14:case 15:dr(2,i,t),Ut||dr(4,i,t),Ns(e,t,i);break;case 1:Ut||(cs(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&nf(i,t,s)),Ns(e,t,i);break;case 21:Ns(e,t,i);break;case 22:Ut=(s=Ut)||i.memoizedState!==null,Ns(e,t,i),Ut=s;break;default:Ns(e,t,i)}}function ff(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Qn(e)}catch(i){ht(t,t.return,i)}}}function _f(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Qn(e)}catch(i){ht(t,t.return,i)}}function wm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new cf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new cf),t;default:throw Error(M(435,e.tag))}}function Cl(e,t){var i=wm(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var o=km.bind(null,e,s);s.then(o,o)}})}function mi(e,t){var i=t.deletions;if(i!==null)for(var s=0;s<i.length;s++){var o=i[s],f=e,D=t,P=D;e:for(;P!==null;){switch(P.tag){case 27:if(Sr(P.type)){Ct=P.stateNode,pi=!1;break e}break;case 5:Ct=P.stateNode,pi=!1;break e;case 3:case 4:Ct=P.stateNode.containerInfo,pi=!0;break e}P=P.return}if(Ct===null)throw Error(M(160));df(f,D,o),Ct=null,pi=!1,f=o.alternate,f!==null&&(f.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)pf(t,e),t=t.sibling}var Ki=null;function pf(e,t){var i=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:mi(t,e),vi(e),s&4&&(dr(3,e,e.return),Ya(3,e),dr(5,e,e.return));break;case 1:mi(t,e),vi(e),s&512&&(Ut||i===null||cs(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 o=Ki;if(mi(t,e),vi(e),s&512&&(Ut||i===null||cs(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,o=o.ownerDocument||o;t:switch(s){case"title":f=o.getElementsByTagName("title")[0],(!f||f[ts]||f[Tt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=o.createElement(s),o.head.insertBefore(f,o.querySelector("head > title"))),Zt(f,s,i),f[Tt]=e,Et(f),s=f;break e;case"link":var D=p_("link","href",o).get(s+(i.href||""));if(D){for(var P=0;P<D.length;P++)if(f=D[P],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(P,1);break t}}f=o.createElement(s),Zt(f,s,i),o.head.appendChild(f);break;case"meta":if(D=p_("meta","content",o).get(s+(i.content||""))){for(P=0;P<D.length;P++)if(f=D[P],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(P,1);break t}}f=o.createElement(s),Zt(f,s,i),o.head.appendChild(f);break;default:throw Error(M(468,s))}f[Tt]=e,Et(f),s=f}e.stateNode=s}else m_(o,e.type,e.stateNode);else e.stateNode=__(o,s,e.memoizedProps);else f!==s?(f===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):f.count--,s===null?m_(o,e.type,e.stateNode):__(o,s,e.memoizedProps)):s===null&&e.stateNode!==null&&gh(e,e.memoizedProps,i.memoizedProps)}break;case 27:mi(t,e),vi(e),s&512&&(Ut||i===null||cs(i,i.return)),i!==null&&s&4&&gh(e,e.memoizedProps,i.memoizedProps);break;case 5:if(mi(t,e),vi(e),s&512&&(Ut||i===null||cs(i,i.return)),e.flags&32){o=e.stateNode;try{Ks(o,"")}catch(De){ht(e,e.return,De)}}s&4&&e.stateNode!=null&&(o=e.memoizedProps,gh(e,o,i!==null?i.memoizedProps:o)),s&1024&&(yh=!0);break;case 6:if(mi(t,e),vi(e),s&4){if(e.stateNode===null)throw Error(M(162));s=e.memoizedProps,i=e.stateNode;try{i.nodeValue=s}catch(De){ht(e,e.return,De)}}break;case 3:if(zl=null,o=Ki,Ki=Nl(t.containerInfo),mi(t,e),Ki=o,vi(e),s&4&&i!==null&&i.memoizedState.isDehydrated)try{Qn(t.containerInfo)}catch(De){ht(e,e.return,De)}yh&&(yh=!1,mf(e));break;case 4:s=Ki,Ki=Nl(e.stateNode.containerInfo),mi(t,e),vi(e),Ki=s;break;case 12:mi(t,e),vi(e);break;case 31:mi(t,e),vi(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Cl(e,s)));break;case 13:mi(t,e),vi(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(xl=ke()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Cl(e,s)));break;case 22:o=e.memoizedState!==null;var Q=i!==null&&i.memoizedState!==null,le=js,de=Ut;if(js=le||o,Ut=de||Q,mi(t,e),Ut=de,js=le,vi(e),s&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(i===null||Q||js||Ut||en(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){Q=i=t;try{if(f=Q.stateNode,o)D=f.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{P=Q.stateNode;var ge=Q.memoizedProps.style,ce=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;P.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(De){ht(Q,Q.return,De)}}}else if(t.tag===6){if(i===null){Q=t;try{Q.stateNode.nodeValue=o?"":Q.memoizedProps}catch(De){ht(Q,Q.return,De)}}}else if(t.tag===18){if(i===null){Q=t;try{var he=Q.stateNode;o?n_(he,!0):n_(Q.stateNode,!1)}catch(De){ht(Q,Q.return,De)}}}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,Cl(e,i))));break;case 19:mi(t,e),vi(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Cl(e,s)));break;case 30:break;case 21:break;default:mi(t,e),vi(e)}}function vi(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(of(s)){i=s;break}s=s.return}if(i==null)throw Error(M(160));switch(i.tag){case 27:var o=i.stateNode,f=Sh(e);yl(e,f,o);break;case 5:var D=i.stateNode;i.flags&32&&(Ks(D,""),i.flags&=-33);var P=Sh(e);yl(e,P,D);break;case 3:case 4:var Q=i.stateNode.containerInfo,le=Sh(e);bh(e,le,Q);break;default:throw Error(M(161))}}catch(de){ht(e,e.return,de)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function mf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;mf(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;)hf(e,t.alternate,t),t=t.sibling}function en(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:dr(4,t,t.return),en(t);break;case 1:cs(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&nf(t,t.return,i),en(t);break;case 27:no(t.stateNode);case 26:case 5:cs(t,t.return),en(t);break;case 22:t.memoizedState===null&&en(t);break;case 30:en(t);break;default:en(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,o=e,f=t,D=f.flags;switch(f.tag){case 0:case 11:case 15:zs(o,f,i),Ya(4,f);break;case 1:if(zs(o,f,i),s=f,o=s.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(le){ht(s,s.return,le)}if(s=f,o=s.updateQueue,o!==null){var P=s.stateNode;try{var Q=o.shared.hiddenCallbacks;if(Q!==null)for(o.shared.hiddenCallbacks=null,o=0;o<Q.length;o++)Gu(Q[o],P)}catch(le){ht(s,s.return,le)}}i&&D&64&&rf(f),Xa(f,f.return);break;case 27:lf(f);case 26:case 5:zs(o,f,i),i&&s===null&&D&4&&af(f),Xa(f,f.return);break;case 12:zs(o,f,i);break;case 31:zs(o,f,i),i&&D&4&&ff(o,f);break;case 13:zs(o,f,i),i&&D&4&&_f(o,f);break;case 22:f.memoizedState===null&&zs(o,f,i),Xa(f,f.return);break;case 30:break;default:zs(o,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 Vi(e,t,i,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)vf(e,t,i,s),t=t.sibling}function vf(e,t,i,s){var o=t.flags;switch(t.tag){case 0:case 11:case 15:Vi(e,t,i,s),o&2048&&Ya(9,t);break;case 1:Vi(e,t,i,s);break;case 3:Vi(e,t,i,s),o&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(o&2048){Vi(e,t,i,s),e=t.stateNode;try{var f=t.memoizedProps,D=f.id,P=f.onPostCommit;typeof P=="function"&&P(D,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(Q){ht(t,t.return,Q)}}else Vi(e,t,i,s);break;case 31:Vi(e,t,i,s);break;case 13:Vi(e,t,i,s);break;case 23:break;case 22:f=t.stateNode,D=t.alternate,t.memoizedState!==null?f._visibility&2?Vi(e,t,i,s):Za(e,t):f._visibility&2?Vi(e,t,i,s):(f._visibility|=2,Pn(e,t,i,s,(t.subtreeFlags&10256)!==0||!1)),o&2048&&Ch(D,t);break;case 24:Vi(e,t,i,s),o&2048&&wh(t.alternate,t);break;default:Vi(e,t,i,s)}}function Pn(e,t,i,s,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,D=t,P=i,Q=s,le=D.flags;switch(D.tag){case 0:case 11:case 15:Pn(f,D,P,Q,o),Ya(8,D);break;case 23:break;case 22:var de=D.stateNode;D.memoizedState!==null?de._visibility&2?Pn(f,D,P,Q,o):Za(f,D):(de._visibility|=2,Pn(f,D,P,Q,o)),o&&le&2048&&Ch(D.alternate,D);break;case 24:Pn(f,D,P,Q,o),o&&le&2048&&wh(D.alternate,D);break;default:Pn(f,D,P,Q,o)}t=t.sibling}}function Za(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,o=s.flags;switch(s.tag){case 22:Za(i,s),o&2048&&Ch(s.alternate,s);break;case 24:Za(i,s),o&2048&&wh(s.alternate,s);break;default:Za(i,s)}t=t.sibling}}var Qa=8192;function $n(e,t,i){if(e.subtreeFlags&Qa)for(e=e.child;e!==null;)gf(e,t,i),e=e.sibling}function gf(e,t,i){switch(e.tag){case 26:$n(e,t,i),e.flags&Qa&&e.memoizedState!==null&&cv(i,Ki,e.memoizedState,e.memoizedProps);break;case 5:$n(e,t,i);break;case 3:case 4:var s=Ki;Ki=Nl(e.stateNode.containerInfo),$n(e,t,i),Ki=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Qa,Qa=16777216,$n(e,t,i),Qa=s):$n(e,t,i));break;default:$n(e,t,i)}}function Sf(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];qt=s,yf(s,e)}Sf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)bf(e),e=e.sibling}function bf(e){switch(e.tag){case 0:case 11:case 15:Ja(e),e.flags&2048&&dr(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,wl(e)):Ja(e);break;default:Ja(e)}}function wl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];qt=s,yf(s,e)}Sf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:dr(8,t,t.return),wl(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,wl(t));break;default:wl(t)}e=e.sibling}}function yf(e,t){for(;qt!==null;){var i=qt;switch(i.tag){case 0:case 11:case 15:dr(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,qt=s;else e:for(i=e;qt!==null;){s=qt;var o=s.sibling,f=s.return;if(uf(s),s===i){qt=null;break e}if(o!==null){o.return=f,qt=o;break e}qt=f}}}var xm={getCacheForType:function(e){var t=Yt(Nt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Yt(Nt).controller.signal}},Em=typeof WeakMap=="function"?WeakMap:Map,at=0,gt=null,Ve=null,Xe=0,ct=0,Ei=null,fr=!1,Fn=!1,xh=!1,Us=0,Lt=0,_r=0,tn=0,Eh=0,Ai=0,Wn=0,eo=null,gi=null,Ah=!1,xl=0,Cf=0,El=1/0,Al=null,pr=null,$t=0,mr=null,qn=null,Is=0,Rh=0,Lh=null,wf=null,to=0,Mh=null;function Ri(){return(at&2)!==0&&Xe!==0?Xe&-Xe:K.T!==null?jh():$i()}function xf(){if(Ai===0)if((Xe&536870912)===0||Pe){var e=Xi;Xi<<=1,(Xi&3932160)===0&&(Xi=262144),Ai=e}else Ai=536870912;return e=wi.current,e!==null&&(e.flags|=32),Ai}function Si(e,t,i){(e===gt&&(ct===2||ct===9)||e.cancelPendingCommit!==null)&&(Gn(e,0),vr(e,Xe,Ai,!1)),Mi(e,i),((at&2)===0||e!==gt)&&(e===gt&&((at&2)===0&&(tn|=i),Lt===4&&vr(e,Xe,Ai,!1)),hs(e))}function Ef(e,t,i){if((at&6)!==0)throw Error(M(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||$s(e,t),o=s?Lm(e,t):Dh(e,t,!0),f=s;do{if(o===0){Fn&&!s&&vr(e,t,0,!1);break}else{if(i=e.current.alternate,f&&!Am(i)){o=Dh(e,t,!1),f=!1;continue}if(o===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 P=e;o=eo;var Q=P.current.memoizedState.isDehydrated;if(Q&&(Gn(P,D).flags|=256),D=Dh(P,D,!1),D!==2){if(xh&&!Q){P.errorRecoveryDisabledLanes|=f,tn|=f,o=4;break e}f=gi,gi=o,f!==null&&(gi===null?gi=f:gi.push.apply(gi,f))}o=D}if(f=!1,o!==2)continue}}if(o===1){Gn(e,0),vr(e,t,0,!0);break}e:{switch(s=e,f=o,f){case 0:case 1:throw Error(M(345));case 4:if((t&4194048)!==t)break;case 6:vr(s,t,Ai,!fr);break e;case 2:gi=null;break;case 3:case 5:break;default:throw Error(M(329))}if((t&62914560)===t&&(o=xl+300-ke(),10<o)){if(vr(s,t,Ai,!fr),Mr(s,0,!0)!==0)break e;Is=t,s.timeoutHandle=i_(Af.bind(null,s,i,gi,Al,Ah,t,Ai,tn,Wn,fr,f,"Throttled",-0,0),o);break e}Af(s,i,gi,Al,Ah,t,Ai,tn,Wn,fr,f,null,-0,0)}}break}while(!0);hs(e)}function Af(e,t,i,s,o,f,D,P,Q,le,de,ge,ce,he){if(e.timeoutHandle=-1,ge=t.subtreeFlags,ge&8192||(ge&16785408)===16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qi},gf(t,f,ge);var De=(f&62914560)===f?xl-ke():(f&4194048)===f?Cf-ke():0;if(De=hv(ge,De),De!==null){Is=f,e.cancelPendingCommit=De(Bf.bind(null,e,t,f,i,s,o,D,P,Q,de,ge,null,ce,he)),vr(e,f,D,!le);return}}Bf(e,t,f,i,s,o,D,P,Q)}function Am(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 o=i[s],f=o.getSnapshot;o=o.value;try{if(!Wt(f(),o))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 vr(e,t,i,s){t&=~Eh,t&=~tn,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var o=t;0<o;){var f=31-xt(o),D=1<<f;s[f]=-1,o&=~D}i!==0&&aa(e,i,t)}function Rl(){return(at&6)===0?(io(0),!1):!0}function Th(){if(Ve!==null){if(ct===0)var e=Ve.return;else e=Ve,Ms=Gr=null,Gc(e),Nn=null,za=0,e=Ve;for(;e!==null;)sf(e.alternate,e),e=e.return;Ve=null}}function Gn(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,Gm(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Is=0,Th(),gt=e,Ve=i=ji(e.current,null),Xe=t,ct=0,Ei=null,fr=!1,Fn=$s(e,t),xh=!1,Wn=Ai=Eh=tn=_r=Lt=0,gi=eo=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 o=31-xt(s),f=1<<o;t|=e[o],s&=~f}return Us=t,$r(),i}function Rf(e,t){qe=null,K.H=Ga,t===jn||t===il?(t=$u(),ct=3):t===Bc?(t=$u(),ct=4):ct=t===lh?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ei=t,Ve===null&&(Lt=1,ml(e,Y(t,e.current)))}function Lf(){var e=wi.current;return e===null?!0:(Xe&4194048)===Xe?Ni===null:(Xe&62914560)===Xe||(Xe&536870912)!==0?e===Ni:!1}function Mf(){var e=K.H;return K.H=Ga,e===null?Ga:e}function Tf(){var e=K.A;return K.A=xm,e}function Ll(){Lt=4,fr||(Xe&4194048)!==Xe&&wi.current!==null||(Fn=!0),(_r&134217727)===0&&(tn&134217727)===0||gt===null||vr(gt,Xe,Ai,!1)}function Dh(e,t,i){var s=at;at|=2;var o=Mf(),f=Tf();(gt!==e||Xe!==t)&&(Al=null,Gn(e,t)),t=!1;var D=Lt;e:do try{if(ct!==0&&Ve!==null){var P=Ve,Q=Ei;switch(ct){case 8:Th(),D=6;break e;case 3:case 2:case 9:case 6:wi.current===null&&(t=!0);var le=ct;if(ct=0,Ei=null,Kn(e,P,Q,le),i&&Fn){D=0;break e}break;default:le=ct,ct=0,Ei=null,Kn(e,P,Q,le)}}Rm(),D=Lt;break}catch(de){Rf(e,de)}while(!0);return t&&e.shellSuspendCounter++,Ms=Gr=null,at=s,K.H=o,K.A=f,Ve===null&&(gt=null,Xe=0,$r()),D}function Rm(){for(;Ve!==null;)Df(Ve)}function Lm(e,t){var i=at;at|=2;var s=Mf(),o=Tf();gt!==e||Xe!==t?(Al=null,El=ke()+500,Gn(e,t)):Fn=$s(e,t);e:do try{if(ct!==0&&Ve!==null){t=Ve;var f=Ei;t:switch(ct){case 1:ct=0,Ei=null,Kn(e,t,f,1);break;case 2:case 9:if(Iu(f)){ct=0,Ei=null,kf(t);break}t=function(){ct!==2&&ct!==9||gt!==e||(ct=7),hs(e)},f.then(t,t);break e;case 3:ct=7;break e;case 4:ct=5;break e;case 7:Iu(f)?(ct=0,Ei=null,kf(t)):(ct=0,Ei=null,Kn(e,t,f,7));break;case 5:var D=null;switch(Ve.tag){case 26:D=Ve.memoizedState;case 5:case 27:var P=Ve;if(D?v_(D):P.stateNode.complete){ct=0,Ei=null;var Q=P.sibling;if(Q!==null)Ve=Q;else{var le=P.return;le!==null?(Ve=le,Ml(le)):Ve=null}break t}}ct=0,Ei=null,Kn(e,t,f,5);break;case 6:ct=0,Ei=null,Kn(e,t,f,6);break;case 8:Th(),Lt=6;break e;default:throw Error(M(462))}}Mm();break}catch(de){Rf(e,de)}while(!0);return Ms=Gr=null,K.H=s,K.A=o,at=i,Ve!==null?0:(gt=null,Xe=0,$r(),Lt)}function Mm(){for(;Ve!==null&&!Ee();)Df(Ve)}function Df(e){var t=ef(e.alternate,e,Us);e.memoizedProps=e.pendingProps,t===null?Ml(e):Ve=t}function kf(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Vd(i,t,t.pendingProps,t.type,void 0,Xe);break;case 11:t=Vd(i,t,t.pendingProps,t.type.render,t.ref,Xe);break;case 5:Gc(t);default:sf(i,t),t=Ve=Zo(t,Us),t=ef(i,t,Us)}e.memoizedProps=e.pendingProps,t===null?Ml(e):Ve=t}function Kn(e,t,i,s){Ms=Gr=null,Gc(t),Nn=null,za=0;var o=t.return;try{if(vm(e,o,t,i,Xe)){Lt=1,ml(e,Y(i,e.current)),Ve=null;return}}catch(f){if(o!==null)throw Ve=o,f;Lt=1,ml(e,Y(i,e.current)),Ve=null;return}t.flags&32768?(Pe||s===1?e=!0:Fn||(Xe&536870912)!==0?e=!1:(fr=e=!0,(s===2||s===9||s===3||s===6)&&(s=wi.current,s!==null&&s.tag===13&&(s.flags|=16384))),Of(t,e)):Ml(t)}function Ml(e){var t=e;do{if((t.flags&32768)!==0){Of(t,fr);return}e=t.return;var i=bm(t.alternate,t,Us);if(i!==null){Ve=i;return}if(t=t.sibling,t!==null){Ve=t;return}Ve=t=e}while(t!==null);Lt===0&&(Lt=5)}function Of(e,t){do{var i=ym(e.alternate,e);if(i!==null){i.flags&=32767,Ve=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Ve=e;return}Ve=e=i}while(e!==null);Lt=6,Ve=null}function Bf(e,t,i,s,o,f,D,P,Q){e.cancelPendingCommit=null;do Tl();while($t!==0);if((at&6)!==0)throw Error(M(327));if(t!==null){if(t===e.current)throw Error(M(177));if(f=t.lanes|t.childLanes,f|=Oa,oc(e,i,f,D,P,Q),e===gt&&(Ve=gt=null,Xe=0),qn=t,mr=e,Is=i,Rh=f,Lh=o,wf=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Om(ot,function(){return Uf(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=K.T,K.T=null,o=X.p,X.p=2,D=at,at|=4;try{Cm(e,t,i)}finally{at=D,X.p=o,K.T=s}}$t=1,jf(),Nf(),Hf()}}function jf(){if($t===1){$t=0;var e=mr,t=qn,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=K.T,K.T=null;var s=X.p;X.p=2;var o=at;at|=4;try{pf(t,e);var f=Fh,D=En(e.containerInfo),P=f.focusedElem,Q=f.selectionRange;if(D!==P&&P&&P.ownerDocument&&Wo(P.ownerDocument.documentElement,P)){if(Q!==null&&Ma(P)){var le=Q.start,de=Q.end;if(de===void 0&&(de=le),"selectionStart"in P)P.selectionStart=le,P.selectionEnd=Math.min(de,P.value.length);else{var ge=P.ownerDocument||document,ce=ge&&ge.defaultView||window;if(ce.getSelection){var he=ce.getSelection(),De=P.textContent.length,He=Math.min(Q.start,De),pt=Q.end===void 0?He:Math.min(Q.end,De);!he.extend&&He>pt&&(D=pt,pt=He,He=D);var ne=Fo(P,He),ie=Fo(P,pt);if(ne&&ie&&(he.rangeCount!==1||he.anchorNode!==ne.node||he.anchorOffset!==ne.offset||he.focusNode!==ie.node||he.focusOffset!==ie.offset)){var oe=ge.createRange();oe.setStart(ne.node,ne.offset),he.removeAllRanges(),He>pt?(he.addRange(oe),he.extend(ie.node,ie.offset)):(oe.setEnd(ie.node,ie.offset),he.addRange(oe))}}}}for(ge=[],he=P;he=he.parentNode;)he.nodeType===1&&ge.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<ge.length;P++){var _e=ge[P];_e.element.scrollLeft=_e.left,_e.element.scrollTop=_e.top}}$l=!!$h,Fh=$h=null}finally{at=o,X.p=s,K.T=i}}e.current=t,$t=2}}function Nf(){if($t===2){$t=0;var e=mr,t=qn,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=K.T,K.T=null;var s=X.p;X.p=2;var o=at;at|=4;try{hf(e,t.alternate,t)}finally{at=o,X.p=s,K.T=i}}$t=3}}function Hf(){if($t===4||$t===3){$t=0,xe();var e=mr,t=qn,i=Is,s=wf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?$t=5:($t=0,qn=mr=null,zf(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(pr=null),Qi(i),t=t.stateNode,Mt&&typeof Mt.onCommitFiberRoot=="function")try{Mt.onCommitFiberRoot(Gt,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=K.T,o=X.p,X.p=2,K.T=null;try{for(var f=e.onRecoverableError,D=0;D<s.length;D++){var P=s[D];f(P.value,{componentStack:P.stack})}}finally{K.T=t,X.p=o}}(Is&3)!==0&&Tl(),hs(e),o=e.pendingLanes,(i&261930)!==0&&(o&42)!==0?e===Mh?to++:(to=0,Mh=e):to=0,io(0)}}function zf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Na(t)))}function Tl(){return jf(),Nf(),Hf(),Uf()}function Uf(){if($t!==5)return!1;var e=mr,t=Rh;Rh=0;var i=Qi(Is),s=K.T,o=X.p;try{X.p=32>i?32:i,K.T=null,i=Lh,Lh=null;var f=mr,D=Is;if($t=0,qn=mr=null,Is=0,(at&6)!==0)throw Error(M(331));var P=at;if(at|=4,bf(f.current),vf(f,f.current,D,i),at=P,io(0,!1),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot(Gt,f)}catch{}return!0}finally{X.p=o,K.T=s,zf(e,t)}}function If(e,t,i){t=Y(i,t),t=oh(e.stateNode,t,2),e=cr(e,t,2),e!==null&&(Mi(e,2),hs(e))}function ht(e,t,i){if(e.tag===3)If(e,e,i);else for(;t!==null;){if(t.tag===3){If(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(pr===null||!pr.has(s))){e=Y(i,e),i=Id(2),s=cr(t,i,2),s!==null&&(Pd(i,s,t,e),Mi(s,2),hs(s));break}}t=t.return}}function kh(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new Em;var o=new Set;s.set(t,o)}else o=s.get(t),o===void 0&&(o=new Set,s.set(t,o));o.has(i)||(xh=!0,o.add(i),e=Tm.bind(null,e,t,i),t.then(e,e))}function Tm(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,gt===e&&(Xe&i)===i&&(Lt===4||Lt===3&&(Xe&62914560)===Xe&&300>ke()-xl?(at&2)===0&&Gn(e,0):Eh|=i,Wn===Xe&&(Wn=0)),hs(e)}function Pf(e,t){t===0&&(t=Ft()),e=As(e,t),e!==null&&(Mi(e,t),hs(e))}function Dm(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Pf(e,i)}function km(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,o=e.memoizedState;o!==null&&(i=o.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(M(314))}s!==null&&s.delete(t),Pf(e,i)}function Om(e,t){return pe(e,t)}var Dl=null,Vn=null,Oh=!1,kl=!1,Bh=!1,gr=0;function hs(e){e!==Vn&&e.next===null&&(Vn===null?Dl=Vn=e:Vn=Vn.next=e),kl=!0,Oh||(Oh=!0,jm())}function io(e,t){if(!Bh&&kl){Bh=!0;do for(var i=!1,s=Dl;s!==null;){if(e!==0){var o=s.pendingLanes;if(o===0)var f=0;else{var D=s.suspendedLanes,P=s.pingedLanes;f=(1<<31-xt(42|e)+1)-1,f&=o&~(D&~P),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(i=!0,qf(s,f))}else f=Xe,f=Mr(s,s===gt?f:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(f&3)===0||$s(s,f)||(i=!0,qf(s,f));s=s.next}while(i);Bh=!1}}function Bm(){$f()}function $f(){kl=Oh=!1;var e=0;gr!==0&&qm()&&(e=gr);for(var t=ke(),i=null,s=Dl;s!==null;){var o=s.next,f=Ff(s,t);f===0?(s.next=null,i===null?Dl=o:i.next=o,o===null&&(Vn=i)):(i=s,(e!==0||(f&3)!==0)&&(kl=!0)),s=o}$t!==0&&$t!==5||io(e),gr!==0&&(gr=0)}function Ff(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,o=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var D=31-xt(f),P=1<<D,Q=o[D];Q===-1?((P&i)===0||(P&s)!==0)&&(o[D]=mt(P,t)):Q<=t&&(e.expiredLanes|=P),f&=~P}if(t=gt,i=Xe,i=Mr(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(ct===2||ct===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&be(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||$s(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&be(s),Qi(i)){case 2:case 8:i=Ie;break;case 32:i=ot;break;case 268435456:i=nt;break;default:i=ot}return s=Wf.bind(null,e),i=pe(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&be(s),e.callbackPriority=2,e.callbackNode=null,2}function Wf(e,t){if($t!==0&&$t!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Tl()&&e.callbackNode!==i)return null;var s=Xe;return s=Mr(e,e===gt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Ef(e,s,t),Ff(e,ke()),e.callbackNode!=null&&e.callbackNode===i?Wf.bind(null,e):null)}function qf(e,t){if(Tl())return null;Ef(e,t,!0)}function jm(){Km(function(){(at&6)!==0?pe(Ae,Bm):$f()})}function jh(){if(gr===0){var e=On;e===0&&(e=Ii,Ii<<=1,(Ii&261888)===0&&(Ii=256)),gr=e}return gr}function Gf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ms(""+e)}function Kf(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 Nm(e,t,i,s,o){if(t==="submit"&&i&&i.stateNode===o){var f=Gf((o[At]||null).action),D=s.submitter;D&&(t=(t=D[At]||null)?Gf(t.formAction):D.getAttribute("formAction"),t!==null&&(f=t,D=null));var P=new Hr("action","action",null,s,o);e.push({event:P,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(gr!==0){var Q=D?Kf(o,D):new FormData(o);th(i,{pending:!0,data:Q,method:o.method,action:f},null,Q)}}else typeof f=="function"&&(P.preventDefault(),Q=D?Kf(o,D):new FormData(o),th(i,{pending:!0,data:Q,method:o.method,action:f},f,Q))},currentTarget:o}]})}}for(var Nh=0;Nh<Rn.length;Nh++){var Hh=Rn[Nh],Hm=Hh.toLowerCase(),zm=Hh[0].toUpperCase()+Hh.slice(1);_i(Hm,"on"+zm)}_i(Ko,"onAnimationEnd"),_i(Ta,"onAnimationIteration"),_i(Da,"onAnimationStart"),_i("dblclick","onDoubleClick"),_i("focusin","onFocus"),_i("focusout","onBlur"),_i(ws,"onTransitionRun"),_i(xs,"onTransitionStart"),_i(Vo,"onTransitionCancel"),_i(Yo,"onTransitionEnd"),_s("onMouseEnter",["mouseout","mouseover"]),_s("onMouseLeave",["mouseout","mouseover"]),_s("onPointerEnter",["pointerout","pointerover"]),_s("onPointerLeave",["pointerout","pointerover"]),di("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),di("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),di("onBeforeInput",["compositionend","keypress","textInput","paste"]),di("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),di("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),di("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var so="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(" "),Um=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(so));function Vf(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],o=s.event;s=s.listeners;e:{var f=void 0;if(t)for(var D=s.length-1;0<=D;D--){var P=s[D],Q=P.instance,le=P.currentTarget;if(P=P.listener,Q!==f&&o.isPropagationStopped())break e;f=P,o.currentTarget=le;try{f(o)}catch(de){Es(de)}o.currentTarget=null,f=Q}else for(D=0;D<s.length;D++){if(P=s[D],Q=P.instance,le=P.currentTarget,P=P.listener,Q!==f&&o.isPropagationStopped())break e;f=P,o.currentTarget=le;try{f(o)}catch(de){Es(de)}o.currentTarget=null,f=Q}}}}function Ye(e,t){var i=t[Ji];i===void 0&&(i=t[Ji]=new Set);var s=e+"__bubble";i.has(s)||(Yf(t,e,2,!1),i.add(s))}function zh(e,t,i){var s=0;t&&(s|=4),Yf(i,e,s,t)}var Ol="_reactListening"+Math.random().toString(36).slice(2);function Uh(e){if(!e[Ol]){e[Ol]=!0,Dr.forEach(function(i){i!=="selectionchange"&&(Um.has(i)||zh(i,!1,e),zh(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ol]||(t[Ol]=!0,zh("selectionchange",!1,t))}}function Yf(e,t,i,s){switch(x_(t)){case 2:var o=fv;break;case 8:o=_v;break;default:o=eu}i=o.bind(null,t,i,e),o=void 0,!va||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),s?o!==void 0?e.addEventListener(t,i,{capture:!0,passive:o}):e.addEventListener(t,i,!0):o!==void 0?e.addEventListener(t,i,{passive:o}):e.addEventListener(t,i,!1)}function Ih(e,t,i,s,o){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 P=s.stateNode.containerInfo;if(P===o)break;if(D===4)for(D=s.return;D!==null;){var Q=D.tag;if((Q===3||Q===4)&&D.stateNode.containerInfo===o)return;D=D.return}for(;P!==null;){if(D=Fi(P),D===null)return;if(Q=D.tag,Q===5||Q===6||Q===26||Q===27){s=f=D;continue e}P=P.parentNode}}s=s.return}xo(function(){var le=f,de=gn(i),ge=[];e:{var ce=ka.get(e);if(ce!==void 0){var he=Hr,De=e;switch(e){case"keypress":if(Sn(i)===0)break e;case"keydown":case"keyup":he=fc;break;case"focusin":De="focus",he=bn;break;case"focusout":De="blur",he=bn;break;case"beforeblur":case"afterblur":he=bn;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=St;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=Ys;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=Mo;break;case Ko:case Ta:case Da:he=Ro;break;case Yo:he=vc;break;case"scroll":case"scrollend":he=ni;break;case"wheel":he=ya;break;case"copy":case"cut":case"paste":he=Lo;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=wn;break;case"toggle":case"beforetoggle":he=bc}var He=(t&4)!==0,pt=!He&&(e==="scroll"||e==="scrollend"),ne=He?ce!==null?ce+"Capture":null:ce;He=[];for(var ie=le,oe;ie!==null;){var _e=ie;if(oe=_e.stateNode,_e=_e.tag,_e!==5&&_e!==26&&_e!==27||oe===null||ne===null||(_e=jr(ie,ne),_e!=null&&He.push(ro(ie,_e,oe))),pt)break;ie=ie.return}0<He.length&&(ce=new he(ce,De,null,i,de),ge.push({event:ce,listeners:He}))}}if((t&7)===0){e:{if(ce=e==="mouseover"||e==="pointerover",he=e==="mouseout"||e==="pointerout",ce&&i!==vn&&(De=i.relatedTarget||i.fromElement)&&(Fi(De)||De[Ti]))break e;if((he||ce)&&(ce=de.window===de?de:(ce=de.ownerDocument)?ce.defaultView||ce.parentWindow:window,he?(De=i.relatedTarget||i.toElement,he=le,De=De?Fi(De):null,De!==null&&(pt=G(De),He=De.tag,De!==pt||He!==5&&He!==27&&He!==6)&&(De=null)):(he=null,De=le),he!==De)){if(He=St,_e="onMouseLeave",ne="onMouseEnter",ie="mouse",(e==="pointerout"||e==="pointerover")&&(He=wn,_e="onPointerLeave",ne="onPointerEnter",ie="pointer"),pt=he==null?ce:Tr(he),oe=De==null?ce:Tr(De),ce=new He(_e,ie+"leave",he,i,de),ce.target=pt,ce.relatedTarget=oe,_e=null,Fi(de)===le&&(He=new He(ne,ie+"enter",De,i,de),He.target=oe,He.relatedTarget=pt,_e=He),pt=_e,he&&De)t:{for(He=Im,ne=he,ie=De,oe=0,_e=ne;_e;_e=He(_e))oe++;_e=0;for(var je=ie;je;je=He(je))_e++;for(;0<oe-_e;)ne=He(ne),oe--;for(;0<_e-oe;)ie=He(ie),_e--;for(;oe--;){if(ne===ie||ie!==null&&ne===ie.alternate){He=ne;break t}ne=He(ne),ie=He(ie)}He=null}else He=null;he!==null&&Xf(ge,ce,he,He,!1),De!==null&&pt!==null&&Xf(ge,pt,De,He,!0)}}e:{if(ce=le?Tr(le):window,he=ce.nodeName&&ce.nodeName.toLowerCase(),he==="select"||he==="input"&&ce.type==="file")var it=Ho;else if(jo(ce))if(zo)it=xc;else{it=La;var Oe=Ra}else he=ce.nodeName,!he||he.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?le&&mn(le.elementType)&&(it=Ho):it=Io;if(it&&(it=it(e,le))){xa(ge,it,i,de);break e}Oe&&Oe(e,ce,le),e==="focusout"&&le&&ce.type==="number"&&le.memoizedProps.value!=null&&pa(ce,"number",ce.value)}switch(Oe=le?Tr(le):window,e){case"focusin":(jo(Oe)||Oe.contentEditable==="true")&&(Qs=Oe,Pr=le,Js=null);break;case"focusout":Js=Pr=Qs=null;break;case"mousedown":An=!0;break;case"contextmenu":case"mouseup":case"dragend":An=!1,qo(ge,i,de);break;case"selectionchange":if(Ec)break;case"keydown":case"keyup":qo(ge,i,de)}var Ge;if(Xs)e:{switch(e){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else bs?ko(e,i)&&(Ze="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ze="onCompositionStart");Ze&&(Ca&&i.locale!=="ko"&&(bs||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&bs&&(Ge=Sa()):(is=de,ga="value"in is?is.value:is.textContent,bs=!0)),Oe=Bl(le,Ze),0<Oe.length&&(Ze=new rs(Ze,e,null,i,de),ge.push({event:Ze,listeners:Oe}),Ge?Ze.data=Ge:(Ge=Oo(i),Ge!==null&&(Ze.data=Ge)))),(Ge=Cc?wa(e,i):Bo(e,i))&&(Ze=Bl(le,"onBeforeInput"),0<Ze.length&&(Oe=new rs("onBeforeInput","beforeinput",null,i,de),ge.push({event:Oe,listeners:Ze}),Oe.data=Ge)),Nm(ge,e,le,i,de)}Vf(ge,t)})}function ro(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Bl(e,t){for(var i=t+"Capture",s=[];e!==null;){var o=e,f=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||f===null||(o=jr(e,i),o!=null&&s.unshift(ro(e,o,f)),o=jr(e,t),o!=null&&s.push(ro(e,o,f))),e.tag===3)return s;e=e.return}return[]}function Im(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xf(e,t,i,s,o){for(var f=t._reactName,D=[];i!==null&&i!==s;){var P=i,Q=P.alternate,le=P.stateNode;if(P=P.tag,Q!==null&&Q===s)break;P!==5&&P!==26&&P!==27||le===null||(Q=le,o?(le=jr(i,f),le!=null&&D.unshift(ro(i,le,Q))):o||(le=jr(i,f),le!=null&&D.push(ro(i,le,Q)))),i=i.return}D.length!==0&&e.push({event:t,listeners:D})}var Pm=/\r\n?/g,$m=/\u0000|\uFFFD/g;function Zf(e){return(typeof e=="string"?e:""+e).replace(Pm,`
|
|
9
|
+
`).replace($m,"")}function Qf(e,t){return t=Zf(t),Zf(e)===t}function _t(e,t,i,s,o,f){switch(i){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Ks(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Ks(e,""+s);break;case"className":ps(e,"class",s);break;case"tabIndex":ps(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":ps(e,i,s);break;case"style":pn(e,s,f);break;case"data":if(t!=="object"){ps(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=ms(""+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"&&_t(e,t,"name",o.name,o,null),_t(e,t,"formEncType",o.formEncType,o,null),_t(e,t,"formMethod",o.formMethod,o,null),_t(e,t,"formTarget",o.formTarget,o,null)):(_t(e,t,"encType",o.encType,o,null),_t(e,t,"method",o.method,o,null),_t(e,t,"target",o.target,o,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=ms(""+s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=qi);break;case"onScroll":s!=null&&Ye("scroll",e);break;case"onScrollEnd":s!=null&&Ye("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(M(61));if(i=s.__html,i!=null){if(o.children!=null)throw Error(M(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=ms(""+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":Ye("beforetoggle",e),Ye("toggle",e),kr(e,"popover",s);break;case"xlinkActuate":Bt(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Bt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Bt(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Bt(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Bt(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Bt(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Bt(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Bt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Bt(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":kr(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=cc.get(i)||i,kr(e,i,s))}}function Ph(e,t,i,s,o,f){switch(i){case"style":pn(e,s,f);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(M(61));if(i=s.__html,i!=null){if(o.children!=null)throw Error(M(60));e.innerHTML=i}}break;case"children":typeof s=="string"?Ks(e,s):(typeof s=="number"||typeof s=="bigint")&&Ks(e,""+s);break;case"onScroll":s!=null&&Ye("scroll",e);break;case"onScrollEnd":s!=null&&Ye("scrollend",e);break;case"onClick":s!=null&&(e.onclick=qi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ca.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(o=i.endsWith("Capture"),t=i.slice(2,o?i.length-7:void 0),f=e[At]||null,f=f!=null?f[i]:null,typeof f=="function"&&e.removeEventListener(t,f,o),typeof s=="function")){typeof f!="function"&&f!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,s,o);break e}i in e?e[i]=s:s===!0?e.setAttribute(i,""):kr(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":Ye("error",e),Ye("load",e);var s=!1,o=!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":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(M(137,t));default:_t(e,t,f,D,i,null)}}o&&_t(e,t,"srcSet",i.srcSet,i,null),s&&_t(e,t,"src",i.src,i,null);return;case"input":Ye("invalid",e);var P=f=D=o=null,Q=null,le=null;for(s in i)if(i.hasOwnProperty(s)){var de=i[s];if(de!=null)switch(s){case"name":o=de;break;case"type":D=de;break;case"checked":Q=de;break;case"defaultChecked":le=de;break;case"value":f=de;break;case"defaultValue":P=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(M(137,t));break;default:_t(e,t,s,de,i,null)}}Or(e,f,P,Q,le,D,o,!1);return;case"select":Ye("invalid",e),s=D=f=null;for(o in i)if(i.hasOwnProperty(o)&&(P=i[o],P!=null))switch(o){case"value":f=P;break;case"defaultValue":D=P;break;case"multiple":s=P;default:_t(e,t,o,P,i,null)}t=f,i=D,e.multiple=!!s,t!=null?Gs(e,!!s,t,!1):i!=null&&Gs(e,!!s,i,!0);return;case"textarea":Ye("invalid",e),f=o=s=null;for(D in i)if(i.hasOwnProperty(D)&&(P=i[D],P!=null))switch(D){case"value":s=P;break;case"defaultValue":o=P;break;case"children":f=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(M(91));break;default:_t(e,t,D,P,i,null)}fn(e,s,o,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":_t(e,t,Q,s,i,null));return;case"dialog":Ye("beforetoggle",e),Ye("toggle",e),Ye("cancel",e),Ye("close",e);break;case"iframe":case"object":Ye("load",e);break;case"video":case"audio":for(s=0;s<so.length;s++)Ye(so[s],e);break;case"image":Ye("error",e),Ye("load",e);break;case"details":Ye("toggle",e);break;case"embed":case"source":case"link":Ye("error",e),Ye("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(le in i)if(i.hasOwnProperty(le)&&(s=i[le],s!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(M(137,t));default:_t(e,t,le,s,i,null)}return;default:if(mn(t)){for(de in i)i.hasOwnProperty(de)&&(s=i[de],s!==void 0&&Ph(e,t,de,s,i,void 0));return}}for(P in i)i.hasOwnProperty(P)&&(s=i[P],s!=null&&_t(e,t,P,s,i,null))}function Fm(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 o=null,f=null,D=null,P=null,Q=null,le=null,de=null;for(he in i){var ge=i[he];if(i.hasOwnProperty(he)&&ge!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":Q=ge;default:s.hasOwnProperty(he)||_t(e,t,he,null,s,ge)}}for(var ce in s){var he=s[ce];if(ge=i[ce],s.hasOwnProperty(ce)&&(he!=null||ge!=null))switch(ce){case"type":f=he;break;case"name":o=he;break;case"checked":le=he;break;case"defaultChecked":de=he;break;case"value":D=he;break;case"defaultValue":P=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(M(137,t));break;default:he!==ge&&_t(e,t,ce,he,s,ge)}}_a(e,D,P,Q,le,de,f,o);return;case"select":he=D=P=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)||_t(e,t,f,null,s,Q)}for(o in s)if(f=s[o],Q=i[o],s.hasOwnProperty(o)&&(f!=null||Q!=null))switch(o){case"value":ce=f;break;case"defaultValue":P=f;break;case"multiple":D=f;default:f!==Q&&_t(e,t,o,f,s,Q)}t=P,i=D,s=he,ce!=null?Gs(e,!!i,ce,!1):!!s!=!!i&&(t!=null?Gs(e,!!i,t,!0):Gs(e,!!i,i?[]:"",!1));return;case"textarea":he=ce=null;for(P in i)if(o=i[P],i.hasOwnProperty(P)&&o!=null&&!s.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:_t(e,t,P,null,s,o)}for(D in s)if(o=s[D],f=i[D],s.hasOwnProperty(D)&&(o!=null||f!=null))switch(D){case"value":ce=o;break;case"defaultValue":he=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(M(91));break;default:o!==f&&_t(e,t,D,o,s,f)}Br(e,ce,he);return;case"option":for(var De in i)ce=i[De],i.hasOwnProperty(De)&&ce!=null&&!s.hasOwnProperty(De)&&(De==="selected"?e.selected=!1:_t(e,t,De,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":_t(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 He in i)ce=i[He],i.hasOwnProperty(He)&&ce!=null&&!s.hasOwnProperty(He)&&_t(e,t,He,null,s,ce);for(le in s)if(ce=s[le],he=i[le],s.hasOwnProperty(le)&&ce!==he&&(ce!=null||he!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(M(137,t));break;default:_t(e,t,le,ce,s,he)}return;default:if(mn(t)){for(var pt in i)ce=i[pt],i.hasOwnProperty(pt)&&ce!==void 0&&!s.hasOwnProperty(pt)&&Ph(e,t,pt,void 0,s,ce);for(de in s)ce=s[de],he=i[de],!s.hasOwnProperty(de)||ce===he||ce===void 0&&he===void 0||Ph(e,t,de,ce,s,he);return}}for(var ne in i)ce=i[ne],i.hasOwnProperty(ne)&&ce!=null&&!s.hasOwnProperty(ne)&&_t(e,t,ne,null,s,ce);for(ge in s)ce=s[ge],he=i[ge],!s.hasOwnProperty(ge)||ce===he||ce==null&&he==null||_t(e,t,ge,ce,s,he)}function Jf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Wm(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var o=i[s],f=o.transferSize,D=o.initiatorType,P=o.duration;if(f&&P&&Jf(D)){for(D=0,P=o.responseEnd,s+=1;s<i.length;s++){var Q=i[s],le=Q.startTime;if(le>P)break;var de=Q.transferSize,ge=Q.initiatorType;de&&Jf(ge)&&(Q=Q.responseEnd,D+=de*(Q<P?1:(P-le)/(Q-le)))}if(--s,t+=8*(f+D)/(o.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 jl(e){return e.nodeType===9?e:e.ownerDocument}function e_(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 t_(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 qm(){var e=window.event;return e&&e.type==="popstate"?e===qh?!1:(qh=e,!0):(qh=null,!1)}var i_=typeof setTimeout=="function"?setTimeout:void 0,Gm=typeof clearTimeout=="function"?clearTimeout:void 0,s_=typeof Promise=="function"?Promise:void 0,Km=typeof queueMicrotask=="function"?queueMicrotask:typeof s_<"u"?function(e){return s_.resolve(null).then(e).catch(Vm)}:i_;function Vm(e){setTimeout(function(){throw e})}function Sr(e){return e==="head"}function r_(e,t){var i=t,s=0;do{var o=i.nextSibling;if(e.removeChild(i),o&&o.nodeType===8)if(i=o.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(o),Qn(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")no(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,no(i);for(var f=i.firstChild;f;){var D=f.nextSibling,P=f.nodeName;f[ts]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&f.rel.toLowerCase()==="stylesheet"||i.removeChild(f),f=D}}else i==="body"&&no(e.ownerDocument.body);i=o}while(i);Qn(t)}function n_(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),Di(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function Ym(e,t,i,s){for(;e.nodeType===1;){var o=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[ts])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!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=Hi(e.nextSibling),e===null)break}return null}function Xm(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Hi(e.nextSibling),e===null))return null;return e}function a_(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Hi(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 Zm(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 Hi(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 o_(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Hi(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 c_(e,t,i){switch(t=jl(i),e){case"html":if(e=t.documentElement,!e)throw Error(M(452));return e;case"head":if(e=t.head,!e)throw Error(M(453));return e;case"body":if(e=t.body,!e)throw Error(M(454));return e;default:throw Error(M(451))}}function no(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Di(e)}var zi=new Map,h_=new Set;function Nl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ps=X.d;X.d={f:Qm,r:Jm,D:ev,C:tv,L:iv,m:sv,X:nv,S:rv,M:av};function Qm(){var e=Ps.f(),t=Rl();return e||t}function Jm(e){var t=Wi(e);t!==null&&t.tag===5&&t.type==="form"?Ad(t):Ps.r(e)}var Yn=typeof document>"u"?null:document;function u_(e,t,i){var s=Yn;if(s&&typeof t=="string"&&t){var o=Kt(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof i=="string"&&(o+='[crossorigin="'+i+'"]'),h_.has(o)||(h_.add(o),e={rel:e,crossOrigin:i,href:t},s.querySelector(o)===null&&(t=s.createElement("link"),Zt(t,"link",e),Et(t),s.head.appendChild(t)))}}function ev(e){Ps.D(e),u_("dns-prefetch",e,null)}function tv(e,t){Ps.C(e,t),u_("preconnect",e,t)}function iv(e,t,i){Ps.L(e,t,i);var s=Yn;if(s&&e&&t){var o='link[rel="preload"][as="'+Kt(t)+'"]';t==="image"&&i&&i.imageSrcSet?(o+='[imagesrcset="'+Kt(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(o+='[imagesizes="'+Kt(i.imageSizes)+'"]')):o+='[href="'+Kt(e)+'"]';var f=o;switch(t){case"style":f=Xn(e);break;case"script":f=Zn(e)}zi.has(f)||(e=l({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),zi.set(f,e),s.querySelector(o)!==null||t==="style"&&s.querySelector(ao(f))||t==="script"&&s.querySelector(oo(f))||(t=s.createElement("link"),Zt(t,"link",e),Et(t),s.head.appendChild(t)))}}function sv(e,t){Ps.m(e,t);var i=Yn;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Kt(s)+'"][href="'+Kt(e)+'"]',f=o;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Zn(e)}if(!zi.has(f)&&(e=l({rel:"modulepreload",href:e},t),zi.set(f,e),i.querySelector(o)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(oo(f)))return}s=i.createElement("link"),Zt(s,"link",e),Et(s),i.head.appendChild(s)}}}function rv(e,t,i){Ps.S(e,t,i);var s=Yn;if(s&&e){var o=ui(s).hoistableStyles,f=Xn(e);t=t||"default";var D=o.get(f);if(!D){var P={loading:0,preload:null};if(D=s.querySelector(ao(f)))P.loading=5;else{e=l({rel:"stylesheet",href:e,"data-precedence":t},i),(i=zi.get(f))&&Xh(e,i);var Q=D=s.createElement("link");Et(Q),Zt(Q,"link",e),Q._p=new Promise(function(le,de){Q.onload=le,Q.onerror=de}),Q.addEventListener("load",function(){P.loading|=1}),Q.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Hl(D,t,s)}D={type:"stylesheet",instance:D,count:1,state:P},o.set(f,D)}}}function nv(e,t){Ps.X(e,t);var i=Yn;if(i&&e){var s=ui(i).hoistableScripts,o=Zn(e),f=s.get(o);f||(f=i.querySelector(oo(o)),f||(e=l({src:e,async:!0},t),(t=zi.get(o))&&Zh(e,t),f=i.createElement("script"),Et(f),Zt(f,"link",e),i.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},s.set(o,f))}}function av(e,t){Ps.M(e,t);var i=Yn;if(i&&e){var s=ui(i).hoistableScripts,o=Zn(e),f=s.get(o);f||(f=i.querySelector(oo(o)),f||(e=l({src:e,async:!0,type:"module"},t),(t=zi.get(o))&&Zh(e,t),f=i.createElement("script"),Et(f),Zt(f,"link",e),i.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},s.set(o,f))}}function d_(e,t,i,s){var o=(o=me.current)?Nl(o):null;if(!o)throw Error(M(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Xn(i.href),i=ui(o).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=Xn(i.href);var f=ui(o).hoistableStyles,D=f.get(e);if(D||(o=o.ownerDocument||o,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,D),(f=o.querySelector(ao(e)))&&!f._p&&(D.instance=f,D.state.loading=5),zi.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},zi.set(e,i),f||ov(o,e,i,D.state))),t&&s===null)throw Error(M(528,""));return D}if(t&&s!==null)throw Error(M(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Zn(i),i=ui(o).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(M(444,e))}}function Xn(e){return'href="'+Kt(e)+'"'}function ao(e){return'link[rel="stylesheet"]['+e+"]"}function f_(e){return l({},e,{"data-precedence":e.precedence,precedence:null})}function ov(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),Et(t),e.head.appendChild(t))}function Zn(e){return'[src="'+Kt(e)+'"]'}function oo(e){return"script[async]"+e}function __(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Kt(i.href)+'"]');if(s)return t.instance=s,Et(s),s;var o=l({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Et(s),Zt(s,"style",o),Hl(s,i.precedence,e),t.instance=s;case"stylesheet":o=Xn(i.href);var f=e.querySelector(ao(o));if(f)return t.state.loading|=4,t.instance=f,Et(f),f;s=f_(i),(o=zi.get(o))&&Xh(s,o),f=(e.ownerDocument||e).createElement("link"),Et(f);var D=f;return D._p=new Promise(function(P,Q){D.onload=P,D.onerror=Q}),Zt(f,"link",s),t.state.loading|=4,Hl(f,i.precedence,e),t.instance=f;case"script":return f=Zn(i.src),(o=e.querySelector(oo(f)))?(t.instance=o,Et(o),o):(s=i,(o=zi.get(f))&&(s=l({},i),Zh(s,o)),e=e.ownerDocument||e,o=e.createElement("script"),Et(o),Zt(o,"link",s),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(M(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Hl(s,i.precedence,e));return t.instance}function Hl(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=s.length?s[s.length-1]:null,f=o,D=0;D<s.length;D++){var P=s[D];if(P.dataset.precedence===t)f=P;else if(f!==o)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 zl=null;function p_(e,t,i){if(zl===null){var s=new Map,o=zl=new Map;o.set(i,s)}else o=zl,s=o.get(i),s||(s=new Map,o.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),o=0;o<i.length;o++){var f=i[o];if(!(f[ts]||f[Tt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var D=f.getAttribute(t)||"";D=e+D;var P=s.get(D);P?P.push(f):s.set(D,[f])}}return s}function m_(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function lv(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 v_(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function cv(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 o=Xn(s.href),f=t.querySelector(ao(o));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ul.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=f,Et(f);return}f=t.ownerDocument||t,s=f_(s),(o=zi.get(o))&&Xh(s,o),f=f.createElement("link"),Et(f);var D=f;D._p=new Promise(function(P,Q){D.onload=P,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=Ul.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Qh=0;function hv(e,t){return e.stylesheets&&e.count===0&&Pl(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&Pl(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&Qh===0&&(Qh=62500*Wm());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Pl(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(o)}}:null}function Ul(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Pl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Il=null;function Pl(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Il=new Map,t.forEach(uv,e),Il=null,Ul.call(e))}function uv(e,t){if(!(t.state.loading&4)){var i=Il.get(e);if(i)var s=i.get(null);else{i=new Map,Il.set(e,i);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<o.length;f++){var D=o[f];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(i.set(D.dataset.precedence,D),s=D)}s&&i.set(null,s)}o=t.instance,D=o.getAttribute("data-precedence"),f=i.get(D)||s,f===s&&i.set(null,o),i.set(D,o),this.count++,s=Ul.bind(this),o.addEventListener("load",s),o.addEventListener("error",s),f?f.parentNode.insertBefore(o,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var lo={$$typeof:c,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function dv(e,t,i,s,o,f,D,P,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=na(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=na(0),this.hiddenUpdates=na(null),this.identifierPrefix=s,this.onUncaughtError=o,this.onCaughtError=f,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Q,this.incompleteTransitions=new Map}function g_(e,t,i,s,o,f,D,P,Q,le,de,ge){return e=new dv(e,t,i,D,Q,le,de,ge,P),t=1,f===!0&&(t|=24),f=oi(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 S_(e){return e?(e=ir,e):ir}function b_(e,t,i,s,o,f){o=S_(o),s.context===null?s.context=o:s.pendingContext=o,s=lr(t),s.payload={element:i},f=f===void 0?null:f,f!==null&&(s.callback=f),i=cr(e,s,t),i!==null&&(Si(i,e,t),Ia(i,e,t))}function y_(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){y_(e,t),(e=e.alternate)&&y_(e,t)}function C_(e){if(e.tag===13||e.tag===31){var t=As(e,67108864);t!==null&&Si(t,e,67108864),Jh(e,67108864)}}function w_(e){if(e.tag===13||e.tag===31){var t=Ri();t=hi(t);var i=As(e,t);i!==null&&Si(i,e,t),Jh(e,t)}}var $l=!0;function fv(e,t,i,s){var o=K.T;K.T=null;var f=X.p;try{X.p=2,eu(e,t,i,s)}finally{X.p=f,K.T=o}}function _v(e,t,i,s){var o=K.T;K.T=null;var f=X.p;try{X.p=8,eu(e,t,i,s)}finally{X.p=f,K.T=o}}function eu(e,t,i,s){if($l){var o=tu(s);if(o===null)Ih(e,t,s,Fl,i),E_(e,s);else if(mv(o,e,t,i,s))s.stopPropagation();else if(E_(e,s),t&4&&-1<pv.indexOf(e)){for(;o!==null;){var f=Wi(o);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var D=Pi(f.pendingLanes);if(D!==0){var P=f;for(P.pendingLanes|=2,P.entangledLanes|=2;D;){var Q=1<<31-xt(D);P.entanglements[1]|=Q,D&=~Q}hs(f),(at&6)===0&&(El=ke()+500,io(0))}}break;case 31:case 13:P=As(f,2),P!==null&&Si(P,f,2),Rl(),Jh(f,2)}if(f=tu(s),f===null&&Ih(e,t,s,Fl,i),f===o)break;o=f}o!==null&&s.stopPropagation()}else Ih(e,t,s,null,i)}}function tu(e){return e=gn(e),iu(e)}var Fl=null;function iu(e){if(Fl=null,e=Fi(e),e!==null){var t=G(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=q(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 Fl=e,null}function x_(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Je()){case Ae:return 2;case Ie:return 8;case ot:case ut:return 32;case nt:return 268435456;default:return 32}default:return 32}}var su=!1,br=null,yr=null,Cr=null,co=new Map,ho=new Map,wr=[],pv="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 E_(e,t){switch(e){case"focusin":case"focusout":br=null;break;case"dragenter":case"dragleave":yr=null;break;case"mouseover":case"mouseout":Cr=null;break;case"pointerover":case"pointerout":co.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ho.delete(t.pointerId)}}function uo(e,t,i,s,o,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:f,targetContainers:[o]},t!==null&&(t=Wi(t),t!==null&&C_(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function mv(e,t,i,s,o){switch(t){case"focusin":return br=uo(br,e,t,i,s,o),!0;case"dragenter":return yr=uo(yr,e,t,i,s,o),!0;case"mouseover":return Cr=uo(Cr,e,t,i,s,o),!0;case"pointerover":var f=o.pointerId;return co.set(f,uo(co.get(f)||null,e,t,i,s,o)),!0;case"gotpointercapture":return f=o.pointerId,ho.set(f,uo(ho.get(f)||null,e,t,i,s,o)),!0}return!1}function A_(e){var t=Fi(e.target);if(t!==null){var i=G(t);if(i!==null){if(t=i.tag,t===13){if(t=q(i),t!==null){e.blockedOn=t,la(e.priority,function(){w_(i)});return}}else if(t===31){if(t=r(i),t!==null){e.blockedOn=t,la(e.priority,function(){w_(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 Wl(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);vn=s,i.target.dispatchEvent(s),vn=null}else return t=Wi(i),t!==null&&C_(t),e.blockedOn=i,!1;t.shift()}return!0}function R_(e,t,i){Wl(e)&&i.delete(t)}function vv(){su=!1,br!==null&&Wl(br)&&(br=null),yr!==null&&Wl(yr)&&(yr=null),Cr!==null&&Wl(Cr)&&(Cr=null),co.forEach(R_),ho.forEach(R_)}function ql(e,t){e.blockedOn===t&&(e.blockedOn=null,su||(su=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,vv)))}var Gl=null;function L_(e){Gl!==e&&(Gl=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Gl===e&&(Gl=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],o=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:o,method:i.method,action:s},s,o))}}))}function Qn(e){function t(Q){return ql(Q,e)}br!==null&&ql(br,e),yr!==null&&ql(yr,e),Cr!==null&&ql(Cr,e),co.forEach(t),ho.forEach(t);for(var i=0;i<wr.length;i++){var s=wr[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<wr.length&&(i=wr[0],i.blockedOn===null);)A_(i),i.blockedOn===null&&wr.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var o=i[s],f=i[s+1],D=o[At]||null;if(typeof f=="function")D||L_(i);else if(D){var P=null;if(f&&f.hasAttribute("formAction")){if(o=f,D=f[At]||null)P=D.formAction;else if(iu(o)!==null)continue}else P=D.action;typeof P=="function"?i[s+1]=P:(i.splice(s,3),s-=3),L_(i)}}}function M_(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(D){return o=D})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=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,o=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),o!==null&&(o(),o=null)}}}function ru(e){this._internalRoot=e}Kl.prototype.render=ru.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(M(409));var i=t.current,s=Ri();b_(i,s,e,t,null,null)},Kl.prototype.unmount=ru.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;b_(e.current,2,null,e,null,null),Rl(),t[Ti]=null}};function Kl(e){this._internalRoot=e}Kl.prototype.unstable_scheduleHydration=function(e){if(e){var t=$i();e={blockedOn:null,target:e,priority:t};for(var i=0;i<wr.length&&t!==0&&t<wr[i].priority;i++);wr.splice(i,0,e),i===0&&A_(e)}};var T_=w.version;if(T_!=="19.2.8")throw Error(M(527,T_,"19.2.8"));X.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(M(188)):(e=Object.keys(e).join(","),Error(M(268,e)));return e=_(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var gv={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:K,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vl.isDisabled&&Vl.supportsFiber)try{Gt=Vl.inject(gv),Mt=Vl}catch{}}return _o.createRoot=function(e,t){if(!j(e))throw Error(M(299));var i=!1,s="",o=Nd,f=Hd,D=zd;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(D=t.onRecoverableError)),t=g_(e,1,!1,null,null,i,s,null,o,f,D,M_),e[Ti]=t.current,Uh(e),new ru(t)},_o.hydrateRoot=function(e,t,i){if(!j(e))throw Error(M(299));var s=!1,o="",f=Nd,D=Hd,P=zd,Q=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(o=i.identifierPrefix),i.onUncaughtError!==void 0&&(f=i.onUncaughtError),i.onCaughtError!==void 0&&(D=i.onCaughtError),i.onRecoverableError!==void 0&&(P=i.onRecoverableError),i.formState!==void 0&&(Q=i.formState)),t=g_(e,1,!0,t,i??null,s,o,Q,f,D,P,M_),t.context=S_(null),i=t.current,s=Ri(),s=hi(s),o=lr(s),o.callback=null,cr(i,o,s),i=s,t.current.lanes=i,Mi(t,i),hs(t),e[Ti]=t.current,Uh(e),new Kl(t)},_o.version="19.2.8",_o}var I_;function Mv(){if(I_)return ou.exports;I_=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(w){console.error(w)}}return a(),ou.exports=Lv(),ou.exports}var Tv=Mv(),uu={exports:{}},P_;function Dv(){return P_||(P_=1,(function(a,w){(function(A,M){a.exports=M()})(globalThis,(()=>(()=>{var A={4567:function(q,r,d){var _=this&&this.__decorate||function(u,c,S,L){var y,T=arguments.length,b=T<3?c:L===null?L=Object.getOwnPropertyDescriptor(c,S):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(u,c,S,L);else for(var R=u.length-1;R>=0;R--)(y=u[R])&&(b=(T<3?y(b):T>3?y(c,S,b):y(c,S))||b);return T>3&&b&&Object.defineProperty(c,S,b),b},v=this&&this.__param||function(u,c){return function(S,L){c(S,L,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const l=d(9042),g=d(9924),x=d(844),E=d(4725),m=d(2585),n=d(3656);let h=r.AccessibilityManager=class extends x.Disposable{constructor(u,c,S,L){super(),this._terminal=u,this._coreBrowserService=S,this._renderService=L,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let 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 g.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,x.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+=l.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 S=this._terminal.buffer,L=S.lines.length.toString();for(let y=u;y<=c;y++){const T=S.lines.get(S.ydisp+y),b=[],R=T?.translateToString(!0,void 0,void 0,b)||"",k=(S.ydisp+y+1).toString(),U=this._rowElements[y];U&&(R.length===0?(U.innerText=" ",this._rowColumns.set(U,[0,1])):(U.textContent=R,this._rowColumns.set(U,b)),U.setAttribute("aria-posinset",k),U.setAttribute("aria-setsize",L))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(u,c){const S=u.target,L=this._rowElements[c===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(c===0?"1":`${this._terminal.buffer.lines.length}`)||u.relatedTarget!==L)return;let y,T;if(c===0?(y=S,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(y=this._rowElements.shift(),T=S,this._rowContainer.removeChild(y)),y.removeEventListener("focus",this._topBoundaryFocusListener),T.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},S={node:u.focusNode,offset:u.focusOffset};if((c.node.compareDocumentPosition(S.node)&Node.DOCUMENT_POSITION_PRECEDING||c.node===S.node&&c.offset>S.offset)&&([c,S]=[S,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 L=this._rowElements.slice(-1)[0];if(S.node.compareDocumentPosition(L)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(S={node:L,offset:L.textContent?.length??0}),!this._rowContainer.contains(S.node))return;const y=({node:R,offset:k})=>{const U=R instanceof Text?R.parentNode:R;let H=parseInt(U?.getAttribute("aria-posinset"),10)-1;if(isNaN(H))return console.warn("row is invalid. Race condition?"),null;const z=this._rowColumns.get(U);if(!z)return console.warn("columns is null. Race condition?"),null;let V=k<z.length?z[k]:z.slice(-1)[0]+1;return V>=this._terminal.cols&&(++H,V=0),{row:H,column:V}},T=y(c),b=y(S);if(T&&b){if(T.row>b.row||T.row===b.row&&T.column>=b.column)throw new Error("invalid range");this._terminal.select(T.column,T.row,(b.row-T.row)*this._terminal.cols-T.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,m.IInstantiationService),v(2,E.ICoreBrowserService),v(3,E.IRenderService)],h)},3614:(q,r)=>{function d(g){return g.replace(/\r?\n/g,"\r")}function _(g,x){return x?"\x1B[200~"+g+"\x1B[201~":g}function v(g,x,E,m){g=_(g=d(g),E.decPrivateModes.bracketedPasteMode&&m.rawOptions.ignoreBracketedPasteMode!==!0),E.triggerDataEvent(g,!0),x.value=""}function l(g,x,E){const m=E.getBoundingClientRect(),n=g.clientX-m.left-10,h=g.clientY-m.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${n}px`,x.style.top=`${h}px`,x.style.zIndex="1000",x.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(g,x){g.clipboardData&&g.clipboardData.setData("text/plain",x.selectionText),g.preventDefault()},r.handlePasteEvent=function(g,x,E,m){g.stopPropagation(),g.clipboardData&&v(g.clipboardData.getData("text/plain"),x,E,m)},r.paste=v,r.moveTextAreaUnderMouseCursor=l,r.rightClickHandler=function(g,x,E,m,n){l(g,x,E),n&&m.rightClickSelect(g),x.value=m.selectionText,x.select()}},7239:(q,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,l,g){this._css.set(v,l,g)}getCss(v,l){return this._css.get(v,l)}setColor(v,l,g){this._color.set(v,l,g)}getColor(v,l){return this._color.get(v,l)}clear(){this._color.clear(),this._css.clear()}}},3656:(q,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(d,_,v,l){d.addEventListener(_,v,l);let g=!1;return{dispose:()=>{g||(g=!0,d.removeEventListener(_,v,l))}}}},3551:function(q,r,d){var _=this&&this.__decorate||function(h,u,c,S){var L,y=arguments.length,T=y<3?u:S===null?S=Object.getOwnPropertyDescriptor(u,c):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(h,u,c,S);else for(var b=h.length-1;b>=0;b--)(L=h[b])&&(T=(y<3?L(T):y>3?L(u,c,T):L(u,c))||T);return y>3&&T&&Object.defineProperty(u,c,T),T},v=this&&this.__param||function(h,u){return function(c,S){u(c,S,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier=void 0;const l=d(3656),g=d(8460),x=d(844),E=d(2585),m=d(4725);let n=r.Linkifier=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(h,u,c,S,L){super(),this._element=h,this._mouseService=u,this._renderService=c,this._bufferService=S,this._linkProviderService=L,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,l.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,l.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,l.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 S=0;S<c.length;S++){const L=c[S];if(L.classList.contains("xterm"))break;if(L.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((S=>{S?.forEach((L=>{L.link.dispose&&L.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=h.y);let c=!1;for(const[S,L]of this._linkProviderService.linkProviders.entries())u?this._activeProviderReplies?.get(S)&&(c=this._checkLinkProviderResult(S,h,c)):L.provideLinks(h.y,(y=>{if(this._isMouseOut)return;const T=y?.map((b=>({link:b})));this._activeProviderReplies?.set(S,T),c=this._checkLinkProviderResult(S,h,c),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(h.y,this._activeProviderReplies)}))}_removeIntersectingLinks(h,u){const c=new Set;for(let S=0;S<u.size;S++){const L=u.get(S);if(L)for(let y=0;y<L.length;y++){const T=L[y],b=T.link.range.start.y<h?0:T.link.range.start.x,R=T.link.range.end.y>h?this._bufferService.cols:T.link.range.end.x;for(let k=b;k<=R;k++){if(c.has(k)){L.splice(y--,1);break}c.add(k)}}}}_checkLinkProviderResult(h,u,c){if(!this._activeProviderReplies)return c;const S=this._activeProviderReplies.get(h);let L=!1;for(let y=0;y<h;y++)this._activeProviderReplies.has(y)&&!this._activeProviderReplies.get(y)||(L=!0);if(!L&&S){const y=S.find((T=>this._linkAtPosition(T.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 T=this._activeProviderReplies.get(y)?.find((b=>this._linkAtPosition(b.link,u)));if(T){c=!0,this._handleNewLink(T);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,x.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 S=c.start===0?0:c.start+1+this._bufferService.buffer.ydisp,L=this._bufferService.buffer.ydisp+1+c.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=L&&(this._clearCurrentLink(S,L),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,S=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(c.start.x-1,c.start.y-S-1,c.end.x,c.end.y-S-1,void 0);(u?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_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,S=h.range.end.y*this._bufferService.cols+h.range.end.x,L=u.y*this._bufferService.cols+u.x;return c<=L&&L<=S}_positionFromMouseEvent(h,u,c){const S=c.getCoords(h,u,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(h,u,c,S,L){return{x1:h,y1:u,x2:c,y2:S,cols:this._bufferService.cols,fg:L}}};r.Linkifier=n=_([v(1,m.IMouseService),v(2,m.IRenderService),v(3,E.IBufferService),v(4,m.ILinkProviderService)],n)},9042:(q,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(q,r,d){var _=this&&this.__decorate||function(m,n,h,u){var c,S=arguments.length,L=S<3?n:u===null?u=Object.getOwnPropertyDescriptor(n,h):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(m,n,h,u);else for(var y=m.length-1;y>=0;y--)(c=m[y])&&(L=(S<3?c(L):S>3?c(n,h,L):c(n,h))||L);return S>3&&L&&Object.defineProperty(n,h,L),L},v=this&&this.__param||function(m,n){return function(h,u){n(h,u,m)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const l=d(511),g=d(2585);let x=r.OscLinkProvider=class{constructor(m,n,h){this._bufferService=m,this._optionsService=n,this._oscLinkService=h}provideLinks(m,n){const h=this._bufferService.buffer.lines.get(m-1);if(!h)return void n(void 0);const u=[],c=this._optionsService.rawOptions.linkHandler,S=new l.CellData,L=h.getTrimmedLength();let y=-1,T=-1,b=!1;for(let R=0;R<L;R++)if(T!==-1||h.hasContent(R)){if(h.loadCell(R,S),S.hasExtendedAttrs()&&S.extended.urlId){if(T===-1){T=R,y=S.extended.urlId;continue}b=S.extended.urlId!==y}else T!==-1&&(b=!0);if(b||T!==-1&&R===L-1){const k=this._oscLinkService.getLinkData(y)?.uri;if(k){const U={start:{x:T+1,y:m},end:{x:R+(b||R!==L-1?0:1),y:m}};let H=!1;if(!c?.allowNonHttpProtocols)try{const z=new URL(k);["http:","https:"].includes(z.protocol)||(H=!0)}catch{H=!0}H||u.push({text:k,range:U,activate:(z,V)=>c?c.activate(z,V,U):E(0,V),hover:(z,V)=>c?.hover?.(z,V,U),leave:(z,V)=>c?.leave?.(z,V,U)})}b=!1,S.hasExtendedAttrs()&&S.extended.urlId?(T=R,y=S.extended.urlId):(T=-1,y=-1)}}n(u)}};function E(m,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=x=_([v(0,g.IBufferService),v(1,g.IOptionsService),v(2,g.IOscLinkService)],x)},6193:(q,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:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const _=d(3614),v=d(3656),l=d(3551),g=d(9042),x=d(3730),E=d(1680),m=d(3107),n=d(5744),h=d(2950),u=d(1296),c=d(428),S=d(4269),L=d(5114),y=d(8934),T=d(3230),b=d(9312),R=d(4725),k=d(6731),U=d(8055),H=d(8969),z=d(8460),V=d(844),re=d(6114),K=d(8437),X=d(2584),I=d(7399),B=d(5941),F=d(9074),O=d(2585),$=d(5435),te=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 V.MutableDisposable),this._onCursorMove=this.register(new z.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new z.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new z.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new z.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new z.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new z.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new z.EventEmitter),this._onBlur=this.register(new z.EventEmitter),this._onA11yCharEmitter=this.register(new z.EventEmitter),this._onA11yTabEmitter=this.register(new z.EventEmitter),this._onWillOpen=this.register(new z.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(F.DecorationService),this._instantiationService.setService(O.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(se.LinkProviderService),this._instantiationService.setService(R.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((W,ae)=>this.refresh(W,ae)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((W=>this._reportWindowsOptions(W)))),this.register(this._inputHandler.onColor((W=>this._handleColorEvent(W)))),this.register((0,z.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,z.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,z.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,z.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((W=>this._afterResize(W.cols,W.rows)))),this.register((0,V.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(Z){if(this._themeService)for(const W of Z){let ae,fe="";switch(W.index){case 256:ae="foreground",fe="10";break;case 257:ae="background",fe="11";break;case 258:ae="cursor",fe="12";break;default:ae="ansi",fe="4;"+W.index}switch(W.type){case 0:const we=U.color.toColorRGB(ae==="ansi"?this._themeService.colors.ansi[W.index]:this._themeService.colors[ae]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${fe};${(0,B.toRgbString)(we)}${X.C1_ESCAPED.ST}`);break;case 1:if(ae==="ansi")this._themeService.modifyColors((Ce=>Ce.ansi[W.index]=U.channels.toColor(...W.color)));else{const Ce=ae;this._themeService.modifyColors((Ne=>Ne[Ce]=U.channels.toColor(...W.color)))}break;case 2:this._themeService.restoreColor(W.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(te.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Z){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.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(X.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const Z=this.buffer.ybase+this.buffer.y,W=this.buffer.lines.get(Z);if(!W)return;const ae=Math.min(this.buffer.x,this.cols-1),fe=this._renderService.dimensions.css.cell.height,we=W.getWidth(ae),Ce=this._renderService.dimensions.css.cell.width*we,Ne=this.buffer.y*this._renderService.dimensions.css.cell.height,Le=ae*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Le+"px",this.textarea.style.top=Ne+"px",this.textarea.style.width=Ce+"px",this.textarea.style.height=fe+"px",this.textarea.style.lineHeight=fe+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,v.addDisposableDomListener)(this.element,"copy",(W=>{this.hasSelection()&&(0,_.copyHandler)(W,this._selectionService)})));const Z=W=>(0,_.handlePasteEvent)(W,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",(W=>{W.button===2&&(0,_.rightClickHandler)(W,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,v.addDisposableDomListener)(this.element,"contextmenu",(W=>{(0,_.rightClickHandler)(W,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),re.isLinux&&this.register((0,v.addDisposableDomListener)(this.element,"auxclick",(W=>{W.button===1&&(0,_.moveTextAreaUnderMouseCursor)(W,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 W=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),W.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),W.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.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(L.CoreBrowserService,this.textarea,Z.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(R.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(R.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(k.ThemeService),this._instantiationService.setService(R.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(R.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(R.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((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(R.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(l.Linkifier,this.screenElement)),this.element.appendChild(W);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(R.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(m.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(te.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,W=this.element;function ae(Ce){const Ne=Z._mouseService.getMouseReportCoords(Ce,Z.screenElement);if(!Ne)return!1;let Le,ze;switch(Ce.overrideType||Ce.type){case"mousemove":ze=32,Ce.buttons===void 0?(Le=3,Ce.button!==void 0&&(Le=Ce.button<3?Ce.button:3)):Le=1&Ce.buttons?0:4&Ce.buttons?1:2&Ce.buttons?2:3;break;case"mouseup":ze=0,Le=Ce.button<3?Ce.button:3;break;case"mousedown":ze=1,Le=Ce.button<3?Ce.button:3;break;case"wheel":if(Z._customWheelEventHandler&&Z._customWheelEventHandler(Ce)===!1||Z.viewport.getLinesScrolled(Ce)===0)return!1;ze=Ce.deltaY<0?0:1,Le=4;break;default:return!1}return!(ze===void 0||Le===void 0||Le>4)&&Z.coreMouseService.triggerMouseEvent({col:Ne.col,row:Ne.row,x:Ne.x,y:Ne.y,button:Le,action:ze,ctrl:Ce.ctrlKey,alt:Ce.altKey,shift:Ce.shiftKey})}const fe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},we={mouseup:Ce=>(ae(Ce),Ce.buttons||(this._document.removeEventListener("mouseup",fe.mouseup),fe.mousedrag&&this._document.removeEventListener("mousemove",fe.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?fe.mousemove||(W.addEventListener("mousemove",we.mousemove),fe.mousemove=we.mousemove):(W.removeEventListener("mousemove",fe.mousemove),fe.mousemove=null),16&Ce?fe.wheel||(W.addEventListener("wheel",we.wheel,{passive:!1}),fe.wheel=we.wheel):(W.removeEventListener("wheel",fe.wheel),fe.wheel=null),2&Ce?fe.mouseup||(fe.mouseup=we.mouseup):(this._document.removeEventListener("mouseup",fe.mouseup),fe.mouseup=null),4&Ce?fe.mousedrag||(fe.mousedrag=we.mousedrag):(this._document.removeEventListener("mousemove",fe.mousedrag),fe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,v.addDisposableDomListener)(W,"mousedown",(Ce=>{if(Ce.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Ce))return ae(Ce),fe.mouseup&&this._document.addEventListener("mouseup",fe.mouseup),fe.mousedrag&&this._document.addEventListener("mousemove",fe.mousedrag),this.cancel(Ce)}))),this.register((0,v.addDisposableDomListener)(W,"wheel",(Ce=>{if(!fe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Ce)===!1)return!1;if(!this.buffer.hasScrollback){const Ne=this.viewport.getLinesScrolled(Ce);if(Ne===0)return;const Le=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Ce.deltaY<0?"A":"B");let ze="";for(let rt=0;rt<Math.abs(Ne);rt++)ze+=Le;return this.coreService.triggerDataEvent(ze,!0),this.cancel(Ce,!0)}return this.viewport.handleWheel(Ce)?this.cancel(Ce):void 0}}),{passive:!1})),this.register((0,v.addDisposableDomListener)(W,"touchstart",(Ce=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Ce),this.cancel(Ce)}),{passive:!0})),this.register((0,v.addDisposableDomListener)(W,"touchmove",(Ce=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Ce)?void 0:this.cancel(Ce)}),{passive:!1}))}refresh(Z,W){this._renderService?.refreshRows(Z,W)}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,W,ae=0){ae===1?(super.scrollLines(Z,W,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 W=this._characterJoinerService.register(Z);return this.refresh(0,this.rows-1),W}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,W,ae){this._selectionService.setSelection(Z,W,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,W){this._selectionService?.selectLines(Z,W)}_keyDown(Z){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1)return!1;const W=this.browser.isMac&&this.options.macOptionIsMeta&&Z.altKey;if(!W&&!this._compositionHelper.keydown(Z))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;W||Z.key!=="Dead"&&Z.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ae=(0,I.evaluateKeyboardEvent)(Z,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Z),ae.type===3||ae.type===2){const fe=this.rows-1;return this.scrollLines(ae.type===2?-fe:fe),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!==X.C0.ETX&&ae.key!==X.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,W){const ae=Z.isMac&&!this.options.macOptionIsMeta&&W.altKey&&!W.ctrlKey&&!W.metaKey||Z.isWindows&&W.altKey&&W.ctrlKey&&!W.metaKey||Z.isWindows&&W.getModifierState("AltGraph");return W.type==="keypress"?ae:ae&&(!W.keyCode||W.keyCode>47)}_keyUp(Z){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1||((function(W){return W.keyCode===16||W.keyCode===17||W.keyCode===18})(Z)||this.focus(),this.updateCursorStyle(Z),this._keyPressHandled=!1)}_keyPress(Z){let W;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1)return!1;if(this.cancel(Z),Z.charCode)W=Z.charCode;else if(Z.which===null||Z.which===void 0)W=Z.keyCode;else{if(Z.which===0||Z.charCode===0)return!1;W=Z.which}return!(!W||(Z.altKey||Z.ctrlKey||Z.metaKey)&&!this._isThirdLevelShift(this.browser,Z)||(W=String.fromCharCode(W),this._onKey.fire({key:W,domEvent:Z}),this._showCursor(),this.coreService.triggerDataEvent(W,!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 W=Z.data;return this.coreService.triggerDataEvent(W,!0),this.cancel(Z),!0}return!1}resize(Z,W){Z!==this.cols||W!==this.rows?super.resize(Z,W):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Z,W){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(K.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(X.C0.ESC+"[I"):this.coreService.triggerDataEvent(X.C0.ESC+"[O")}_reportWindowsOptions(Z){if(this._renderService)switch(Z){case $.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const W=this._renderService.dimensions.css.canvas.width.toFixed(0),ae=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[4;${ae};${W}t`);break;case $.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const fe=this._renderService.dimensions.css.cell.width.toFixed(0),we=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[6;${we};${fe}t`)}}cancel(Z,W){if(this.options.cancelEvents||W)return Z.preventDefault(),Z.stopPropagation(),!1}}r.Terminal=ue},9924:(q,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 l=Date.now();if(l-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=l,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=l-this._lastRefreshMs,x=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),x)}}_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(q,r,d){var _=this&&this.__decorate||function(h,u,c,S){var L,y=arguments.length,T=y<3?u:S===null?S=Object.getOwnPropertyDescriptor(u,c):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(h,u,c,S);else for(var b=h.length-1;b>=0;b--)(L=h[b])&&(T=(y<3?L(T):y>3?L(u,c,T):L(u,c))||T);return y>3&&T&&Object.defineProperty(u,c,T),T},v=this&&this.__param||function(h,u){return function(c,S){u(c,S,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;const l=d(3656),g=d(4725),x=d(8460),E=d(844),m=d(2585);let n=r.Viewport=class extends E.Disposable{constructor(h,u,c,S,L,y,T,b){super(),this._viewportElement=h,this._scrollArea=u,this._bufferService=c,this._optionsService=S,this._charSizeService=L,this._renderService=y,this._coreBrowserService=T,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,l.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((R=>this._activeBuffer=R.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((R=>this._renderDimensions=R))),this._handleThemeChange(b.colors),this.register(b.onChangeColors((R=>this._handleThemeChange(R)))),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,S="";const L=[],y=u??this._bufferService.buffer.lines.length,T=this._bufferService.buffer.lines;for(let b=h;b<y;b++){const R=T.get(b);if(!R)continue;const k=T.get(b+1)?.isWrapped;if(S+=R.translateToString(!k),!k||b===T.length-1){const U=document.createElement("div");U.textContent=S,L.push(U),S.length>0&&(c=U),S=""}}return{bufferElements:L,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,m.IBufferService),v(3,m.IOptionsService),v(4,g.ICharSizeService),v(5,g.IRenderService),v(6,g.ICoreBrowserService),v(7,g.IThemeService)],n)},3107:function(q,r,d){var _=this&&this.__decorate||function(m,n,h,u){var c,S=arguments.length,L=S<3?n:u===null?u=Object.getOwnPropertyDescriptor(n,h):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(m,n,h,u);else for(var y=m.length-1;y>=0;y--)(c=m[y])&&(L=(S<3?c(L):S>3?c(n,h,L):c(n,h))||L);return S>3&&L&&Object.defineProperty(n,h,L),L},v=this&&this.__param||function(m,n){return function(h,u){n(h,u,m)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;const l=d(4725),g=d(844),x=d(2585);let E=r.BufferDecorationRenderer=class extends g.Disposable{constructor(m,n,h,u,c){super(),this._screenElement=m,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((S=>this._removeDecoration(S)))),this.register((0,g.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 m of this._decorationService.decorations)this._renderDecoration(m);this._dimensionsChanged=!1}_renderDecoration(m){this._refreshStyle(m),this._dimensionsChanged&&this._refreshXPosition(m)}_createElement(m){const n=this._coreBrowserService.mainDocument.createElement("div");n.classList.add("xterm-decoration"),n.classList.toggle("xterm-decoration-top-layer",m?.options?.layer==="top"),n.style.width=`${Math.round((m.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=(m.options.height||1)*this._renderService.dimensions.css.cell.height+"px",n.style.top=(m.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=m.options.x??0;return h&&h>this._bufferService.cols&&(n.style.display="none"),this._refreshXPosition(m,n),n}_refreshStyle(m){const n=m.marker.line-this._bufferService.buffers.active.ydisp;if(n<0||n>=this._bufferService.rows)m.element&&(m.element.style.display="none",m.onRenderEmitter.fire(m.element));else{let h=this._decorationElements.get(m);h||(h=this._createElement(m),m.element=h,this._decorationElements.set(m,h),this._container.appendChild(h),m.onDispose((()=>{this._decorationElements.delete(m),h.remove()}))),h.style.top=n*this._renderService.dimensions.css.cell.height+"px",h.style.display=this._altBufferIsActive?"none":"block",m.onRenderEmitter.fire(h)}}_refreshXPosition(m,n=m.element){if(!n)return;const h=m.options.x??0;(m.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(m){this._decorationElements.get(m)?.remove(),this._decorationElements.delete(m),m.dispose()}};r.BufferDecorationRenderer=E=_([v(1,x.IBufferService),v(2,l.ICoreBrowserService),v(3,x.IDecorationService),v(4,l.IRenderService)],E)},5871:(q,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(q,r,d){var _=this&&this.__decorate||function(c,S,L,y){var T,b=arguments.length,R=b<3?S:y===null?y=Object.getOwnPropertyDescriptor(S,L):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(c,S,L,y);else for(var k=c.length-1;k>=0;k--)(T=c[k])&&(R=(b<3?T(R):b>3?T(S,L,R):T(S,L))||R);return b>3&&R&&Object.defineProperty(S,L,R),R},v=this&&this.__param||function(c,S){return function(L,y){S(L,y,c)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;const l=d(5871),g=d(4725),x=d(844),E=d(2585),m={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 x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(c,S,L,y,T,b,R){super(),this._viewportElement=c,this._screenElement=S,this._bufferService=L,this._decorationService=y,this._renderService=T,this._optionsService=b,this._coreBrowserService=R,this._colorZoneStore=new l.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 k=this._canvas.getContext("2d");if(!k)throw new Error("Ctx cannot be null");this._ctx=k,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.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),S=Math.ceil(this._canvas.width/3);n.full=this._canvas.width,n.left=c,n.center=S,n.right=c,this._refreshDrawHeightConstants(),h.full=0,h.left=0,h.center=n.left,h.right=n.left+n.center}_refreshDrawHeightConstants(){m.full=Math.round(2*this._coreBrowserService.dpr);const c=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(c,12),6)*this._coreBrowserService.dpr);m.left=S,m.center=S,m.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.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 S of this._decorationService.decorations)this._colorZoneStore.addDecoration(S);this._ctx.lineWidth=1;const c=this._colorZoneStore.zones;for(const S of c)S.position!=="full"&&this._renderColorZone(S);for(const S of c)S.position==="full"&&this._renderColorZone(S);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)-m[c.position||"full"]/2),n[c.position||"full"],Math.round((this._canvas.height-1)*((c.endBufferLine-c.startBufferLine)/this._bufferService.buffers.active.lines.length)+m[c.position||"full"]))}_queueRefresh(c,S){this._shouldUpdateDimensions=c||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||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,g.IRenderService),v(5,E.IOptionsService),v(6,g.ICoreBrowserService)],u)},2950:function(q,r,d){var _=this&&this.__decorate||function(m,n,h,u){var c,S=arguments.length,L=S<3?n:u===null?u=Object.getOwnPropertyDescriptor(n,h):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(m,n,h,u);else for(var y=m.length-1;y>=0;y--)(c=m[y])&&(L=(S<3?c(L):S>3?c(n,h,L):c(n,h))||L);return S>3&&L&&Object.defineProperty(n,h,L),L},v=this&&this.__param||function(m,n){return function(h,u){n(h,u,m)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;const l=d(4725),g=d(2585),x=d(2584);let E=r.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(m,n,h,u,c,S){this._textarea=m,this._compositionView=n,this._bufferService=h,this._optionsService=u,this._coreService=c,this._renderService=S,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(m){this._compositionView.textContent=m.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(m){if(this._isComposing||this._isSendingComposition){if(m.keyCode===229||m.keyCode===16||m.keyCode===17||m.keyCode===18)return!1;this._finalizeComposition(!1)}return m.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(m){if(this._compositionView.classList.remove("active"),this._isComposing=!1,m){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 m=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const n=this._textarea.value,h=n.replace(m,"");this._dataAlreadySent=h,n.length>m.length?this._coreService.triggerDataEvent(h,!0):n.length<m.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):n.length===m.length&&n!==m&&this._coreService.triggerDataEvent(n,!0)}}),0)}updateCompositionElements(m){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 S=this._compositionView.getBoundingClientRect();this._textarea.style.left=c+"px",this._textarea.style.top=u+"px",this._textarea.style.width=Math.max(S.width,1)+"px",this._textarea.style.height=Math.max(S.height,1)+"px",this._textarea.style.lineHeight=S.height+"px"}m||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};r.CompositionHelper=E=_([v(2,g.IBufferService),v(3,g.IOptionsService),v(4,g.ICoreService),v(5,l.IRenderService)],E)},9806:(q,r)=>{function d(_,v,l){const g=l.getBoundingClientRect(),x=_.getComputedStyle(l),E=parseInt(x.getPropertyValue("padding-left")),m=parseInt(x.getPropertyValue("padding-top"));return[v.clientX-g.left-E,v.clientY-g.top-m]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=d,r.getCoords=function(_,v,l,g,x,E,m,n,h){if(!E)return;const u=d(_,v,l);return u?(u[0]=Math.ceil((u[0]+(h?m/2:0))/m),u[1]=Math.ceil(u[1]/n),u[0]=Math.min(Math.max(u[0],1),g+(h?1:0)),u[1]=Math.min(Math.max(u[1],1),x),u):void 0}},9504:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;const _=d(2584);function v(n,h,u,c){const S=n-l(n,u),L=h-l(h,u),y=Math.abs(S-L)-(function(T,b,R){let k=0;const U=T-l(T,R),H=b-l(b,R);for(let z=0;z<Math.abs(U-H);z++){const V=g(T,b)==="A"?-1:1;R.buffer.lines.get(U+V*z)?.isWrapped&&k++}return k})(n,h,u);return m(y,E(g(n,h),c))}function l(n,h){let u=0,c=h.buffer.lines.get(n),S=c?.isWrapped;for(;S&&n>=0&&n<h.rows;)u++,c=h.buffer.lines.get(--n),S=c?.isWrapped;return u}function g(n,h){return n>h?"A":"B"}function x(n,h,u,c,S,L){let y=n,T=h,b="";for(;y!==u||T!==c;)y+=S?1:-1,S&&y>L.cols-1?(b+=L.buffer.translateBufferLineToString(T,!1,n,y),y=0,n=0,T++):!S&&y<0&&(b+=L.buffer.translateBufferLineToString(T,!1,0,n+1),y=L.cols-1,n=y,T--);return b+L.buffer.translateBufferLineToString(T,!1,n,y)}function E(n,h){const u=h?"O":"[";return _.C0.ESC+u+n}function m(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 S=u.buffer.x,L=u.buffer.y;if(!u.buffer.hasScrollback)return(function(b,R,k,U,H,z){return v(R,U,H,z).length===0?"":m(x(b,R,b,R-l(R,H),!1,H).length,E("D",z))})(S,L,0,h,u,c)+v(L,h,u,c)+(function(b,R,k,U,H,z){let V;V=v(R,U,H,z).length>0?U-l(U,H):R;const re=U,K=(function(X,I,B,F,O,$){let te;return te=v(B,F,O,$).length>0?F-l(F,O):I,X<B&&te<=F||X>=B&&te<F?"C":"D"})(b,R,k,U,H,z);return m(x(b,V,k,re,K==="C",H).length,E(K,z))})(S,L,n,h,u,c);let y;if(L===h)return y=S>n?"D":"C",m(Math.abs(S-n),E(y,c));y=L>h?"D":"C";const T=Math.abs(L-h);return m((function(b,R){return R.cols-b})(L>h?n:S,u)+(T-1)*u.cols+1+((L>h?S:n)-1),E(y,c))}},1296:function(q,r,d){var _=this&&this.__decorate||function(z,V,re,K){var X,I=arguments.length,B=I<3?V:K===null?K=Object.getOwnPropertyDescriptor(V,re):K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(z,V,re,K);else for(var F=z.length-1;F>=0;F--)(X=z[F])&&(B=(I<3?X(B):I>3?X(V,re,B):X(V,re))||B);return I>3&&B&&Object.defineProperty(V,re,B),B},v=this&&this.__param||function(z,V){return function(re,K){V(re,K,z)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;const l=d(3787),g=d(2550),x=d(2223),E=d(6171),m=d(6052),n=d(4725),h=d(8055),u=d(8460),c=d(844),S=d(2585),L="xterm-dom-renderer-owner-",y="xterm-rows",T="xterm-fg-",b="xterm-bg-",R="xterm-focus",k="xterm-selection";let U=1,H=r.DomRenderer=class extends c.Disposable{constructor(z,V,re,K,X,I,B,F,O,$,te,se,ue){super(),this._terminal=z,this._document=V,this._element=re,this._screenElement=K,this._viewportElement=X,this._helperContainer=I,this._linkifier2=B,this._charSizeService=O,this._optionsService=$,this._bufferService=te,this._coreBrowserService=se,this._themeService=ue,this._terminalClass=U++,this._rowElements=[],this._selectionRenderModel=(0,m.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(k),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((me=>this._injectCss(me)))),this._injectCss(this._themeService.colors),this._rowFactory=F.createInstance(l.DomRendererRowFactory,document),this._element.classList.add(L+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((me=>this._handleLinkHover(me)))),this.register(this._linkifier2.onHideLinkUnderline((me=>this._handleLinkLeave(me)))),this.register((0,c.toDisposable)((()=>{this._element.classList.remove(L+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new g.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 z=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*z,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*z),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/z),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/z),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 V=`${this._terminalSelector} .${y} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=V,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(z){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let V=`${this._terminalSelector} .${y} { color: ${z.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;V+=`${this._terminalSelector} .${y} .xterm-dim { color: ${h.color.multiplyOpacity(z.foreground,.5).css};}`,V+=`${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}`,K=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;V+=`@keyframes ${re} { 50% { border-bottom-style: hidden; }}`,V+=`@keyframes ${K} { 50% { box-shadow: none; }}`,V+=`@keyframes ${X} { 0% { background-color: ${z.cursor.css}; color: ${z.cursorAccent.css}; } 50% { background-color: inherit; color: ${z.cursor.css}; }}`,V+=`${this._terminalSelector} .${y}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${re} 1s step-end infinite;}${this._terminalSelector} .${y}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${y}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${z.cursor.css}; color: ${z.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${z.cursor.css} !important; color: ${z.cursorAccent.css} !important;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${z.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${z.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${z.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,V+=`${this._terminalSelector} .${k} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${k} div { position: absolute; background-color: ${z.selectionBackgroundOpaque.css};}${this._terminalSelector} .${k} div { position: absolute; background-color: ${z.selectionInactiveBackgroundOpaque.css};}`;for(const[I,B]of z.ansi.entries())V+=`${this._terminalSelector} .${T}${I} { color: ${B.css}; }${this._terminalSelector} .${T}${I}.xterm-dim { color: ${h.color.multiplyOpacity(B,.5).css}; }${this._terminalSelector} .${b}${I} { background-color: ${B.css}; }`;V+=`${this._terminalSelector} .${T}${x.INVERTED_DEFAULT_COLOR} { color: ${h.color.opaque(z.background).css}; }${this._terminalSelector} .${T}${x.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${h.color.multiplyOpacity(h.color.opaque(z.background),.5).css}; }${this._terminalSelector} .${b}${x.INVERTED_DEFAULT_COLOR} { background-color: ${z.foreground.css}; }`,this._themeStyleElement.textContent=V}_setDefaultSpacing(){const z=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${z}px`,this._rowFactory.defaultSpacing=z}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(z,V){for(let re=this._rowElements.length;re<=V;re++){const K=this._document.createElement("div");this._rowContainer.appendChild(K),this._rowElements.push(K)}for(;this._rowElements.length>V;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(z,V){this._refreshRowElements(z,V),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(R),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(R),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(z,V,re){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(z,V,re),this.renderRows(0,this._bufferService.rows-1),!z||!V)return;this._selectionRenderModel.update(this._terminal,z,V,re);const K=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,I=this._selectionRenderModel.viewportCappedStartRow,B=this._selectionRenderModel.viewportCappedEndRow;if(I>=this._bufferService.rows||B<0)return;const F=this._document.createDocumentFragment();if(re){const O=z[0]>V[0];F.appendChild(this._createSelectionElement(I,O?V[0]:z[0],O?z[0]:V[0],B-I+1))}else{const O=K===I?z[0]:0,$=I===X?V[0]:this._bufferService.cols;F.appendChild(this._createSelectionElement(I,O,$));const te=B-I-1;if(F.appendChild(this._createSelectionElement(I+1,0,this._bufferService.cols,te)),I!==B){const se=X===B?V[0]:this._bufferService.cols;F.appendChild(this._createSelectionElement(B,0,se))}}this._selectionContainer.appendChild(F)}_createSelectionElement(z,V,re,K=1){const X=this._document.createElement("div"),I=V*this.dimensions.css.cell.width;let B=this.dimensions.css.cell.width*(re-V);return I+B>this.dimensions.css.canvas.width&&(B=this.dimensions.css.canvas.width-I),X.style.height=K*this.dimensions.css.cell.height+"px",X.style.top=z*this.dimensions.css.cell.height+"px",X.style.left=`${I}px`,X.style.width=`${B}px`,X}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const z of this._rowElements)z.replaceChildren()}renderRows(z,V){const re=this._bufferService.buffer,K=re.ybase+re.y,X=Math.min(re.x,this._bufferService.cols-1),I=this._optionsService.rawOptions.cursorBlink,B=this._optionsService.rawOptions.cursorStyle,F=this._optionsService.rawOptions.cursorInactiveStyle;for(let O=z;O<=V;O++){const $=O+re.ydisp,te=this._rowElements[O],se=re.lines.get($);if(!te||!se)break;te.replaceChildren(...this._rowFactory.createRow(se,$,$===K,B,F,X,I,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${L}${this._terminalClass}`}_handleLinkHover(z){this._setCellUnderline(z.x1,z.x2,z.y1,z.y2,z.cols,!0)}_handleLinkLeave(z){this._setCellUnderline(z.x1,z.x2,z.y1,z.y2,z.cols,!1)}_setCellUnderline(z,V,re,K,X,I){re<0&&(z=0),K<0&&(V=0);const B=this._bufferService.rows-1;re=Math.max(Math.min(re,B),0),K=Math.max(Math.min(K,B),0),X=Math.min(X,this._bufferService.cols);const F=this._bufferService.buffer,O=F.ybase+F.y,$=Math.min(F.x,X-1),te=this._optionsService.rawOptions.cursorBlink,se=this._optionsService.rawOptions.cursorStyle,ue=this._optionsService.rawOptions.cursorInactiveStyle;for(let me=re;me<=K;++me){const Z=me+F.ydisp,W=this._rowElements[me],ae=F.lines.get(Z);if(!W||!ae)break;W.replaceChildren(...this._rowFactory.createRow(ae,Z,Z===O,se,ue,$,te,this.dimensions.css.cell.width,this._widthCache,I?me===re?z:0:-1,I?(me===K?V:X)-1:-1))}}};r.DomRenderer=H=_([v(7,S.IInstantiationService),v(8,n.ICharSizeService),v(9,S.IOptionsService),v(10,S.IBufferService),v(11,n.ICoreBrowserService),v(12,n.IThemeService)],H)},3787:function(q,r,d){var _=this&&this.__decorate||function(y,T,b,R){var k,U=arguments.length,H=U<3?T:R===null?R=Object.getOwnPropertyDescriptor(T,b):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(y,T,b,R);else for(var z=y.length-1;z>=0;z--)(k=y[z])&&(H=(U<3?k(H):U>3?k(T,b,H):k(T,b))||H);return U>3&&H&&Object.defineProperty(T,b,H),H},v=this&&this.__param||function(y,T){return function(b,R){T(b,R,y)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=void 0;const l=d(2223),g=d(643),x=d(511),E=d(2585),m=d(8055),n=d(4725),h=d(4269),u=d(6171),c=d(3734);let S=r.DomRendererRowFactory=class{constructor(y,T,b,R,k,U,H){this._document=y,this._characterJoinerService=T,this._optionsService=b,this._coreBrowserService=R,this._coreService=k,this._decorationService=U,this._themeService=H,this._workCell=new x.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(y,T,b){this._selectionStart=y,this._selectionEnd=T,this._columnSelectMode=b}createRow(y,T,b,R,k,U,H,z,V,re,K){const X=[],I=this._characterJoinerService.getJoinedCharacters(T),B=this._themeService.colors;let F,O=y.getNoBgTrimmedLength();b&&O<U+1&&(O=U+1);let $=0,te="",se=0,ue=0,me=0,Z=!1,W=0,ae=!1,fe=0;const we=[],Ce=re!==-1&&K!==-1;for(let Ne=0;Ne<O;Ne++){y.loadCell(Ne,this._workCell);let Le=this._workCell.getWidth();if(Le===0)continue;let ze=!1,rt=Ne,Be=this._workCell;if(I.length>0&&Ne===I[0][0]){ze=!0;const Ue=I.shift();Be=new h.JoinedCellData(this._workCell,y.translateToString(!0,Ue[0],Ue[1]),Ue[1]-Ue[0]),rt=Ue[1]-1,Le=Be.getWidth()}const It=this._isCellInSelection(Ne,T),ve=b&&Ne===U,pe=Ce&&Ne>=re&&Ne<=K;let be=!1;this._decorationService.forEachDecorationAtCell(Ne,T,void 0,(Ue=>{be=!0}));let Ee=Be.getChars()||g.WHITESPACE_CELL_CHAR;if(Ee===" "&&(Be.isUnderline()||Be.isOverline())&&(Ee=" "),fe=Le*z-V.get(Ee,Be.isBold(),Be.isItalic()),F){if($&&(It&&ae||!It&&!ae&&Be.bg===se)&&(It&&ae&&B.selectionForeground||Be.fg===ue)&&Be.extended.ext===me&&pe===Z&&fe===W&&!ve&&!ze&&!be){Be.isInvisible()?te+=g.WHITESPACE_CELL_CHAR:te+=Ee,$++;continue}$&&(F.textContent=te),F=this._document.createElement("span"),$=0,te=""}else F=this._document.createElement("span");if(se=Be.bg,ue=Be.fg,me=Be.extended.ext,Z=pe,W=fe,ae=It,ze&&U>=Ne&&U<=rt&&(U=Ne),!this._coreService.isCursorHidden&&ve&&this._coreService.isCursorInitialized){if(we.push("xterm-cursor"),this._coreBrowserService.isFocused)H&&we.push("xterm-cursor-blink"),we.push(R==="bar"?"xterm-cursor-bar":R==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(k)switch(k){case"outline":we.push("xterm-cursor-outline");break;case"block":we.push("xterm-cursor-block");break;case"bar":we.push("xterm-cursor-bar");break;case"underline":we.push("xterm-cursor-underline")}}if(Be.isBold()&&we.push("xterm-bold"),Be.isItalic()&&we.push("xterm-italic"),Be.isDim()&&we.push("xterm-dim"),te=Be.isInvisible()?g.WHITESPACE_CELL_CHAR:Be.getChars()||g.WHITESPACE_CELL_CHAR,Be.isUnderline()&&(we.push(`xterm-underline-${Be.extended.underlineStyle}`),te===" "&&(te=" "),!Be.isUnderlineColorDefault()))if(Be.isUnderlineColorRGB())F.style.textDecorationColor=`rgb(${c.AttributeData.toColorRGB(Be.getUnderlineColor()).join(",")})`;else{let Ue=Be.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Be.isBold()&&Ue<8&&(Ue+=8),F.style.textDecorationColor=B.ansi[Ue].css}Be.isOverline()&&(we.push("xterm-overline"),te===" "&&(te=" ")),Be.isStrikethrough()&&we.push("xterm-strikethrough"),pe&&(F.style.textDecoration="underline");let xe=Be.getFgColor(),ke=Be.getFgColorMode(),Je=Be.getBgColor(),Ae=Be.getBgColorMode();const Ie=!!Be.isInverse();if(Ie){const Ue=xe;xe=Je,Je=Ue;const Gt=ke;ke=Ae,Ae=Gt}let ot,ut,nt,Ke=!1;switch(this._decorationService.forEachDecorationAtCell(Ne,T,void 0,(Ue=>{Ue.options.layer!=="top"&&Ke||(Ue.backgroundColorRGB&&(Ae=50331648,Je=Ue.backgroundColorRGB.rgba>>8&16777215,ot=Ue.backgroundColorRGB),Ue.foregroundColorRGB&&(ke=50331648,xe=Ue.foregroundColorRGB.rgba>>8&16777215,ut=Ue.foregroundColorRGB),Ke=Ue.options.layer==="top")})),!Ke&&It&&(ot=this._coreBrowserService.isFocused?B.selectionBackgroundOpaque:B.selectionInactiveBackgroundOpaque,Je=ot.rgba>>8&16777215,Ae=50331648,Ke=!0,B.selectionForeground&&(ke=50331648,xe=B.selectionForeground.rgba>>8&16777215,ut=B.selectionForeground)),Ke&&we.push("xterm-decoration-top"),Ae){case 16777216:case 33554432:nt=B.ansi[Je],we.push(`xterm-bg-${Je}`);break;case 50331648:nt=m.channels.toColor(Je>>16,Je>>8&255,255&Je),this._addStyle(F,`background-color:#${L((Je>>>0).toString(16),"0",6)}`);break;default:Ie?(nt=B.foreground,we.push(`xterm-bg-${l.INVERTED_DEFAULT_COLOR}`)):nt=B.background}switch(ot||Be.isDim()&&(ot=m.color.multiplyOpacity(nt,.5)),ke){case 16777216:case 33554432:Be.isBold()&&xe<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(xe+=8),this._applyMinimumContrast(F,nt,B.ansi[xe],Be,ot,void 0)||we.push(`xterm-fg-${xe}`);break;case 50331648:const Ue=m.channels.toColor(xe>>16&255,xe>>8&255,255&xe);this._applyMinimumContrast(F,nt,Ue,Be,ot,ut)||this._addStyle(F,`color:#${L(xe.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(F,nt,B.foreground,Be,ot,ut)||Ie&&we.push(`xterm-fg-${l.INVERTED_DEFAULT_COLOR}`)}we.length&&(F.className=we.join(" "),we.length=0),ve||ze||be?F.textContent=te:$++,fe!==this.defaultSpacing&&(F.style.letterSpacing=`${fe}px`),X.push(F),Ne=rt}return F&&$&&(F.textContent=te),X}_applyMinimumContrast(y,T,b,R,k,U){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,u.treatGlyphAsBackgroundColor)(R.getCode()))return!1;const H=this._getContrastCache(R);let z;if(k||U||(z=H.getColor(T.rgba,b.rgba)),z===void 0){const V=this._optionsService.rawOptions.minimumContrastRatio/(R.isDim()?2:1);z=m.color.ensureContrastRatio(k||T,U||b,V),H.setColor((k||T).rgba,(U||b).rgba,z??null)}return!!z&&(this._addStyle(y,`color:${z.css}`),!0)}_getContrastCache(y){return y.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(y,T){y.setAttribute("style",`${y.getAttribute("style")||""}${T};`)}_isCellInSelection(y,T){const b=this._selectionStart,R=this._selectionEnd;return!(!b||!R)&&(this._columnSelectMode?b[0]<=R[0]?y>=b[0]&&T>=b[1]&&y<R[0]&&T<=R[1]:y<b[0]&&T>=b[1]&&y>=R[0]&&T<=R[1]:T>b[1]&&T<R[1]||b[1]===R[1]&&T===b[1]&&y>=b[0]&&y<R[0]||b[1]<R[1]&&T===R[1]&&y<R[0]||b[1]<R[1]&&T===b[1]&&y>=b[0])}};function L(y,T,b){for(;y.length<b;)y=T+y;return y}r.DomRendererRowFactory=S=_([v(1,n.ICharacterJoinerService),v(2,E.IOptionsService),v(3,n.ICoreBrowserService),v(4,E.ICoreService),v(5,E.IDecorationService),v(6,n.IThemeService)],S)},2550:(q,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 l=d.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold";const g=d.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontStyle="italic";const x=d.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontWeight="bold",x.style.fontStyle="italic",this._measureElements=[v,l,g,x],this._container.appendChild(v),this._container.appendChild(l),this._container.appendChild(g),this._container.appendChild(x),_.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,l){d===this._font&&_===this._fontSize&&v===this._weight&&l===this._weightBold||(this._font=d,this._fontSize=_,this._weight=v,this._weightBold=l,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${v}`,this._measureElements[1].style.fontWeight=`${l}`,this._measureElements[2].style.fontWeight=`${v}`,this._measureElements[3].style.fontWeight=`${l}`,this.clear())}get(d,_,v){let l=0;if(!_&&!v&&d.length===1&&(l=d.charCodeAt(0))<256){if(this._flat[l]!==-9999)return this._flat[l];const E=this._measure(d,0);return E>0&&(this._flat[l]=E),E}let g=d;_&&(g+="B"),v&&(g+="I");let x=this._holey.get(g);if(x===void 0){let E=0;_&&(E|=1),v&&(E|=2),x=this._measure(d,E),x>0&&this._holey.set(g,x)}return x}_measure(d,_){const v=this._measureElements[_];return v.textContent=d.repeat(32),v.offsetWidth/32}}},2223:(q,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:(q,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,l,g,x){return l===1&&g>Math.ceil(1.5*x)&&v!==void 0&&v>255&&!_(v)&&!d(v)&&!(function(E){return 57344<=E&&E<=63743})(v)},r.treatGlyphAsBackgroundColor=function(v){return d(v)||(function(l){return 9472<=l&&l<=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,l,g=0){return(v-(2*Math.round(l)-g))%(2*Math.round(l))}},6052:(q,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,l,g,x=!1){if(this.selectionStart=l,this.selectionEnd=g,!l||!g||l[0]===g[0]&&l[1]===g[1])return void this.clear();const E=v.buffers.active.ydisp,m=l[1]-E,n=g[1]-E,h=Math.max(m,0),u=Math.min(n,v.rows-1);h>=v.rows||u<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=m,this.viewportEndRow=n,this.viewportCappedStartRow=h,this.viewportCappedEndRow=u,this.startCol=l[0],this.endCol=g[0])}isCellSelected(v,l,g){return!!this.hasSelection&&(g-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&g>=this.viewportCappedStartRow&&l<this.endCol&&g<=this.viewportCappedEndRow:l<this.startCol&&g>=this.viewportCappedStartRow&&l>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&l>=this.startCol)}}r.createSelectionRenderModel=function(){return new d}},456:(q,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(q,r,d){var _=this&&this.__decorate||function(u,c,S,L){var y,T=arguments.length,b=T<3?c:L===null?L=Object.getOwnPropertyDescriptor(c,S):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(u,c,S,L);else for(var R=u.length-1;R>=0;R--)(y=u[R])&&(b=(T<3?y(b):T>3?y(c,S,b):y(c,S))||b);return T>3&&b&&Object.defineProperty(c,S,b),b},v=this&&this.__param||function(u,c){return function(S,L){c(S,L,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;const l=d(2585),g=d(8460),x=d(844);let E=r.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(u,c,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.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,l.IOptionsService)],E);class m extends x.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(c,S){c!==void 0&&c>0&&S!==void 0&&S>0&&(this._result.width=c,this._result.height=S)}}class n extends m{constructor(c,S,L){super(),this._document=c,this._parentElement=S,this._optionsService=L,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class h extends m{constructor(c){super(),this._optionsService=c,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const S=this._ctx.measureText("W");if(!("width"in S&&"fontBoundingBoxAscent"in S&&"fontBoundingBoxDescent"in S))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(q,r,d){var _=this&&this.__decorate||function(h,u,c,S){var L,y=arguments.length,T=y<3?u:S===null?S=Object.getOwnPropertyDescriptor(u,c):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(h,u,c,S);else for(var b=h.length-1;b>=0;b--)(L=h[b])&&(T=(y<3?L(T):y>3?L(u,c,T):L(u,c))||T);return y>3&&T&&Object.defineProperty(u,c,T),T},v=this&&this.__param||function(h,u){return function(c,S){u(c,S,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const l=d(3734),g=d(643),x=d(511),E=d(2585);class m extends l.AttributeData{constructor(u,c,S){super(),this.content=0,this.combinedData="",this.fg=u.fg,this.bg=u.bg,this.combinedData=c,this._width=S}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=m;let n=r.CharacterJoinerService=class Rp{constructor(u){this._bufferService=u,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.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 S=[],L=c.translateToString(!0);let y=0,T=0,b=0,R=c.getFg(0),k=c.getBg(0);for(let U=0;U<c.getTrimmedLength();U++)if(c.loadCell(U,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==R||this._workCell.bg!==k){if(U-y>1){const H=this._getJoinedRanges(L,b,T,c,y);for(let z=0;z<H.length;z++)S.push(H[z])}y=U,b=T,R=this._workCell.fg,k=this._workCell.bg}T+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-y>1){const U=this._getJoinedRanges(L,b,T,c,y);for(let H=0;H<U.length;H++)S.push(U[H])}return S}_getJoinedRanges(u,c,S,L,y){const T=u.substring(c,S);let b=[];try{b=this._characterJoiners[0].handler(T)}catch(R){console.error(R)}for(let R=1;R<this._characterJoiners.length;R++)try{const k=this._characterJoiners[R].handler(T);for(let U=0;U<k.length;U++)Rp._mergeRanges(b,k[U])}catch(k){console.error(k)}return this._stringRangesToCellRanges(b,L,y),b}_stringRangesToCellRanges(u,c,S){let L=0,y=!1,T=0,b=u[L];if(b){for(let R=S;R<this._bufferService.cols;R++){const k=c.getWidth(R),U=c.getString(R).length||g.WHITESPACE_CELL_CHAR.length;if(k!==0){if(!y&&b[0]<=T&&(b[0]=R,y=!0),b[1]<=T){if(b[1]=R,b=u[++L],!b)break;b[0]<=T?(b[0]=R,y=!0):y=!1}T+=U}}b&&(b[1]=this._bufferService.cols)}}static _mergeRanges(u,c){let S=!1;for(let L=0;L<u.length;L++){const y=u[L];if(S){if(c[1]<=y[0])return u[L-1][1]=c[1],u;if(c[1]<=y[1])return u[L-1][1]=Math.max(c[1],y[1]),u.splice(L,1),u;u.splice(L,1),L--}else{if(c[1]<=y[0])return u.splice(L,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]),S=!0)}}return S?u[u.length-1][1]=c[1]:u.push(c),u}};r.CharacterJoinerService=n=_([v(0,E.IBufferService)],n)},5114:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0;const _=d(844),v=d(8460),l=d(3656);class g extends _.Disposable{constructor(m,n,h){super(),this._textarea=m,this._window=n,this.mainDocument=h,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new x(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(m){this._window!==m&&(this._window=m,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=g;class x extends _.Disposable{constructor(m){super(),this._parentWindow=m,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(m){this._parentWindow=m,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,l.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:(q,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(g){return this.linkProviders.push(g),{dispose:()=>{const x=this.linkProviders.indexOf(g);x!==-1&&this.linkProviders.splice(x,1)}}}}r.LinkProviderService=v},8934:function(q,r,d){var _=this&&this.__decorate||function(E,m,n,h){var u,c=arguments.length,S=c<3?m:h===null?h=Object.getOwnPropertyDescriptor(m,n):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(E,m,n,h);else for(var L=E.length-1;L>=0;L--)(u=E[L])&&(S=(c<3?u(S):c>3?u(m,n,S):u(m,n))||S);return c>3&&S&&Object.defineProperty(m,n,S),S},v=this&&this.__param||function(E,m){return function(n,h){m(n,h,E)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;const l=d(4725),g=d(9806);let x=r.MouseService=class{constructor(E,m){this._renderService=E,this._charSizeService=m}getCoords(E,m,n,h,u){return(0,g.getCoords)(window,E,m,n,h,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,u)}getMouseReportCoords(E,m){const n=(0,g.getCoordsRelativeToElement)(window,E,m);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=x=_([v(0,l.IRenderService),v(1,l.ICharSizeService)],x)},3230:function(q,r,d){var _=this&&this.__decorate||function(u,c,S,L){var y,T=arguments.length,b=T<3?c:L===null?L=Object.getOwnPropertyDescriptor(c,S):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(u,c,S,L);else for(var R=u.length-1;R>=0;R--)(y=u[R])&&(b=(T<3?y(b):T>3?y(c,S,b):y(c,S))||b);return T>3&&b&&Object.defineProperty(c,S,b),b},v=this&&this.__param||function(u,c){return function(S,L){c(S,L,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;const l=d(6193),g=d(4725),x=d(8460),E=d(844),m=d(7226),n=d(2585);let h=r.RenderService=class extends E.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(u,c,S,L,y,T,b,R){super(),this._rowCount=u,this._charSizeService=L,this._renderer=this.register(new E.MutableDisposable),this._pausedResizeTask=new m.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 x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new l.RenderDebouncer(((k,U)=>this._renderRows(k,U)),b),this.register(this._renderDebouncer),this.register(b.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(T.onResize((()=>this._fullRefresh()))),this.register(T.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(S.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(y.onDecorationRegistered((()=>this._fullRefresh()))),this.register(y.onDecorationRemoved((()=>this._fullRefresh()))),this.register(S.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(T.cols,T.rows),this._fullRefresh()}))),this.register(S.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(T.buffer.y,T.buffer.y,!0)))),this.register(R.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(b.window,c),this.register(b.onWindowChange((k=>this._registerIntersectionObserver(k,c))))}_registerIntersectionObserver(u,c){if("IntersectionObserver"in u){const S=new u.IntersectionObserver((L=>this._handleIntersectionChange(L[L.length-1])),{threshold:0});S.observe(c),this._observerDisposable.value=(0,E.toDisposable)((()=>S.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,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(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,S){this._selectionState.start=u,this._selectionState.end=c,this._selectionState.columnSelectMode=S,this._renderer.value?.handleSelectionChanged(u,c,S)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};r.RenderService=h=_([v(2,n.IOptionsService),v(3,g.ICharSizeService),v(4,n.IDecorationService),v(5,n.IBufferService),v(6,g.ICoreBrowserService),v(7,g.IThemeService)],h)},9312:function(q,r,d){var _=this&&this.__decorate||function(b,R,k,U){var H,z=arguments.length,V=z<3?R:U===null?U=Object.getOwnPropertyDescriptor(R,k):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(b,R,k,U);else for(var re=b.length-1;re>=0;re--)(H=b[re])&&(V=(z<3?H(V):z>3?H(R,k,V):H(R,k))||V);return z>3&&V&&Object.defineProperty(R,k,V),V},v=this&&this.__param||function(b,R){return function(k,U){R(k,U,b)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;const l=d(9806),g=d(9504),x=d(456),E=d(4725),m=d(8460),n=d(844),h=d(6114),u=d(4841),c=d(511),S=d(2585),L=" ",y=new RegExp(L,"g");let T=r.SelectionService=class extends n.Disposable{constructor(b,R,k,U,H,z,V,re,K){super(),this._element=b,this._screenElement=R,this._linkifier=k,this._bufferService=U,this._coreService=H,this._mouseService=z,this._optionsService=V,this._renderService=re,this._coreBrowserService=K,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 m.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new m.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new m.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new x.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,R=this._model.finalSelectionEnd;return!(!b||!R||b[0]===R[0]&&b[1]===R[1])}get selectionText(){const b=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;if(!b||!R)return"";const k=this._bufferService.buffer,U=[];if(this._activeSelectionMode===3){if(b[0]===R[0])return"";const H=b[0]<R[0]?b[0]:R[0],z=b[0]<R[0]?R[0]:b[0];for(let V=b[1];V<=R[1];V++){const re=k.translateBufferLineToString(V,!0,H,z);U.push(re)}}else{const H=b[1]===R[1]?R[0]:void 0;U.push(k.translateBufferLineToString(b[1],!0,b[0],H));for(let z=b[1]+1;z<=R[1]-1;z++){const V=k.lines.get(z),re=k.translateBufferLineToString(z,!0);V?.isWrapped?U[U.length-1]+=re:U.push(re)}if(b[1]!==R[1]){const z=k.lines.get(R[1]),V=k.translateBufferLineToString(R[1],!0,0,R[0]);z&&z.isWrapped?U[U.length-1]+=V:U.push(V)}}return U.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 R=this._getMouseBufferCoords(b),k=this._model.finalSelectionStart,U=this._model.finalSelectionEnd;return!!(k&&U&&R)&&this._areCoordsInSelection(R,k,U)}isCellInSelection(b,R){const k=this._model.finalSelectionStart,U=this._model.finalSelectionEnd;return!(!k||!U)&&this._areCoordsInSelection([b,R],k,U)}_areCoordsInSelection(b,R,k){return b[1]>R[1]&&b[1]<k[1]||R[1]===k[1]&&b[1]===R[1]&&b[0]>=R[0]&&b[0]<k[0]||R[1]<k[1]&&b[1]===k[1]&&b[0]<k[0]||R[1]<k[1]&&b[1]===R[1]&&b[0]>=R[0]}_selectWordAtCursor(b,R){const k=this._linkifier.currentLink?.link?.range;if(k)return this._model.selectionStart=[k.start.x-1,k.start.y-1],this._model.selectionStartLength=(0,u.getRangeLength)(k,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const U=this._getMouseBufferCoords(b);return!!U&&(this._selectWordAt(U,R),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(b,R){this._model.clearSelection(),b=Math.max(b,0),R=Math.min(R,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,b],this._model.selectionEnd=[this._bufferService.cols,R],this.refresh(),this._onSelectionChange.fire()}_handleTrim(b){this._model.handleTrim(b)&&this.refresh()}_getMouseBufferCoords(b){const R=this._mouseService.getCoords(b,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(R)return R[0]--,R[1]--,R[1]+=this._bufferService.buffer.ydisp,R}_getMouseEventScrollAmount(b){let R=(0,l.getCoordsRelativeToElement)(this._coreBrowserService.window,b,this._screenElement)[1];const k=this._renderService.dimensions.css.canvas.height;return R>=0&&R<=k?0:(R>k&&(R-=k),R=Math.min(Math.max(R,-50),50),R/=50,R/Math.abs(R)+Math.round(14*R))}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 R=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);R&&R.length!==this._model.selectionStart[0]&&R.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(b){this._selectWordAtCursor(b,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(b){const R=this._getMouseBufferCoords(b);R&&(this._activeSelectionMode=2,this._selectLineAt(R[1]))}shouldColumnSelect(b){return b.altKey&&!(h.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(b){if(b.stopImmediatePropagation(),!this._model.selectionStart)return;const R=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(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 k=this._bufferService.buffer;if(this._model.selectionEnd[1]<k.lines.length){const U=k.lines.get(this._model.selectionEnd[1]);U&&U.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}R&&R[0]===this._model.selectionEnd[0]&&R[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const 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 R=b.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&R<500&&b.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const k=this._mouseService.getCoords(b,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(k&&k[0]!==void 0&&k[1]!==void 0){const U=(0,g.moveToCellSequence)(k[0]-1,k[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(U,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const b=this._model.finalSelectionStart,R=this._model.finalSelectionEnd,k=!(!b||!R||b[0]===R[0]&&b[1]===R[1]);k?b&&R&&(this._oldSelectionStart&&this._oldSelectionEnd&&b[0]===this._oldSelectionStart[0]&&b[1]===this._oldSelectionStart[1]&&R[0]===this._oldSelectionEnd[0]&&R[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(b,R,k)):this._oldHasSelection&&this._fireOnSelectionChange(b,R,k)}_fireOnSelectionChange(b,R,k){this._oldSelectionStart=b,this._oldSelectionEnd=R,this._oldHasSelection=k,this._onSelectionChange.fire()}_handleBufferActivate(b){this.clearSelection(),this._trimListener.dispose(),this._trimListener=b.activeBuffer.lines.onTrim((R=>this._handleTrim(R)))}_convertViewportColToCharacterIndex(b,R){let k=R;for(let U=0;R>=U;U++){const H=b.loadCell(U,this._workCell).getChars().length;this._workCell.getWidth()===0?k--:H>1&&R!==U&&(k+=H-1)}return k}setSelection(b,R,k){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[b,R],this._model.selectionStartLength=k,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(b){this._isClickInSelection(b)||(this._selectWordAtCursor(b,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(b,R,k=!0,U=!0){if(b[0]>=this._bufferService.cols)return;const H=this._bufferService.buffer,z=H.lines.get(b[1]);if(!z)return;const V=H.translateBufferLineToString(b[1],!1);let re=this._convertViewportColToCharacterIndex(z,b[0]),K=re;const X=b[0]-re;let I=0,B=0,F=0,O=0;if(V.charAt(re)===" "){for(;re>0&&V.charAt(re-1)===" ";)re--;for(;K<V.length&&V.charAt(K+1)===" ";)K++}else{let se=b[0],ue=b[0];z.getWidth(se)===0&&(I++,se--),z.getWidth(ue)===2&&(B++,ue++);const me=z.getString(ue).length;for(me>1&&(O+=me-1,K+=me-1);se>0&&re>0&&!this._isCharWordSeparator(z.loadCell(se-1,this._workCell));){z.loadCell(se-1,this._workCell);const Z=this._workCell.getChars().length;this._workCell.getWidth()===0?(I++,se--):Z>1&&(F+=Z-1,re-=Z-1),re--,se--}for(;ue<z.length&&K+1<V.length&&!this._isCharWordSeparator(z.loadCell(ue+1,this._workCell));){z.loadCell(ue+1,this._workCell);const Z=this._workCell.getChars().length;this._workCell.getWidth()===2?(B++,ue++):Z>1&&(O+=Z-1,K+=Z-1),K++,ue++}}K++;let $=re+X-I+F,te=Math.min(this._bufferService.cols,K-re+I+B-F-O);if(R||V.slice(re,K).trim()!==""){if(k&&$===0&&z.getCodePoint(0)!==32){const se=H.lines.get(b[1]-1);if(se&&z.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 me=this._bufferService.cols-ue.start;$-=me,te+=me}}}if(U&&$+te===this._bufferService.cols&&z.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&&(te+=ue.length)}}return{start:$,length:te}}}_selectWordAt(b,R){const k=this._getWordAt(b,R);if(k){for(;k.start<0;)k.start+=this._bufferService.cols,b[1]--;this._model.selectionStart=[k.start,b[1]],this._model.selectionStartLength=k.length}}_selectToWordAt(b){const R=this._getWordAt(b,!0);if(R){let k=b[1];for(;R.start<0;)R.start+=this._bufferService.cols,k--;if(!this._model.areSelectionValuesReversed())for(;R.start+R.length>this._bufferService.cols;)R.length-=this._bufferService.cols,k++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?R.start:R.start+R.length,k]}}_isCharWordSeparator(b){return b.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(b.getChars())>=0}_selectLineAt(b){const R=this._bufferService.buffer.getWrappedRangeForLine(b),k={start:{x:0,y:R.first},end:{x:this._bufferService.cols-1,y:R.last}};this._model.selectionStart=[0,R.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,u.getRangeLength)(k,this._bufferService.cols)}};r.SelectionService=T=_([v(3,S.IBufferService),v(4,S.ICoreService),v(5,E.IMouseService),v(6,S.IOptionsService),v(7,E.IRenderService),v(8,E.ICoreBrowserService)],T)},4725:(q,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(q,r,d){var _=this&&this.__decorate||function(T,b,R,k){var U,H=arguments.length,z=H<3?b:k===null?k=Object.getOwnPropertyDescriptor(b,R):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(T,b,R,k);else for(var V=T.length-1;V>=0;V--)(U=T[V])&&(z=(H<3?U(z):H>3?U(b,R,z):U(b,R))||z);return H>3&&z&&Object.defineProperty(b,R,z),z},v=this&&this.__param||function(T,b){return function(R,k){b(R,k,T)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;const l=d(7239),g=d(8055),x=d(8460),E=d(844),m=d(2585),n=g.css.toColor("#ffffff"),h=g.css.toColor("#000000"),u=g.css.toColor("#ffffff"),c=g.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],b=[0,95,135,175,215,255];for(let R=0;R<216;R++){const k=b[R/36%6|0],U=b[R/6%6|0],H=b[R%6];T.push({css:g.channels.toCss(k,U,H),rgba:g.channels.toRgba(k,U,H)})}for(let R=0;R<24;R++){const k=8+10*R;T.push({css:g.channels.toCss(k,k,k),rgba:g.channels.toRgba(k,k,k)})}return T})());let L=r.ThemeService=class extends E.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new l.ColorContrastCache,this._halfContrastCache=new l.ColorContrastCache,this._onChangeColors=this.register(new x.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:n,background:h,cursor:u,cursorAccent:c,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:g.color.blend(h,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:g.color.blend(h,S),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(T={}){const b=this._colors;if(b.foreground=y(T.foreground,n),b.background=y(T.background,h),b.cursor=y(T.cursor,u),b.cursorAccent=y(T.cursorAccent,c),b.selectionBackgroundTransparent=y(T.selectionBackground,S),b.selectionBackgroundOpaque=g.color.blend(b.background,b.selectionBackgroundTransparent),b.selectionInactiveBackgroundTransparent=y(T.selectionInactiveBackground,b.selectionBackgroundTransparent),b.selectionInactiveBackgroundOpaque=g.color.blend(b.background,b.selectionInactiveBackgroundTransparent),b.selectionForeground=T.selectionForeground?y(T.selectionForeground,g.NULL_COLOR):void 0,b.selectionForeground===g.NULL_COLOR&&(b.selectionForeground=void 0),g.color.isOpaque(b.selectionBackgroundTransparent)&&(b.selectionBackgroundTransparent=g.color.opacity(b.selectionBackgroundTransparent,.3)),g.color.isOpaque(b.selectionInactiveBackgroundTransparent)&&(b.selectionInactiveBackgroundTransparent=g.color.opacity(b.selectionInactiveBackgroundTransparent,.3)),b.ansi=r.DEFAULT_ANSI_COLORS.slice(),b.ansi[0]=y(T.black,r.DEFAULT_ANSI_COLORS[0]),b.ansi[1]=y(T.red,r.DEFAULT_ANSI_COLORS[1]),b.ansi[2]=y(T.green,r.DEFAULT_ANSI_COLORS[2]),b.ansi[3]=y(T.yellow,r.DEFAULT_ANSI_COLORS[3]),b.ansi[4]=y(T.blue,r.DEFAULT_ANSI_COLORS[4]),b.ansi[5]=y(T.magenta,r.DEFAULT_ANSI_COLORS[5]),b.ansi[6]=y(T.cyan,r.DEFAULT_ANSI_COLORS[6]),b.ansi[7]=y(T.white,r.DEFAULT_ANSI_COLORS[7]),b.ansi[8]=y(T.brightBlack,r.DEFAULT_ANSI_COLORS[8]),b.ansi[9]=y(T.brightRed,r.DEFAULT_ANSI_COLORS[9]),b.ansi[10]=y(T.brightGreen,r.DEFAULT_ANSI_COLORS[10]),b.ansi[11]=y(T.brightYellow,r.DEFAULT_ANSI_COLORS[11]),b.ansi[12]=y(T.brightBlue,r.DEFAULT_ANSI_COLORS[12]),b.ansi[13]=y(T.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),b.ansi[14]=y(T.brightCyan,r.DEFAULT_ANSI_COLORS[14]),b.ansi[15]=y(T.brightWhite,r.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const R=Math.min(b.ansi.length-16,T.extendedAnsi.length);for(let k=0;k<R;k++)b.ansi[k+16]=y(T.extendedAnsi[k],r.DEFAULT_ANSI_COLORS[k+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(T){this._restoreColor(T),this._onChangeColors.fire(this.colors)}_restoreColor(T){if(T!==void 0)switch(T){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[T]=this._restoreColors.ansi[T]}else for(let b=0;b<this._restoreColors.ansi.length;++b)this._colors.ansi[b]=this._restoreColors.ansi[b]}modifyColors(T){T(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function y(T,b){if(T!==void 0)try{return g.css.toColor(T)}catch{}return b}r.ThemeService=L=_([v(0,m.IOptionsService)],L)},6349:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;const _=d(8460),v=d(844);class l extends v.Disposable{constructor(x){super(),this._maxLength=x,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(x){if(this._maxLength===x)return;const E=new Array(x);for(let m=0;m<Math.min(x,this.length);m++)E[m]=this._array[this._getCyclicIndex(m)];this._array=E,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let E=this._length;E<x;E++)this._array[E]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,E){this._array[this._getCyclicIndex(x)]=E}push(x){this._array[this._getCyclicIndex(this._length)]=x,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(x,E,...m){if(E){for(let n=x;n<this._length-E;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+E)];this._length-=E,this.onDeleteEmitter.fire({index:x,amount:E})}for(let n=this._length-1;n>=x;n--)this._array[this._getCyclicIndex(n+m.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<m.length;n++)this._array[this._getCyclicIndex(x+n)]=m[n];if(m.length&&this.onInsertEmitter.fire({index:x,amount:m.length}),this._length+m.length>this._maxLength){const n=this._length+m.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=m.length}trimStart(x){x>this._length&&(x=this._length),this._startIndex+=x,this._length-=x,this.onTrimEmitter.fire(x)}shiftElements(x,E,m){if(!(E<=0)){if(x<0||x>=this._length)throw new Error("start argument out of range");if(x+m<0)throw new Error("Cannot shift elements in list beyond index 0");if(m>0){for(let h=E-1;h>=0;h--)this.set(x+h+m,this.get(x+h));const n=x+E+m-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(x+n+m,this.get(x+n))}}_getCyclicIndex(x){return(this._startIndex+x)%this._maxLength}}r.CircularList=l},1439:(q,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function d(_,v=5){if(typeof _!="object")return _;const l=Array.isArray(_)?[]:{};for(const g in _)l[g]=v<=1?_[g]:_[g]&&d(_[g],v-1);return l}},8055:(q,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,l=0;var g,x,E,m,n;function h(c){const S=c.toString(16);return S.length<2?"0"+S:S}function u(c,S){return c<S?(S+.05)/(c+.05):(c+.05)/(S+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},(function(c){c.toCss=function(S,L,y,T){return T!==void 0?`#${h(S)}${h(L)}${h(y)}${h(T)}`:`#${h(S)}${h(L)}${h(y)}`},c.toRgba=function(S,L,y,T=255){return(S<<24|L<<16|y<<8|T)>>>0},c.toColor=function(S,L,y,T){return{css:c.toCss(S,L,y,T),rgba:c.toRgba(S,L,y,T)}}})(g||(r.channels=g={})),(function(c){function S(L,y){return l=Math.round(255*y),[d,_,v]=n.toChannels(L.rgba),{css:g.toCss(d,_,v,l),rgba:g.toRgba(d,_,v,l)}}c.blend=function(L,y){if(l=(255&y.rgba)/255,l===1)return{css:y.css,rgba:y.rgba};const T=y.rgba>>24&255,b=y.rgba>>16&255,R=y.rgba>>8&255,k=L.rgba>>24&255,U=L.rgba>>16&255,H=L.rgba>>8&255;return d=k+Math.round((T-k)*l),_=U+Math.round((b-U)*l),v=H+Math.round((R-H)*l),{css:g.toCss(d,_,v),rgba:g.toRgba(d,_,v)}},c.isOpaque=function(L){return(255&L.rgba)==255},c.ensureContrastRatio=function(L,y,T){const b=n.ensureContrastRatio(L.rgba,y.rgba,T);if(b)return g.toColor(b>>24&255,b>>16&255,b>>8&255)},c.opaque=function(L){const y=(255|L.rgba)>>>0;return[d,_,v]=n.toChannels(y),{css:g.toCss(d,_,v),rgba:y}},c.opacity=S,c.multiplyOpacity=function(L,y){return l=255&L.rgba,S(L,l*y/255)},c.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(x||(r.color=x={})),(function(c){let S,L;try{const y=document.createElement("canvas");y.width=1,y.height=1;const T=y.getContext("2d",{willReadFrequently:!0});T&&(S=T,S.globalCompositeOperation="copy",L=S.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),g.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),l=parseInt(y.slice(4,5).repeat(2),16),g.toColor(d,_,v,l);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 T=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(T)return d=parseInt(T[1]),_=parseInt(T[2]),v=parseInt(T[3]),l=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),g.toColor(d,_,v,l);if(!S||!L)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=L,S.fillStyle=y,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[d,_,v,l]=S.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(d,_,v,l),css:y}}})(E||(r.css=E={})),(function(c){function S(L,y,T){const b=L/255,R=y/255,k=T/255;return .2126*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))}c.relativeLuminance=function(L){return S(L>>16&255,L>>8&255,255&L)},c.relativeLuminance2=S})(m||(r.rgb=m={})),(function(c){function S(y,T,b){const R=y>>24&255,k=y>>16&255,U=y>>8&255;let H=T>>24&255,z=T>>16&255,V=T>>8&255,re=u(m.relativeLuminance2(H,z,V),m.relativeLuminance2(R,k,U));for(;re<b&&(H>0||z>0||V>0);)H-=Math.max(0,Math.ceil(.1*H)),z-=Math.max(0,Math.ceil(.1*z)),V-=Math.max(0,Math.ceil(.1*V)),re=u(m.relativeLuminance2(H,z,V),m.relativeLuminance2(R,k,U));return(H<<24|z<<16|V<<8|255)>>>0}function L(y,T,b){const R=y>>24&255,k=y>>16&255,U=y>>8&255;let H=T>>24&255,z=T>>16&255,V=T>>8&255,re=u(m.relativeLuminance2(H,z,V),m.relativeLuminance2(R,k,U));for(;re<b&&(H<255||z<255||V<255);)H=Math.min(255,H+Math.ceil(.1*(255-H))),z=Math.min(255,z+Math.ceil(.1*(255-z))),V=Math.min(255,V+Math.ceil(.1*(255-V))),re=u(m.relativeLuminance2(H,z,V),m.relativeLuminance2(R,k,U));return(H<<24|z<<16|V<<8|255)>>>0}c.blend=function(y,T){if(l=(255&T)/255,l===1)return T;const b=T>>24&255,R=T>>16&255,k=T>>8&255,U=y>>24&255,H=y>>16&255,z=y>>8&255;return d=U+Math.round((b-U)*l),_=H+Math.round((R-H)*l),v=z+Math.round((k-z)*l),g.toRgba(d,_,v)},c.ensureContrastRatio=function(y,T,b){const R=m.relativeLuminance(y>>8),k=m.relativeLuminance(T>>8);if(u(R,k)<b){if(k<R){const z=S(y,T,b),V=u(R,m.relativeLuminance(z>>8));if(V<b){const re=L(y,T,b);return V>u(R,m.relativeLuminance(re>>8))?z:re}return z}const U=L(y,T,b),H=u(R,m.relativeLuminance(U>>8));if(H<b){const z=S(y,T,b);return H>u(R,m.relativeLuminance(z>>8))?U:z}return U}},c.reduceLuminance=S,c.increaseLuminance=L,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:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;const _=d(844),v=d(2585),l=d(4348),g=d(7866),x=d(744),E=d(7302),m=d(6975),n=d(8460),h=d(1753),u=d(1480),c=d(7994),S=d(9282),L=d(5435),y=d(5981),T=d(2660);let b=!1;class R extends _.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new n.EventEmitter),this._onScroll.event((U=>{this._onScrollApi?.fire(U.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(U){for(const H in U)this.optionsService.options[H]=U[H]}constructor(U){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 l.InstantiationService,this.optionsService=this.register(new E.OptionsService(U)),this._instantiationService.setService(v.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(x.BufferService)),this._instantiationService.setService(v.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(v.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(m.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(T.OscLinkService),this._instantiationService.setService(v.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new L.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,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,z)=>this._inputHandler.parse(H,z)))),this.register((0,n.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(U,H){this._writeBuffer.write(U,H)}writeSync(U,H){this._logService.logLevel<=v.LogLevelEnum.WARN&&!b&&(this._logService.warn("writeSync is unreliable and will be removed soon."),b=!0),this._writeBuffer.writeSync(U,H)}input(U,H=!0){this.coreService.triggerDataEvent(U,H)}resize(U,H){isNaN(U)||isNaN(H)||(U=Math.max(U,x.MINIMUM_COLS),H=Math.max(H,x.MINIMUM_ROWS),this._bufferService.resize(U,H))}scroll(U,H=!1){this._bufferService.scroll(U,H)}scrollLines(U,H,z){this._bufferService.scrollLines(U,H,z)}scrollPages(U){this.scrollLines(U*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(U){const H=U-this._bufferService.buffer.ydisp;H!==0&&this.scrollLines(H)}registerEscHandler(U,H){return this._inputHandler.registerEscHandler(U,H)}registerDcsHandler(U,H){return this._inputHandler.registerDcsHandler(U,H)}registerCsiHandler(U,H){return this._inputHandler.registerCsiHandler(U,H)}registerOscHandler(U,H){return this._inputHandler.registerOscHandler(U,H)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let U=!1;const H=this.optionsService.rawOptions.windowsPty;H&&H.buildNumber!==void 0&&H.buildNumber!==void 0?U=H.backend==="conpty"&&H.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(U=!0),U?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const U=[];U.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),U.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,_.toDisposable)((()=>{for(const H of U)H.dispose()}))}}}r.CoreTerminal=R},8460:(q,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 l=0;l<this._listeners.length;l++)v.push(this._listeners[l]);for(let l=0;l<v.length;l++)v[l].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(q,r,d){var _=this&&this.__decorate||function(I,B,F,O){var $,te=arguments.length,se=te<3?B:O===null?O=Object.getOwnPropertyDescriptor(B,F):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")se=Reflect.decorate(I,B,F,O);else for(var ue=I.length-1;ue>=0;ue--)($=I[ue])&&(se=(te<3?$(se):te>3?$(B,F,se):$(B,F))||se);return te>3&&se&&Object.defineProperty(B,F,se),se},v=this&&this.__param||function(I,B){return function(F,O){B(F,O,I)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;const l=d(2584),g=d(7116),x=d(2015),E=d(844),m=d(482),n=d(8437),h=d(8460),u=d(643),c=d(511),S=d(3734),L=d(2585),y=d(1480),T=d(6242),b=d(6351),R=d(5941),k={"(":0,")":1,"*":2,"+":3,"-":1,".":2},U=131072;function H(I,B){if(I>24)return B.setWinLines||!1;switch(I){case 1:return!!B.restoreWin;case 2:return!!B.minimizeWin;case 3:return!!B.setWinPosition;case 4:return!!B.setWinSizePixels;case 5:return!!B.raiseWin;case 6:return!!B.lowerWin;case 7:return!!B.refreshWin;case 8:return!!B.setWinSizeChars;case 9:return!!B.maximizeWin;case 10:return!!B.fullscreenWin;case 11:return!!B.getWinState;case 13:return!!B.getWinPosition;case 14:return!!B.getWinSizePixels;case 15:return!!B.getScreenSizePixels;case 16:return!!B.getCellSizePixels;case 18:return!!B.getWinSizeChars;case 19:return!!B.getScreenSizeChars;case 20:return!!B.getIconTitle;case 21:return!!B.getWinTitle;case 22:return!!B.pushTitle;case 23:return!!B.popTitle;case 24:return!!B.setWinLines}return!1}var z;(function(I){I[I.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",I[I.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(z||(r.WindowsOptionsReportType=z={}));let V=0;class re extends E.Disposable{getAttrData(){return this._curAttrData}constructor(B,F,O,$,te,se,ue,me,Z=new x.EscapeSequenceParser){super(),this._bufferService=B,this._charsetService=F,this._coreService=O,this._logService=$,this._optionsService=te,this._oscLinkService=se,this._coreMouseService=ue,this._unicodeService=me,this._parser=Z,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new m.StringToUtf32,this._utf8Decoder=new m.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 K(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((W=>this._activeBuffer=W.activeBuffer))),this._parser.setCsiHandlerFallback(((W,ae)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(W),params:ae.toArray()})})),this._parser.setEscHandlerFallback((W=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(W)})})),this._parser.setExecuteHandlerFallback((W=>{this._logService.debug("Unknown EXECUTE code: ",{code:W})})),this._parser.setOscHandlerFallback(((W,ae,fe)=>{this._logService.debug("Unknown OSC code: ",{identifier:W,action:ae,data:fe})})),this._parser.setDcsHandlerFallback(((W,ae,fe)=>{ae==="HOOK"&&(fe=fe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(W),action:ae,payload:fe})})),this._parser.setPrintHandler(((W,ae,fe)=>this.print(W,ae,fe))),this._parser.registerCsiHandler({final:"@"},(W=>this.insertChars(W))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(W=>this.scrollLeft(W))),this._parser.registerCsiHandler({final:"A"},(W=>this.cursorUp(W))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(W=>this.scrollRight(W))),this._parser.registerCsiHandler({final:"B"},(W=>this.cursorDown(W))),this._parser.registerCsiHandler({final:"C"},(W=>this.cursorForward(W))),this._parser.registerCsiHandler({final:"D"},(W=>this.cursorBackward(W))),this._parser.registerCsiHandler({final:"E"},(W=>this.cursorNextLine(W))),this._parser.registerCsiHandler({final:"F"},(W=>this.cursorPrecedingLine(W))),this._parser.registerCsiHandler({final:"G"},(W=>this.cursorCharAbsolute(W))),this._parser.registerCsiHandler({final:"H"},(W=>this.cursorPosition(W))),this._parser.registerCsiHandler({final:"I"},(W=>this.cursorForwardTab(W))),this._parser.registerCsiHandler({final:"J"},(W=>this.eraseInDisplay(W,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(W=>this.eraseInDisplay(W,!0))),this._parser.registerCsiHandler({final:"K"},(W=>this.eraseInLine(W,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(W=>this.eraseInLine(W,!0))),this._parser.registerCsiHandler({final:"L"},(W=>this.insertLines(W))),this._parser.registerCsiHandler({final:"M"},(W=>this.deleteLines(W))),this._parser.registerCsiHandler({final:"P"},(W=>this.deleteChars(W))),this._parser.registerCsiHandler({final:"S"},(W=>this.scrollUp(W))),this._parser.registerCsiHandler({final:"T"},(W=>this.scrollDown(W))),this._parser.registerCsiHandler({final:"X"},(W=>this.eraseChars(W))),this._parser.registerCsiHandler({final:"Z"},(W=>this.cursorBackwardTab(W))),this._parser.registerCsiHandler({final:"`"},(W=>this.charPosAbsolute(W))),this._parser.registerCsiHandler({final:"a"},(W=>this.hPositionRelative(W))),this._parser.registerCsiHandler({final:"b"},(W=>this.repeatPrecedingCharacter(W))),this._parser.registerCsiHandler({final:"c"},(W=>this.sendDeviceAttributesPrimary(W))),this._parser.registerCsiHandler({prefix:">",final:"c"},(W=>this.sendDeviceAttributesSecondary(W))),this._parser.registerCsiHandler({final:"d"},(W=>this.linePosAbsolute(W))),this._parser.registerCsiHandler({final:"e"},(W=>this.vPositionRelative(W))),this._parser.registerCsiHandler({final:"f"},(W=>this.hVPosition(W))),this._parser.registerCsiHandler({final:"g"},(W=>this.tabClear(W))),this._parser.registerCsiHandler({final:"h"},(W=>this.setMode(W))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(W=>this.setModePrivate(W))),this._parser.registerCsiHandler({final:"l"},(W=>this.resetMode(W))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(W=>this.resetModePrivate(W))),this._parser.registerCsiHandler({final:"m"},(W=>this.charAttributes(W))),this._parser.registerCsiHandler({final:"n"},(W=>this.deviceStatus(W))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(W=>this.deviceStatusPrivate(W))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(W=>this.softReset(W))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(W=>this.setCursorStyle(W))),this._parser.registerCsiHandler({final:"r"},(W=>this.setScrollRegion(W))),this._parser.registerCsiHandler({final:"s"},(W=>this.saveCursor(W))),this._parser.registerCsiHandler({final:"t"},(W=>this.windowOptions(W))),this._parser.registerCsiHandler({final:"u"},(W=>this.restoreCursor(W))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(W=>this.insertColumns(W))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(W=>this.deleteColumns(W))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(W=>this.selectProtected(W))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(W=>this.requestMode(W,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(W=>this.requestMode(W,!1))),this._parser.setExecuteHandler(l.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(l.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(l.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(l.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(l.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(l.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(l.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(l.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(l.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((W=>(this.setTitle(W),this.setIconName(W),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((W=>this.setIconName(W)))),this._parser.registerOscHandler(2,new T.OscHandler((W=>this.setTitle(W)))),this._parser.registerOscHandler(4,new T.OscHandler((W=>this.setOrReportIndexedColor(W)))),this._parser.registerOscHandler(8,new T.OscHandler((W=>this.setHyperlink(W)))),this._parser.registerOscHandler(10,new T.OscHandler((W=>this.setOrReportFgColor(W)))),this._parser.registerOscHandler(11,new T.OscHandler((W=>this.setOrReportBgColor(W)))),this._parser.registerOscHandler(12,new T.OscHandler((W=>this.setOrReportCursorColor(W)))),this._parser.registerOscHandler(104,new T.OscHandler((W=>this.restoreIndexedColor(W)))),this._parser.registerOscHandler(110,new T.OscHandler((W=>this.restoreFgColor(W)))),this._parser.registerOscHandler(111,new T.OscHandler((W=>this.restoreBgColor(W)))),this._parser.registerOscHandler(112,new T.OscHandler((W=>this.restoreCursorColor(W)))),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 W in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:W},(()=>this.selectCharset("("+W))),this._parser.registerEscHandler({intermediates:")",final:W},(()=>this.selectCharset(")"+W))),this._parser.registerEscHandler({intermediates:"*",final:W},(()=>this.selectCharset("*"+W))),this._parser.registerEscHandler({intermediates:"+",final:W},(()=>this.selectCharset("+"+W))),this._parser.registerEscHandler({intermediates:"-",final:W},(()=>this.selectCharset("-"+W))),this._parser.registerEscHandler({intermediates:".",final:W},(()=>this.selectCharset("."+W))),this._parser.registerEscHandler({intermediates:"/",final:W},(()=>this.selectCharset("/"+W)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((W=>(this._logService.error("Parsing error: ",W),W))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new b.DcsHandler(((W,ae)=>this.requestStatusString(W,ae))))}_preserveStack(B,F,O,$){this._parseStack.paused=!0,this._parseStack.cursorStartX=B,this._parseStack.cursorStartY=F,this._parseStack.decodedLength=O,this._parseStack.position=$}_logSlowResolvingAsync(B){this._logService.logLevel<=L.LogLevelEnum.WARN&&Promise.race([B,new Promise(((F,O)=>setTimeout((()=>O("#SLOW_TIMEOUT")),5e3)))]).catch((F=>{if(F!=="#SLOW_TIMEOUT")throw F;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(B,F){let O,$=this._activeBuffer.x,te=this._activeBuffer.y,se=0;const ue=this._parseStack.paused;if(ue){if(O=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,F))return this._logSlowResolvingAsync(O),O;$=this._parseStack.cursorStartX,te=this._parseStack.cursorStartY,this._parseStack.paused=!1,B.length>U&&(se=this._parseStack.position+U)}if(this._logService.logLevel<=L.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof B=="string"?` "${B}"`:` "${Array.prototype.map.call(B,(W=>String.fromCharCode(W))).join("")}"`),typeof B=="string"?B.split("").map((W=>W.charCodeAt(0))):B),this._parseBuffer.length<B.length&&this._parseBuffer.length<U&&(this._parseBuffer=new Uint32Array(Math.min(B.length,U))),ue||this._dirtyRowTracker.clearRange(),B.length>U)for(let W=se;W<B.length;W+=U){const ae=W+U<B.length?W+U:B.length,fe=typeof B=="string"?this._stringDecoder.decode(B.substring(W,ae),this._parseBuffer):this._utf8Decoder.decode(B.subarray(W,ae),this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,fe))return this._preserveStack($,te,fe,W),this._logSlowResolvingAsync(O),O}else if(!ue){const W=typeof B=="string"?this._stringDecoder.decode(B,this._parseBuffer):this._utf8Decoder.decode(B,this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,W))return this._preserveStack($,te,W,0),this._logSlowResolvingAsync(O),O}this._activeBuffer.x===$&&this._activeBuffer.y===te||this._onCursorMove.fire();const me=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(me,this._bufferService.rows-1))}print(B,F,O){let $,te;const se=this._charsetService.charset,ue=this._optionsService.rawOptions.screenReaderMode,me=this._bufferService.cols,Z=this._coreService.decPrivateModes.wraparound,W=this._coreService.modes.insertMode,ae=this._curAttrData;let fe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&O-F>0&&fe.getWidth(this._activeBuffer.x-1)===2&&fe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ae);let we=this._parser.precedingJoinState;for(let Ce=F;Ce<O;++Ce){if($=B[Ce],$<127&&se){const rt=se[String.fromCharCode($)];rt&&($=rt.charCodeAt(0))}const Ne=this._unicodeService.charProperties($,we);te=y.UnicodeService.extractWidth(Ne);const Le=y.UnicodeService.extractShouldJoin(Ne),ze=Le?y.UnicodeService.extractWidth(we):0;if(we=Ne,ue&&this._onA11yChar.fire((0,m.stringFromCodePoint)($)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+te-ze>me){if(Z){const rt=fe;let Be=this._activeBuffer.x-ze;for(this._activeBuffer.x=ze,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),fe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ze>0&&fe instanceof n.BufferLine&&fe.copyCellsFrom(rt,Be,0,ze,!1);Be<me;)rt.setCellFromCodepoint(Be++,0,1,ae)}else if(this._activeBuffer.x=me-1,te===2)continue}if(Le&&this._activeBuffer.x){const rt=fe.getWidth(this._activeBuffer.x-1)?1:2;fe.addCodepointToCell(this._activeBuffer.x-rt,$,te);for(let Be=te-ze;--Be>=0;)fe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ae)}else if(W&&(fe.insertCells(this._activeBuffer.x,te-ze,this._activeBuffer.getNullCell(ae)),fe.getWidth(me-1)===2&&fe.setCellFromCodepoint(me-1,u.NULL_CELL_CODE,u.NULL_CELL_WIDTH,ae)),fe.setCellFromCodepoint(this._activeBuffer.x++,$,te,ae),te>0)for(;--te;)fe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ae)}this._parser.precedingJoinState=we,this._activeBuffer.x<me&&O-F>0&&fe.getWidth(this._activeBuffer.x)===0&&!fe.hasContent(this._activeBuffer.x)&&fe.setCellFromCodepoint(this._activeBuffer.x,0,1,ae),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(B,F){return B.final!=="t"||B.prefix||B.intermediates?this._parser.registerCsiHandler(B,F):this._parser.registerCsiHandler(B,(O=>!H(O.params[0],this._optionsService.rawOptions.windowOptions)||F(O)))}registerDcsHandler(B,F){return this._parser.registerDcsHandler(B,new b.DcsHandler(F))}registerEscHandler(B,F){return this._parser.registerEscHandler(B,F)}registerOscHandler(B,F){return this._parser.registerOscHandler(B,new T.OscHandler(F))}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 B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);B.hasWidth(this._activeBuffer.x)&&!B.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const B=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-B),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(B=this._bufferService.cols-1){this._activeBuffer.x=Math.min(B,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(B,F){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=B,this._activeBuffer.y=this._activeBuffer.scrollTop+F):(this._activeBuffer.x=B,this._activeBuffer.y=F),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(B,F){this._restrictCursor(),this._setCursor(this._activeBuffer.x+B,this._activeBuffer.y+F)}cursorUp(B){const F=this._activeBuffer.y-this._activeBuffer.scrollTop;return F>=0?this._moveCursor(0,-Math.min(F,B.params[0]||1)):this._moveCursor(0,-(B.params[0]||1)),!0}cursorDown(B){const F=this._activeBuffer.scrollBottom-this._activeBuffer.y;return F>=0?this._moveCursor(0,Math.min(F,B.params[0]||1)):this._moveCursor(0,B.params[0]||1),!0}cursorForward(B){return this._moveCursor(B.params[0]||1,0),!0}cursorBackward(B){return this._moveCursor(-(B.params[0]||1),0),!0}cursorNextLine(B){return this.cursorDown(B),this._activeBuffer.x=0,!0}cursorPrecedingLine(B){return this.cursorUp(B),this._activeBuffer.x=0,!0}cursorCharAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(B){return this._setCursor(B.length>=2?(B.params[1]||1)-1:0,(B.params[0]||1)-1),!0}charPosAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(B){return this._moveCursor(B.params[0]||1,0),!0}linePosAbsolute(B){return this._setCursor(this._activeBuffer.x,(B.params[0]||1)-1),!0}vPositionRelative(B){return this._moveCursor(0,B.params[0]||1),!0}hVPosition(B){return this.cursorPosition(B),!0}tabClear(B){const F=B.params[0];return F===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:F===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let F=B.params[0]||1;for(;F--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let F=B.params[0]||1;for(;F--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(B){const F=B.params[0];return F===1&&(this._curAttrData.bg|=536870912),F!==2&&F!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(B,F,O,$=!1,te=!1){const se=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);se.replaceCells(F,O,this._activeBuffer.getNullCell(this._eraseAttrData()),te),$&&(se.isWrapped=!1)}_resetBufferLine(B,F=!1){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);O&&(O.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),F),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+B),O.isWrapped=!1)}eraseInDisplay(B,F=!1){let O;switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,F);O<this._bufferService.rows;O++)this._resetBufferLine(O,F);this._dirtyRowTracker.markDirty(O);break;case 1:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O,0,this._activeBuffer.x+1,!0,F),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(O+1).isWrapped=!1);O--;)this._resetBufferLine(O,F);this._dirtyRowTracker.markDirty(0);break;case 2:for(O=this._bufferService.rows,this._dirtyRowTracker.markDirty(O-1);O--;)this._resetBufferLine(O,F);this._dirtyRowTracker.markDirty(0);break;case 3:const $=this._activeBuffer.lines.length-this._bufferService.rows;$>0&&(this._activeBuffer.lines.trimStart($),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-$,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-$,0),this._onScroll.fire(0))}return!0}eraseInLine(B,F=!1){switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,F);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,F);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,F)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(B){this._restrictCursor();let F=B.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y,$=this._bufferService.rows-1-this._activeBuffer.scrollBottom,te=this._bufferService.rows-1+this._activeBuffer.ybase-$+1;for(;F--;)this._activeBuffer.lines.splice(te-1,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(B){this._restrictCursor();let F=B.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y;let $;for($=this._bufferService.rows-1-this._activeBuffer.scrollBottom,$=this._bufferService.rows-1+this._activeBuffer.ybase-$;F--;)this._activeBuffer.lines.splice(O,1),this._activeBuffer.lines.splice($,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(B){this._restrictCursor();const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return F&&(F.insertCells(this._activeBuffer.x,B.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(B){this._restrictCursor();const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return F&&(F.deleteCells(this._activeBuffer.x,B.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(B){let F=B.params[0]||1;for(;F--;)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(B){let F=B.params[0]||1;for(;F--;)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(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=B.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);$.deleteCells(0,F,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=B.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);$.insertCells(0,F,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=B.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);$.insertCells(this._activeBuffer.x,F,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=B.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);$.deleteCells(this._activeBuffer.x,F,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(B){this._restrictCursor();const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return F&&(F.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(B.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(B){const F=this._parser.precedingJoinState;if(!F)return!0;const O=B.params[0]||1,$=y.UnicodeService.extractWidth(F),te=this._activeBuffer.x-$,se=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(te),ue=new Uint32Array(se.length*O);let me=0;for(let W=0;W<se.length;){const ae=se.codePointAt(W)||0;ue[me++]=ae,W+=ae>65535?2:1}let Z=me;for(let W=1;W<O;++W)ue.copyWithin(Z,0,me),Z+=me;return this.print(ue,0,Z),!0}sendDeviceAttributesPrimary(B){return B.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(l.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(l.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(B){return B.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(l.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(l.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(B.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(l.C0.ESC+"[>83;40003;0c")),!0}_is(B){return(this._optionsService.rawOptions.termName+"").indexOf(B)===0}setMode(B){for(let F=0;F<B.length;F++)switch(B.params[F]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(B){for(let F=0;F<B.length;F++)switch(B.params[F]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,g.DEFAULT_CHARSET),this._charsetService.setgCharset(1,g.DEFAULT_CHARSET),this._charsetService.setgCharset(2,g.DEFAULT_CHARSET),this._charsetService.setgCharset(3,g.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(B){for(let F=0;F<B.length;F++)switch(B.params[F]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(B){for(let F=0;F<B.length;F++)switch(B.params[F]){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(),B.params[F]===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(B,F){const O=this._coreService.decPrivateModes,{activeProtocol:$,activeEncoding:te}=this._coreMouseService,se=this._coreService,{buffers:ue,cols:me}=this._bufferService,{active:Z,alt:W}=ue,ae=this._optionsService.rawOptions,fe=Le=>Le?1:2,we=B.params[0];return Ce=we,Ne=F?we===2?4:we===4?fe(se.modes.insertMode):we===12?3:we===20?fe(ae.convertEol):0:we===1?fe(O.applicationCursorKeys):we===3?ae.windowOptions.setWinLines?me===80?2:me===132?1:0:0:we===6?fe(O.origin):we===7?fe(O.wraparound):we===8?3:we===9?fe($==="X10"):we===12?fe(ae.cursorBlink):we===25?fe(!se.isCursorHidden):we===45?fe(O.reverseWraparound):we===66?fe(O.applicationKeypad):we===67?4:we===1e3?fe($==="VT200"):we===1002?fe($==="DRAG"):we===1003?fe($==="ANY"):we===1004?fe(O.sendFocus):we===1005?4:we===1006?fe(te==="SGR"):we===1015?4:we===1016?fe(te==="SGR_PIXELS"):we===1048?1:we===47||we===1047||we===1049?fe(Z===W):we===2004?fe(O.bracketedPasteMode):0,se.triggerDataEvent(`${l.C0.ESC}[${F?"":"?"}${Ce};${Ne}$y`),!0;var Ce,Ne}_updateAttrColor(B,F,O,$,te){return F===2?(B|=50331648,B&=-16777216,B|=S.AttributeData.fromColorRGB([O,$,te])):F===5&&(B&=-50331904,B|=33554432|255&O),B}_extractColor(B,F,O){const $=[0,0,-1,0,0,0];let te=0,se=0;do{if($[se+te]=B.params[F+se],B.hasSubParams(F+se)){const ue=B.getSubParams(F+se);let me=0;do $[1]===5&&(te=1),$[se+me+1+te]=ue[me];while(++me<ue.length&&me+se+1+te<$.length);break}if($[1]===5&&se+te>=2||$[1]===2&&se+te>=5)break;$[1]&&(te=1)}while(++se+F<B.length&&se+te<$.length);for(let ue=2;ue<$.length;++ue)$[ue]===-1&&($[ue]=0);switch($[0]){case 38:O.fg=this._updateAttrColor(O.fg,$[1],$[3],$[4],$[5]);break;case 48:O.bg=this._updateAttrColor(O.bg,$[1],$[3],$[4],$[5]);break;case 58:O.extended=O.extended.clone(),O.extended.underlineColor=this._updateAttrColor(O.extended.underlineColor,$[1],$[3],$[4],$[5])}return se}_processUnderline(B,F){F.extended=F.extended.clone(),(!~B||B>5)&&(B=1),F.extended.underlineStyle=B,F.fg|=268435456,B===0&&(F.fg&=-268435457),F.updateExtended()}_processSGR0(B){B.fg=n.DEFAULT_ATTR_DATA.fg,B.bg=n.DEFAULT_ATTR_DATA.bg,B.extended=B.extended.clone(),B.extended.underlineStyle=0,B.extended.underlineColor&=-67108864,B.updateExtended()}charAttributes(B){if(B.length===1&&B.params[0]===0)return this._processSGR0(this._curAttrData),!0;const F=B.length;let O;const $=this._curAttrData;for(let te=0;te<F;te++)O=B.params[te],O>=30&&O<=37?($.fg&=-50331904,$.fg|=16777216|O-30):O>=40&&O<=47?($.bg&=-50331904,$.bg|=16777216|O-40):O>=90&&O<=97?($.fg&=-50331904,$.fg|=16777224|O-90):O>=100&&O<=107?($.bg&=-50331904,$.bg|=16777224|O-100):O===0?this._processSGR0($):O===1?$.fg|=134217728:O===3?$.bg|=67108864:O===4?($.fg|=268435456,this._processUnderline(B.hasSubParams(te)?B.getSubParams(te)[0]:1,$)):O===5?$.fg|=536870912:O===7?$.fg|=67108864:O===8?$.fg|=1073741824:O===9?$.fg|=2147483648:O===2?$.bg|=134217728:O===21?this._processUnderline(2,$):O===22?($.fg&=-134217729,$.bg&=-134217729):O===23?$.bg&=-67108865:O===24?($.fg&=-268435457,this._processUnderline(0,$)):O===25?$.fg&=-536870913:O===27?$.fg&=-67108865:O===28?$.fg&=-1073741825:O===29?$.fg&=2147483647:O===39?($.fg&=-67108864,$.fg|=16777215&n.DEFAULT_ATTR_DATA.fg):O===49?($.bg&=-67108864,$.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):O===38||O===48||O===58?te+=this._extractColor(B,te,$):O===53?$.bg|=1073741824:O===55?$.bg&=-1073741825:O===59?($.extended=$.extended.clone(),$.extended.underlineColor=-1,$.updateExtended()):O===100?($.fg&=-67108864,$.fg|=16777215&n.DEFAULT_ATTR_DATA.fg,$.bg&=-67108864,$.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",O);return!0}deviceStatus(B){switch(B.params[0]){case 5:this._coreService.triggerDataEvent(`${l.C0.ESC}[0n`);break;case 6:const F=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[${F};${O}R`)}return!0}deviceStatusPrivate(B){if(B.params[0]===6){const F=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[?${F};${O}R`)}return!0}softReset(B){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(B){const F=B.params[0]||1;switch(F){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 O=F%2==1;return this._optionsService.options.cursorBlink=O,!0}setScrollRegion(B){const F=B.params[0]||1;let O;return(B.length<2||(O=B.params[1])>this._bufferService.rows||O===0)&&(O=this._bufferService.rows),O>F&&(this._activeBuffer.scrollTop=F-1,this._activeBuffer.scrollBottom=O-1,this._setCursor(0,0)),!0}windowOptions(B){if(!H(B.params[0],this._optionsService.rawOptions.windowOptions))return!0;const F=B.length>1?B.params[1]:0;switch(B.params[0]){case 14:F!==2&&this._onRequestWindowsOptionsReport.fire(z.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(z.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${l.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:F!==0&&F!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),F!==0&&F!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:F!==0&&F!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),F!==0&&F!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(B){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(B){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(B){return this._windowTitle=B,this._onTitleChange.fire(B),!0}setIconName(B){return this._iconName=B,!0}setOrReportIndexedColor(B){const F=[],O=B.split(";");for(;O.length>1;){const $=O.shift(),te=O.shift();if(/^\d+$/.exec($)){const se=parseInt($);if(X(se))if(te==="?")F.push({type:0,index:se});else{const ue=(0,R.parseColor)(te);ue&&F.push({type:1,index:se,color:ue})}}}return F.length&&this._onColor.fire(F),!0}setHyperlink(B){const F=B.split(";");return!(F.length<2)&&(F[1]?this._createHyperlink(F[0],F[1]):!F[0]&&this._finishHyperlink())}_createHyperlink(B,F){this._getCurrentLinkId()&&this._finishHyperlink();const O=B.split(":");let $;const te=O.findIndex((se=>se.startsWith("id=")));return te!==-1&&($=O[te].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:$,uri:F}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(B,F){const O=B.split(";");for(let $=0;$<O.length&&!(F>=this._specialColors.length);++$,++F)if(O[$]==="?")this._onColor.fire([{type:0,index:this._specialColors[F]}]);else{const te=(0,R.parseColor)(O[$]);te&&this._onColor.fire([{type:1,index:this._specialColors[F],color:te}])}return!0}setOrReportFgColor(B){return this._setOrReportSpecialColor(B,0)}setOrReportBgColor(B){return this._setOrReportSpecialColor(B,1)}setOrReportCursorColor(B){return this._setOrReportSpecialColor(B,2)}restoreIndexedColor(B){if(!B)return this._onColor.fire([{type:2}]),!0;const F=[],O=B.split(";");for(let $=0;$<O.length;++$)if(/^\d+$/.exec(O[$])){const te=parseInt(O[$]);X(te)&&F.push({type:2,index:te})}return F.length&&this._onColor.fire(F),!0}restoreFgColor(B){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(B){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(B){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,g.DEFAULT_CHARSET),!0}selectCharset(B){return B.length!==2?(this.selectDefaultCharset(),!0):(B[0]==="/"||this._charsetService.setgCharset(k[B[0]],g.CHARSETS[B[1]]||g.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 B=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,B,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(B){return this._charsetService.setgLevel(B),!0}screenAlignmentPattern(){const B=new c.CellData;B.content=4194373,B.fg=this._curAttrData.fg,B.bg=this._curAttrData.bg,this._setCursor(0,0);for(let F=0;F<this._bufferService.rows;++F){const O=this._activeBuffer.ybase+this._activeBuffer.y+F,$=this._activeBuffer.lines.get(O);$&&($.fill(B),$.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(B,F){const O=this._bufferService.buffer,$=this._optionsService.rawOptions;return(te=>(this._coreService.triggerDataEvent(`${l.C0.ESC}${te}${l.C0.ESC}\\`),!0))(B==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:B==='"p'?'P1$r61;1"p':B==="r"?`P1$r${O.scrollTop+1};${O.scrollBottom+1}r`:B==="m"?"P1$r0m":B===" q"?`P1$r${{block:2,underline:4,bar:6}[$.cursorStyle]-($.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(B,F){this._dirtyRowTracker.markRangeDirty(B,F)}}r.InputHandler=re;let K=class{constructor(I){this._bufferService=I,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(I){I<this.start?this.start=I:I>this.end&&(this.end=I)}markRangeDirty(I,B){I>B&&(V=I,I=B,B=V),I<this.start&&(this.start=I),B>this.end&&(this.end=B)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(I){return 0<=I&&I<256}K=_([v(0,L.IBufferService)],K)},844:(q,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:(q,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class d{constructor(){this._data={}}set(v,l,g){this._data[v]||(this._data[v]={}),this._data[v][l]=g}get(v,l){return this._data[v]?this._data[v][l]:void 0}clear(){this._data={}}}r.TwoKeyMap=d,r.FourKeyMap=class{constructor(){this._data=new d}set(_,v,l,g,x){this._data.get(_,v)||this._data.set(_,v,new d),this._data.get(_,v).set(l,g,x)}get(_,v,l,g){return this._data.get(_,v)?.get(l,g)}clear(){this._data.clear()}}},6114:(q,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:(q,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,l=this._array.length-1;for(;l>=v;){let g=v+l>>1;const x=this._getKey(this._array[g]);if(x>_)l=g-1;else{if(!(x<_)){for(;g>0&&this._getKey(this._array[g-1])===_;)g--;return g}v=g+1}}return v}}},7226:(q,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(x){this._tasks.push(x),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(x){this._idleCallback=void 0;let E=0,m=0,n=x.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),m=Math.max(E,m),h=x.timeRemaining(),1.5*m>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 l extends v{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const E=Date.now()+x;return{timeRemaining:()=>Math.max(0,E-Date.now())}}}r.PriorityTaskQueue=l,r.IdleTaskQueue=!_.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:l,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;const _=d(643);r.updateWindowsModeWrappedState=function(v){const l=v.buffer.lines.get(v.buffer.ybase+v.buffer.y-1),g=l?.get(v.cols-1),x=v.buffer.lines.get(v.buffer.ybase+v.buffer.y);x&&g&&(x.isWrapped=g[_.CHAR_DATA_CODE_INDEX]!==_.NULL_CELL_CODE&&g[_.CHAR_DATA_CODE_INDEX]!==_.WHITESPACE_CELL_CODE)}},3734:(q,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(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){const l=new d;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}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(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){const l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,g=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=g}clone(){return new _(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=_},9092:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;const _=d(6349),v=d(7226),l=d(3734),g=d(8437),x=d(4634),E=d(511),m=d(643),n=d(4863),h=d(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(u,c,S){this._hasScrollback=u,this._optionsService=c,this._bufferService=S,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=h.DEFAULT_CHARSET,this.markers=[],this._nullCell=E.CellData.fromCharData([0,m.NULL_CELL_CHAR,m.NULL_CELL_WIDTH,m.NULL_CELL_CODE]),this._whitespaceCell=E.CellData.fromCharData([0,m.WHITESPACE_CELL_CHAR,m.WHITESPACE_CELL_WIDTH,m.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 l.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 l.ExtendedAttrs),this._whitespaceCell}getBlankLine(u,c){return new g.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=g.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 S=this.getNullCell(g.DEFAULT_ATTR_DATA);let L=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++)L+=+this.lines.get(b).resize(u,S);let T=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 g.BufferLine(u,S)):this.ybase>0&&this.lines.length<=this.ybase+this.y+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(u,S)));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),T&&(this.y+=T),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 T=0;T<this.lines.length;T++)L+=+this.lines.get(T).resize(u,S);this._cols=u,this._rows=c,this._memoryCleanupQueue.clear(),L>.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 S=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,u,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(S.length>0){const L=(0,x.reflowLargerCreateNewLayout)(this.lines,S);(0,x.reflowLargerApplyNewLayout)(this.lines,L.layout),this._reflowLargerAdjustViewport(u,c,L.countRemoved)}}_reflowLargerAdjustViewport(u,c,S){const L=this.getNullCell(g.DEFAULT_ATTR_DATA);let y=S;for(;y-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<c&&this.lines.push(new g.BufferLine(u,L))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(u,c){const S=this.getNullCell(g.DEFAULT_ATTR_DATA),L=[];let y=0;for(let T=this.lines.length-1;T>=0;T--){let b=this.lines.get(T);if(!b||!b.isWrapped&&b.getTrimmedLength()<=u)continue;const R=[b];for(;b.isWrapped&&T>0;)b=this.lines.get(--T),R.unshift(b);const k=this.ybase+this.y;if(k>=T&&k<T+R.length)continue;const U=R[R.length-1].getTrimmedLength(),H=(0,x.reflowSmallerGetNewLineLengths)(R,this._cols,u),z=H.length-R.length;let V;V=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+z):Math.max(0,this.lines.length-this.lines.maxLength+z);const re=[];for(let O=0;O<z;O++){const $=this.getBlankLine(g.DEFAULT_ATTR_DATA,!0);re.push($)}re.length>0&&(L.push({start:T+R.length+y,newLines:re}),y+=re.length),R.push(...re);let K=H.length-1,X=H[K];X===0&&(K--,X=H[K]);let I=R.length-z-1,B=U;for(;I>=0;){const O=Math.min(B,X);if(R[K]===void 0)break;if(R[K].copyCellsFrom(R[I],B-O,X-O,O,!0),X-=O,X===0&&(K--,X=H[K]),B-=O,B===0){I--;const $=Math.max(I,0);B=(0,x.getWrappedLineTrimmedLength)(R,$,this._cols)}}for(let O=0;O<R.length;O++)H[O]<u&&R[O].setCell(H[O],S);let F=z-V;for(;F-- >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+z,this.ybase+c-1)}if(L.length>0){const T=[],b=[];for(let K=0;K<this.lines.length;K++)b.push(this.lines.get(K));const R=this.lines.length;let k=R-1,U=0,H=L[U];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+y);let z=0;for(let K=Math.min(this.lines.maxLength-1,R+y-1);K>=0;K--)if(H&&H.start>k+z){for(let X=H.newLines.length-1;X>=0;X--)this.lines.set(K--,H.newLines[X]);K++,T.push({index:k+1,amount:H.newLines.length}),z+=H.newLines.length,H=L[++U]}else this.lines.set(K,b[k--]);let V=0;for(let K=T.length-1;K>=0;K--)T[K].index+=V,this.lines.onInsertEmitter.fire(T[K]),V+=T[K].amount;const re=Math.max(0,R+y-this.lines.maxLength);re>0&&this.lines.onTrimEmitter.fire(re)}}translateBufferLineToString(u,c,S=0,L){const y=this.lines.get(u);return y?y.translateToString(c,S,L):""}getWrappedRangeForLine(u){let c=u,S=u;for(;c>0&&this.lines.get(c).isWrapped;)c--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:c,last:S}}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((S=>{c.line-=S,c.line<0&&c.dispose()}))),c.register(this.lines.onInsert((S=>{c.line>=S.index&&(c.line+=S.amount)}))),c.register(this.lines.onDelete((S=>{c.line>=S.index&&c.line<S.index+S.amount&&c.dispose(),c.line>S.index&&(c.line-=S.amount)}))),c.register(c.onDispose((()=>this._removeMarker(c)))),c}_removeMarker(u){this._isClearing||this.markers.splice(this.markers.indexOf(u),1)}}},8437:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;const _=d(3734),v=d(511),l=d(643),g=d(482);r.DEFAULT_ATTR_DATA=Object.freeze(new _.AttributeData);let x=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,l.NULL_CELL_CHAR,l.NULL_CELL_WIDTH,l.NULL_CELL_CODE]);for(let S=0;S<n;++S)this.setCell(S,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,g.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[l.CHAR_DATA_ATTR_INDEX],h[l.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[n]=h[1],this._data[3*n+0]=2097152|n|h[l.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*n+0]=h[l.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|h[l.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,g.stringFromCodePoint)(2097151&h):""}isProtected(n){return 536870912&this._data[3*n+2]}loadCell(n,h){return x=3*n,h.content=this._data[x+0],h.fg=this._data[x+1],h.bg=this._data[x+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,g.stringFromCodePoint)(h):2097151&c?(this._combined[n]=(0,g.stringFromCodePoint)(2097151&c)+(0,g.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 S=this.length-n-h-1;S>=0;--S)this.setCell(n+h+S,this.loadCell(n+S,c));for(let S=0;S<h;++S)this.setCell(n+S,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 S=0;S<this.length-n-h;++S)this.setCell(n+S,this.loadCell(n+h+S,c));for(let S=this.length-h;S<this.length;++S)this.setCell(S,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 L=0;L<c.length;L++){const y=parseInt(c[L],10);y>=n&&delete this._combined[y]}const S=Object.keys(this._extendedAttrs);for(let L=0;L<S.length;L++){const y=parseInt(S[L],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,S){const L=n._data;if(S)for(let T=c-1;T>=0;T--){for(let b=0;b<3;b++)this._data[3*(u+T)+b]=L[3*(h+T)+b];268435456&L[3*(h+T)+2]&&(this._extendedAttrs[u+T]=n._extendedAttrs[h+T])}else for(let T=0;T<c;T++){for(let b=0;b<3;b++)this._data[3*(u+T)+b]=L[3*(h+T)+b];268435456&L[3*(h+T)+2]&&(this._extendedAttrs[u+T]=n._extendedAttrs[h+T])}const y=Object.keys(n._combined);for(let T=0;T<y.length;T++){const b=parseInt(y[T],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 S="";for(;h<u;){const L=this._data[3*h+0],y=2097151&L,T=2097152&L?this._combined[h]:y?(0,g.stringFromCodePoint)(y):l.WHITESPACE_CELL_CHAR;if(S+=T,c)for(let b=0;b<T.length;++b)c.push(h);h+=L>>22||1}return c&&c.push(h),S}}r.BufferLine=E},4841:(q,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:(q,r)=>{function d(_,v,l){if(v===_.length-1)return _[v].getTrimmedLength();const g=!_[v].hasContent(l-1)&&_[v].getWidth(l-1)===1,x=_[v+1].getWidth(0)===2;return g&&x?l-1:l}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(_,v,l,g,x){const E=[];for(let m=0;m<_.length-1;m++){let n=m,h=_.get(++n);if(!h.isWrapped)continue;const u=[_.get(m)];for(;n<_.length&&h.isWrapped;)u.push(h),h=_.get(++n);if(g>=m&&g<n){m+=u.length-1;continue}let c=0,S=d(u,c,v),L=1,y=0;for(;L<u.length;){const b=d(u,L,v),R=b-y,k=l-S,U=Math.min(R,k);u[c].copyCellsFrom(u[L],y,S,U,!1),S+=U,S===l&&(c++,S=0),y+=U,y===b&&(L++,y=0),S===0&&c!==0&&u[c-1].getWidth(l-1)===2&&(u[c].copyCellsFrom(u[c-1],l-1,S++,1,!1),u[c-1].setCell(l-1,x))}u[c].replaceCells(S,l,x);let T=0;for(let b=u.length-1;b>0&&(b>c||u[b].getTrimmedLength()===0);b--)T++;T>0&&(E.push(m+u.length-T),E.push(T)),m+=u.length-1}return E},r.reflowLargerCreateNewLayout=function(_,v){const l=[];let g=0,x=v[g],E=0;for(let m=0;m<_.length;m++)if(x===m){const n=v[++g];_.onDeleteEmitter.fire({index:m-E,amount:n}),m+=n-1,E+=n,x=v[++g]}else l.push(m);return{layout:l,countRemoved:E}},r.reflowLargerApplyNewLayout=function(_,v){const l=[];for(let g=0;g<v.length;g++)l.push(_.get(v[g]));for(let g=0;g<l.length;g++)_.set(g,l[g]);_.length=v.length},r.reflowSmallerGetNewLineLengths=function(_,v,l){const g=[],x=_.map(((h,u)=>d(_,u,v))).reduce(((h,u)=>h+u));let E=0,m=0,n=0;for(;n<x;){if(x-n<l){g.push(x-n);break}E+=l;const h=d(_,m,v);E>h&&(E-=h,m++);const u=_[m].getWidth(E-1)===2;u&&E--;const c=u?l-1:l;g.push(c),n+=c}return g},r.getWrappedLineTrimmedLength=d},5295:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;const _=d(8460),v=d(844),l=d(9092);class g extends v.Disposable{constructor(E,m){super(),this._optionsService=E,this._bufferService=m,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 l.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new l.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,m){this._normal.resize(E,m),this._alt.resize(E,m),this.setupTabStops(E)}setupTabStops(E){this._normal.setupTabStops(E),this._alt.setupTabStops(E)}}r.BufferSet=g},511:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const _=d(482),v=d(643),l=d(3734);class g extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(E){const m=new g;return m.setFromCharData(E),m}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 m=!1;if(E[v.CHAR_DATA_CHAR_INDEX].length>2)m=!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:m=!0}else m=!0}else this.content=E[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|E[v.CHAR_DATA_WIDTH_INDEX]<<22;m&&(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=g},643:(q,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:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;const _=d(8460),v=d(844);class l{get id(){return this._id}constructor(x){this.line=x,this.isDisposed=!1,this._disposables=[],this._id=l._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(x){return this._disposables.push(x),x}}r.Marker=l,l._nextId=1},7116:(q,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:(q,r)=>{var d,_,v;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,(function(l){l.NUL="\0",l.SOH="",l.STX="",l.ETX="",l.EOT="",l.ENQ="",l.ACK="",l.BEL="\x07",l.BS="\b",l.HT=" ",l.LF=`
|
|
16
|
+
`,l.VT="\v",l.FF="\f",l.CR="\r",l.SO="",l.SI="",l.DLE="",l.DC1="",l.DC2="",l.DC3="",l.DC4="",l.NAK="",l.SYN="",l.ETB="",l.CAN="",l.EM="",l.SUB="",l.ESC="\x1B",l.FS="",l.GS="",l.RS="",l.US="",l.SP=" ",l.DEL=""})(d||(r.C0=d={})),(function(l){l.PAD="",l.HOP="",l.BPH="",l.NBH="",l.IND="",l.NEL="
",l.SSA="",l.ESA="",l.HTS="",l.HTJ="",l.VTS="",l.PLD="",l.PLU="",l.RI="",l.SS2="",l.SS3="",l.DCS="",l.PU1="",l.PU2="",l.STS="",l.CCH="",l.MW="",l.SPA="",l.EPA="",l.SOS="",l.SGCI="",l.SCI="",l.CSI="",l.ST="",l.OSC="",l.PM="",l.APC=""})(_||(r.C1=_={})),(function(l){l.ST=`${d.ESC}\\`})(v||(r.C1_ESCAPED=v={}))},7399:(q,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(l,g,x,E){const m={type:0,cancel:!1,key:void 0},n=(l.shiftKey?1:0)|(l.altKey?2:0)|(l.ctrlKey?4:0)|(l.metaKey?8:0);switch(l.keyCode){case 0:l.key==="UIKeyInputUpArrow"?m.key=g?_.C0.ESC+"OA":_.C0.ESC+"[A":l.key==="UIKeyInputLeftArrow"?m.key=g?_.C0.ESC+"OD":_.C0.ESC+"[D":l.key==="UIKeyInputRightArrow"?m.key=g?_.C0.ESC+"OC":_.C0.ESC+"[C":l.key==="UIKeyInputDownArrow"&&(m.key=g?_.C0.ESC+"OB":_.C0.ESC+"[B");break;case 8:m.key=l.ctrlKey?"\b":_.C0.DEL,l.altKey&&(m.key=_.C0.ESC+m.key);break;case 9:if(l.shiftKey){m.key=_.C0.ESC+"[Z";break}m.key=_.C0.HT,m.cancel=!0;break;case 13:m.key=l.altKey?_.C0.ESC+_.C0.CR:_.C0.CR,m.cancel=!0;break;case 27:m.key=_.C0.ESC,l.altKey&&(m.key=_.C0.ESC+_.C0.ESC),m.cancel=!0;break;case 37:if(l.metaKey)break;n?(m.key=_.C0.ESC+"[1;"+(n+1)+"D",m.key===_.C0.ESC+"[1;3D"&&(m.key=_.C0.ESC+(x?"b":"[1;5D"))):m.key=g?_.C0.ESC+"OD":_.C0.ESC+"[D";break;case 39:if(l.metaKey)break;n?(m.key=_.C0.ESC+"[1;"+(n+1)+"C",m.key===_.C0.ESC+"[1;3C"&&(m.key=_.C0.ESC+(x?"f":"[1;5C"))):m.key=g?_.C0.ESC+"OC":_.C0.ESC+"[C";break;case 38:if(l.metaKey)break;n?(m.key=_.C0.ESC+"[1;"+(n+1)+"A",x||m.key!==_.C0.ESC+"[1;3A"||(m.key=_.C0.ESC+"[1;5A")):m.key=g?_.C0.ESC+"OA":_.C0.ESC+"[A";break;case 40:if(l.metaKey)break;n?(m.key=_.C0.ESC+"[1;"+(n+1)+"B",x||m.key!==_.C0.ESC+"[1;3B"||(m.key=_.C0.ESC+"[1;5B")):m.key=g?_.C0.ESC+"OB":_.C0.ESC+"[B";break;case 45:l.shiftKey||l.ctrlKey||(m.key=_.C0.ESC+"[2~");break;case 46:m.key=n?_.C0.ESC+"[3;"+(n+1)+"~":_.C0.ESC+"[3~";break;case 36:m.key=n?_.C0.ESC+"[1;"+(n+1)+"H":g?_.C0.ESC+"OH":_.C0.ESC+"[H";break;case 35:m.key=n?_.C0.ESC+"[1;"+(n+1)+"F":g?_.C0.ESC+"OF":_.C0.ESC+"[F";break;case 33:l.shiftKey?m.type=2:l.ctrlKey?m.key=_.C0.ESC+"[5;"+(n+1)+"~":m.key=_.C0.ESC+"[5~";break;case 34:l.shiftKey?m.type=3:l.ctrlKey?m.key=_.C0.ESC+"[6;"+(n+1)+"~":m.key=_.C0.ESC+"[6~";break;case 112:m.key=n?_.C0.ESC+"[1;"+(n+1)+"P":_.C0.ESC+"OP";break;case 113:m.key=n?_.C0.ESC+"[1;"+(n+1)+"Q":_.C0.ESC+"OQ";break;case 114:m.key=n?_.C0.ESC+"[1;"+(n+1)+"R":_.C0.ESC+"OR";break;case 115:m.key=n?_.C0.ESC+"[1;"+(n+1)+"S":_.C0.ESC+"OS";break;case 116:m.key=n?_.C0.ESC+"[15;"+(n+1)+"~":_.C0.ESC+"[15~";break;case 117:m.key=n?_.C0.ESC+"[17;"+(n+1)+"~":_.C0.ESC+"[17~";break;case 118:m.key=n?_.C0.ESC+"[18;"+(n+1)+"~":_.C0.ESC+"[18~";break;case 119:m.key=n?_.C0.ESC+"[19;"+(n+1)+"~":_.C0.ESC+"[19~";break;case 120:m.key=n?_.C0.ESC+"[20;"+(n+1)+"~":_.C0.ESC+"[20~";break;case 121:m.key=n?_.C0.ESC+"[21;"+(n+1)+"~":_.C0.ESC+"[21~";break;case 122:m.key=n?_.C0.ESC+"[23;"+(n+1)+"~":_.C0.ESC+"[23~";break;case 123:m.key=n?_.C0.ESC+"[24;"+(n+1)+"~":_.C0.ESC+"[24~";break;default:if(!l.ctrlKey||l.shiftKey||l.altKey||l.metaKey)if(x&&!E||!l.altKey||l.metaKey)!x||l.altKey||l.ctrlKey||l.shiftKey||!l.metaKey?l.key&&!l.ctrlKey&&!l.altKey&&!l.metaKey&&l.keyCode>=48&&l.key.length===1?m.key=l.key:l.key&&l.ctrlKey&&(l.key==="_"&&(m.key=_.C0.US),l.key==="@"&&(m.key=_.C0.NUL)):l.keyCode===65&&(m.type=1);else{const h=v[l.keyCode],u=h?.[l.shiftKey?1:0];if(u)m.key=_.C0.ESC+u;else if(l.keyCode>=65&&l.keyCode<=90){const c=l.ctrlKey?l.keyCode-64:l.keyCode+32;let S=String.fromCharCode(c);l.shiftKey&&(S=S.toUpperCase()),m.key=_.C0.ESC+S}else if(l.keyCode===32)m.key=_.C0.ESC+(l.ctrlKey?_.C0.NUL:" ");else if(l.key==="Dead"&&l.code.startsWith("Key")){let c=l.code.slice(3,4);l.shiftKey||(c=c.toLowerCase()),m.key=_.C0.ESC+c,m.cancel=!0}}else l.keyCode>=65&&l.keyCode<=90?m.key=String.fromCharCode(l.keyCode-64):l.keyCode===32?m.key=_.C0.NUL:l.keyCode>=51&&l.keyCode<=55?m.key=String.fromCharCode(l.keyCode-51+27):l.keyCode===56?m.key=_.C0.DEL:l.keyCode===219?m.key=_.C0.ESC:l.keyCode===220?m.key=_.C0.FS:l.keyCode===221&&(m.key=_.C0.GS)}return m}},482:(q,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 l="";for(let g=_;g<v;++g){let x=d[g];x>65535?(x-=65536,l+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):l+=String.fromCharCode(x)}return l},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(d,_){const v=d.length;if(!v)return 0;let l=0,g=0;if(this._interim){const x=d.charCodeAt(g++);56320<=x&&x<=57343?_[l++]=1024*(this._interim-55296)+x-56320+65536:(_[l++]=this._interim,_[l++]=x),this._interim=0}for(let x=g;x<v;++x){const E=d.charCodeAt(x);if(55296<=E&&E<=56319){if(++x>=v)return this._interim=E,l;const m=d.charCodeAt(x);56320<=m&&m<=57343?_[l++]=1024*(E-55296)+m-56320+65536:(_[l++]=E,_[l++]=m)}else E!==65279&&(_[l++]=E)}return l}},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 l,g,x,E,m=0,n=0,h=0;if(this.interim[0]){let S=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let y,T=0;for(;(y=63&this.interim[++T])&&T<4;)L<<=6,L|=y;const b=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=b-T;for(;h<R;){if(h>=v)return 0;if(y=d[h++],(192&y)!=128){h--,S=!0;break}this.interim[T++]=y,L<<=6,L|=63&y}S||(b===2?L<128?h--:_[m++]=L:b===3?L<2048||L>=55296&&L<=57343||L===65279||(_[m++]=L):L<65536||L>1114111||(_[m++]=L)),this.interim.fill(0)}const u=v-4;let c=h;for(;c<v;){for(;!(!(c<u)||128&(l=d[c])||128&(g=d[c+1])||128&(x=d[c+2])||128&(E=d[c+3]));)_[m++]=l,_[m++]=g,_[m++]=x,_[m++]=E,c+=4;if(l=d[c++],l<128)_[m++]=l;else if((224&l)==192){if(c>=v)return this.interim[0]=l,m;if(g=d[c++],(192&g)!=128){c--;continue}if(n=(31&l)<<6|63&g,n<128){c--;continue}_[m++]=n}else if((240&l)==224){if(c>=v)return this.interim[0]=l,m;if(g=d[c++],(192&g)!=128){c--;continue}if(c>=v)return this.interim[0]=l,this.interim[1]=g,m;if(x=d[c++],(192&x)!=128){c--;continue}if(n=(15&l)<<12|(63&g)<<6|63&x,n<2048||n>=55296&&n<=57343||n===65279)continue;_[m++]=n}else if((248&l)==240){if(c>=v)return this.interim[0]=l,m;if(g=d[c++],(192&g)!=128){c--;continue}if(c>=v)return this.interim[0]=l,this.interim[1]=g,m;if(x=d[c++],(192&x)!=128){c--;continue}if(c>=v)return this.interim[0]=l,this.interim[1]=g,this.interim[2]=x,m;if(E=d[c++],(192&E)!=128){c--;continue}if(n=(7&l)<<18|(63&g)<<12|(63&x)<<6|63&E,n<65536||n>1114111)continue;_[m++]=n}}return m}}},225:(q,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]],l=[[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 g;r.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let x=0;x<v.length;++x)g.fill(0,v[x][0],v[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?g[x]:(function(E,m){let n,h=0,u=m.length-1;if(E<m[0][0]||E>m[u][1])return!1;for(;u>=h;)if(n=h+u>>1,E>m[n][1])h=n+1;else{if(!(E<m[n][0]))return!0;u=n-1}return!1})(x,l)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,E){let m=this.wcwidth(x),n=m===0&&E!==0;if(n){const h=_.UnicodeService.extractWidth(E);h===0?n=!1:h>m&&(m=h)}return _.UnicodeService.createPropertyValue(0,m,n)}}},5981:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;const _=d(8460),v=d(844);class l extends v.Disposable{constructor(x){super(),this._action=x,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(x,E){if(E!==void 0&&this._syncCalls>E)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let m;for(this._isSyncWriting=!0;m=this._writeBuffer.shift();){this._action(m);const n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,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+=x.length,this._writeBuffer.push(x),this._callbacks.push(E),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(E)}_innerWrite(x=0,E=!0){const m=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const n=this._writeBuffer[this._bufferOffset],h=this._action(n,E);if(h){const c=S=>Date.now()-m>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(m,S);return void h.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(c)}const u=this._callbacks[this._bufferOffset];if(u&&u(),this._bufferOffset++,this._pendingData-=n.length,Date.now()-m>=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=l},5941:(q,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(l,g){const x=l.toString(16),E=x.length<2?"0"+x:x;switch(g){case 4:return x[0];case 8:return E;case 12:return(E+E).slice(0,3);default:return E+E}}r.parseColor=function(l){if(!l)return;let g=l.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const x=d.exec(g);if(x){const E=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/E*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/E*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/E*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),_.exec(g)&&[3,6,9,12].includes(g.length))){const x=g.length/3,E=[0,0,0];for(let m=0;m<3;++m){const n=parseInt(g.slice(x*m,x*m+x),16);E[m]=x===1?n<<4:x===2?n:x===3?n>>4:n>>8}return E}},r.toRgbString=function(l,g=16){const[x,E,m]=l;return`rgb:${v(x,g)}/${v(E,g)}/${v(m,g)}`}},5770:(q,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;const _=d(482),v=d(8742),l=d(5770),g=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(E,m){this._handlers[E]===void 0&&(this._handlers[E]=[]);const n=this._handlers[E];return n.push(m),{dispose:()=>{const h=n.indexOf(m);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=g,this._ident=0}hook(E,m){if(this.reset(),this._ident=E,this._active=this._handlers[E]||g,this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(m);else this._handlerFb(this._ident,"HOOK",m)}put(E,m,n){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(E,m,n);else this._handlerFb(this._ident,"PUT",(0,_.utf32ToString)(E,m,n))}unhook(E,m=!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=m,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=g,this._ident=0}};const x=new v.Params;x.addParam(0),r.DcsHandler=class{constructor(E){this._handler=E,this._data="",this._params=x,this._hitLimit=!1}hook(E){this._params=E.length>1||E.params[0]?E.clone():x,this._data="",this._hitLimit=!1}put(E,m,n){this._hitLimit||(this._data+=(0,_.utf32ToString)(E,m,n),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(E){let m=!1;if(this._hitLimit)m=!1;else if(E&&(m=this._handler(this._data,this._params),m instanceof Promise))return m.then((n=>(this._params=x,this._data="",this._hitLimit=!1,n)));return this._params=x,this._data="",this._hitLimit=!1,m}}},2015:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;const _=d(844),v=d(8742),l=d(6242),g=d(6351);class x{constructor(h){this.table=new Uint8Array(h)}setDefault(h,u){this.table.fill(h<<4|u)}add(h,u,c,S){this.table[u<<8|h]=c<<4|S}addMany(h,u,c,S){for(let L=0;L<h.length;L++)this.table[u<<8|h[L]]=c<<4|S}}r.TransitionTable=x;const E=160;r.VT500_TRANSITION_TABLE=(function(){const n=new x(4095),h=Array.apply(null,Array(256)).map(((T,b)=>b)),u=(T,b)=>h.slice(T,b),c=u(32,127),S=u(0,24);S.push(25),S.push.apply(S,u(28,32));const L=u(0,14);let y;for(y in n.setDefault(1,0),n.addMany(c,0,2,0),L)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(S,0,3,0),n.addMany(S,1,3,1),n.add(127,1,0,1),n.addMany(S,8,0,8),n.addMany(S,3,3,3),n.add(127,3,0,3),n.addMany(S,4,3,4),n.add(127,4,0,4),n.addMany(S,6,3,6),n.addMany(S,5,3,5),n.add(127,5,0,5),n.addMany(S,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(S,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(S,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(S,11,0,11),n.addMany(u(32,128),11,0,11),n.addMany(u(28,32),11,0,11),n.addMany(S,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(S,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(S,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 m 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,S)=>{},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 l.OscParser),this._dcsParser=this.register(new g.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 L=0;L<h.intermediates.length;++L){const y=h.intermediates.charCodeAt(L);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 S=h.final.charCodeAt(0);if(u[0]>S||S>u[1])throw new Error(`final must be in range ${u[0]} .. ${u[1]}`);return c<<=8,c|=S,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 S=this._escHandlers[c];return S.push(u),{dispose:()=>{const L=S.indexOf(u);L!==-1&&S.splice(L,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 S=this._csiHandlers[c];return S.push(u),{dispose:()=>{const L=S.indexOf(u);L!==-1&&S.splice(L,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,S,L){this._parseStack.state=h,this._parseStack.handlers=u,this._parseStack.handlerPos=c,this._parseStack.transition=S,this._parseStack.chunkPos=L}parse(h,u,c){let S,L=0,y=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=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 R=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(c===!1&&R>-1){for(;R>=0&&(S=b[R](this._params),S!==!0);R--)if(S instanceof Promise)return this._parseStack.handlerPos=R,S}this._parseStack.handlers=[];break;case 4:if(c===!1&&R>-1){for(;R>=0&&(S=b[R](),S!==!0);R--)if(S instanceof Promise)return this._parseStack.handlerPos=R,S}this._parseStack.handlers=[];break;case 6:if(L=h[this._parseStack.chunkPos],S=this._dcsParser.unhook(L!==24&&L!==26,c),S)return S;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(L=h[this._parseStack.chunkPos],S=this._oscParser.end(L!==24&&L!==26,c),S)return S;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,T=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let b=T;b<u;++b){switch(L=h[b],y=this._transitions.table[this.currentState<<8|(L<160?L:E)],y>>4){case 2:for(let z=b+1;;++z){if(z>=u||(L=h[z])<32||L>126&&L<E){this._printHandler(h,b,z),b=z-1;break}if(++z>=u||(L=h[z])<32||L>126&&L<E){this._printHandler(h,b,z),b=z-1;break}if(++z>=u||(L=h[z])<32||L>126&&L<E){this._printHandler(h,b,z),b=z-1;break}if(++z>=u||(L=h[z])<32||L>126&&L<E){this._printHandler(h,b,z),b=z-1;break}}break;case 3:this._executeHandlers[L]?this._executeHandlers[L]():this._executeHandlerFb(L),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:b,code:L,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const R=this._csiHandlers[this._collect<<8|L];let k=R?R.length-1:-1;for(;k>=0&&(S=R[k](this._params),S!==!0);k--)if(S instanceof Promise)return this._preserveStack(3,R,k,y,b),S;k<0&&this._csiHandlerFb(this._collect<<8|L,this._params),this.precedingJoinState=0;break;case 8:do switch(L){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(L-48)}while(++b<u&&(L=h[b])>47&&L<60);b--;break;case 9:this._collect<<=8,this._collect|=L;break;case 10:const U=this._escHandlers[this._collect<<8|L];let H=U?U.length-1:-1;for(;H>=0&&(S=U[H](),S!==!0);H--)if(S instanceof Promise)return this._preserveStack(4,U,H,y,b),S;H<0&&this._escHandlerFb(this._collect<<8|L),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|L,this._params);break;case 13:for(let z=b+1;;++z)if(z>=u||(L=h[z])===24||L===26||L===27||L>127&&L<E){this._dcsParser.put(h,b,z),b=z-1;break}break;case 14:if(S=this._dcsParser.unhook(L!==24&&L!==26),S)return this._preserveStack(6,[],0,y,b),S;L===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 z=b+1;;z++)if(z>=u||(L=h[z])<32||L>127&&L<E){this._oscParser.put(h,b,z),b=z-1;break}break;case 6:if(S=this._oscParser.end(L!==24&&L!==26),S)return this._preserveStack(5,[],0,y,b),S;L===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&y}}}r.EscapeSequenceParser=m},6242:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;const _=d(5770),v=d(482),l=[];r.OscParser=class{constructor(){this._state=0,this._active=l,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,x){this._handlers[g]===void 0&&(this._handlers[g]=[]);const E=this._handlers[g];return E.push(x),{dispose:()=>{const m=E.indexOf(x);m!==-1&&E.splice(m,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=l}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=l,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||l,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,x,E){if(this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].put(g,x,E);else this._handlerFb(this._id,"PUT",(0,v.utf32ToString)(g,x,E))}start(){this.reset(),this._state=1}put(g,x,E){if(this._state!==3){if(this._state===1)for(;x<E;){const m=g[x++];if(m===59){this._state=2,this._start();break}if(m<48||57<m)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+m-48}this._state===2&&E-x>0&&this._put(g,x,E)}}end(g,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let E=!1,m=this._active.length-1,n=!1;if(this._stack.paused&&(m=this._stack.loopPosition-1,E=x,n=this._stack.fallThrough,this._stack.paused=!1),!n&&E===!1){for(;m>=0&&(E=this._active[m].end(g),E!==!0);m--)if(E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!1,E;m--}for(;m>=0;m--)if(E=this._active[m].end(!1),E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!0,E}else this._handlerFb(this._id,"END",g);this._active=l,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,x,E){this._hitLimit||(this._data+=(0,v.utf32ToString)(g,x,E),this._data.length>_.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let x=!1;if(this._hitLimit)x=!1;else if(g&&(x=this._handler(this._data),x instanceof Promise))return x.then((E=>(this._data="",this._hitLimit=!1,E)));return this._data="",this._hitLimit=!1,x}}},8742:(q,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;const d=2147483647;class _{static fromArray(l){const g=new _;if(!l.length)return g;for(let x=Array.isArray(l[0])?1:0;x<l.length;++x){const E=l[x];if(Array.isArray(E))for(let m=0;m<E.length;++m)g.addSubParam(E[m]);else g.addParam(E)}return g}constructor(l=32,g=32){if(this.maxLength=l,this.maxSubParamsLength=g,g>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(l),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(l),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const l=new _(this.maxLength,this.maxSubParamsLength);return l.params.set(this.params),l.length=this.length,l._subParams.set(this._subParams),l._subParamsLength=this._subParamsLength,l._subParamsIdx.set(this._subParamsIdx),l._rejectDigits=this._rejectDigits,l._rejectSubDigits=this._rejectSubDigits,l._digitIsSub=this._digitIsSub,l}toArray(){const l=[];for(let g=0;g<this.length;++g){l.push(this.params[g]);const x=this._subParamsIdx[g]>>8,E=255&this._subParamsIdx[g];E-x>0&&l.push(Array.prototype.slice.call(this._subParams,x,E))}return l}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(l){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=l>d?d:l}}addSubParam(l){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=l>d?d:l,this._subParamsIdx[this.length-1]++}}hasSubParams(l){return(255&this._subParamsIdx[l])-(this._subParamsIdx[l]>>8)>0}getSubParams(l){const g=this._subParamsIdx[l]>>8,x=255&this._subParamsIdx[l];return x-g>0?this._subParams.subarray(g,x):null}getSubParamsAll(){const l={};for(let g=0;g<this.length;++g){const x=this._subParamsIdx[g]>>8,E=255&this._subParamsIdx[g];E-x>0&&(l[g]=this._subParams.slice(x,E))}return l}addDigit(l){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,E=x[g-1];x[g-1]=~E?Math.min(10*E+l,d):l}}r.Params=_},5741:(q,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:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;const _=d(3785),v=d(511);r.BufferApiView=class{constructor(l,g){this._buffer=l,this.type=g}init(l){return this._buffer=l,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(l){const g=this._buffer.lines.get(l);if(g)return new _.BufferLineApiView(g)}getNullCell(){return new v.CellData}}},3785:(q,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,l){if(!(v<0||v>=this._line.length))return l?(this._line.loadCell(v,l),l):this._line.loadCell(v,new _.CellData)}translateToString(v,l,g){return this._line.translateToString(v,l,g)}}},8285:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;const _=d(8771),v=d(8460),l=d(844);class g extends l.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=g},7975:(q,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,l)=>_(v,l.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:(q,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(q,r,d){var _=this&&this.__decorate||function(n,h,u,c){var S,L=arguments.length,y=L<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 T=n.length-1;T>=0;T--)(S=n[T])&&(y=(L<3?S(y):L>3?S(h,u,y):S(h,u))||y);return L>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 l=d(8460),g=d(844),x=d(5295),E=d(2585);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let m=r.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(n){super(),this.isUserScrolling=!1,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new l.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 x.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 S=u.ybase+u.scrollTop,L=u.ybase+u.scrollBottom;if(u.scrollTop===0){const y=u.lines.isFull;L===u.lines.length-1?y?u.lines.recycle().copyFrom(c):u.lines.push(c.clone()):u.lines.splice(L+1,0,c.clone()),y?this.isUserScrolling&&(u.ydisp=Math.max(u.ydisp-1,0)):(u.ybase++,this.isUserScrolling||u.ydisp++)}else{const y=L-S+1;u.lines.shiftElements(S+1,y-1,-1),u.lines.set(L,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 S=c.ydisp;c.ydisp=Math.max(Math.min(c.ydisp+n,c.ybase),0),S!==c.ydisp&&(h||this._onScroll.fire(c.ydisp))}};r.BufferService=m=_([v(0,E.IOptionsService)],m)},7994:(q,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(q,r,d){var _=this&&this.__decorate||function(c,S,L,y){var T,b=arguments.length,R=b<3?S:y===null?y=Object.getOwnPropertyDescriptor(S,L):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(c,S,L,y);else for(var k=c.length-1;k>=0;k--)(T=c[k])&&(R=(b<3?T(R):b>3?T(S,L,R):T(S,L))||R);return b>3&&R&&Object.defineProperty(S,L,R),R},v=this&&this.__param||function(c,S){return function(L,y){S(L,y,c)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;const l=d(2585),g=d(8460),x=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 m(c,S){let L=(c.ctrl?16:0)|(c.shift?4:0)|(c.alt?8:0);return c.button===4?(L|=64,L|=c.action):(L|=3&c.button,4&c.button&&(L|=64),8&c.button&&(L|=128),c.action===32?L|=32:c.action!==0||S||(L|=3)),L}const n=String.fromCharCode,h={DEFAULT:c=>{const S=[m(c,!1)+32,c.col+32,c.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${n(S[0])}${n(S[1])}${n(S[2])}`},SGR:c=>{const S=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${m(c,!0)};${c.col};${c.row}${S}`},SGR_PIXELS:c=>{const S=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${m(c,!0)};${c.x};${c.y}${S}`}};let u=r.CoreMouseService=class extends x.Disposable{constructor(c,S){super(),this._bufferService=c,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const L of Object.keys(E))this.addProtocol(L,E[L]);for(const L of Object.keys(h))this.addEncoding(L,h[L]);this.reset()}addProtocol(c,S){this._protocols[c]=S}addEncoding(c,S){this._encodings[c]=S}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 S=this._encodings[this._activeEncoding](c);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!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,S,L){if(L){if(c.x!==S.x||c.y!==S.y)return!1}else if(c.col!==S.col||c.row!==S.row)return!1;return c.button===S.button&&c.action===S.action&&c.ctrl===S.ctrl&&c.alt===S.alt&&c.shift===S.shift}};r.CoreMouseService=u=_([v(0,l.IBufferService),v(1,l.ICoreService)],u)},6975:function(q,r,d){var _=this&&this.__decorate||function(u,c,S,L){var y,T=arguments.length,b=T<3?c:L===null?L=Object.getOwnPropertyDescriptor(c,S):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(u,c,S,L);else for(var R=u.length-1;R>=0;R--)(y=u[R])&&(b=(T<3?y(b):T>3?y(c,S,b):y(c,S))||b);return T>3&&b&&Object.defineProperty(c,S,b),b},v=this&&this.__param||function(u,c){return function(S,L){c(S,L,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;const l=d(1439),g=d(8460),x=d(844),E=d(2585),m=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 x.Disposable{constructor(u,c,S){super(),this._bufferService=u,this._logService=c,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,l.clone)(m),this.decPrivateModes=(0,l.clone)(n)}reset(){this.modes=(0,l.clone)(m),this.decPrivateModes=(0,l.clone)(n)}triggerDataEvent(u,c=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;c&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),c&&this._onUserInput.fire(),this._logService.debug(`sending data "${u}"`,(()=>u.split("").map((L=>L.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:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;const _=d(8055),v=d(8460),l=d(844),g=d(6106);let x=0,E=0;class m extends l.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.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,l.toDisposable)((()=>this.reset())))}registerDecoration(u){if(u.marker.isDisposed)return;const c=new n(u);if(c){const S=c.marker.onDispose((()=>c.dispose()));c.onDispose((()=>{c&&(this._decorations.delete(c)&&this._onDecorationRemoved.fire(c),S.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,S){let L=0,y=0;for(const T of this._decorations.getKeyIterator(c))L=T.options.x??0,y=L+(T.options.width??1),u>=L&&u<y&&(!S||(T.options.layer??"bottom")===S)&&(yield T)}forEachDecorationAtCell(u,c,S,L){this._decorations.forEachByKey(c,(y=>{x=y.options.x??0,E=x+(y.options.width??1),u>=x&&u<E&&(!S||(y.options.layer??"bottom")===S)&&L(y)}))}}r.DecorationService=m;class n extends l.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:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;const _=d(2585),v=d(8343);class l{constructor(...x){this._entries=new Map;for(const[E,m]of x)this.set(E,m)}set(x,E){const m=this._entries.get(x);return this._entries.set(x,E),m}forEach(x){for(const[E,m]of this._entries.entries())x(E,m)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}r.ServiceCollection=l,r.InstantiationService=class{constructor(){this._services=new l,this._services.set(_.IInstantiationService,this)}setService(g,x){this._services.set(g,x)}getService(g){return this._services.get(g)}createInstance(g,...x){const E=(0,v.getServiceDependencies)(g).sort(((h,u)=>h.index-u.index)),m=[];for(const h of E){const u=this._services.get(h.id);if(!u)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${h.id}.`);m.push(u)}const n=E.length>0?E[0].index:x.length;if(x.length!==n)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${n+1} conflicts with ${x.length} static arguments`);return new g(...x,...m)}}},7866:function(q,r,d){var _=this&&this.__decorate||function(n,h,u,c){var S,L=arguments.length,y=L<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 T=n.length-1;T>=0;T--)(S=n[T])&&(y=(L<3?S(y):L>3?S(h,u,y):S(h,u))||y);return L>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 l=d(844),g=d(2585),x={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let E,m=r.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),E=this}_updateLogLevel(){this._logLevel=x[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<=g.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,n,h)}debug(n,...h){this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,n,h)}info(n,...h){this._logLevel<=g.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,n,h)}warn(n,...h){this._logLevel<=g.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,n,h)}error(n,...h){this._logLevel<=g.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,n,h)}};r.LogService=m=_([v(0,g.IOptionsService)],m),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(...S){if(E.logLevel!==g.LogLevelEnum.TRACE)return c.apply(this,S);E.trace(`GlyphRenderer#${c.name}(${S.map((y=>JSON.stringify(y))).join(", ")})`);const L=c.apply(this,S);return E.trace(`GlyphRenderer#${c.name} return`,L),L}}},7302:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;const _=d(8460),v=d(844),l=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:l.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class x extends v.Disposable{constructor(m){super(),this._onOptionChange=this.register(new _.EventEmitter),this.onOptionChange=this._onOptionChange.event;const n={...r.DEFAULT_OPTIONS};for(const h in m)if(h in n)try{const u=m[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(m,n){return this.onOptionChange((h=>{h===m&&n(this.rawOptions[m])}))}onMultipleOptionChange(m,n){return this.onOptionChange((h=>{m.indexOf(h)!==-1&&n()}))}_setupOptions(){const m=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:m.bind(this,h),set:n.bind(this,h)};Object.defineProperty(this.options,h,u)}}_sanitizeAndValidateOption(m,n){switch(m){case"cursorStyle":if(n||(n=r.DEFAULT_OPTIONS[m]),!(function(h){return h==="block"||h==="underline"||h==="bar"})(n))throw new Error(`"${n}" is not a valid value for ${m}`);break;case"wordSeparator":n||(n=r.DEFAULT_OPTIONS[m]);break;case"fontWeight":case"fontWeightBold":if(typeof n=="number"&&1<=n&&n<=1e3)break;n=g.includes(n)?n:r.DEFAULT_OPTIONS[m];break;case"cursorWidth":n=Math.floor(n);case"lineHeight":case"tabStopWidth":if(n<1)throw new Error(`${m} 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(`${m} cannot be less than 0, value: ${n}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(n<=0)throw new Error(`${m} cannot be less than or equal to 0, value: ${n}`);break;case"rows":case"cols":if(!n&&n!==0)throw new Error(`${m} must be numeric, value: ${n}`);break;case"windowsPty":n=n??{}}return n}}r.OptionsService=x},2660:function(q,r,d){var _=this&&this.__decorate||function(x,E,m,n){var h,u=arguments.length,c=u<3?E:n===null?n=Object.getOwnPropertyDescriptor(E,m):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(x,E,m,n);else for(var S=x.length-1;S>=0;S--)(h=x[S])&&(c=(u<3?h(c):u>3?h(E,m,c):h(E,m))||c);return u>3&&c&&Object.defineProperty(E,m,c),c},v=this&&this.__param||function(x,E){return function(m,n){E(m,n,x)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;const l=d(2585);let g=r.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const E=this._bufferService.buffer;if(x.id===void 0){const S=E.addMarker(E.ybase+E.y),L={data:x,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(L,S))),this._dataByLinkId.set(L.id,L),L.id}const m=x,n=this._getEntryIdKey(m),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(m),data:m,lines:[u]};return u.onDispose((()=>this._removeMarkerFromLink(c,u))),this._entriesWithId.set(c.key,c),this._dataByLinkId.set(c.id,c),c.id}addLineToLink(x,E){const m=this._dataByLinkId.get(x);if(m&&m.lines.every((n=>n.line!==E))){const n=this._bufferService.buffer.addMarker(E);m.lines.push(n),n.onDispose((()=>this._removeMarkerFromLink(m,n)))}}getLinkData(x){return this._dataByLinkId.get(x)?.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,E){const m=x.lines.indexOf(E);m!==-1&&(x.lines.splice(m,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};r.OscLinkService=g=_([v(0,l.IBufferService)],g)},8343:(q,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 l=function(g,x,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(m,n,h){n[d]===n?n[_].push({id:m,index:h}):(n[_]=[{id:m,index:h}],n[d]=n)})(l,g,E)};return l.toString=()=>v,r.serviceRegistry.set(v,l),l}},2585:(q,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(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.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:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;const _=d(8460),v=d(225);class l{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,E,m=!1){return(16777215&x)<<3|(3&E)<<1|(m?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new _.EventEmitter,this.onChange=this._onChange.event;const x=new v.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let E=0,m=0;const n=x.length;for(let h=0;h<n;++h){let u=x.charCodeAt(h);if(55296<=u&&u<=56319){if(++h>=n)return E+this.wcwidth(u);const L=x.charCodeAt(h);56320<=L&&L<=57343?u=1024*(u-55296)+L-56320+65536:E+=this.wcwidth(L)}const c=this.charProperties(u,m);let S=l.extractWidth(c);l.extractShouldJoin(c)&&(S-=l.extractWidth(m)),E+=S,m=c}return E}charProperties(x,E){return this._activeProvider.charProperties(x,E)}}r.UnicodeService=l}},M={};function j(q){var r=M[q];if(r!==void 0)return r.exports;var d=M[q]={exports:{}};return A[q].call(d.exports,d,d.exports,j),d.exports}var G={};return(()=>{var q=G;Object.defineProperty(q,"__esModule",{value:!0}),q.Terminal=void 0;const r=j(9042),d=j(3236),_=j(844),v=j(5741),l=j(8285),g=j(7975),x=j(7090),E=["cols","rows"];class m 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=S=>this._core.options[S],c=(S,L)=>{this._checkReadonlyOptions(S),this._core.options[S]=L};for(const S in this._core.options){const L={get:u.bind(this,S),set:c.bind(this,S)};Object.defineProperty(this._publicOptions,S,L)}}_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 g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new x.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 l.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")}}q.Terminal=m})(),G})()))})(uu)),uu.exports}var kv=Dv(),du={exports:{}},$_;function Ov(){return $_||($_=1,(function(a,w){(function(A,M){a.exports=M()})(self,(()=>(()=>{var A={};return(()=>{var M=A;Object.defineProperty(M,"__esModule",{value:!0}),M.FitAddon=void 0,M.FitAddon=class{activate(j){this._terminal=j}dispose(){}fit(){const j=this.proposeDimensions();if(!j||!this._terminal||isNaN(j.cols)||isNaN(j.rows))return;const G=this._terminal._core;this._terminal.rows===j.rows&&this._terminal.cols===j.cols||(G._renderService.clear(),this._terminal.resize(j.cols,j.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const j=this._terminal._core,G=j._renderService.dimensions;if(G.css.cell.width===0||G.css.cell.height===0)return;const q=this._terminal.options.scrollback===0?0:j.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),l=d-(parseInt(v.getPropertyValue("padding-top"))+parseInt(v.getPropertyValue("padding-bottom"))),g=_-(parseInt(v.getPropertyValue("padding-right"))+parseInt(v.getPropertyValue("padding-left")))-q;return{cols:Math.max(2,Math.floor(g/G.css.cell.width)),rows:Math.max(1,Math.floor(l/G.css.cell.height))}}}})(),A})()))})(du)),du.exports}var Bv=Ov(),fu={exports:{}},F_;function jv(){return F_||(F_=1,(function(a,w){(function(A,M){a.exports=M()})(self,(()=>(()=>{var A={965:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.GlyphRenderer=void 0;const _=d(374),v=d(509),l=d(855),g=d(859),x=d(381),E=11,m=E*Float32Array.BYTES_PER_ELEMENT;let n,h=0,u=0,c=0;class S extends g.Disposable{constructor(y,T,b,R){super(),this._terminal=y,this._gl=T,this._dimensions=b,this._optionsService=R,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const k=this._gl;v.TextureAtlas.maxAtlasPages===void 0&&(v.TextureAtlas.maxAtlasPages=Math.min(32,(0,_.throwIfFalsy)(k.getParameter(k.MAX_TEXTURE_IMAGE_UNITS))),v.TextureAtlas.maxTextureSize=(0,_.throwIfFalsy)(k.getParameter(k.MAX_TEXTURE_SIZE))),this._program=(0,_.throwIfFalsy)((0,x.createProgram)(k,`#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(K){let X="";for(let I=1;I<K;I++)X+=` else if (v_texpage == ${I}) { outColor = texture(u_texture[${I}], 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[${K}];
|
|
44
|
+
|
|
45
|
+
out vec4 outColor;
|
|
46
|
+
|
|
47
|
+
void main() {
|
|
48
|
+
if (v_texpage == 0) {
|
|
49
|
+
outColor = texture(u_texture[0], v_texcoord);
|
|
50
|
+
} ${X}
|
|
51
|
+
}`})(v.TextureAtlas.maxAtlasPages))),this.register((0,g.toDisposable)((()=>k.deleteProgram(this._program)))),this._projectionLocation=(0,_.throwIfFalsy)(k.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,_.throwIfFalsy)(k.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,_.throwIfFalsy)(k.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=k.createVertexArray(),k.bindVertexArray(this._vertexArrayObject);const U=new Float32Array([0,0,1,0,0,1,1,1]),H=k.createBuffer();this.register((0,g.toDisposable)((()=>k.deleteBuffer(H)))),k.bindBuffer(k.ARRAY_BUFFER,H),k.bufferData(k.ARRAY_BUFFER,U,k.STATIC_DRAW),k.enableVertexAttribArray(0),k.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const z=new Uint8Array([0,1,2,3]),V=k.createBuffer();this.register((0,g.toDisposable)((()=>k.deleteBuffer(V)))),k.bindBuffer(k.ELEMENT_ARRAY_BUFFER,V),k.bufferData(k.ELEMENT_ARRAY_BUFFER,z,k.STATIC_DRAW),this._attributesBuffer=(0,_.throwIfFalsy)(k.createBuffer()),this.register((0,g.toDisposable)((()=>k.deleteBuffer(this._attributesBuffer)))),k.bindBuffer(k.ARRAY_BUFFER,this._attributesBuffer),k.enableVertexAttribArray(2),k.vertexAttribPointer(2,2,k.FLOAT,!1,m,0),k.vertexAttribDivisor(2,1),k.enableVertexAttribArray(3),k.vertexAttribPointer(3,2,k.FLOAT,!1,m,2*Float32Array.BYTES_PER_ELEMENT),k.vertexAttribDivisor(3,1),k.enableVertexAttribArray(4),k.vertexAttribPointer(4,1,k.FLOAT,!1,m,4*Float32Array.BYTES_PER_ELEMENT),k.vertexAttribDivisor(4,1),k.enableVertexAttribArray(5),k.vertexAttribPointer(5,2,k.FLOAT,!1,m,5*Float32Array.BYTES_PER_ELEMENT),k.vertexAttribDivisor(5,1),k.enableVertexAttribArray(6),k.vertexAttribPointer(6,2,k.FLOAT,!1,m,7*Float32Array.BYTES_PER_ELEMENT),k.vertexAttribDivisor(6,1),k.enableVertexAttribArray(1),k.vertexAttribPointer(1,2,k.FLOAT,!1,m,9*Float32Array.BYTES_PER_ELEMENT),k.vertexAttribDivisor(1,1),k.useProgram(this._program);const re=new Int32Array(v.TextureAtlas.maxAtlasPages);for(let K=0;K<v.TextureAtlas.maxAtlasPages;K++)re[K]=K;k.uniform1iv(this._textureLocation,re),k.uniformMatrix4fv(this._projectionLocation,!1,x.PROJECTION_MATRIX),this._atlasTextures=[];for(let K=0;K<v.TextureAtlas.maxAtlasPages;K++){const X=new x.GLTexture((0,_.throwIfFalsy)(k.createTexture()));this.register((0,g.toDisposable)((()=>k.deleteTexture(X.texture)))),k.activeTexture(k.TEXTURE0+K),k.bindTexture(k.TEXTURE_2D,X.texture),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_WRAP_S,k.CLAMP_TO_EDGE),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_WRAP_T,k.CLAMP_TO_EDGE),k.texImage2D(k.TEXTURE_2D,0,k.RGBA,1,1,0,k.RGBA,k.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[K]=X}k.enable(k.BLEND),k.blendFunc(k.SRC_ALPHA,k.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(y,T,b,R,k,U,H,z,V){this._updateCell(this._vertices.attributes,y,T,b,R,k,U,H,z,V)}_updateCell(y,T,b,R,k,U,H,z,V,re){h=(b*this._terminal.cols+T)*E,R!==l.NULL_CELL_CODE&&R!==void 0?this._atlas&&(n=z&&z.length>1?this._atlas.getRasterizedGlyphCombinedChar(z,k,U,H,!1):this._atlas.getRasterizedGlyph(R,k,U,H,!1),u=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),k!==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)(R,V,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,T=y.cols*y.rows*E;this._vertices.count!==T?this._vertices.attributes=new Float32Array(T):this._vertices.attributes.fill(0);let b=0;for(;b<this._vertices.attributesBuffers.length;b++)this._vertices.count!==T?this._vertices.attributesBuffers[b]=new Float32Array(T):this._vertices.attributesBuffers[b].fill(0);this._vertices.count=T,b=0;for(let R=0;R<y.rows;R++)for(let k=0;k<y.cols;k++)this._vertices.attributes[b+9]=k/y.cols,this._vertices.attributes[b+10]=R/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 T=this._gl;T.useProgram(this._program),T.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const b=this._vertices.attributesBuffers[this._activeBuffer];let R=0;for(let k=0;k<y.lineLengths.length;k++){const U=k*this._terminal.cols*E,H=this._vertices.attributes.subarray(U,U+y.lineLengths[k]*E);b.set(H,R),R+=H.length}T.bindBuffer(T.ARRAY_BUFFER,this._attributesBuffer),T.bufferData(T.ARRAY_BUFFER,b.subarray(0,R),T.STREAM_DRAW);for(let k=0;k<this._atlas.pages.length;k++)this._atlas.pages[k].version!==this._atlasTextures[k].version&&this._bindAtlasPageTexture(T,this._atlas,k);T.drawElementsInstanced(T.TRIANGLE_STRIP,4,T.UNSIGNED_BYTE,0,R/E)}setAtlas(y){this._atlas=y;for(const T of this._atlasTextures)T.version=-1}_bindAtlasPageTexture(y,T,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,T.pages[b].canvas),y.generateMipmap(y.TEXTURE_2D),this._atlasTextures[b].version=T.pages[b].version}setDimensions(y){this._dimensions=y}}r.GlyphRenderer=S},742:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RectangleRenderer=void 0;const _=d(374),v=d(859),l=d(310),g=d(381),x=8*Float32Array.BYTES_PER_ELEMENT;class E{constructor(){this.attributes=new Float32Array(160),this.count=0}}let m=0,n=0,h=0,u=0,c=0,S=0,L=0;class y extends v.Disposable{constructor(b,R,k,U){super(),this._terminal=b,this._gl=R,this._dimensions=k,this._themeService=U,this._vertices=new E,this._verticesCursor=new E;const H=this._gl;this._program=(0,_.throwIfFalsy)((0,g.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 z=new Float32Array([0,0,1,0,0,1,1,1]),V=H.createBuffer();this.register((0,v.toDisposable)((()=>H.deleteBuffer(V)))),H.bindBuffer(H.ARRAY_BUFFER,V),H.bufferData(H.ARRAY_BUFFER,z,H.STATIC_DRAW),H.enableVertexAttribArray(3),H.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const re=new Uint8Array([0,1,2,3]),K=H.createBuffer();this.register((0,v.toDisposable)((()=>H.deleteBuffer(K)))),H.bindBuffer(H.ELEMENT_ARRAY_BUFFER,K),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,x,0),H.vertexAttribDivisor(0,1),H.enableVertexAttribArray(1),H.vertexAttribPointer(1,2,H.FLOAT,!1,x,2*Float32Array.BYTES_PER_ELEMENT),H.vertexAttribDivisor(1,1),H.enableVertexAttribArray(2),H.vertexAttribPointer(2,4,H.FLOAT,!1,x,4*Float32Array.BYTES_PER_ELEMENT),H.vertexAttribDivisor(2,1),this._updateCachedColors(U.colors),this.register(this._themeService.onChangeColors((X=>{this._updateCachedColors(X),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(b){const R=this._gl;R.useProgram(this._program),R.bindVertexArray(this._vertexArrayObject),R.uniformMatrix4fv(this._projectionLocation,!1,g.PROJECTION_MATRIX),R.bindBuffer(R.ARRAY_BUFFER,this._attributesBuffer),R.bufferData(R.ARRAY_BUFFER,b.attributes,R.DYNAMIC_DRAW),R.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,R.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 R=this._terminal,k=this._vertices;let U,H,z,V,re,K,X,I,B,F,O,$=1;for(U=0;U<R.rows;U++){for(z=-1,V=0,re=0,K=!1,H=0;H<R.cols;H++)X=(U*R.cols+H)*l.RENDER_MODEL_INDICIES_PER_CELL,I=b.cells[X+l.RENDER_MODEL_BG_OFFSET],B=b.cells[X+l.RENDER_MODEL_FG_OFFSET],F=!!(67108864&B),(I!==V||B!==re&&(K||F))&&((V!==0||K&&re!==0)&&(O=8*$++,this._updateRectangle(k,O,re,V,z,H,U)),z=H,V=I,re=B,K=F);(V!==0||K&&re!==0)&&(O=8*$++,this._updateRectangle(k,O,re,V,z,R.cols,U))}k.count=$}updateCursor(b){const R=this._verticesCursor,k=b.cursor;if(!k||k.style==="block")return void(R.count=0);let U,H=0;k.style!=="bar"&&k.style!=="outline"||(U=8*H++,this._addRectangleFloat(R.attributes,U,k.x*this._dimensions.device.cell.width,k.y*this._dimensions.device.cell.height,k.style==="bar"?k.dpr*k.cursorWidth:k.dpr,this._dimensions.device.cell.height,this._cursorFloat)),k.style!=="underline"&&k.style!=="outline"||(U=8*H++,this._addRectangleFloat(R.attributes,U,k.x*this._dimensions.device.cell.width,(k.y+1)*this._dimensions.device.cell.height-k.dpr,k.width*this._dimensions.device.cell.width,k.dpr,this._cursorFloat)),k.style==="outline"&&(U=8*H++,this._addRectangleFloat(R.attributes,U,k.x*this._dimensions.device.cell.width,k.y*this._dimensions.device.cell.height,k.width*this._dimensions.device.cell.width,k.dpr,this._cursorFloat),U=8*H++,this._addRectangleFloat(R.attributes,U,(k.x+k.width)*this._dimensions.device.cell.width-k.dpr,k.y*this._dimensions.device.cell.height,k.dpr,this._dimensions.device.cell.height,this._cursorFloat)),R.count=H}_updateRectangle(b,R,k,U,H,z,V){if(67108864&k)switch(50331648&k){case 16777216:case 33554432:m=this._themeService.colors.ansi[255&k].rgba;break;case 50331648:m=(16777215&k)<<8;break;default:m=this._themeService.colors.foreground.rgba}else switch(50331648&U){case 16777216:case 33554432:m=this._themeService.colors.ansi[255&U].rgba;break;case 50331648:m=(16777215&U)<<8;break;default:m=this._themeService.colors.background.rgba}b.attributes.length<R+4&&(b.attributes=(0,g.expandFloat32Array)(b.attributes,this._terminal.rows*this._terminal.cols*8)),n=H*this._dimensions.device.cell.width,h=V*this._dimensions.device.cell.height,u=(m>>24&255)/255,c=(m>>16&255)/255,S=(m>>8&255)/255,L=1,this._addRectangle(b.attributes,R,n,h,(z-H)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,u,c,S,L)}_addRectangle(b,R,k,U,H,z,V,re,K,X){b[R]=k/this._dimensions.device.canvas.width,b[R+1]=U/this._dimensions.device.canvas.height,b[R+2]=H/this._dimensions.device.canvas.width,b[R+3]=z/this._dimensions.device.canvas.height,b[R+4]=V,b[R+5]=re,b[R+6]=K,b[R+7]=X}_addRectangleFloat(b,R,k,U,H,z,V){b[R]=k/this._dimensions.device.canvas.width,b[R+1]=U/this._dimensions.device.canvas.height,b[R+2]=H/this._dimensions.device.canvas.width,b[R+3]=z/this._dimensions.device.canvas.height,b[R+4]=V[0],b[R+5]=V[1],b[R+6]=V[2],b[R+7]=V[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:(q,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,l){const g=v*l*r.RENDER_MODEL_INDICIES_PER_CELL;g!==this.cells.length&&(this.cells=new Uint32Array(g),this.lineLengths=new Uint32Array(l))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.JoinedCellData=r.WebglRenderer=void 0;const _=d(820),v=d(274),l=d(627),g=d(457),x=d(56),E=d(374),m=d(345),n=d(859),h=d(147),u=d(782),c=d(855),S=d(965),L=d(742),y=d(310),T=d(733);class b extends n.Disposable{constructor(H,z,V,re,K,X,I,B,F){super(),this._terminal=H,this._characterJoinerService=z,this._charSizeService=V,this._coreBrowserService=re,this._coreService=K,this._decorationService=X,this._optionsService=I,this._themeService=B,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 m.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new m.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new m.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new m.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new m.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 T.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,I,this._themeService)],this.dimensions=(0,E.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(I.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const O={antialias:!1,depth:!1,preserveDrawingBuffer:F};if(this._gl=this._canvas.getContext("webgl2",O),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,_.addDisposableDomListener)(this._canvas,"webglcontextlost",($=>{console.log("webglcontextlost event received"),$.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire($)}),3e3)}))),this.register((0,_.addDisposableDomListener)(this._canvas,"webglcontextrestored",($=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,l.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,x.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,(($,te)=>this._setCanvasDevicePixelDimensions($,te))),this.register(this._coreBrowserService.onWindowChange(($=>{this._observerDisposable.value=(0,x.observeDevicePixelDimensions)(this._canvas,$,((te,se)=>this._setCanvasDevicePixelDimensions(te,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 $ of this._renderLayers)$.dispose();this._canvas.parentElement?.removeChild(this._canvas),(0,l.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,z){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const V of this._renderLayers)V.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,z,V){for(const re of this._renderLayers)re.handleSelectionChanged(this._terminal,H,z,V);this._model.selection.update(this._core,H,z,V),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 L.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new S.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,l.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,m.forwardEvent)(H.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,m.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,z){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 V of this._renderLayers)V.handleGridChanged(this._terminal,H,z);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(H,z),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 g.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(H,z){const V=this._core;let re,K,X,I,B,F,O,$,te,se,ue,me,Z,W,ae=this._workCell;H=k(H,V.rows-1,0),z=k(z,V.rows-1,0);const fe=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,we=fe-V.buffer.ydisp,Ce=Math.min(this._terminal.buffer.active.cursorX,V.cols-1);let Ne=-1;const Le=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let ze=!1;for(K=H;K<=z;K++)for(X=K+V.buffer.ydisp,I=V.buffer.lines.get(X),this._model.lineLengths[K]=0,B=this._characterJoinerService.getJoinedCharacters(X),Z=0;Z<V.cols;Z++)if(re=this._cellColorResolver.result.bg,I.loadCell(Z,ae),Z===0&&(re=this._cellColorResolver.result.bg),F=!1,O=Z,B.length>0&&Z===B[0][0]&&(F=!0,$=B.shift(),ae=new R(ae,I.translateToString(!0,$[0],$[1]),$[1]-$[0]),O=$[1]-1),te=ae.getChars(),se=ae.getCode(),me=(K*V.cols+Z)*y.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(ae,Z,X,this.dimensions.device.cell.width),Le&&X===fe&&(Z===Ce&&(this._model.cursor={x:Ce,y:we,width:ae.getWidth(),style:this._coreBrowserService.isFocused?V.options.cursorStyle||"block":V.options.cursorInactiveStyle,cursorWidth:V.options.cursorWidth,dpr:this._devicePixelRatio},Ne=Ce+ae.getWidth()-1),Z>=Ce&&Z<=Ne&&(this._coreBrowserService.isFocused&&(V.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&V.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[K]=Z+1),(this._model.cells[me]!==se||this._model.cells[me+y.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[me+y.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[me+y.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(ze=!0,te.length>1&&(se|=y.COMBINED_CHAR_BIT_MASK),this._model.cells[me]=se,this._model.cells[me+y.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[me+y.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[me+y.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,ue=ae.getWidth(),this._glyphRenderer.value.updateCell(Z,K,se,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,te,ue,re),F))for(ae=this._workCell,Z++;Z<O;Z++)W=(K*V.cols+Z)*y.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(Z,K,c.NULL_CELL_CODE,0,0,0,c.NULL_CELL_CHAR,0,0),this._model.cells[W]=c.NULL_CELL_CODE,this._model.cells[W+y.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[W+y.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[W+y.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;ze&&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,z){this._canvas.width===H&&this._canvas.height===z||(this._canvas.width=H,this._canvas.height=z,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 R extends h.AttributeData{constructor(H,z,V){super(),this.content=0,this.combinedData="",this.fg=H.fg,this.bg=H.bg,this.combinedData=z,this._width=V}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 k(U,H,z=0){return Math.max(Math.min(U,H),z)}r.JoinedCellData=R},381:(q,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(l,g,x){const E=(0,_.throwIfFalsy)(l.createShader(g));if(l.shaderSource(E,x),l.compileShader(E),l.getShaderParameter(E,l.COMPILE_STATUS))return E;console.error(l.getShaderInfoLog(E)),l.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(l,g,x){const E=(0,_.throwIfFalsy)(l.createProgram());if(l.attachShader(E,(0,_.throwIfFalsy)(v(l,l.VERTEX_SHADER,g))),l.attachShader(E,(0,_.throwIfFalsy)(v(l,l.FRAGMENT_SHADER,x))),l.linkProgram(E),l.getProgramParameter(E,l.LINK_STATUS))return E;console.error(l.getProgramInfoLog(E)),l.deleteProgram(E)},r.createShader=v,r.expandFloat32Array=function(l,g){const x=Math.min(2*l.length,g),E=new Float32Array(x);for(let m=0;m<l.length;m++)E[m]=l[m];return E},r.GLTexture=class{constructor(l){this.texture=l,this.version=-1}}},592:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BaseRenderLayer=void 0;const _=d(627),v=d(237),l=d(374),g=d(859);class x extends g.Disposable{constructor(m,n,h,u,c,S,L,y){super(),this._container=n,this._alpha=c,this._coreBrowserService=S,this._optionsService=L,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((T=>{this._refreshCharAtlas(m,T),this.reset(m)}))),this.register((0,g.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,l.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(m){}handleFocus(m){}handleCursorMove(m){}handleGridChanged(m,n,h){}handleSelectionChanged(m,n,h,u=!1){}_setTransparency(m,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(m,this._themeService.colors),this.handleGridChanged(m,0,m.rows-1)}_refreshCharAtlas(m,n){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,_.acquireTextureAtlas)(m,this._optionsService.rawOptions,n,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(m,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(m,this._themeService.colors)}_fillBottomLineAtCells(m,n,h=1){this._ctx.fillRect(m*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(m,n,h,u){this._alpha?this._ctx.clearRect(m*this._deviceCellWidth,n*this._deviceCellHeight,h*this._deviceCellWidth,u*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(m*this._deviceCellWidth,n*this._deviceCellHeight,h*this._deviceCellWidth,u*this._deviceCellHeight))}_fillCharTrueColor(m,n,h,u){this._ctx.font=this._getFont(m,!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(m,n,h){this._ctx.beginPath(),this._ctx.rect(m*this._deviceCellWidth,n*this._deviceCellHeight,h*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(m,n,h){return`${h?"italic":""} ${n?m.options.fontWeightBold:m.options.fontWeight} ${m.options.fontSize*this._coreBrowserService.dpr}px ${m.options.fontFamily}`}}r.BaseRenderLayer=x},733:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkRenderLayer=void 0;const _=d(197),v=d(237),l=d(592);class g extends l.BaseRenderLayer{constructor(E,m,n,h,u,c,S){super(n,E,"link",m,!0,u,c,S),this.register(h.onShowLinkUnderline((L=>this._handleShowLinkUnderline(L)))),this.register(h.onHideLinkUnderline((L=>this._handleHideLinkUnderline(L))))}resize(E,m){super.resize(E,m),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 m=E.y1+1;m<E.y2;m++)this._fillBottomLineAtCells(0,m,E.cols);this._fillBottomLineAtCells(0,E.y2,E.x2)}this._state=E}_handleHideLinkUnderline(E){this._clearCurrentLink()}}r.LinkRenderLayer=g},820:(q,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(d,_,v,l){d.addEventListener(_,v,l);let g=!1;return{dispose:()=>{g||(g=!0,d.removeEventListener(_,v,l))}}}},274:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellColorResolver=void 0;const _=d(855),v=d(160),l=d(374);let g,x=0,E=0,m=!1,n=!1,h=!1,u=0;r.CellColorResolver=class{constructor(c,S,L,y,T,b){this._terminal=c,this._optionService=S,this._selectionRenderModel=L,this._decorationService=y,this._coreBrowserService=T,this._themeService=b,this.result={fg:0,bg:0,ext:0}}resolve(c,S,L,y){if(this.result.bg=c.bg,this.result.fg=c.fg,this.result.ext=268435456&c.bg?c.extended.ext:0,E=0,x=0,n=!1,m=!1,h=!1,g=this._themeService.colors,u=0,c.getCode()!==_.NULL_CELL_CODE&&c.extended.underlineStyle===4){const T=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));u=S*y%(2*Math.round(T))}if(this._decorationService.forEachDecorationAtCell(S,L,"bottom",(T=>{T.backgroundColorRGB&&(E=T.backgroundColorRGB.rgba>>8&16777215,n=!0),T.foregroundColorRGB&&(x=T.foregroundColorRGB.rgba>>8&16777215,m=!0)})),h=this._selectionRenderModel.isCellSelected(this._terminal,S,L),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?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else E=(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(n=!0,g.selectionForeground&&(x=g.selectionForeground.rgba>>8&16777215,m=!0),(0,l.treatGlyphAsBackgroundColor)(c.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)x=(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:x=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:x=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:x=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:x=(16777215&this.result.fg)<<8|255;break;default:x=this._themeService.colors.foreground.rgba}x=v.rgba.blend(x,4294967040&(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}m=!0}}this._decorationService.forEachDecorationAtCell(S,L,"top",(T=>{T.backgroundColorRGB&&(E=T.backgroundColorRGB.rgba>>8&16777215,n=!0),T.foregroundColorRGB&&(x=T.foregroundColorRGB.rgba>>8&16777215,m=!0)})),n&&(E=h?-16777216&c.bg&-134217729|E|50331648:-16777216&c.bg|E|50331648),m&&(x=-16777216&c.fg&-67108865|x|50331648),67108864&this.result.fg&&(n&&!m&&(x=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&g.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,m=!0),!n&&m&&(E=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&g.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,n=!0)),g=void 0,this.result.bg=n?E:this.result.bg,this.result.fg=m?x:this.result.fg,this.result.ext&=536870911,this.result.ext|=u<<29&3758096384}}},627:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.removeTerminalFromCache=r.acquireTextureAtlas=void 0;const _=d(509),v=d(197),l=[];r.acquireTextureAtlas=function(g,x,E,m,n,h,u,c){const S=(0,v.generateConfig)(m,n,h,u,x,E,c);for(let T=0;T<l.length;T++){const b=l[T],R=b.ownedBy.indexOf(g);if(R>=0){if((0,v.configEquals)(b.config,S))return b.atlas;b.ownedBy.length===1?(b.atlas.dispose(),l.splice(T,1)):b.ownedBy.splice(R,1);break}}for(let T=0;T<l.length;T++){const b=l[T];if((0,v.configEquals)(b.config,S))return b.ownedBy.push(g),b.atlas}const L=g._core,y={atlas:new _.TextureAtlas(document,S,L.unicodeService),config:S,ownedBy:[g]};return l.push(y),y.atlas},r.removeTerminalFromCache=function(g){for(let x=0;x<l.length;x++){const E=l[x].ownedBy.indexOf(g);if(E!==-1){l[x].ownedBy.length===1?(l[x].atlas.dispose(),l.splice(x,1)):l[x].ownedBy.splice(E,1);break}}}},197:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.is256Color=r.configEquals=r.generateConfig=void 0;const _=d(160);r.generateConfig=function(v,l,g,x,E,m,n){const h={foreground:m.foreground,background:m.background,cursor:_.NULL_COLOR,cursorAccent:_.NULL_COLOR,selectionForeground:_.NULL_COLOR,selectionBackgroundTransparent:_.NULL_COLOR,selectionBackgroundOpaque:_.NULL_COLOR,selectionInactiveBackgroundTransparent:_.NULL_COLOR,selectionInactiveBackgroundOpaque:_.NULL_COLOR,ansi:m.ansi.slice(),contrastCache:m.contrastCache,halfContrastCache:m.halfContrastCache};return{customGlyphs:E.customGlyphs,devicePixelRatio:n,letterSpacing:E.letterSpacing,lineHeight:E.lineHeight,deviceCellWidth:v,deviceCellHeight:l,deviceCharWidth:g,deviceCharHeight:x,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,l){for(let g=0;g<v.colors.ansi.length;g++)if(v.colors.ansi[g].rgba!==l.colors.ansi[g].rgba)return!1;return v.devicePixelRatio===l.devicePixelRatio&&v.customGlyphs===l.customGlyphs&&v.lineHeight===l.lineHeight&&v.letterSpacing===l.letterSpacing&&v.fontFamily===l.fontFamily&&v.fontSize===l.fontSize&&v.fontWeight===l.fontWeight&&v.fontWeightBold===l.fontWeightBold&&v.allowTransparency===l.allowTransparency&&v.deviceCharWidth===l.deviceCharWidth&&v.deviceCharHeight===l.deviceCharHeight&&v.drawBoldTextInBrightColors===l.drawBoldTextInBrightColors&&v.minimumContrastRatio===l.minimumContrastRatio&&v.colors.foreground.rgba===l.colors.foreground.rgba&&v.colors.background.rgba===l.colors.background.rgba},r.is256Color=function(v){return(50331648&v)==16777216||(50331648&v)==33554432}},237:(q,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:(q,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:(q,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:(m,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"║":{1:(m,n)=>`M${.5-m},0 L${.5-m},1 M${.5+m},0 L${.5+m},1`},"╒":{1:(m,n)=>`M.5,1 L.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╓":{1:(m,n)=>`M${.5-m},1 L${.5-m},.5 L1,.5 M${.5+m},.5 L${.5+m},1`},"╔":{1:(m,n)=>`M1,${.5-n} L${.5-m},${.5-n} L${.5-m},1 M1,${.5+n} L${.5+m},${.5+n} L${.5+m},1`},"╕":{1:(m,n)=>`M0,${.5-n} L.5,${.5-n} L.5,1 M0,${.5+n} L.5,${.5+n}`},"╖":{1:(m,n)=>`M${.5+m},1 L${.5+m},.5 L0,.5 M${.5-m},.5 L${.5-m},1`},"╗":{1:(m,n)=>`M0,${.5+n} L${.5-m},${.5+n} L${.5-m},1 M0,${.5-n} L${.5+m},${.5-n} L${.5+m},1`},"╘":{1:(m,n)=>`M.5,0 L.5,${.5+n} L1,${.5+n} M.5,${.5-n} L1,${.5-n}`},"╙":{1:(m,n)=>`M1,.5 L${.5-m},.5 L${.5-m},0 M${.5+m},.5 L${.5+m},0`},"╚":{1:(m,n)=>`M1,${.5-n} L${.5+m},${.5-n} L${.5+m},0 M1,${.5+n} L${.5-m},${.5+n} L${.5-m},0`},"╛":{1:(m,n)=>`M0,${.5+n} L.5,${.5+n} L.5,0 M0,${.5-n} L.5,${.5-n}`},"╜":{1:(m,n)=>`M0,.5 L${.5+m},.5 L${.5+m},0 M${.5-m},.5 L${.5-m},0`},"╝":{1:(m,n)=>`M0,${.5-n} L${.5-m},${.5-n} L${.5-m},0 M0,${.5+n} L${.5+m},${.5+n} L${.5+m},0`},"╞":{1:(m,n)=>`M.5,0 L.5,1 M.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╟":{1:(m,n)=>`M${.5-m},0 L${.5-m},1 M${.5+m},0 L${.5+m},1 M${.5+m},.5 L1,.5`},"╠":{1:(m,n)=>`M${.5-m},0 L${.5-m},1 M1,${.5+n} L${.5+m},${.5+n} L${.5+m},1 M1,${.5-n} L${.5+m},${.5-n} L${.5+m},0`},"╡":{1:(m,n)=>`M.5,0 L.5,1 M0,${.5-n} L.5,${.5-n} M0,${.5+n} L.5,${.5+n}`},"╢":{1:(m,n)=>`M0,.5 L${.5-m},.5 M${.5-m},0 L${.5-m},1 M${.5+m},0 L${.5+m},1`},"╣":{1:(m,n)=>`M${.5+m},0 L${.5+m},1 M0,${.5+n} L${.5-m},${.5+n} L${.5-m},1 M0,${.5-n} L${.5-m},${.5-n} L${.5-m},0`},"╤":{1:(m,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n} M.5,${.5+n} L.5,1`},"╥":{1:(m,n)=>`M0,.5 L1,.5 M${.5-m},.5 L${.5-m},1 M${.5+m},.5 L${.5+m},1`},"╦":{1:(m,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L${.5-m},${.5+n} L${.5-m},1 M1,${.5+n} L${.5+m},${.5+n} L${.5+m},1`},"╧":{1:(m,n)=>`M.5,0 L.5,${.5-n} M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╨":{1:(m,n)=>`M0,.5 L1,.5 M${.5-m},.5 L${.5-m},0 M${.5+m},.5 L${.5+m},0`},"╩":{1:(m,n)=>`M0,${.5+n} L1,${.5+n} M0,${.5-n} L${.5-m},${.5-n} L${.5-m},0 M1,${.5-n} L${.5+m},${.5-n} L${.5+m},0`},"╪":{1:(m,n)=>`M.5,0 L.5,1 M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╫":{1:(m,n)=>`M0,.5 L1,.5 M${.5-m},0 L${.5-m},1 M${.5+m},0 L${.5+m},1`},"╬":{1:(m,n)=>`M0,${.5+n} L${.5-m},${.5+n} L${.5-m},1 M1,${.5+n} L${.5+m},${.5+n} L${.5+m},1 M0,${.5-n} L${.5-m},${.5-n} L${.5-m},0 M1,${.5-n} L${.5+m},${.5-n} L${.5+m},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:(m,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,1,.5`},"╮":{1:(m,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,0,.5`},"╯":{1:(m,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,0,.5`},"╰":{1:(m,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(m,n,h,u,c,S,L,y){const T=r.blockElementDefinitions[n];if(T)return(function(U,H,z,V,re,K){for(let X=0;X<H.length;X++){const I=H[X],B=re/8,F=K/8;U.fillRect(z+I.x*B,V+I.y*F,I.w*B,I.h*F)}})(m,T,h,u,c,S),!0;const b=v[n];if(b)return(function(U,H,z,V,re,K){let X=l.get(H);X||(X=new Map,l.set(H,X));const I=U.fillStyle;if(typeof I!="string")throw new Error(`Unexpected fillStyle type "${I}"`);let B=X.get(I);if(!B){const F=H[0].length,O=H.length,$=U.canvas.ownerDocument.createElement("canvas");$.width=F,$.height=O;const te=(0,_.throwIfFalsy)($.getContext("2d")),se=new ImageData(F,O);let ue,me,Z,W;if(I.startsWith("#"))ue=parseInt(I.slice(1,3),16),me=parseInt(I.slice(3,5),16),Z=parseInt(I.slice(5,7),16),W=I.length>7&&parseInt(I.slice(7,9),16)||1;else{if(!I.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${I}" when drawing pattern glyph`);[ue,me,Z,W]=I.substring(5,I.length-1).split(",").map((ae=>parseFloat(ae)))}for(let ae=0;ae<O;ae++)for(let fe=0;fe<F;fe++)se.data[4*(ae*F+fe)]=ue,se.data[4*(ae*F+fe)+1]=me,se.data[4*(ae*F+fe)+2]=Z,se.data[4*(ae*F+fe)+3]=H[ae][fe]*(255*W);te.putImageData(se,0,0),B=(0,_.throwIfFalsy)(U.createPattern($,null)),X.set(I,B)}U.fillStyle=B,U.fillRect(z,V,re,K)})(m,b,h,u,c,S),!0;const R=r.boxDrawingDefinitions[n];if(R)return(function(U,H,z,V,re,K,X){U.strokeStyle=U.fillStyle;for(const[I,B]of Object.entries(H)){let F;U.beginPath(),U.lineWidth=X*Number.parseInt(I),F=typeof B=="function"?B(.15,.15/K*re):B;for(const O of F.split(" ")){const $=O[0],te=x[$];if(!te){console.error(`Could not find drawing instructions for "${$}"`);continue}const se=O.substring(1).split(",");se[0]&&se[1]&&te(U,E(se,re,K,z,V,!0,X))}U.stroke(),U.closePath()}})(m,R,h,u,c,S,y),!0;const k=r.powerlineDefinitions[n];return!!k&&((function(U,H,z,V,re,K,X,I){const B=new Path2D;B.rect(z,V,re,K),U.clip(B),U.beginPath();const F=X/12;U.lineWidth=I*F;for(const O of H.d.split(" ")){const $=O[0],te=x[$];if(!te){console.error(`Could not find drawing instructions for "${$}"`);continue}const se=O.substring(1).split(",");se[0]&&se[1]&&te(U,E(se,re,K,z,V,!1,I,(H.leftPadding??0)*(F/2),(H.rightPadding??0)*(F/2)))}H.type===1?(U.strokeStyle=U.fillStyle,U.stroke()):U.fill(),U.closePath()})(m,k,h,u,c,S,L,y),!0)};const l=new Map;function g(m,n,h=0){return Math.max(Math.min(m,n),h)}const x={C:(m,n)=>m.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]),L:(m,n)=>m.lineTo(n[0],n[1]),M:(m,n)=>m.moveTo(n[0],n[1])};function E(m,n,h,u,c,S,L,y=0,T=0){const b=m.map((R=>parseFloat(R)||parseInt(R)));if(b.length<2)throw new Error("Too few arguments for instruction");for(let R=0;R<b.length;R+=2)b[R]*=n-y*L-T*L,S&&b[R]!==0&&(b[R]=g(Math.round(b[R]+.5)-.5,n,0)),b[R]+=u+y*L;for(let R=1;R<b.length;R+=2)b[R]*=h,S&&b[R]!==0&&(b[R]=g(Math.round(b[R]+.5)-.5,h,0)),b[R]+=c;return b}},56:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.observeDevicePixelDimensions=void 0;const _=d(859);r.observeDevicePixelDimensions=function(v,l,g){let x=new l.ResizeObserver((E=>{const m=E.find((u=>u.target===v));if(!m)return;if(!("devicePixelContentBoxSize"in m))return x?.disconnect(),void(x=void 0);const n=m.devicePixelContentBoxSize[0].inlineSize,h=m.devicePixelContentBoxSize[0].blockSize;n>0&&h>0&&g(n,h)}));try{x.observe(v,{box:["device-pixel-content-box"]})}catch{x.disconnect(),x=void 0}return(0,_.toDisposable)((()=>x?.disconnect()))}},374:(q,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,l,g,x){return l===1&&g>Math.ceil(1.5*x)&&v!==void 0&&v>255&&!_(v)&&!d(v)&&!(function(E){return 57344<=E&&E<=63743})(v)},r.treatGlyphAsBackgroundColor=function(v){return d(v)||(function(l){return 9472<=l&&l<=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,l,g=0){return(v-(2*Math.round(l)-g))%(2*Math.round(l))}},296:(q,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,l,g,x=!1){if(this.selectionStart=l,this.selectionEnd=g,!l||!g||l[0]===g[0]&&l[1]===g[1])return void this.clear();const E=v.buffers.active.ydisp,m=l[1]-E,n=g[1]-E,h=Math.max(m,0),u=Math.min(n,v.rows-1);h>=v.rows||u<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=m,this.viewportEndRow=n,this.viewportCappedStartRow=h,this.viewportCappedEndRow=u,this.startCol=l[0],this.endCol=g[0])}isCellSelected(v,l,g){return!!this.hasSelection&&(g-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&g>=this.viewportCappedStartRow&&l<this.endCol&&g<=this.viewportCappedEndRow:l<this.startCol&&g>=this.viewportCappedStartRow&&l>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&l>=this.startCol)}}r.createSelectionRenderModel=function(){return new d}},509:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TextureAtlas=void 0;const _=d(237),v=d(860),l=d(374),g=d(160),x=d(345),E=d(485),m=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 S{get pages(){return this._pages}constructor(R,k,U){this._document=R,this._config=k,this._unicodeService=U,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 x.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new x.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=T(R,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,l.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const R of this.pages)R.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const R=new m.IdleTaskQueue;for(let k=33;k<126;k++)R.enqueue((()=>{if(!this._cacheMap.get(k,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT)){const U=this._drawToCache(k,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT);this._cacheMap.set(k,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT,U)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const R of this._pages)R.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(S.maxAtlasPages&&this._pages.length>=Math.max(4,S.maxAtlasPages)){const k=this._pages.filter((X=>2*X.canvas.width<=(S.maxTextureSize||4096))).sort(((X,I)=>I.canvas.width!==X.canvas.width?I.canvas.width-X.canvas.width:I.percentageUsed-X.percentageUsed));let U=-1,H=0;for(let X=0;X<k.length;X++)if(k[X].canvas.width!==H)U=X,H=k[X].canvas.width;else if(X-U==3)break;const z=k.slice(U,U+4),V=z.map((X=>X.glyphs[0].texturePage)).sort(((X,I)=>X>I?1:-1)),re=this.pages.length-z.length,K=this._mergePages(z,re);K.version++;for(let X=V.length-1;X>=0;X--)this._deletePage(V[X]);this.pages.push(K),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(K.canvas)}const R=new L(this._document,this._textureSize);return this._pages.push(R),this._activePages.push(R),this._onAddTextureAtlasCanvas.fire(R.canvas),R}_mergePages(R,k){const U=2*R[0].canvas.width,H=new L(this._document,U,R);for(const[z,V]of R.entries()){const re=z*V.canvas.width%U,K=Math.floor(z/2)*V.canvas.height;H.ctx.drawImage(V.canvas,re,K);for(const I of V.glyphs)I.texturePage=k,I.sizeClipSpace.x=I.size.x/U,I.sizeClipSpace.y=I.size.y/U,I.texturePosition.x+=re,I.texturePosition.y+=K,I.texturePositionClipSpace.x=I.texturePosition.x/U,I.texturePositionClipSpace.y=I.texturePosition.y/U;this._onRemoveTextureAtlasCanvas.fire(V.canvas);const X=this._activePages.indexOf(V);X!==-1&&this._activePages.splice(X,1)}return H}_deletePage(R){this._pages.splice(R,1);for(let k=R;k<this._pages.length;k++){const U=this._pages[k];for(const H of U.glyphs)H.texturePage--;U.version++}}getRasterizedGlyphCombinedChar(R,k,U,H,z){return this._getFromCacheMap(this._cacheMapCombined,R,k,U,H,z)}getRasterizedGlyph(R,k,U,H,z){return this._getFromCacheMap(this._cacheMap,R,k,U,H,z)}_getFromCacheMap(R,k,U,H,z,V=!1){return c=R.get(k,U,H,z),c||(c=this._drawToCache(k,U,H,z,V),R.set(k,U,H,z,c)),c}_getColorFromAnsiIndex(R){if(R>=this._config.colors.ansi.length)throw new Error("No color found for idx "+R);return this._config.colors.ansi[R]}_getBackgroundColor(R,k,U,H){if(this._config.allowTransparency)return g.NULL_COLOR;let z;switch(R){case 16777216:case 33554432:z=this._getColorFromAnsiIndex(k);break;case 50331648:const V=n.AttributeData.toColorRGB(k);z=g.channels.toColor(V[0],V[1],V[2]);break;default:z=U?g.color.opaque(this._config.colors.foreground):this._config.colors.background}return z}_getForegroundColor(R,k,U,H,z,V,re,K,X,I){const B=this._getMinimumContrastColor(R,k,U,H,z,V,re,X,K,I);if(B)return B;let F;switch(z){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&X&&V<8&&(V+=8),F=this._getColorFromAnsiIndex(V);break;case 50331648:const O=n.AttributeData.toColorRGB(V);F=g.channels.toColor(O[0],O[1],O[2]);break;default:F=re?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(F=g.color.opaque(F)),K&&(F=g.color.multiplyOpacity(F,_.DIM_OPACITY)),F}_resolveBackgroundRgba(R,k,U){switch(R){case 16777216:case 33554432:return this._getColorFromAnsiIndex(k).rgba;case 50331648:return k<<8;default:return U?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(R,k,U,H){switch(R){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&H&&k<8&&(k+=8),this._getColorFromAnsiIndex(k).rgba;case 50331648:return k<<8;default:return U?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(R,k,U,H,z,V,re,K,X,I){if(this._config.minimumContrastRatio===1||I)return;const B=this._getContrastCache(X),F=B.getColor(R,H);if(F!==void 0)return F||void 0;const O=this._resolveBackgroundRgba(k,U,re),$=this._resolveForegroundRgba(z,V,re,K),te=g.rgba.ensureContrastRatio(O,$,this._config.minimumContrastRatio/(X?2:1));if(!te)return void B.setColor(R,H,null);const se=g.channels.toColor(te>>24&255,te>>16&255,te>>8&255);return B.setColor(R,H,se),se}_getContrastCache(R){return R?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(R,k,U,H,z=!1){const V=typeof R=="number"?String.fromCharCode(R):R,re=Math.min(this._config.deviceCellWidth*Math.max(V.length,2)+4,this._textureSize);this._tmpCanvas.width<re&&(this._tmpCanvas.width=re);const K=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<K&&(this._tmpCanvas.height=K),this._tmpCtx.save(),this._workAttributeData.fg=U,this._workAttributeData.bg=k,this._workAttributeData.extended.ext=H,this._workAttributeData.isInvisible())return u;const X=!!this._workAttributeData.isBold(),I=!!this._workAttributeData.isInverse(),B=!!this._workAttributeData.isDim(),F=!!this._workAttributeData.isItalic(),O=!!this._workAttributeData.isUnderline(),$=!!this._workAttributeData.isStrikethrough(),te=!!this._workAttributeData.isOverline();let se=this._workAttributeData.getFgColor(),ue=this._workAttributeData.getFgColorMode(),me=this._workAttributeData.getBgColor(),Z=this._workAttributeData.getBgColorMode();if(I){const xe=se;se=me,me=xe;const ke=ue;ue=Z,Z=ke}const W=this._getBackgroundColor(Z,me,I,B);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=W.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const ae=X?this._config.fontWeightBold:this._config.fontWeight,fe=F?"italic":"";this._tmpCtx.font=`${fe} ${ae} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=_.TEXT_BASELINE;const we=V.length===1&&(0,l.isPowerlineGlyph)(V.charCodeAt(0)),Ce=V.length===1&&(0,l.isRestrictedPowerlineGlyph)(V.charCodeAt(0)),Ne=this._getForegroundColor(k,Z,me,U,ue,se,I,B,X,(0,l.treatGlyphAsBackgroundColor)(V.charCodeAt(0)));this._tmpCtx.fillStyle=Ne.css;const Le=Ce?0:4;let ze=!1;this._config.customGlyphs!==!1&&(ze=(0,v.tryDrawCustomChar)(this._tmpCtx,V,Le,Le,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let rt,Be=!we;if(rt=typeof R=="number"?this._unicodeService.wcwidth(R):this._unicodeService.getStringCellWidth(R),O){this._tmpCtx.save();const xe=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ke=xe%2==1?.5:0;if(this._tmpCtx.lineWidth=xe,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())Be=!1,this._tmpCtx.strokeStyle=`rgb(${n.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{Be=!1;let nt=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&nt<8&&(nt+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(nt).css}this._tmpCtx.beginPath();const Je=Le,Ae=Math.ceil(Le+this._config.deviceCharHeight)-ke-(z?2*xe:0),Ie=Ae+xe,ot=Ae+2*xe;let ut=this._workAttributeData.getUnderlineVariantOffset();for(let nt=0;nt<rt;nt++){this._tmpCtx.save();const Ke=Je+nt*this._config.deviceCellWidth,Ue=Je+(nt+1)*this._config.deviceCellWidth,Gt=Ke+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Ke,Ae),this._tmpCtx.lineTo(Ue,Ae),this._tmpCtx.moveTo(Ke,ot),this._tmpCtx.lineTo(Ue,ot);break;case 3:const Mt=xe<=1?ot:Math.ceil(Le+this._config.deviceCharHeight-xe/2)-ke,Qt=xe<=1?Ae:Math.ceil(Le+this._config.deviceCharHeight+xe/2)-ke,xt=new Path2D;xt.rect(Ke,Ae,this._config.deviceCellWidth,ot-Ae),this._tmpCtx.clip(xt),this._tmpCtx.moveTo(Ke-this._config.deviceCellWidth/2,Ie),this._tmpCtx.bezierCurveTo(Ke-this._config.deviceCellWidth/2,Qt,Ke,Qt,Ke,Ie),this._tmpCtx.bezierCurveTo(Ke,Mt,Gt,Mt,Gt,Ie),this._tmpCtx.bezierCurveTo(Gt,Qt,Ue,Qt,Ue,Ie),this._tmpCtx.bezierCurveTo(Ue,Mt,Ue+this._config.deviceCellWidth/2,Mt,Ue+this._config.deviceCellWidth/2,Ie);break;case 4:const fs=ut===0?0:ut>=xe?2*xe-ut:xe-ut;ut>=xe||fs===0?(this._tmpCtx.setLineDash([Math.round(xe),Math.round(xe)]),this._tmpCtx.moveTo(Ke+fs,Ae),this._tmpCtx.lineTo(Ue,Ae)):(this._tmpCtx.setLineDash([Math.round(xe),Math.round(xe)]),this._tmpCtx.moveTo(Ke,Ae),this._tmpCtx.lineTo(Ke+fs,Ae),this._tmpCtx.moveTo(Ke+fs+xe,Ae),this._tmpCtx.lineTo(Ue,Ae)),ut=(0,l.computeNextVariantOffset)(Ue-Ke,xe,ut);break;case 5:const un=.6,ra=.3,Ii=Ue-Ke,Xi=Math.floor(un*Ii),Zi=Math.floor(ra*Ii),Pi=Ii-Xi-Zi;this._tmpCtx.setLineDash([Xi,Zi,Pi]),this._tmpCtx.moveTo(Ke,Ae),this._tmpCtx.lineTo(Ue,Ae);break;default:this._tmpCtx.moveTo(Ke,Ae),this._tmpCtx.lineTo(Ue,Ae)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!ze&&this._config.fontSize>=12&&!this._config.allowTransparency&&V!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const nt=this._tmpCtx.measureText(V);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in nt&&nt.actualBoundingBoxDescent>0){this._tmpCtx.save();const Ke=new Path2D;Ke.rect(Je,Ae-Math.ceil(xe/2),this._config.deviceCellWidth*rt,ot-Ae+Math.ceil(xe/2)),this._tmpCtx.clip(Ke),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=W.css,this._tmpCtx.strokeText(V,Le,Le+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(te){const xe=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ke=xe%2==1?.5:0;this._tmpCtx.lineWidth=xe,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(Le,Le+ke),this._tmpCtx.lineTo(Le+this._config.deviceCharWidth*rt,Le+ke),this._tmpCtx.stroke()}if(ze||this._tmpCtx.fillText(V,Le,Le+this._config.deviceCharHeight),V==="_"&&!this._config.allowTransparency){let xe=y(this._tmpCtx.getImageData(Le,Le,this._config.deviceCellWidth,this._config.deviceCellHeight),W,Ne,Be);if(xe)for(let ke=1;ke<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=W.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(V,Le,Le+this._config.deviceCharHeight-ke),xe=y(this._tmpCtx.getImageData(Le,Le,this._config.deviceCellWidth,this._config.deviceCellHeight),W,Ne,Be),xe);ke++);}if($){const xe=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),ke=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=xe,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(Le,Le+Math.floor(this._config.deviceCharHeight/2)-ke),this._tmpCtx.lineTo(Le+this._config.deviceCharWidth*rt,Le+Math.floor(this._config.deviceCharHeight/2)-ke),this._tmpCtx.stroke()}this._tmpCtx.restore();const It=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let ve;if(ve=this._config.allowTransparency?(function(xe){for(let ke=0;ke<xe.data.length;ke+=4)if(xe.data[ke+3]>0)return!1;return!0})(It):y(It,W,Ne,Be),ve)return u;const pe=this._findGlyphBoundingBox(It,this._workBoundingBox,re,Ce,ze,Le);let be,Ee;for(;;){if(this._activePages.length===0){const xe=this._createNewPage();be=xe,Ee=xe.currentRow,Ee.height=pe.size.y;break}be=this._activePages[this._activePages.length-1],Ee=be.currentRow;for(const xe of this._activePages)pe.size.y<=xe.currentRow.height&&(be=xe,Ee=xe.currentRow);for(let xe=this._activePages.length-1;xe>=0;xe--)for(const ke of this._activePages[xe].fixedRows)ke.height<=Ee.height&&pe.size.y<=ke.height&&(be=this._activePages[xe],Ee=ke);if(Ee.y+pe.size.y>=be.canvas.height||Ee.height>pe.size.y+2){let xe=!1;if(be.currentRow.y+be.currentRow.height+pe.size.y>=be.canvas.height){let ke;for(const Je of this._activePages)if(Je.currentRow.y+Je.currentRow.height+pe.size.y<Je.canvas.height){ke=Je;break}if(ke)be=ke;else if(S.maxAtlasPages&&this._pages.length>=S.maxAtlasPages&&Ee.y+pe.size.y<=be.canvas.height&&Ee.height>=pe.size.y&&Ee.x+pe.size.x<=be.canvas.width)xe=!0;else{const Je=this._createNewPage();be=Je,Ee=Je.currentRow,Ee.height=pe.size.y,xe=!0}}xe||(be.currentRow.height>0&&be.fixedRows.push(be.currentRow),Ee={x:0,y:be.currentRow.y+be.currentRow.height,height:pe.size.y},be.fixedRows.push(Ee),be.currentRow={x:0,y:Ee.y+Ee.height,height:0})}if(Ee.x+pe.size.x<=be.canvas.width)break;Ee===be.currentRow?(Ee.x=0,Ee.y+=Ee.height,Ee.height=0):be.fixedRows.splice(be.fixedRows.indexOf(Ee),1)}return pe.texturePage=this._pages.indexOf(be),pe.texturePosition.x=Ee.x,pe.texturePosition.y=Ee.y,pe.texturePositionClipSpace.x=Ee.x/be.canvas.width,pe.texturePositionClipSpace.y=Ee.y/be.canvas.height,pe.sizeClipSpace.x/=be.canvas.width,pe.sizeClipSpace.y/=be.canvas.height,Ee.height=Math.max(Ee.height,pe.size.y),Ee.x+=pe.size.x,be.ctx.putImageData(It,pe.texturePosition.x-this._workBoundingBox.left,pe.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,pe.size.x,pe.size.y),be.addGlyph(pe),be.version++,pe}_findGlyphBoundingBox(R,k,U,H,z,V){k.top=0;const re=H?this._config.deviceCellHeight:this._tmpCanvas.height,K=H?this._config.deviceCellWidth:U;let X=!1;for(let I=0;I<re;I++){for(let B=0;B<K;B++){const F=I*this._tmpCanvas.width*4+4*B+3;if(R.data[F]!==0){k.top=I,X=!0;break}}if(X)break}k.left=0,X=!1;for(let I=0;I<V+K;I++){for(let B=0;B<re;B++){const F=B*this._tmpCanvas.width*4+4*I+3;if(R.data[F]!==0){k.left=I,X=!0;break}}if(X)break}k.right=K,X=!1;for(let I=V+K-1;I>=V;I--){for(let B=0;B<re;B++){const F=B*this._tmpCanvas.width*4+4*I+3;if(R.data[F]!==0){k.right=I,X=!0;break}}if(X)break}k.bottom=re,X=!1;for(let I=re-1;I>=0;I--){for(let B=0;B<K;B++){const F=I*this._tmpCanvas.width*4+4*B+3;if(R.data[F]!==0){k.bottom=I,X=!0;break}}if(X)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:k.right-k.left+1,y:k.bottom-k.top+1},sizeClipSpace:{x:k.right-k.left+1,y:k.bottom-k.top+1},offset:{x:-k.left+V+(H||z?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-k.top+V+(H||z?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}r.TextureAtlas=S;class L{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(R){this._glyphs.push(R),this._usedPixels+=R.size.x*R.size.y}constructor(R,k,U){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],U)for(const H of U)this._glyphs.push(...H.glyphs),this._usedPixels+=H._usedPixels;this.canvas=T(R,k,k),this.ctx=(0,l.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,R,k,U){const H=R.rgba>>>24,z=R.rgba>>>16&255,V=R.rgba>>>8&255,re=k.rgba>>>24,K=k.rgba>>>16&255,X=k.rgba>>>8&255,I=Math.floor((Math.abs(H-re)+Math.abs(z-K)+Math.abs(V-X))/12);let B=!0;for(let F=0;F<b.data.length;F+=4)b.data[F]===H&&b.data[F+1]===z&&b.data[F+2]===V||U&&Math.abs(b.data[F]-H)+Math.abs(b.data[F+1]-z)+Math.abs(b.data[F+2]-V)<I?b.data[F+3]=0:B=!1;return B}function T(b,R,k){const U=b.createElement("canvas");return U.width=R,U.height=k,U}},160:(q,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,l=0;var g,x,E,m,n;function h(c){const S=c.toString(16);return S.length<2?"0"+S:S}function u(c,S){return c<S?(S+.05)/(c+.05):(c+.05)/(S+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},(function(c){c.toCss=function(S,L,y,T){return T!==void 0?`#${h(S)}${h(L)}${h(y)}${h(T)}`:`#${h(S)}${h(L)}${h(y)}`},c.toRgba=function(S,L,y,T=255){return(S<<24|L<<16|y<<8|T)>>>0},c.toColor=function(S,L,y,T){return{css:c.toCss(S,L,y,T),rgba:c.toRgba(S,L,y,T)}}})(g||(r.channels=g={})),(function(c){function S(L,y){return l=Math.round(255*y),[d,_,v]=n.toChannels(L.rgba),{css:g.toCss(d,_,v,l),rgba:g.toRgba(d,_,v,l)}}c.blend=function(L,y){if(l=(255&y.rgba)/255,l===1)return{css:y.css,rgba:y.rgba};const T=y.rgba>>24&255,b=y.rgba>>16&255,R=y.rgba>>8&255,k=L.rgba>>24&255,U=L.rgba>>16&255,H=L.rgba>>8&255;return d=k+Math.round((T-k)*l),_=U+Math.round((b-U)*l),v=H+Math.round((R-H)*l),{css:g.toCss(d,_,v),rgba:g.toRgba(d,_,v)}},c.isOpaque=function(L){return(255&L.rgba)==255},c.ensureContrastRatio=function(L,y,T){const b=n.ensureContrastRatio(L.rgba,y.rgba,T);if(b)return g.toColor(b>>24&255,b>>16&255,b>>8&255)},c.opaque=function(L){const y=(255|L.rgba)>>>0;return[d,_,v]=n.toChannels(y),{css:g.toCss(d,_,v),rgba:y}},c.opacity=S,c.multiplyOpacity=function(L,y){return l=255&L.rgba,S(L,l*y/255)},c.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(x||(r.color=x={})),(function(c){let S,L;try{const y=document.createElement("canvas");y.width=1,y.height=1;const T=y.getContext("2d",{willReadFrequently:!0});T&&(S=T,S.globalCompositeOperation="copy",L=S.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),g.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),l=parseInt(y.slice(4,5).repeat(2),16),g.toColor(d,_,v,l);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 T=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(T)return d=parseInt(T[1]),_=parseInt(T[2]),v=parseInt(T[3]),l=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),g.toColor(d,_,v,l);if(!S||!L)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=L,S.fillStyle=y,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[d,_,v,l]=S.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(d,_,v,l),css:y}}})(E||(r.css=E={})),(function(c){function S(L,y,T){const b=L/255,R=y/255,k=T/255;return .2126*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))}c.relativeLuminance=function(L){return S(L>>16&255,L>>8&255,255&L)},c.relativeLuminance2=S})(m||(r.rgb=m={})),(function(c){function S(y,T,b){const R=y>>24&255,k=y>>16&255,U=y>>8&255;let H=T>>24&255,z=T>>16&255,V=T>>8&255,re=u(m.relativeLuminance2(H,z,V),m.relativeLuminance2(R,k,U));for(;re<b&&(H>0||z>0||V>0);)H-=Math.max(0,Math.ceil(.1*H)),z-=Math.max(0,Math.ceil(.1*z)),V-=Math.max(0,Math.ceil(.1*V)),re=u(m.relativeLuminance2(H,z,V),m.relativeLuminance2(R,k,U));return(H<<24|z<<16|V<<8|255)>>>0}function L(y,T,b){const R=y>>24&255,k=y>>16&255,U=y>>8&255;let H=T>>24&255,z=T>>16&255,V=T>>8&255,re=u(m.relativeLuminance2(H,z,V),m.relativeLuminance2(R,k,U));for(;re<b&&(H<255||z<255||V<255);)H=Math.min(255,H+Math.ceil(.1*(255-H))),z=Math.min(255,z+Math.ceil(.1*(255-z))),V=Math.min(255,V+Math.ceil(.1*(255-V))),re=u(m.relativeLuminance2(H,z,V),m.relativeLuminance2(R,k,U));return(H<<24|z<<16|V<<8|255)>>>0}c.blend=function(y,T){if(l=(255&T)/255,l===1)return T;const b=T>>24&255,R=T>>16&255,k=T>>8&255,U=y>>24&255,H=y>>16&255,z=y>>8&255;return d=U+Math.round((b-U)*l),_=H+Math.round((R-H)*l),v=z+Math.round((k-z)*l),g.toRgba(d,_,v)},c.ensureContrastRatio=function(y,T,b){const R=m.relativeLuminance(y>>8),k=m.relativeLuminance(T>>8);if(u(R,k)<b){if(k<R){const z=S(y,T,b),V=u(R,m.relativeLuminance(z>>8));if(V<b){const re=L(y,T,b);return V>u(R,m.relativeLuminance(re>>8))?z:re}return z}const U=L(y,T,b),H=u(R,m.relativeLuminance(U>>8));if(H<b){const z=S(y,T,b);return H>u(R,m.relativeLuminance(z>>8))?U:z}return U}},c.reduceLuminance=S,c.increaseLuminance=L,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:(q,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 l=0;l<this._listeners.length;l++)v.push(this._listeners[l]);for(let l=0;l<v.length;l++)v[l].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:(q,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:(q,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class d{constructor(){this._data={}}set(v,l,g){this._data[v]||(this._data[v]={}),this._data[v][l]=g}get(v,l){return this._data[v]?this._data[v][l]:void 0}clear(){this._data={}}}r.TwoKeyMap=d,r.FourKeyMap=class{constructor(){this._data=new d}set(_,v,l,g,x){this._data.get(_,v)||this._data.set(_,v,new d),this._data.get(_,v).set(l,g,x)}get(_,v,l,g){return this._data.get(_,v)?.get(l,g)}clear(){this._data.clear()}}},399:(q,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:(q,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(x){this._tasks.push(x),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(x){this._idleCallback=void 0;let E=0,m=0,n=x.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),m=Math.max(E,m),h=x.timeRemaining(),1.5*m>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 l extends v{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const E=Date.now()+x;return{timeRemaining:()=>Math.max(0,E-Date.now())}}}r.PriorityTaskQueue=l,r.IdleTaskQueue=!_.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:l,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},147:(q,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(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){const l=new d;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}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(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){const l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,g=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=g}clone(){return new _(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=_},782:(q,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const _=d(133),v=d(855),l=d(147);class g extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(E){const m=new g;return m.setFromCharData(E),m}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 m=!1;if(E[v.CHAR_DATA_CHAR_INDEX].length>2)m=!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:m=!0}else m=!0}else this.content=E[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|E[v.CHAR_DATA_WIDTH_INDEX]<<22;m&&(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=g},855:(q,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:(q,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 l="";for(let g=_;g<v;++g){let x=d[g];x>65535?(x-=65536,l+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):l+=String.fromCharCode(x)}return l},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(d,_){const v=d.length;if(!v)return 0;let l=0,g=0;if(this._interim){const x=d.charCodeAt(g++);56320<=x&&x<=57343?_[l++]=1024*(this._interim-55296)+x-56320+65536:(_[l++]=this._interim,_[l++]=x),this._interim=0}for(let x=g;x<v;++x){const E=d.charCodeAt(x);if(55296<=E&&E<=56319){if(++x>=v)return this._interim=E,l;const m=d.charCodeAt(x);56320<=m&&m<=57343?_[l++]=1024*(E-55296)+m-56320+65536:(_[l++]=E,_[l++]=m)}else E!==65279&&(_[l++]=E)}return l}},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 l,g,x,E,m=0,n=0,h=0;if(this.interim[0]){let S=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let y,T=0;for(;(y=63&this.interim[++T])&&T<4;)L<<=6,L|=y;const b=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=b-T;for(;h<R;){if(h>=v)return 0;if(y=d[h++],(192&y)!=128){h--,S=!0;break}this.interim[T++]=y,L<<=6,L|=63&y}S||(b===2?L<128?h--:_[m++]=L:b===3?L<2048||L>=55296&&L<=57343||L===65279||(_[m++]=L):L<65536||L>1114111||(_[m++]=L)),this.interim.fill(0)}const u=v-4;let c=h;for(;c<v;){for(;!(!(c<u)||128&(l=d[c])||128&(g=d[c+1])||128&(x=d[c+2])||128&(E=d[c+3]));)_[m++]=l,_[m++]=g,_[m++]=x,_[m++]=E,c+=4;if(l=d[c++],l<128)_[m++]=l;else if((224&l)==192){if(c>=v)return this.interim[0]=l,m;if(g=d[c++],(192&g)!=128){c--;continue}if(n=(31&l)<<6|63&g,n<128){c--;continue}_[m++]=n}else if((240&l)==224){if(c>=v)return this.interim[0]=l,m;if(g=d[c++],(192&g)!=128){c--;continue}if(c>=v)return this.interim[0]=l,this.interim[1]=g,m;if(x=d[c++],(192&x)!=128){c--;continue}if(n=(15&l)<<12|(63&g)<<6|63&x,n<2048||n>=55296&&n<=57343||n===65279)continue;_[m++]=n}else if((248&l)==240){if(c>=v)return this.interim[0]=l,m;if(g=d[c++],(192&g)!=128){c--;continue}if(c>=v)return this.interim[0]=l,this.interim[1]=g,m;if(x=d[c++],(192&x)!=128){c--;continue}if(c>=v)return this.interim[0]=l,this.interim[1]=g,this.interim[2]=x,m;if(E=d[c++],(192&E)!=128){c--;continue}if(n=(7&l)<<18|(63&g)<<12|(63&x)<<6|63&E,n<65536||n>1114111)continue;_[m++]=n}}return m}}},776:function(q,r,d){var _=this&&this.__decorate||function(n,h,u,c){var S,L=arguments.length,y=L<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 T=n.length-1;T>=0;T--)(S=n[T])&&(y=(L<3?S(y):L>3?S(h,u,y):S(h,u))||y);return L>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 l=d(859),g=d(97),x={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let E,m=r.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),E=this}_updateLogLevel(){this._logLevel=x[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<=g.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,n,h)}debug(n,...h){this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,n,h)}info(n,...h){this._logLevel<=g.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,n,h)}warn(n,...h){this._logLevel<=g.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,n,h)}error(n,...h){this._logLevel<=g.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,n,h)}};r.LogService=m=_([v(0,g.IOptionsService)],m),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(...S){if(E.logLevel!==g.LogLevelEnum.TRACE)return c.apply(this,S);E.trace(`GlyphRenderer#${c.name}(${S.map((y=>JSON.stringify(y))).join(", ")})`);const L=c.apply(this,S);return E.trace(`GlyphRenderer#${c.name} return`,L),L}}},726:(q,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 l=function(g,x,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(m,n,h){n[d]===n?n[_].push({id:m,index:h}):(n[_]=[{id:m,index:h}],n[d]=n)})(l,g,E)};return l.toString=()=>v,r.serviceRegistry.set(v,l),l}},97:(q,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(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.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")}},M={};function j(q){var r=M[q];if(r!==void 0)return r.exports;var d=M[q]={exports:{}};return A[q].call(d.exports,d,d.exports,j),d.exports}var G={};return(()=>{var q=G;Object.defineProperty(q,"__esModule",{value:!0}),q.WebglAddon=void 0;const r=j(345),d=j(859),_=j(399),v=j(666),l=j(776);class g extends d.Disposable{constructor(E){if(_.isSafari&&(0,_.getSafariVersion)()<16){const m={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",m))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 m=E._core;if(!E.element)return void this.register(m.onWillOpen((()=>this.activate(E))));this._terminal=E;const n=m.coreService,h=m.optionsService,u=m,c=u._renderService,S=u._characterJoinerService,L=u._charSizeService,y=u._coreBrowserService,T=u._decorationService,b=u._logService,R=u._themeService;(0,l.setTraceLogger)(b),this._renderer=this.register(new v.WebglRenderer(E,S,L,y,n,T,h,R,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 k=this._terminal._core._renderService;k.setRenderer(this._terminal._core._createRenderer()),k.handleResize(E.cols,E.rows)})))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}}q.WebglAddon=g})(),G})()))})(fu)),fu.exports}var Nv=jv();const sa=16e3,Hv=.004,zv=["audio/webm;codecs=opus","audio/webm","audio/mp4"];function Lp(a){if(!a.length)return 0;let w=0;for(const A of a)w+=A*A;return Math.sqrt(w/a.length)}function W_(a,w=Hv){return Lp(a)<w}async function Uv(a){const w=new AudioContext;try{const A=await w.decodeAudioData(await a.arrayBuffer()),M=Math.max(1,Math.ceil(A.duration*sa)),j=new OfflineAudioContext(1,M,sa),G=j.createBufferSource();return G.buffer=A,G.connect(j.destination),G.start(),(await j.startRendering()).getChannelData(0)}finally{w.close()}}class q_{constructor(){this.stream=null,this.recorder=null,this.chunks=[]}async start(){this.stream=await navigator.mediaDevices.getUserMedia({audio:!0});const w=zv.find(A=>MediaRecorder.isTypeSupported(A));this.recorder=new MediaRecorder(this.stream,w?{mimeType:w}:void 0),this.chunks=[],this.recorder.ondataavailable=A=>{A.data.size&&this.chunks.push(A.data)},this.recorder.start()}stop(){return new Promise(w=>{const A=this.recorder;if(!A||A.state==="inactive"){this.dispose(),w(null);return}A.onstop=()=>{const M=new Blob(this.chunks,{type:A.mimeType||"audio/webm"});if(this.dispose(),!M.size){w(null);return}Uv(M).then(w,()=>w(null))},A.stop()})}cancel(){const w=this.recorder;w&&w.state!=="inactive"&&(w.onstop=null,w.stop()),this.dispose()}dispose(){this.stream?.getTracks().forEach(w=>w.stop()),this.stream=null,this.recorder=null,this.chunks=[]}}function ds(a){const w=a.replace(/^.*@/,""),A=w.replace(/:\d+$/,"");return A.includes(":")?w:A}const Ql="\x1B",G_="\x07",Iv=new RegExp(Ql+"\\][^"+G_+Ql+"]*(?:"+G_+"|"+Ql+"\\\\)","g"),Pv=new RegExp(Ql+"\\[[0-9;?]*[A-Za-z]","g");function K_(a){return/[#$%>]\s*$/.test(a.replace(Iv,"").replace(Pv,""))}const $v=60,Fv=200;function Wv(a){if(a.type!=="keydown"||!(a.ctrlKey||a.metaKey)||!a.shiftKey)return null;const w=a.key.toLowerCase();return w==="c"?"copy":w==="v"?"paste":null}function tc(a){return a instanceof Error?a.message:String(a)}function qv(a,w,A){if(w.mark(),typeof a.terminal.paste=="function"){a.terminal.paste(A);return}a.writeToPty?.(A)}function Mp(a=()=>Date.now()){let w=Number.NEGATIVE_INFINITY;return{mark(){w=a()},isDuplicate(){return a()-w<Fv}}}function Gv(a,w){const A=M=>{w.isDuplicate()&&(M.preventDefault(),M.stopPropagation(),M.stopImmediatePropagation?.())};return a.addEventListener("paste",A,!0),()=>a.removeEventListener("paste",A,!0)}function Kv(a,w=Mp()){return A=>{const M=Wv(A);if(!M)return!0;if(A.preventDefault(),A.stopPropagation(),M==="copy"){const j=a.terminal.getSelection();return j&&a.clipboard.copyText(j).catch(G=>{a.onError(tc(G))}),!1}return a.clipboard.readText().then(j=>{j&&qv(a,w,j)}).catch(j=>{a.onError(tc(j))}),!1}}const Vv=new Set(["c","p","s"]);function Yv(a){return a?[...a].some(w=>Vv.has(w)):!0}function Xv(a){const w=a.replace(/\s+/g,"");if(!/^[A-Za-z0-9+/]*={0,2}$/.test(w))return null;try{const A=atob(w),M=Uint8Array.from(A,j=>j.charCodeAt(0));return new TextDecoder().decode(M)}catch{return null}}function Zv(a){const w=a.indexOf(";");if(w===-1||!Yv(a.slice(0,w)))return null;const A=a.slice(w+1);return A==="?"||!A?null:Xv(A)}function Qv(a){const w=a.terminal.parser;if(!w)return()=>{};const A=w.registerOscHandler(52,M=>{const j=Zv(M);return j!==null&&a.clipboard.copyText(j).catch(G=>{a.onError(tc(G))}),!0});return()=>{A&&typeof A.dispose=="function"&&A.dispose()}}function Jv(a){const{terminal:w}=a;if(typeof w.onSelectionChange!="function")return()=>{};let A,M=null;const j=w.onSelectionChange(()=>{A&&clearTimeout(A),A=setTimeout(()=>{if(A=void 0,a.isCopyOnSelectEnabled&&!a.isCopyOnSelectEnabled())return;const G=w.getSelection();!G||G===M||(M=G,a.clipboard.copyText(G).catch(q=>{M=null,a.onError(tc(q))}))},$v)});return()=>{A&&clearTimeout(A),j&&typeof j.dispose=="function"&&j.dispose()}}function eg(a){const w=Mp();a.terminal.attachCustomKeyEventHandler(Kv(a,w));const A=[Qv(a),Jv(a),a.pasteEventTarget?Gv(a.pasteEventTarget,w):()=>{}];return()=>{for(const M of A.reverse())M()}}function tg(a){let w=!1;return{onMouseDown(A){w=A.target===A.currentTarget},onClick(A){const M=w&&A.target===A.currentTarget;w=!1,M&&a()}}}function Er(a){const w=ee.useRef(a);w.current=a;const A=ee.useRef(null);return A.current||(A.current=tg(()=>w.current())),A.current}const ig=250,sg={setTimeout:(a,w)=>setTimeout(a,w),clearTimeout:a=>clearTimeout(a)};function rg(a){const w=a.windowMs??ig,A=a.timers??sg;let M=null,j=null;const G=()=>{M!==null&&(A.clearTimeout(M),M=null)},q=()=>{j!==null&&A.clearTimeout(j),j=A.setTimeout(()=>{j=null},w)};return{onClick(){if(j!==null){q();return}G(),M=A.setTimeout(()=>{M=null,a.onSingleClick()},w)},onDoubleClick(){G(),q(),a.onDoubleClick()},cancel(){G(),j!==null&&(A.clearTimeout(j),j=null)}}}function Tp(a,w){const A=ee.useRef({onSingleClick:a,onDoubleClick:w});A.current={onSingleClick:a,onDoubleClick:w};const M=ee.useRef(null);M.current||(M.current=rg({onSingleClick:()=>A.current.onSingleClick(),onDoubleClick:()=>A.current.onDoubleClick()}));const j=M.current;return ee.useEffect(()=>()=>j.cancel(),[j]),j}function ng(a,w){if(!a)return;const A=ds(a);if(A)return w.find(M=>ds(M.hostName??"")===A||M.alias===A)}function Dp(a){return a.screenName?a.screenName:a.backend==="screen"?a.name:void 0}function ag(a,w,A){return A.find(M=>M.screenName===a&&M.kind===w)??A.find(M=>M.screenName===a)}function _u(a,w,A){if(a.id){const G=w.find(q=>q.id===a.id);if(G)return{kind:"attach",sessionId:G.id}}const M=Dp(a);if(M){const G=ag(M,a.kind,w);if(G)return{kind:"attach",sessionId:G.id};if(a.kind==="local")return{kind:"unavailable",reason:`No local screen session named ${M} is running`};const q=ng(a.host,A);if(q)return{kind:"attach-remote-screen",connection:q,screenName:M,name:a.name};const r=a.sshTarget||a.host;return r?{kind:"create-ssh",target:r,name:a.name,screenCommand:`screen -x ${M}`}:{kind:"unavailable",reason:`No host recorded for ${a.name}`}}if(a.kind==="local")return{kind:"unavailable",reason:`${a.name} was not persistent and did not survive`};const j=a.sshTarget||a.host;return j?{kind:"create-ssh",target:j,name:a.name}:{kind:"unavailable",reason:`No host recorded for ${a.name}`}}const kp=25,Op=85,Bp=60;function pu(a){return a.sessionIds.length+a.pending.length}const og=4;function lg(a,w,A){const M=new Map(w.map(j=>[j.id,j]));return a.flatMap(j=>j.sessionIds.map(G=>M.get(G)).filter(G=>G!==void 0).slice(0,og).map((G,q)=>({session:G,workspaceId:j.id,index:q,dormant:j.id!==A})))}function vo(a){return{layout:a,lastSplit:a==="stack"?"split-v":a,maximizedSessionId:null}}function V_(a,w,A=[]){return{id:`ws-${crypto.randomUUID()}`,name:a,sessionIds:A,pending:[],view:vo(w)}}function mu(a){return a<=1?"stack":a===2?"split-v":"grid"}function Y_(a,w,A){return a.map(M=>{if(M.id!==w)return M;const j={...M.view,...typeof A=="function"?A(M.view):A};return{...M,view:j}})}function cg(a,w,A){return a.map(M=>M.id!==w?M.sessionIds.includes(A)?{...M,sessionIds:M.sessionIds.filter(j=>j!==A)}:M:M.sessionIds.includes(A)?M:{...M,sessionIds:[...M.sessionIds,A]})}function hg(a,w){return a.map(A=>{if(!A.sessionIds.includes(w))return A;const M=A.sessionIds.filter(j=>j!==w);return{...A,sessionIds:M,view:Au(A.view,Eu({...A,sessionIds:M}))}})}function Eu(a){return[...a.sessionIds,...a.pending.map(w=>w.sessionId)]}function Au(a,w){const A=new Set(w),M=a.activeSessionId&&A.has(a.activeSessionId)?a.activeSessionId:void 0,j=a.focusedSessionId&&A.has(a.focusedSessionId)?a.focusedSessionId:void 0,G=a.maximizedSessionId&&A.has(a.maximizedSessionId)?a.maximizedSessionId:null,q=ug(a.browsers,A);return M===a.activeSessionId&&j===a.focusedSessionId&&G===(a.maximizedSessionId??null)&&q===a.browsers?a:{...a,activeSessionId:M,focusedSessionId:j,maximizedSessionId:G,browsers:q}}function ug(a,w){if(!a)return a;const A=Object.keys(a),M=A.filter(j=>w.has(j));return M.length===A.length?a:Object.fromEntries(M.map(j=>[j,a[j]]))}function dg(a,w){const A=new Set(w.map(G=>G.id));let M=!1;const j=a.map(G=>{const q=G.sessionIds.filter(d=>A.has(d)),r=Au(G.view,Eu({...G,sessionIds:q}));return q.length===G.sessionIds.length&&r===G.view?G:(M=!0,{...G,sessionIds:q,view:r})});return M?j:a}const Jl="[A-Za-z0-9](?:[A-Za-z0-9_.]|-| ){0,48}",fg=new RegExp(`^(?:${Jl})$`);function Cu(a){return fg.test(a)}function Yl(a){let w=a.length+1;const A=new Set(a.map(M=>M.name.toLowerCase()));for(;A.has(`workspace ${w}`);)w+=1;return`Workspace ${w}`}function X_(a,w,A){const M=A.trim();return Cu(M)?a.map(j=>j.id===w?{...j,name:M}:j):a}function _g(a,w,A,M,j=()=>`pending-${crypto.randomUUID()}`){const G=a.findIndex(x=>x.id===w);if(G<0)return{workspaces:a,created:null,copied:0,skipped:0};const q=a[G],r=new Map(A.map(x=>[x.id,x])),d=[...q.sessionIds.map(x=>r.get(x)).filter(x=>x!==void 0).map(jp),...q.pending],_=d.filter(x=>x.kind==="ssh"),v=_.map(x=>{const{screenName:E,...m}=x;return{...m,sessionId:j()}}),l={id:`ws-${crypto.randomUUID()}`,name:M,sessionIds:[],pending:v,view:{...vo(q.view.layout),lastSplit:q.view.lastSplit,maximizedSessionId:null}},g=[...a];return g.splice(G+1,0,l),{workspaces:g,created:l,copied:v.length,skipped:d.length-_.length}}function pg(a,w){const A=w.filter(M=>a.sessionIds.includes(M.id));return A.some(M=>M.status==="connected")?"connected":A.length||a.pending.length?"detached":"empty"}function mg(a,w,A){const M=a.findIndex(d=>d.id===w),j={workspaces:a,activeWorkspaceId:A,releasedSessionIds:[]};if(M<0||a.length<2)return j;const G=a[M],q=a.filter(d=>d.id!==w),r=A===w?(q[Math.max(0,M-1)]??q[0]).id:A;return{workspaces:q,activeWorkspaceId:r,releasedSessionIds:[...G.sessionIds]}}function Z_(a,w,A){return a.map(M=>{if(M.id!==w||!M.pending.some(G=>G.sessionId===A))return M;const j={...M,pending:M.pending.filter(G=>G.sessionId!==A)};return{...j,view:Au(j.view,Eu(j))}})}function vg(a,w){let A=!1;const M=a.map(j=>{if(!j.pending.length)return j;const G=[],q=[...j.sessionIds];let r=j.view,d=!1;for(const _ of j.pending){const v=w(_);if(!v){G.push(_);continue}q.includes(v)||q.push(v),r=gg(r,_.sessionId,v),d=!0}return d?(A=!0,{...j,sessionIds:q,pending:G,view:r}):j});return A?M:a}function gg(a,w,A){return a.activeSessionId!==w&&a.focusedSessionId!==w&&a.maximizedSessionId!==w?a:{...a,activeSessionId:a.activeSessionId===w?A:a.activeSessionId,focusedSessionId:a.focusedSessionId===w?A:a.focusedSessionId,maximizedSessionId:a.maximizedSessionId===w?A:a.maximizedSessionId}}const Sg=1,bg=["stack","split-v","split-h","grid"],yg=["split-v","split-h","grid"];function Cg(a,w,A){const M=new Map(A.map(j=>[j.id,j]));return{version:Sg,activeWorkspaceId:w,workspaces:a.map(j=>({id:j.id,name:j.name,view:{layout:j.view.layout,lastSplit:j.view.lastSplit,activeSessionId:j.view.activeSessionId,focusedSessionId:j.view.focusedSessionId,maximizedSessionId:j.view.maximizedSessionId??null,browsers:j.view.browsers},members:[...j.sessionIds.map(G=>M.get(G)).filter(G=>G!==void 0).map(jp),...j.pending]}))}}function jp(a){const w={sessionId:a.id,kind:a.kind,name:a.name};return a.host&&(w.host=a.host),a.screenName&&(w.screenName=a.screenName),a.sshTarget&&(w.sshTarget=a.sshTarget),a.backend&&(w.backend=a.backend),w}function wg(a){if(!a||typeof a!="object"||Array.isArray(a))return;const w={};for(const[A,M]of Object.entries(a)){if(!A||!M||typeof M!="object")continue;const j=M;if(typeof j.open!="boolean")continue;const G=typeof j.ratio=="number"&&Number.isFinite(j.ratio)&&j.ratio>=kp&&j.ratio<=Op?j.ratio:void 0;w[A]=G===void 0?{open:j.open}:{open:j.open,ratio:G}}return Object.keys(w).length?w:void 0}function xg(a){return Dp(a)!==void 0}function Eg(a,w){const A=a.workspaces.map(j=>{const G=bg.find(r=>r===j.view?.layout)??w,q=vo(G);return{id:j.id,name:j.name,sessionIds:[],pending:(j.members??[]).filter(xg),view:{...q,lastSplit:yg.find(r=>r===j.view?.lastSplit)??q.lastSplit,activeSessionId:j.view?.activeSessionId,focusedSessionId:j.view?.focusedSessionId,maximizedSessionId:j.view?.maximizedSessionId??null,browsers:wg(j.view?.browsers)}}}),M=A.some(j=>j.id===a.activeWorkspaceId)?a.activeWorkspaceId:A[0]?.id;return{workspaces:A,activeWorkspaceId:M}}function Fe({name:a,className:w=""}){const A={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",className:`icon-svg ${w}`.trim(),"aria-hidden":!0};switch(a){case"plus":return p.jsx("svg",{...A,children:p.jsx("path",{d:"M12 5v14M5 12h14"})});case"panel-left":return p.jsxs("svg",{...A,children:[p.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),p.jsx("path",{d:"M9 4v16"})]});case"panel-left-open":return p.jsxs("svg",{...A,children:[p.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),p.jsx("path",{d:"M9 4v16M6 9l2 3-2 3"})]});case"grid":return p.jsxs("svg",{...A,children:[p.jsx("rect",{x:"4",y:"4",width:"7",height:"7",rx:"1"}),p.jsx("rect",{x:"13",y:"4",width:"7",height:"7",rx:"1"}),p.jsx("rect",{x:"4",y:"13",width:"7",height:"7",rx:"1"}),p.jsx("rect",{x:"13",y:"13",width:"7",height:"7",rx:"1"})]});case"sessions":return p.jsx("svg",{...A,children:p.jsx("path",{d:"M4 7h16M4 12h16M4 17h10"})});case"terminal":return p.jsxs("svg",{...A,children:[p.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),p.jsx("path",{d:"M7 9l3 3-3 3M13 15h4"})]});case"ssh":return p.jsx("svg",{...A,children:p.jsx("path",{d:"M7 17l5-5-5-5M12 17h7"})});case"history":return p.jsxs("svg",{...A,children:[p.jsx("path",{d:"M4 12a8 8 0 1 0 2.3-5.7L4 8.5M4 4v4.5h4.5"}),p.jsx("path",{d:"M12 7v5l3 2"})]});case"spark":return p.jsx("svg",{...A,children:p.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 p.jsxs("svg",{...A,children:[p.jsx("circle",{cx:"12",cy:"12",r:"3"}),p.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 p.jsxs("svg",{...A,children:[p.jsx("circle",{cx:"12",cy:"12",r:"4"}),p.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 p.jsx("svg",{...A,children:p.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 p.jsx("svg",{...A,children:p.jsx("rect",{x:"5",y:"5",width:"14",height:"14",rx:"1.5"})});case"maximize":return p.jsx("svg",{...A,children:p.jsx("path",{d:"M8 4H4v4M16 4h4v4M4 16v4h4M20 16v4h-4"})});case"restore":return p.jsx("svg",{...A,children:p.jsx("path",{d:"M8 8h12v12H8zM4 16V4h12"})});case"chevron-left":return p.jsx("svg",{...A,children:p.jsx("path",{d:"M15 5l-7 7 7 7"})});case"chevron-right":return p.jsx("svg",{...A,children:p.jsx("path",{d:"M9 5l7 7-7 7"})});case"split-v":return p.jsxs("svg",{...A,children:[p.jsx("rect",{x:"4",y:"5",width:"7",height:"14",rx:"1"}),p.jsx("rect",{x:"13",y:"5",width:"7",height:"14",rx:"1"})]});case"split-h":return p.jsxs("svg",{...A,children:[p.jsx("rect",{x:"4",y:"4",width:"16",height:"7",rx:"1"}),p.jsx("rect",{x:"4",y:"13",width:"16",height:"7",rx:"1"})]});case"x":return p.jsx("svg",{...A,children:p.jsx("path",{d:"M6 6l12 12M18 6L6 18"})});case"stop":return p.jsx("svg",{...A,children:p.jsx("rect",{x:"5",y:"5",width:"14",height:"14",rx:"2"})});case"mic":return p.jsxs("svg",{...A,children:[p.jsx("rect",{x:"9",y:"2.5",width:"6",height:"12",rx:"3"}),p.jsx("path",{d:"M5 11.5a7 7 0 0 0 14 0"}),p.jsx("path",{d:"M12 18.5V21"})]});case"check":return p.jsx("svg",{...A,children:p.jsx("path",{d:"M5 13l4.5 4.5L19 7"})});case"transfer":return p.jsxs("svg",{...A,children:[p.jsx("path",{d:"M8 20V6M8 6L4.5 9.5M8 6l3.5 3.5"}),p.jsx("path",{d:"M16 4v14M16 18l3.5-3.5M16 18l-3.5-3.5"})]});case"ports":return p.jsxs("svg",{...A,children:[p.jsx("rect",{x:"2.5",y:"8.5",width:"5",height:"7",rx:"1"}),p.jsx("rect",{x:"16.5",y:"8.5",width:"5",height:"7",rx:"1"}),p.jsx("path",{d:"M7.5 12h9M14 9.5l2.5 2.5L14 14.5"})]});case"port-plus":return p.jsxs("svg",{...A,children:[p.jsx("rect",{x:"2.5",y:"8.5",width:"5",height:"7",rx:"1"}),p.jsx("path",{d:"M7.5 12h7"}),p.jsx("path",{d:"M18.5 8v8M14.5 12h8"})]});case"folder":return p.jsx("svg",{...A,children:p.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 p.jsxs("svg",{...A,children:[p.jsx("path",{d:"M6 3.5h7L18 8v12.5H6z"}),p.jsx("path",{d:"M13 3.5V8h5"})]});case"link":return p.jsxs("svg",{...A,children:[p.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"}),p.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 p.jsxs("svg",{...A,children:[p.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"}),p.jsx("path",{d:"M11 11v5M8.5 13.5h5"})]});case"trash":return p.jsx("svg",{...A,children:p.jsx("path",{d:"M4.5 7h15M9 7V4.5h6V7M6.5 7l1 13h9l1-13"})});case"pencil":return p.jsx("svg",{...A,children:p.jsx("path",{d:"M4 20h4L20 8l-4-4L4 16z"})});case"refresh":return p.jsx("svg",{...A,children:p.jsx("path",{d:"M20 12a8 8 0 1 1-2.3-5.7L20 8.5M20 4v4.5h-4.5"})});case"arrow-up":return p.jsx("svg",{...A,children:p.jsx("path",{d:"M12 20V4M12 4l-6 6M12 4l6 6"})});case"arrow-down":return p.jsx("svg",{...A,children:p.jsx("path",{d:"M12 4v16M12 20l-6-6M12 20l6-6"})});case"level-up":return p.jsxs("svg",{...A,children:[p.jsx("path",{d:"M5 12l7-7 7 7"}),p.jsx("path",{d:"M12 5v14"})]});case"help":return p.jsxs("svg",{...A,children:[p.jsx("circle",{cx:"12",cy:"12",r:"9"}),p.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"}),p.jsx("path",{d:"M12 17.2h.01"})]});case"copy":return p.jsxs("svg",{...A,children:[p.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),p.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 p.jsxs("svg",{...A,children:[p.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),p.jsx("path",{d:"M8 12h7"}),p.jsx("path",{d:"M12.5 9l2.5 3-2.5 3"})]});case"info":return p.jsxs("svg",{...A,children:[p.jsx("circle",{cx:"12",cy:"12",r:"9"}),p.jsx("path",{d:"M12 11v5"}),p.jsx("path",{d:"M12 8h.01"})]});default:return p.jsx("span",{className:"icon","aria-hidden":"true",children:"•"})}}function Ru(a){if(!a||a.kind!=="ssh")return null;const w=a.sshTarget||a.host;return w&&w!=="local"?w:null}function Ag(a){return a?Ru(a)?{available:!0,reason:`Transfer files with ${a.host}`}:{available:!1,reason:`${a.name} is a local session — SFTP needs an SSH connection`}:{available:!1,reason:"Open an SSH session to transfer files"}}function ia(a){return a.kind==="directory"||a.kind==="symlink"}function Q_(a,w,A=!1){return a.filter(M=>w.has(M.name)&&(A||M.kind!=="directory"))}function J_(a,w,A="file"){return w===0?a:`${a} ${w} ${w===1?A:`${A}s`}`}function ep(a,w,A,M,j){if(M&&j){const q=j.indexOf(M),r=j.indexOf(w);if(q>=0&&r>=0){const d=A?new Set(a):new Set,_=Math.min(q,r),v=Math.max(q,r);for(const l of j.slice(_,v+1))d.add(l);return d}}if(!A)return new Set([w]);const G=new Set(a);return G.has(w)?G.delete(w):G.add(w),G}const Np=["\\\\wsl.localhost\\","\\\\wsl$\\"];function Rg(a){if(!a)return null;if(a.kind==="ssh")return"posix";switch(a.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(a){return!!(a&&a.kind==="local"&&a.backend==="wsl"&&a.wslDistribution)}function Lg(a,w){const M=w.replace(/\/+$/,"").split("/").filter(Boolean),j=M.length?M.join("\\"):".";return`${Np[0]}${a}\\${j}`}function Mg(a,w){const A=w.replace(/\//g,"\\");for(const M of Np){const j=`${M}${a}`;if(!A.toLowerCase().startsWith(j.toLowerCase()))continue;return`/${A.slice(j.length).replace(/^\\+/,"").split("\\").filter(r=>r&&r!==".").join("/")}`}return null}function Tg(a){return a?a.kind==="ssh"?"posix":Lu(a)?"unc":a.backend===void 0?null:a.host==="local"&&/^[A-Za-z]:/.test(a.cwd??"")?"windows":"posix":null}function tp(a,w){if(!a)return null;const A=kg(a.cwd,w);return A?Lu(a)?A.startsWith("/")?Lg(a.wslDistribution,A):null:A:null}function Dg(a,w){const A=tp(a,w);return A||(!a||!w?null:tp({...a,cwd:w},w))}function ip(a,w){return a?Lu(a)?Mg(a.wslDistribution,w):w:null}function kg(a,w){return a?a==="~"?w??null:a.startsWith("~/")?w?`${w.replace(/\/+$/,"")}/${a.slice(2)}`:null:a:null}function Og(a,w){if(w==="posix"){const r=a.replace(/\/+$/,"");if(!r||r==="")return null;const d=r.lastIndexOf("/");return d<0?null:d===0?"/":r.slice(0,d)}if(w==="windows"){const r=a.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 M=a.replace(/\//g,"\\").replace(/\\+$/,"").match(/^(\\\\[^\\]+\\[^\\]+)(?:\\(.*))?$/);if(!M)return null;const[,j,G=""]=M,q=G.split("\\").filter(r=>r&&r!==".");return q.length?(q.pop(),q.length?`${j}\\${q.join("\\")}`:`${j}\\.`):null}const Bg=new RegExp(`[
|
|
75
|
+
\r]`);function jg(a,w){return w?Bg.test(w)?{refused:"That directory name contains a line break, which cannot be typed safely."}:a==="posix"?{command:`cd '${w.split("'").join(String.raw`'\''`)}'`}:a==="powershell"?{command:`Set-Location -LiteralPath '${w.split("'").join("''")}'`}:w.includes('"')?{refused:"Command Prompt cannot quote a directory name containing a double quote."}:{command:`cd /d "${w}"`}:{refused:"That directory has no path."}}function Ng(a,w,A){return A==="posix"?a==="/"?`/${w}`:`${a.replace(/\/+$/,"")}/${w}`:`${a.replace(/\\\.$/,"").replace(/[\\/]+$/,"")}\\${w}`}function Hg({session:a,path:w,unanchored:A=!1,pathKind:M,shellPath:j,list:G,question:q,onOpen:r,onBrowse:d,onClose:_}){const[v,l]=ee.useState({phase:"idle"}),g=ee.useCallback(h=>{let u=!1;return l({phase:"loading",path:h??""}),G(h??void 0).then(c=>{u||l({phase:"ready",path:h??c.path,listing:c})}).catch(c=>{u||l({phase:"failed",path:h??"",message:c instanceof Error?c.message:String(c)})}),()=>{u=!0}},[G]);ee.useEffect(()=>{if(!w&&!A){l({phase:"idle"});return}return g(w)},[w,A,g]);const x=v.phase==="ready"?v.listing.path:w,E=x?Og(x,M):null,n=[...v.phase==="ready"?v.listing.entries:[]].sort((h,u)=>{const c=ia(h)?0:1,S=ia(u)?0:1;return c===S?h.name.localeCompare(u.name):c-S});return p.jsxs("div",{className:"pane-browser","aria-label":`Directories on ${a.host}`,children:[p.jsxs("div",{className:"pane-browser-head",children:[p.jsx("span",{className:"pane-browser-path",title:x??"",children:j??x??"connecting…"}),p.jsxs("span",{className:"pane-browser-actions",children:[p.jsx("button",{type:"button",className:"pane-browser-icon",disabled:v.phase!=="ready"&&v.phase!=="failed",onClick:()=>g(x??w),title:"Refresh","aria-label":"Refresh",children:p.jsx(Fe,{name:"refresh"})}),p.jsx("button",{type:"button",className:"pane-browser-icon",onClick:_,title:"Close the browser","aria-label":"Close the browser",children:p.jsx(Fe,{name:"x"})})]})]}),p.jsx("div",{className:"pane-browser-list",children:q&&v.phase==="loading"?p.jsxs("p",{className:"pane-browser-note pane-browser-asking",children:[q,p.jsx("br",{}),"Answer it in the transfer panel (⇅), then refresh."]}):v.phase==="idle"?p.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"?p.jsx("p",{className:"pane-browser-note pane-browser-error",children:v.message}):p.jsxs(p.Fragment,{children:[E?p.jsx(sp,{label:"..",icon:"level-up",target:E,navigable:!0,className:"pane-browser-parent",onOpen:r,onBrowse:d},".."):null,n.map(h=>p.jsx(sp,{label:h.name,icon:ia(h)?"folder":"file",target:Ng(x??"",h.name,M),navigable:ia(h),link:h.kind==="symlink",onOpen:r,onBrowse:d},h.name)),v.phase==="ready"&&!n.length?p.jsx("p",{className:"pane-browser-note",children:"Nothing here."}):null,v.phase==="loading"?p.jsx("p",{className:"pane-browser-note",children:"Listing…"}):null]})}),p.jsxs("div",{className:"pane-browser-foot",children:[p.jsx("small",{children:"Double-click a folder to take the shell there."}),p.jsx("button",{type:"button",className:"pane-browser-send",disabled:!x,onClick:()=>x&&r(x),title:"Take the shell to this directory","aria-label":"Take the shell to this directory",children:p.jsx(Fe,{name:"send-right"})})]})]})}function sp({label:a,icon:w,target:A,navigable:M,link:j,className:G="",onOpen:q,onBrowse:r}){const d=Tp(()=>M&&r(A),()=>M&&q(A));return p.jsxs("button",{type:"button",className:`pane-browser-row ${M?"":"pane-browser-file"} ${G}`.trim(),disabled:!M,onClick:d.onClick,onDoubleClick:d.onDoubleClick,onKeyDown:_=>{_.key!=="Enter"||!M||(_.preventDefault(),d.cancel(),q(A))},title:M?`${a} — double-click to take the shell there`:a,children:[p.jsx(Fe,{name:w}),p.jsx("span",{className:"pane-browser-name",children:a}),j?p.jsx("span",{className:"pane-browser-kind",children:"link"}):null]})}const Lr=[{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"}],zg=[{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"}],Ug=[[/^Key([A-Z])$/,a=>a[1]],[/^Digit([0-9])$/,a=>a[1]],[/^F([1-9]|1[0-2])$/,a=>`F${a[1]}`],[/^Comma$/,()=>","],[/^Period$/,()=>"."],[/^Slash$/,()=>"/"],[/^Semicolon$/,()=>";"],[/^Quote$/,()=>"'"],[/^BracketLeft$/,()=>"["],[/^BracketRight$/,()=>"]"],[/^Minus$/,()=>"-"],[/^Equal$/,()=>"="],[/^Backquote$/,()=>"`"],[/^(Space|Enter|Tab|Backspace|Home|End|PageUp|PageDown|Insert|Delete)$/,a=>a[1]],[/^Arrow(Up|Down|Left|Right)$/,a=>a[1]]];function Ig(a){for(const[w,A]of Ug){const M=w.exec(a);if(M)return A(M)}return null}function Hp(a){const w=a.ctrlKey||a.metaKey,A=!!a.altKey;if(!w||!(a.shiftKey||A))return null;const M=Ig(a.code);return M?["Ctrl",...A?["Alt"]:[],...a.shiftKey?["Shift"]:[],M].join("+"):null}const Pg=/^([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 zp(a){if(typeof a!="string"||!a||a.length>40)return!1;const w=a.split("+"),A=w.pop();if(!Pg.test(A)||w[0]!=="Ctrl")return!1;const M=w.slice(1).join("+");return M==="Shift"||M==="Alt"||M==="Alt+Shift"}const ic=Object.freeze(Object.fromEntries(Lr.map(a=>[a.action,a.chord]))),Up=/^Ctrl\+Shift\+([1-9])$/;function Ip(a,w,A={}){if(!zp(a))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 M=Mu.find(G=>G.chord===a);if(M)return`${a} is reserved: ${M.reason}.`;if(Up.test(a))return`${a} switches to a workspace by position.`;const j=A[a];if(j&&j!==w){const G=Lr.find(q=>q.action===j)?.description??j;return`${a} is already ${G}.`}return null}function Tu(a={}){const w={...ic},A=[],M=new Map;for(const{action:j}of Lr){const G=a?.[j];if(typeof G!="string"||!G||G===w[j])continue;const q=Ip(G,j);if(q){A.push({action:j,chord:G,reason:q});continue}M.set(j,G)}for(const[j,G]of M)w[j]=G;for(const{action:j}of[...Lr].reverse()){const G=w[j],q=Object.entries(w).find(([d,_])=>d!==j&&_===G);if(!q||!M.has(j))continue;w[j]=ic[j];const r=Lr.find(d=>d.action===q[0])?.description??q[0];A.push({action:j,chord:G,reason:`${G} is already ${r}.`})}return{chords:w,rejected:A}}const rc=Tu();function bi(a,w=rc){return w.chords[a]??ic[a]}function $g(a,w=rc){return bi(a,w)!==ic[a]}function Fg(a,w=rc){if(a.inTextField)return null;const A=Hp(a);if(!A)return null;const M=Up.exec(A);if(M)return{action:"switch-workspace",position:Number(M[1])};for(const[j,G]of Object.entries(w.chords))if(G===A)return{action:j};return null}const Wg=["help","transfer","settings","voiceReview","overview","suggest","modal","palette","history"];function qg(a){return Wg.find(w=>a[w])??null}function Gg(a=rc){return[...Lr.map(({action:w,description:A})=>({chord:bi(w,a),description:A})),{chord:"Ctrl+Shift+1 … 9",description:"switch to a workspace by position"},...Mu.map(w=>({chord:w.chord,description:w.description})),{chord:"Esc",description:"close whatever is open, or cancel a recording"}]}const Kg=40;function Pp(a){if(typeof a!="string")return null;const w=a.trim();return!w||w.length>Kg?null:w.startsWith("v")||w.startsWith("V")?w:`v${w}`}function $p(a){const w=Pp(a);return w?`ZeroG Terminal ${w}`:"ZeroG Terminal"}const Vg=a=>[{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:`${bi("history-palette",a)} 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 Yg({version:a,bindings:w,onClose:A}){const M=zg.filter(j=>Object.values(w.chords).includes(j.chord));return p.jsx("div",{className:"modal-layer",role:"dialog","aria-modal":"true","aria-label":"Help",children:p.jsxs("div",{className:"help-card",children:[p.jsxs("div",{className:"modal-head",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"HELP"}),p.jsx("h2",{children:$p(a)})]}),p.jsx("button",{type:"button",className:"close-button",onClick:A,children:"Esc"})]}),p.jsxs("div",{className:"help-body",children:[p.jsxs("section",{className:"help-keys","aria-label":"Keyboard shortcuts",children:[p.jsx("h3",{children:"Keyboard"}),p.jsx("table",{children:p.jsx("tbody",{children:Gg(w).map(j=>p.jsxs("tr",{children:[p.jsx("th",{scope:"row",children:p.jsx("kbd",{children:j.chord})}),p.jsx("td",{children:j.description})]},j.chord))})}),p.jsxs("p",{className:"help-note",children:[p.jsx(Fe,{name:"info"}),p.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",M.length?", and ":". ",M.map((j,G)=>p.jsxs(cn.Fragment,{children:[G>0?"; ":"",p.jsx("kbd",{children:j.chord})," is also ",j.owner]},j.chord)),M.length?". ":"","Any of them can be moved in Settings, and every one has a button that does the same job."]})]})]}),p.jsxs("section",{className:"help-features","aria-label":"Features",children:[p.jsx("h3",{children:"What is here"}),p.jsx("dl",{children:Vg(w).map(j=>p.jsxs(cn.Fragment,{children:[p.jsx("dt",{children:j.title}),p.jsx("dd",{children:j.body})]},j.title))})]})]}),p.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 Rr(a,w){return w.startsWith("/")?w:a==="/"?`/${w}`:`${a.replace(/\/+$/,"")}/${w}`}function Xg(a){const w=a.replace(/\/+$/,""),A=w.lastIndexOf("/");return A<=0?"/":w.slice(0,A)}function Fp(a){return/^[A-Za-z]:/.test(a)||a.startsWith("\\\\")||a.includes("\\")}function Jn(a,w){const A=Fp(a)?"\\":"/";return`${a.replace(/[\\/]+$/,"")}${A}${w}`}function Zg(a){const w=Fp(a),A=a.replace(/[\\/]+$/,""),M=Math.max(A.lastIndexOf("/"),A.lastIndexOf("\\"));if(M<0)return a;if(!w)return M===0?"/":A.slice(0,M);const j=A.slice(0,M);return/^[A-Za-z]:$/.test(j)?`${j}\\`:j||"\\"}function Qg(a){const w=a.split(/[\\/]/).filter(Boolean);return w[w.length-1]??a}function Jg(a){if(a.kind==="directory")return"—";const w=["B","KB","MB","GB","TB"];let A=a.size,M=0;for(;A>=1024&&M<w.length-1;)A/=1024,M+=1;return`${M===0?A:A.toFixed(A<10?1:0)} ${w[M]}`}function e0(a){if(!a)return"";const w=a.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/);if(!w)return a;const[,A,M,j,G,q]=w;return`${A}-${M}-${j} ${G}:${q}`}const hn="\x1B",sc="\x07",t0=new RegExp(hn+"\\]7;([^"+sc+hn+"]*)(?:"+sc+"|"+hn+"\\\\)","g"),i0=new RegExp(hn+"\\][^"+sc+hn+"]*(?:"+sc+"|"+hn+"\\\\)","g"),s0=new RegExp(hn+"\\[[0-9;?]*[ -/]*[@-~]","g");function r0(a){const w=a.match(/^file:\/\/[^/]*(\/.*)$/);if(!w)return null;try{const A=decodeURIComponent(w[1]);return A.includes("\0")?null:A}catch{return null}}function n0(a){const A=a.replace(i0,"").replace(s0,"").replace(/\r/g,`
|
|
76
|
+
`).split(`
|
|
77
|
+
`).filter(q=>q.trim()),M=A[A.length-1];if(!M)return null;const j=M.match(/(?:^|[:\s])(~|~\/[^\s:]*|\/[^\s:]*)\s*[#$%>]\s*$/);return j?j[1].replace(/\/+$/,"")||"/":null}function a0(a){let w=null;for(const M of a.matchAll(t0))w=M[1];if(w){const M=r0(w);if(M)return{path:M,source:"osc7"}}const A=n0(a);return A?{path:A,source:"prompt"}:null}function Wp(a){return!a||a==="~"||a==="~/"?{}:a.startsWith("/")?{absolute:a}:a.startsWith("~/")?{homeRelative:a.slice(2)}:{}}const o0=/connection is closed|not connected|no such connection/i;function l0(a,w){const A=new Map,M=new Map,j=new Map;function G(){const _=a();if(!_)throw new Error("The terminal bridge is not available.");return _}async function q(_,v=!1){v&&(M.delete(_.id),j.delete(_.id));const l=M.get(_.id);if(l)return l;const g=j.get(_.id);if(g!==void 0)return g;const x=Ru(_);if(!x)throw new Error(`${_.name} has no SSH host to list.`);const E=G().sftpOpen(x).then(m=>{const n={handle:m.id,home:m.cwd};return M.set(_.id,n),w?.(_.id,m.cwd),n}).finally(()=>{j.delete(_.id)});return j.set(_.id,E),E}function r(_,v){if(!_)return;const l=Wp(_);return l.absolute?l.absolute:l.homeRelative?Rr(v,l.homeRelative):v}async function d(_,v){const l=await q(_);try{return await G().sftpList(l.handle,r(v,l.home))}catch(g){const x=g instanceof Error?g.message:String(g);if(!o0.test(x))throw g;const E=await q(_,!0);return await G().sftpList(E.handle,r(v,E.home))}}return{listerFor(_){const v=A.get(_.id);if(v)return v;const l=g=>_.kind==="ssh"?d(_,g):Promise.resolve().then(()=>G().listLocalDirectory(g));return A.set(_.id,l),l},homeFor(_){return M.get(_)?.home},async learnHome(_){if(_.kind!=="ssh")return;const v=M.get(_.id);return v?v.home:(await q(_)).home},forget(_){A.delete(_),M.delete(_),j.delete(_)}}}function c0(a){const w=new Map;for(const A of a){const M=ds(A.target)||A.target,j=w.get(M)??{host:M,forwards:[]};j.forwards.push(A),w.set(M,j)}return[...w.values()]}function h0(a){return a.status==="open"?"connected":a.status==="error"?"error":a.status==="connecting"?"detached":""}function rp(a){const w=`${a.destinationHost||"localhost"}:${a.destinationPort}`;return a.direction==="local"?`${on(a)} → ${w}`:`${on(a)} → ${w} here`}function on(a){if(a.direction==="local")return`${a.bind==="all"?"0.0.0.0":"localhost"}:${a.listenPort}`;const w=ds(a.target)||a.target;return`${a.bind==="all"?`${w} (all)`:w}:${a.listenPort}`}function u0(a){return a.bind==="all"}function d0(a,w){const A=w.find(M=>M.id===a.id||M.listenPort!==a.listenPort||M.direction!==a.direction?!1:a.direction==="local"?!0:ds(M.target)===ds(a.target));return A?a.direction==="local"?`Port ${a.listenPort} is already shared from ${A.target}.`:`Port ${a.listenPort} is already shared to ${A.target}.`:null}function po(a,w){const A=a.findIndex(j=>j.id===w.id);if(A<0)return[...a,w];const M=[...a];return M[A]=w,M}function f0(a){return{version:1,forwards:a.map(({status:w,message:A,...M})=>M)}}function _0(a){return a.forwards.map(w=>({...w,status:"idle"}))}function p0({session:a,target:w,api:A,onClose:M,backdrop:j}){const[G,q]=ee.useState(null),[r,d]=ee.useState(null),[_,v]=ee.useState(null),[l,g]=ee.useState({local:!0,remote:!0}),[x,E]=ee.useState({local:new Set,remote:new Set}),[m,n]=ee.useState({local:"",remote:""}),[h,u]=ee.useState("Connecting…"),[c,S]=ee.useState({}),[L,y]=ee.useState(null),[T,b]=ee.useState(null),[R,k]=ee.useState(""),[U,H]=ee.useState(null),[z,V]=ee.useState(null),[re,K]=ee.useState(null),X=ee.useRef({local:null,remote:null}),I=ee.useRef(null),B=ee.useRef(void 0),F=ee.useRef(void 0);B.current=G?.path,F.current=r?.path;const O=ee.useRef(!0);ee.useEffect(()=>()=>{O.current=!1},[]);const $=ee.useCallback(ve=>{const pe=ve instanceof Error?ve.message:String(ve);return u(pe),pe},[]),te=ee.useCallback(async ve=>{g(pe=>({...pe,local:!0}));try{const pe=await A.listLocalDirectory(ve);if(!O.current)return;q(pe),n(be=>({...be,local:pe.path})),E(be=>({...be,local:new Set})),S(be=>({...be,local:void 0}))}catch(pe){if(!O.current)return;S(be=>({...be,local:$(pe)}))}finally{O.current&&g(pe=>({...pe,local:!1}))}},[A,$]),se=ee.useCallback(async ve=>{const pe=I.current;if(pe){g(be=>({...be,remote:!0}));try{const be=await A.sftpList(pe,ve);if(!O.current)return;d(be),n(Ee=>({...Ee,remote:be.path})),E(Ee=>({...Ee,remote:new Set})),S(Ee=>({...Ee,remote:void 0}))}catch(be){if(!O.current)return;S(Ee=>({...Ee,remote:$(be)}))}finally{O.current&&g(be=>({...be,remote:!1}))}}},[A,$]);ee.useEffect(()=>A.onSftpEvent?.(ve=>{if(!O.current)return;const pe=I.current;if(ve.type==="prompt"){if(pe&&ve.prompt.sessionId!==pe)return;I.current=ve.prompt.sessionId,b(ve.prompt),k("");return}pe&&ve.sessionId!==pe||(ve.type==="progress"&&y({name:ve.name,percent:ve.percent,detail:ve.detail}),ve.type==="status"&&u(ve.message),ve.type==="closed"&&(I.current=null,v(null),S(be=>({...be,remote:ve.message})),u(ve.message)))}),[A]),ee.useEffect(()=>{te();const ve=Wp(a.cwd);let pe=!1;return(async()=>{try{const be=await A.sftpOpen(w,ve.absolute);if(pe||!O.current)return;I.current=be.id,v(be),b(null),u(`Connected to ${be.target}`),await se(ve.homeRelative?Rr(be.cwd,ve.homeRelative):void 0)}catch(be){if(pe||!O.current)return;b(null),g(Ee=>({...Ee,remote:!1})),S(Ee=>({...Ee,remote:$(be)}))}})(),()=>{pe=!0}},[]);const ue=ee.useCallback(ve=>ve==="local"?te(B.current):se(F.current),[te,se]),me=(ve,pe)=>ve==="local"?te(pe):se(pe),Z=ee.useMemo(()=>Q_(G?.entries??[],x.local),[G,x.local]),W=ee.useMemo(()=>Q_(r?.entries??[],x.remote,!0),[r,x.remote]),ae=L!==null,fe=async ve=>{const pe=I.current;if(!pe||!G||!r)return;const be=ve==="upload"?Z:W;if(!be.length)return;y({name:be[0].name,percent:0,detail:"starting"});let Ee=0;try{for(const xe of be)u(`${ve==="upload"?"Uploading":"Downloading"} ${xe.name}…`),ve==="upload"?await A.sftpUpload(pe,Jn(G.path,xe.name),r.path):await A.sftpDownload(pe,Rr(r.path,xe.name),G.path,xe.kind),Ee+=1;u(`${ve==="upload"?"Uploaded":"Downloaded"} ${Ee} ${Ee===1?"file":"files"}.`)}catch(xe){const ke=$(xe);u(`${ke} (${Ee} of ${be.length} transferred)`)}finally{O.current&&(y(null),await ue(ve==="upload"?"remote":"local"))}},we=async ve=>{if(ve.preventDefault(),!U)return;const pe=U.value.trim(),be=U.side;if(pe)try{be==="local"&&G?await A.createLocalDirectory(Jn(G.path,pe)):be==="remote"&&r&&I.current&&await A.sftpMkdir(I.current,Rr(r.path,pe)),H(null),u(`Created ${pe}`),await ue(be)}catch(Ee){$(Ee)}},Ce=async ve=>{if(ve.preventDefault(),!z)return;const pe=z.value.trim(),{side:be,entry:Ee}=z;if(!pe||pe===Ee.name){V(null);return}try{be==="local"&&G?await A.renameLocalEntry(Jn(G.path,Ee.name),Jn(G.path,pe)):be==="remote"&&r&&I.current&&await A.sftpRename(I.current,Rr(r.path,Ee.name),Rr(r.path,pe)),V(null),u(`Renamed to ${pe}`),await ue(be)}catch(xe){$(xe)}},Ne=async()=>{if(!re)return;const{side:ve,entry:pe}=re;try{ve==="local"&&G?await A.removeLocalEntry(Jn(G.path,pe.name),pe.kind):ve==="remote"&&r&&I.current&&await A.sftpRemove(I.current,Rr(r.path,pe.name),pe.kind),K(null),u(`Deleted ${pe.name}`),await ue(ve)}catch(be){$(be)}},Le=async ve=>{ve.preventDefault();const pe=I.current;if(!pe||!T)return;const be=T.kind==="confirm"?"yes":R;b(null),k(""),u(T.kind==="confirm"?"Accepting host key…":"Authenticating…");try{await A.sftpAnswerPrompt(pe,be)}catch(Ee){$(Ee)}},ze=async ve=>{const pe=I.current;if(b(null),k(""),u(ve==="confirm"?"Host key rejected.":"Cancelled. The transfer connection was closed."),!!pe)try{ve==="confirm"?await A.sftpAnswerPrompt(pe,"no"):await A.sftpClose(pe)}catch{}},rt=(ve,pe)=>{if(!ia(pe))return;const be=ve==="local"?G?.path:r?.path;be&&me(ve,ve==="local"?Jn(be,pe.name):Rr(be,pe.name))},Be=ve=>{const pe=ve==="local"?x.local:x.remote,be=(ve==="local"?G?.entries:r?.entries)??[];return pe.size!==1?null:be.find(Ee=>pe.has(Ee.name))??null},It=ve=>{const pe=ve==="local"?G:r,be=ve==="local"?x.local:x.remote,Ee=ve==="local"?c.local:c.remote,xe=ve==="local"?l.local:l.remote,ke=Be(ve),Je=ve==="remote"&&!_;return p.jsxs("section",{className:`sftp-pane sftp-pane-${ve}`,children:[p.jsxs("header",{className:"sftp-pane-head",children:[p.jsx("span",{className:"eyebrow",children:ve==="local"?"THIS COMPUTER":a.host.toUpperCase()}),p.jsxs("div",{className:"sftp-pane-tools",children:[p.jsx("button",{type:"button",title:"Parent folder","aria-label":`${ve} parent folder`,disabled:!pe||xe,onClick:()=>pe&&void me(ve,ve==="local"?Zg(pe.path):Xg(pe.path)),children:p.jsx(Fe,{name:"level-up"})}),p.jsx("button",{type:"button",title:"Refresh","aria-label":`Refresh ${ve}`,disabled:xe||Je,onClick:()=>{ue(ve)},children:p.jsx(Fe,{name:"refresh"})}),p.jsx("button",{type:"button",title:"New folder","aria-label":`New folder on ${ve}`,disabled:!pe||Je,onClick:()=>H({side:ve,value:""}),children:p.jsx(Fe,{name:"folder-plus"})}),p.jsx("button",{type:"button",title:ke?`Rename ${ke.name}`:"Select one item to rename","aria-label":`Rename on ${ve}`,disabled:!ke||Je,onClick:()=>ke&&V({side:ve,entry:ke,value:ke.name}),children:p.jsx(Fe,{name:"pencil"})}),p.jsx("button",{type:"button",className:"sftp-danger",title:ke?`Delete ${ke.name}`:"Select one item to delete","aria-label":`Delete on ${ve}`,disabled:!ke||Je,onClick:()=>ke&&K({side:ve,entry:ke}),children:p.jsx(Fe,{name:"trash"})})]})]}),p.jsx("form",{className:"sftp-path",onSubmit:Ae=>{Ae.preventDefault();const Ie=(ve==="local"?m.local:m.remote).trim();Ie&&me(ve,Ie)},children:p.jsx("input",{value:ve==="local"?m.local:m.remote,onChange:Ae=>{const Ie=Ae.target.value;n(ot=>ve==="local"?{...ot,local:Ie}:{...ot,remote:Ie})},spellCheck:!1,"aria-label":`${ve} path`,placeholder:ve==="local"?"Local folder":"Remote folder",disabled:Je})}),p.jsx("div",{className:"sftp-list",role:"listbox","aria-label":`${ve} files`,"aria-busy":xe,children:Ee?p.jsxs("div",{className:"sftp-empty sftp-error",children:[p.jsx("b",{children:ve==="local"?"Cannot read this folder":"No remote listing"}),p.jsx("small",{children:Ee})]}):xe&&!pe?p.jsxs("div",{className:"sftp-empty",children:[p.jsx("b",{children:ve==="remote"&&!_?"Connecting…":"Loading…"}),p.jsx("small",{children:ve==="remote"?`Opening SFTP to ${a.host}`:"Reading the local folder"})]}):pe&&pe.entries.length?pe.entries.map(Ae=>p.jsxs("button",{type:"button",role:"option","aria-selected":be.has(Ae.name),className:`sftp-row ${be.has(Ae.name)?"selected":""} ${Ae.kind==="directory"?"is-directory":""}`,onClick:Ie=>{const ot=Ie.ctrlKey||Ie.metaKey,ut=X.current[ve],nt=Ie.shiftKey&&ut?ut:void 0,Ke=pe?.entries.map(Ue=>Ue.name);E(Ue=>ve==="local"?{...Ue,local:ep(Ue.local,Ae.name,ot,nt,Ke)}:{...Ue,remote:ep(Ue.remote,Ae.name,ot,nt,Ke)}),Ie.shiftKey||(X.current[ve]=Ae.name)},onDoubleClick:()=>rt(ve,Ae),onKeyDown:Ie=>{Ie.key!=="Enter"||!ia(Ae)||(Ie.preventDefault(),rt(ve,Ae))},title:Ae.linkTarget?`${Ae.name} → ${Ae.linkTarget}`:Ae.name,children:[p.jsx(Fe,{name:Ae.kind==="directory"?"folder":Ae.kind==="symlink"?"link":"file"}),p.jsx("span",{className:"sftp-name",children:Ae.name}),p.jsx("span",{className:"sftp-size",children:Jg(Ae)}),p.jsx("span",{className:"sftp-modified",children:e0(Ae.modified)})]},Ae.name)):p.jsxs("div",{className:"sftp-empty",children:[p.jsx("b",{children:"Empty folder"}),p.jsx("small",{children:"Nothing here to transfer."})]})}),p.jsxs("footer",{className:"sftp-pane-foot",children:[ve==="local"?p.jsxs("button",{type:"button",className:"primary-button",disabled:!Z.length||!_||ae,onClick:()=>{fe("upload")},title:Z.length?`Copy to ${a.host}`:"Select files to upload",children:[p.jsx(Fe,{name:"arrow-up"})," ",J_("Upload",Z.length)]}):p.jsxs("button",{type:"button",className:"primary-button",disabled:!W.length||!_||ae,onClick:()=>{fe("download")},title:W.length?"Copy to this computer":"Select files to download",children:[p.jsx(Fe,{name:"arrow-down"})," ",J_("Download",W.length,"item")]}),p.jsx("span",{className:"sftp-count",children:pe?`${pe.entries.length} items`:""})]})]})};return p.jsx("div",{className:"sftp-layer",role:"presentation",...j,children:p.jsxs("section",{className:"sftp-panel",role:"dialog","aria-label":"Transfer files",children:[p.jsxs("div",{className:"sftp-head",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"TRANSFER FILES"}),p.jsxs("h2",{children:[a.name," · ",a.host]})]}),p.jsx("button",{type:"button",className:"close-button",onClick:M,children:"Esc"})]}),p.jsxs("div",{className:"sftp-body",children:[It("local"),It("remote")]}),T&&p.jsxs("form",{className:"sftp-prompt",onSubmit:Le,children:[p.jsx("span",{className:"eyebrow warning-text",children:T.kind==="confirm"?"HOST KEY":"AUTHENTICATION"}),p.jsx("pre",{children:T.text}),T.kind==="confirm"?p.jsxs("div",{className:"modal-actions",children:[p.jsx("button",{type:"button",onClick:()=>{ze("confirm")},children:"Reject"}),p.jsx("button",{type:"submit",className:"primary-button",children:"Accept key"})]}):p.jsxs(p.Fragment,{children:[p.jsxs("label",{children:[T.kind==="passphrase"?"Key passphrase":"Password",p.jsx("input",{autoFocus:!0,type:"password",value:R,onChange:ve=>k(ve.target.value),autoComplete:"off"})]}),p.jsxs("div",{className:"modal-actions",children:[p.jsx("button",{type:"button",onClick:()=>{ze(T.kind)},children:"Cancel"}),p.jsx("button",{type:"submit",className:"primary-button",children:"Send"})]})]})]}),U&&p.jsxs("form",{className:"sftp-inline-form",onSubmit:we,children:[p.jsxs("label",{children:["New folder in ",U.side==="local"?G?.path:r?.path,p.jsx("input",{autoFocus:!0,value:U.value,onChange:ve=>H({...U,value:ve.target.value}),required:!0})]}),p.jsxs("div",{className:"modal-actions",children:[p.jsx("button",{type:"button",onClick:()=>H(null),children:"Cancel"}),p.jsx("button",{type:"submit",className:"primary-button",children:"Create"})]})]}),z&&p.jsxs("form",{className:"sftp-inline-form",onSubmit:Ce,children:[p.jsxs("label",{children:["Rename ",z.entry.name,p.jsx("input",{autoFocus:!0,value:z.value,onChange:ve=>V({...z,value:ve.target.value}),required:!0})]}),p.jsxs("div",{className:"modal-actions",children:[p.jsx("button",{type:"button",onClick:()=>V(null),children:"Cancel"}),p.jsx("button",{type:"submit",className:"primary-button",children:"Rename"})]})]}),re&&p.jsxs("div",{className:"sftp-inline-form",children:[p.jsx("span",{className:"eyebrow warning-text",children:"CONFIRM DELETE"}),p.jsxs("p",{children:["Delete ",p.jsx("b",{children:re.entry.name})," from ",re.side==="local"?"this computer":a.host,"?",re.entry.kind==="directory"?" Only an empty folder can be deleted here.":""]}),p.jsxs("div",{className:"modal-actions",children:[p.jsx("button",{type:"button",autoFocus:!0,onClick:()=>K(null),children:"Cancel"}),p.jsx("button",{type:"button",className:"primary-button sftp-danger-button",onClick:()=>{Ne()},children:"Delete"})]})]}),p.jsxs("footer",{className:"sftp-foot",children:[L?p.jsxs("div",{className:"sftp-progress",role:"progressbar","aria-valuenow":L.percent,"aria-valuemin":0,"aria-valuemax":100,"aria-label":`Transferring ${L.name}`,children:[p.jsx("div",{className:"sftp-progress-fill",style:{width:`${L.percent}%`}}),p.jsxs("span",{children:[Qg(L.name)," · ",L.percent,"% · ",L.detail]})]}):p.jsx("span",{className:"sftp-notice",children:h}),p.jsx("span",{className:"sftp-hint",children:"Double-click a folder to open · Ctrl-click to select several · Esc closes"})]})]})})}const np={q4:96,q8:41,fp16:76,fp32:152},ap={q4:142,q8:77,fp16:146,fp32:291},op={q4:299,q8:249,fp16:485,fp32:968},Du=[{id:"onnx-community/whisper-tiny.en",label:"Whisper tiny · English",family:"tiny",multilingual:!1,downloadMb:np},{id:"onnx-community/whisper-base.en",label:"Whisper base · English",family:"base",multilingual:!1,downloadMb:ap},{id:"onnx-community/whisper-small.en",label:"Whisper small · English",family:"small",multilingual:!1,downloadMb:op},{id:"onnx-community/whisper-tiny",label:"Whisper tiny · multilingual",family:"tiny",multilingual:!0,downloadMb:np},{id:"onnx-community/whisper-base",label:"Whisper base · multilingual",family:"base",multilingual:!0,downloadMb:ap},{id:"onnx-community/whisper-small",label:"Whisper small · multilingual",family:"small",multilingual:!0,downloadMb:op}],m0="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"}],qp=[{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 nc(a){return Du.find(w=>w.id===a)}function v0(a){return nc(a)?.multilingual??!1}function g0(a,w){return nc(a)?.downloadMb[w]??null}function S0(a,w){const A=g0(a,w);return A===null?"Download size unknown":`≈${A} MB download, cached after first use`}const b0={bash:"bash",zsh:"zsh",fish:"fish",sh:"sh",powershell:"Windows PowerShell",pwsh:"PowerShell 7",cmd:"Command Prompt",wsl:"WSL"};function Gp(a){return b0[a]??a}const Kp="zerog-settings",Vp="zerog-theme",$e={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:m0,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"}},wt={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}},cp={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'},y0=[{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(a){return cp[a]??cp.system}function C0(a){const w={};for(const{action:A}of Lr){const M=a[A];zp(M)&&(w[A]=M)}return w}function sn(a){return typeof a=="object"&&a!==null}function Li(a,w,A){return typeof a=="string"&&w.includes(a)?a:A}function ea(a,w){return typeof a=="boolean"?a:w}function us(a,w,A){return typeof a!="number"||!Number.isFinite(a)?A:Math.min(w.max,Math.max(w.min,a))}function mo(a,w,A=512){return typeof a!="string"?w:a.slice(0,A)}function w0(a,w,A=200){return typeof a!="string"?w:Array.from(a.slice(0,A),M=>{const j=M.codePointAt(0)??0;return j<32||j===127?" ":M}).join("")}function hp(a){return a.proceedPhrase.trim()||$e.ai.proceedPhrase}const up=["dark","light"],x0=["stack","split-v","split-h","grid"],Yp=["bash","zsh","fish","sh","powershell","pwsh","cmd","wsl"],E0=["block","underline","bar"],A0=["system","jetbrains","cascadia","consolas","fira","menlo"],R0=["builtin","server"],L0=["wasm","webgpu"],M0=["q4","q8","fp16","fp32"],T0=["transcribe","translate"],D0=["type","review"];function ln(a,w){const A=sn(a)?a:{},M=sn(A.appearance)?A.appearance:{},j=sn(A.terminal)?A.terminal:{},G=sn(A.sessions)?A.sessions:{},q=sn(A.ai)?A.ai:{},r=sn(A.speech)?A.speech:{},d=sn(A.shortcuts)?A.shortcuts:{},_=Li(w,up,$e.appearance.theme),v=Li(r.engine,R0,$e.speech.engine),l=Li(r.model,Du.map(x=>x.id),$e.speech.model),g=v==="server"||nc(l)?.multilingual?Li(r.language,qp.map(x=>x.value),$e.speech.language):"auto";return{shortcuts:C0(d),appearance:{theme:Li(M.theme,up,_),font:Li(M.font,A0,$e.appearance.font),fontSize:Math.round(us(M.fontSize,wt.fontSize,$e.appearance.fontSize)),lineHeight:us(M.lineHeight,wt.lineHeight,$e.appearance.lineHeight),letterSpacing:us(M.letterSpacing,wt.letterSpacing,$e.appearance.letterSpacing)},terminal:{scrollback:Math.round(us(j.scrollback,wt.scrollback,$e.terminal.scrollback)),cursorStyle:Li(j.cursorStyle,E0,$e.terminal.cursorStyle),cursorBlink:ea(j.cursorBlink,$e.terminal.cursorBlink),copyOnSelect:ea(j.copyOnSelect,$e.terminal.copyOnSelect)},sessions:{defaultBackend:Li(G.defaultBackend,Yp,$e.sessions.defaultBackend),defaultWslDistribution:mo(G.defaultWslDistribution,$e.sessions.defaultWslDistribution,64),defaultLayout:Li(G.defaultLayout,x0,$e.sessions.defaultLayout),startSidebarCollapsed:ea(G.startSidebarCollapsed,$e.sessions.startSidebarCollapsed),sidebarWidth:Math.round(us(G.sidebarWidth,wt.sidebarWidth,$e.sessions.sidebarWidth)),splitColumnRatio:us(G.splitColumnRatio,wt.splitRatio,$e.sessions.splitColumnRatio),splitRowRatio:us(G.splitRowRatio,wt.splitRatio,$e.sessions.splitRowRatio)},ai:{requireApproval:ea(q.requireApproval,$e.ai.requireApproval),voiceInsert:Li(q.voiceInsert,D0,$e.ai.voiceInsert),proceedPhrase:w0(q.proceedPhrase,$e.ai.proceedPhrase),recordCommands:ea(q.recordCommands,$e.ai.recordCommands),baseUrl:mo(q.baseUrl,$e.ai.baseUrl,512),model:mo(q.model,$e.ai.model,200),includeOutput:ea(q.includeOutput,$e.ai.includeOutput),outputChars:Math.round(us(q.outputChars,wt.outputChars,$e.ai.outputChars))},speech:{engine:v,model:l,precision:Li(r.precision,M0,$e.speech.precision),device:Li(r.device,L0,$e.speech.device),language:g,task:Li(r.task,T0,$e.speech.task),maxUtteranceSeconds:Math.round(us(r.maxUtteranceSeconds,wt.maxUtteranceSeconds,$e.speech.maxUtteranceSeconds)),silenceThreshold:us(r.silenceThreshold,wt.silenceThreshold,$e.speech.silenceThreshold),serverUrl:mo(r.serverUrl,$e.speech.serverUrl,512),serverModel:mo(r.serverModel,$e.speech.serverModel,128)}}}function k0(a){if(!a)return ln(void 0);let w=null,A=null;try{w=a.getItem(Kp),A=a.getItem(Vp)}catch{return ln(void 0)}if(!w)return ln(void 0,A);try{return ln(JSON.parse(w),A)}catch{return ln(void 0,A)}}function dp(a,w){if(a)try{a.setItem(Kp,JSON.stringify(w)),a.setItem(Vp,w.appearance.theme)}catch{}}function fp(a,w,A){return ln({...a,[w]:{...a[w],...A}})}function Xp(a,w){if(w.some(M=>M.backend===a))return a;const A=w[0]?.backend;return A&&Yp.includes(A)?A:a}function O0(a){const w=a.engine==="builtin",A=nc(a.model)?.multilingual??!1;return{model:w,precision:w,device:w,language:w?A:!0,task:w&&A,server:!w}}function B0(a,w){return ln({...a,[w]:$e[w]})}const j0=new Set(["127.0.0.1","localhost","::1","[::1]"]);function Zp(a){try{const w=new URL(a);return w.protocol!=="http:"&&w.protocol!=="https:"||!w.hostname?null:w}catch{return null}}function Qp(a){const w=Zp(a);return w===null?null:w.hostname.toLowerCase()}function ku(a){return Qp(a)!==null}function ac(a){const w=Qp(a);return w===null?!1:j0.has(w)||w.endsWith(".localhost")}function N0(a){const w=Zp(a);return w===null?!1:w.protocol==="http:"&&!ac(a)}const H0=12e4,_p=300;function Xl(a,w,A){for(let M=0;M<A.length;M+=1)a.setUint8(w+M,A.charCodeAt(M))}function Ou(a,w=sa){const M=a.length*2,j=new ArrayBuffer(44+M),G=new DataView(j);Xl(G,0,"RIFF"),G.setUint32(4,36+M,!0),Xl(G,8,"WAVE"),Xl(G,12,"fmt "),G.setUint32(16,16,!0),G.setUint16(20,1,!0),G.setUint16(22,1,!0),G.setUint32(24,w,!0),G.setUint32(28,w*2,!0),G.setUint16(32,2,!0),G.setUint16(34,16,!0),Xl(G,36,"data"),G.setUint32(40,M,!0);for(let q=0;q<a.length;q+=1){const r=Math.max(-1,Math.min(1,a[q]));G.setInt16(44+q*2,Math.round(r*32767),!0)}return j}function pp(a){if(typeof a=="string"){const j=a.trim();return j||null}if(typeof a!="object"||a===null)return null;const w=a;if(typeof w.text=="string"&&w.text.trim())return w.text.trim();const A=w.segments;if(Array.isArray(A)){const j=A.map(G=>typeof G=="object"&&G!==null?G.text:null).filter(G=>typeof G=="string").join(" ").trim();if(j)return j}const M=w.choices;if(Array.isArray(M)&&M.length>0){const j=M[0];if(typeof j=="object"&&j!==null){const G=j.message;if(typeof G=="object"&&G!==null){const q=G.content;if(typeof q=="string"&&q.trim())return q.trim()}}}if(typeof w.error=="string")throw new Error(w.error);return null}function z0(a){const w=Ou(a.audio,a.sampleRate??sa),A=new FormData;return A.set("file",new Blob([w],{type:"audio/wav"}),"utterance.wav"),A.set("model",a.model),A.set("response_format","json"),a.language&&a.language!=="auto"&&A.set("language",a.language),A}function U0(a){const w=new Uint8Array(Ou(a.audio,a.sampleRate??sa));let A="";for(const j of w)A+=String.fromCharCode(j);const M={file:`data:audio/wav;base64,${btoa(A)}`,model:a.model,response_format:"json"};return a.language&&a.language!=="auto"&&(M.language=a.language),JSON.stringify(M)}function I0(a){const w=new Uint8Array(Ou(a.audio,a.sampleRate??sa));let A="";for(const j of w)A+=String.fromCharCode(j);const M=[{type:"text",text:a.language&&a.language!=="auto"?`Transcribe this ${a.language} audio. Return only the transcript.`:"Transcribe this audio. Return only the transcript."},{type:"input_audio",input_audio:{data:btoa(A),format:"wav"}}];return JSON.stringify({model:a.model,messages:[{role:"user",content:M}],temperature:0,stream:!1})}function P0(a){try{return new URL(a).pathname.replace(/\/+$/,"")==="/v1/chat/completions"}catch{return!1}}function $0(a,w){return a.status===415&&/POST requests must use ['"]application\/json['"]/.test(w)}function mp(){return typeof AbortSignal<"u"&&typeof AbortSignal.timeout=="function"?AbortSignal.timeout(H0):void 0}async function F0(a,w=fetch){if(!ku(a.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(!a.model.trim())throw new Error("Speech server model name is required");const A=a.apiKey?.trim();if(P0(a.url)){const d=await w(a.url,{method:"POST",headers:{...A?{Authorization:`Bearer ${A}`}:{},"Content-Type":"application/json"},body:I0(a),signal:mp()}),_=await d.text();if(!d.ok){const g=_.slice(0,_p).trim();throw new Error(`Speech server returned ${d.status}${g?`: ${g}`:""}`)}let v=_;try{v=JSON.parse(_)}catch{}const l=pp(v);if(l===null)throw new Error("Speech server returned no transcript");return l}const M={method:"POST",headers:A?{Authorization:`Bearer ${A}`}:void 0,body:z0(a),signal:mp()};let j=await w(a.url,M),G=await j.text();if($0(j,G)&&(j=await w(a.url,{...M,headers:{...A?{Authorization:`Bearer ${A}`}:{},"Content-Type":"application/json"},body:U0(a)}),G=await j.text()),!j.ok){const d=G.slice(0,_p).trim(),_=!A&&(j.status===401||j.status===403)?" — this server wants an API key":"";throw new Error(`Speech server returned ${j.status}${d?`: ${d}`:""}${_}`)}let q=G;try{q=JSON.parse(G)}catch{}const r=pp(q);if(r===null)throw new Error("Speech server returned no transcript");return r}const Jp=[{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"}],W0=`# 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\\]"`,q0=`# 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%}'`,G0=`# 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`,K0=`# 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
|
+
}`,V0={bash:W0,zsh:q0,fish:G0,powershell:K0};function Y0(a){return V0[a]}function X0(a){return Jp.find(w=>w.id===a)?.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 Z0({action:a,description:w,chord:A,moved:M,taken:j,onSet:G,onReset:q}){const[r,d]=cn.useState(!1),[_,v]=cn.useState(null);return cn.useEffect(()=>{if(!r)return;const l=g=>{if(g.preventDefault(),g.stopPropagation(),g.key==="Escape"){d(!1),v(null);return}if(["Control","Shift","Alt","Meta","OS"].includes(g.key))return;const x=Hp({key:g.key,code:g.code,ctrlKey:g.ctrlKey,metaKey:g.metaKey,shiftKey:g.shiftKey,altKey:g.altKey}),E=x?Ip(x,a,j):"A shortcut needs Ctrl and at least one of Shift or Alt, so a shell keeps Ctrl+C and Ctrl+R for itself.";if(!x||E){v(E);return}G(x),v(null),d(!1)};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[r,a,j,G]),p.jsxs("div",{className:_?"shortcut-row invalid":"shortcut-row",children:[p.jsx("span",{className:"shortcut-what",children:w}),p.jsx("button",{type:"button",className:r?"shortcut-chord capturing":"shortcut-chord",onClick:()=>{v(null),d(l=>!l)},"aria-label":r?`Press a new shortcut for ${w}`:`Change the shortcut for ${w}`,children:r?p.jsx("span",{className:"shortcut-prompt",children:"press a chord · Esc"}):p.jsx("kbd",{children:A})}),p.jsx("button",{type:"button",className:"shortcut-reset",onClick:()=>{v(null),d(!1),q()},disabled:!M,title:M?"Back to the shortcut this shipped with":"This is the shortcut it shipped with",children:"Reset"}),_?p.jsx("small",{className:"shortcut-problem",children:_}):null]})}function Ui({label:a,hint:w,children:A}){return p.jsxs("label",{className:"settings-field",children:[p.jsx("span",{className:"settings-field-label",children:a}),A,w?p.jsx("small",{children:w}):null]})}function Q0(a){const w="OpenAI-compatible: POST to {base}/chat/completions. Ollama, LM Studio, llama.cpp, vLLM and OpenRouter all serve this.";return ku(a)?ac(a)?`On this machine, so nothing leaves it. ${w}`:`Off this machine. ${w}`:`Any http:// or https:// address ending in /v1. ${w}`}function J0(a){const w="OpenAI-compatible: POST multipart audio to /v1/audio/transcriptions.";return ku(a)?ac(a)?`On this machine. ${w}`:`Off this machine — recorded audio is sent to this host. ${w}`:`Any http:// or https:// address. ${w}`}function vp({label:a="Server API key",state:w,url:A,onSave:M,onClear:j}){const[G,q]=ee.useState(""),r=w.status==="saving",d=G.trim(),_=w.encryptionAvailable?N0(A)?"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 p.jsxs(Ui,{label:a,hint:_,children:[p.jsxs("div",{className:"settings-key-row",children:[p.jsx("input",{type:"password",value:G,placeholder:w.stored||w.sessionOnly?"•••••••• (a key is set)":"Leave empty if the server needs none",autoComplete:"off",spellCheck:!1,onChange:v=>q(v.target.value),onKeyDown:v=>{v.key!=="Enter"||!d||r||(v.preventDefault(),M(d),q(""))}}),p.jsx("button",{type:"button",disabled:!d||r,onClick:()=>{M(d),q("")},children:r?"Saving…":"Save"}),w.stored||w.sessionOnly?p.jsx("button",{type:"button",disabled:r,onClick:j,children:"Clear"}):null]}),w.error?p.jsx("small",{className:"settings-key-error",children:w.error}):null,!w.error&&w.notice?p.jsx("small",{className:"settings-key-notice",children:w.notice}):null]})}function eS({enabled:a,state:w,bindings:A,onToggle:M,onCopySnippet:j,onClear:G}){const[q,r]=ee.useState("bash"),d=Y0(q),_=bi("history-palette",A);return p.jsxs(p.Fragment,{children:[p.jsx(ta,{label:"Remember commands for the history palette",hint:a?`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:a,onChange:M}),a?p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"settings-note",children:w.panesOpen===0?"No panes open, so nothing is reporting yet.":w.panesReporting===0?`None of your ${w.panesOpen} open pane${w.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.`:`${w.panesReporting} of ${w.panesOpen} open pane${w.panesOpen===1?"":"s"} reporting prompt marks. ${w.entries} command${w.entries===1?"":"s"} remembered.`}),p.jsx(Ui,{label:"Shell integration",hint:`Paste this into ${X0(q)} 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:p.jsxs("div",{className:"settings-key-row",children:[p.jsx("select",{value:q,onChange:v=>r(v.target.value),children:Jp.map(v=>p.jsx("option",{value:v.id,children:v.label},v.id))}),p.jsx("button",{type:"button",onClick:()=>j(d),children:"Copy snippet"})]})}),p.jsx("pre",{className:"settings-snippet",children:d}),p.jsxs("div",{className:"settings-test",children:[p.jsx("button",{type:"button",onClick:G,children:"Forget all remembered commands"}),p.jsx("small",{className:"settings-hint",children:"Removes the stored history and the file it lives in."})]})]}):null]})}function tS({state:a,onRun:w}){const A=a.status==="testing";return p.jsxs("div",{className:"settings-test",children:[p.jsx("button",{type:"button",className:"primary-button",disabled:A,onClick:w,children:A?"Testing…":"Test connection"}),a.message?p.jsx("small",{className:a.ok?"settings-key-notice":"settings-key-error",children:a.message}):null]})}function Yi({label:a,hint:w,value:A,options:M,onChange:j}){return p.jsx(Ui,{label:a,hint:w,children:p.jsx("select",{value:A,onChange:G=>j(G.target.value),children:M.map(G=>p.jsx("option",{value:G.value,children:G.label},G.value))})})}function rn({label:a,hint:w,value:A,min:M,max:j,step:G,format:q,onChange:r}){return p.jsx(Ui,{label:a,hint:w,children:p.jsxs("span",{className:"settings-range",children:[p.jsx("input",{type:"range",min:M,max:j,step:G,value:A,onChange:d=>r(Number(d.target.value)),"aria-label":a}),p.jsx("output",{children:q(A)})]})})}function ta({label:a,hint:w,checked:A,disabled:M=!1,onChange:j}){return p.jsxs("label",{className:`settings-toggle ${M?"settings-toggle-fixed":""}`,children:[p.jsx("input",{type:"checkbox",checked:A,disabled:M,onChange:G=>j(G.target.checked)}),p.jsxs("span",{children:[p.jsx("b",{children:a}),w?p.jsx("small",{children:w}):null]})]})}function iS({value:a,onChange:w}){const A=[{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 p.jsx("div",{className:"settings-engines",role:"radiogroup","aria-label":"Speech engine",children:A.map(M=>p.jsxs("button",{type:"button",role:"radio","aria-checked":a===M.id,className:`settings-engine ${a===M.id?"active":""}`,onClick:()=>w(M.id),children:[p.jsx("b",{children:M.title}),p.jsx("small",{children:M.detail})]},M.id))})}function sS({state:a,onRun:w}){const A=a.status!=="idle",M=a.status==="recording"?"Stop and transcribe":a.status==="transcribing"?"Transcribing…":"Test recognition";return p.jsxs("div",{className:"settings-test",children:[p.jsxs("div",{className:"settings-test-head",children:[p.jsxs("div",{children:[p.jsx("b",{children:"Try it"}),p.jsx("small",{children:"Records a phrase and transcribes it here, without typing into a terminal."})]}),p.jsx("button",{type:"button",className:a.status==="recording"?"settings-test-button recording":"settings-test-button",onClick:w,disabled:a.status==="transcribing",children:M})]}),a.message?p.jsx("p",{className:"settings-test-status",children:a.message}):null,a.error?p.jsx("p",{className:"settings-test-error",children:a.error}):null,a.transcript!==null&&a.transcript!==void 0?p.jsx("output",{className:"settings-test-transcript",children:a.transcript||"(nothing transcribed)"}):null,!A&&(a.elapsedMs!=null||a.level!=null)?p.jsxs("p",{className:"settings-test-metrics",children:[a.elapsedMs!=null?`${(a.elapsedMs/1e3).toFixed(1)}s`:null,a.elapsedMs!=null&&a.level!=null?" · ":null,a.level!=null?`level ${a.level.toFixed(4)} RMS`:null]}):null]})}function rS({status:a,info:w,onStart:A,onStop:M,onCopyToken:j}){const G=a.state==="listening"||a.state==="connected";return p.jsxs("section",{className:"settings-group mcp-settings",children:[p.jsxs("div",{className:"settings-group-head",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"ZERO G CONTROL"}),p.jsx("h3",{children:"Local MCP connection"})]}),p.jsx("span",{className:`mcp-state-dot ${a.state}`,title:a.state})]}),p.jsx("p",{className:"settings-hint",children:"Allow a local agent such as Hermes to inspect and restore ZeroG workspaces. Terminal command execution is not enabled."}),p.jsx("div",{className:"settings-actions",children:G?p.jsx("button",{type:"button",onClick:M,children:"Disable MCP"}):p.jsx("button",{type:"button",className:"primary-button",onClick:A,children:"Enable MCP"})}),w&&G?p.jsxs(p.Fragment,{children:[p.jsx(Ui,{label:"Endpoint",hint:"Give this URL to the local MCP client.",children:p.jsx("code",{className:"settings-value",children:w.endpoint})}),p.jsx(Ui,{label:"Bearer token",hint:"Held only for this app run. Copy it into the local client configuration.",children:p.jsxs("div",{className:"settings-key-row",children:[p.jsx("code",{className:"settings-value token-value",children:w.token}),p.jsx("button",{type:"button",onClick:j,children:"Copy"})]})})]}):null]})}function nS({settings:a,onChange:w,onReset:A,onClose:M,backdrop:j,backends:G,wslDistributions:q,speechTest:r,onSpeechTest:d,speechKey:_,onSpeechKeySave:v,onSpeechKeyClear:l,commandHistory:g,onCopySnippet:x,onClearCommandHistory:E,aiKey:m,onAiKeySave:n,onAiKeyClear:h,aiModels:u,onAiModelsRefresh:c,aiTest:S,onAiTest:L,mcpStatus:y,mcpInfo:T,onMcpStart:b,onMcpStop:R,onMcpCopyToken:k}){const[U,H]=ee.useState("appearance"),z=ee.useMemo(()=>Tu(a.shortcuts),[a.shortcuts]),V=ee.useMemo(()=>Object.fromEntries(Object.entries(z.chords).map(([I,B])=>[B,I])),[z]),re=vu.find(I=>I.id===U)??vu[0],K=O0(a.speech),X=G.length?G.map(I=>({value:I.backend,label:I.label})):[{value:a.sessions.defaultBackend,label:a.sessions.defaultBackend}];return p.jsx("div",{className:"modal-layer settings-layer",role:"presentation",...j,children:p.jsxs("section",{className:"settings-card",role:"dialog","aria-modal":"true","aria-label":"Settings",children:[p.jsxs("div",{className:"modal-head",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"SETTINGS"}),p.jsx("h2",{children:re.label})]}),p.jsx("button",{type:"button",className:"close-button",onClick:M,children:"Esc"})]}),p.jsxs("div",{className:"settings-body",children:[p.jsx("nav",{className:"settings-nav","aria-label":"Settings pages",children:vu.map(I=>p.jsxs("button",{type:"button",className:`settings-nav-item ${I.id===U?"active":""}`,"aria-current":I.id===U,onClick:()=>H(I.id),children:[p.jsx("b",{children:I.label}),p.jsx("small",{children:I.hint})]},I.id))}),p.jsxs("div",{className:"settings-page",children:[p.jsx("p",{className:"settings-blurb",children:re.blurb}),U==="shortcuts"&&p.jsxs(p.Fragment,{children:[z.rejected.length?p.jsxs("p",{className:"settings-warning",children:[z.rejected.map(I=>I.reason).join(" ")," The default is in use instead."]}):null,p.jsx("div",{className:"shortcut-list",children:Lr.map(I=>p.jsx(Z0,{action:I.action,description:I.description,chord:bi(I.action,z),moved:$g(I.action,z),taken:V,onSet:B=>w("shortcuts",{[I.action]:B}),onReset:()=>w("shortcuts",{[I.action]:void 0})},I.action))}),p.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((I,B)=>p.jsxs(cn.Fragment,{children:[B?" and ":" ",p.jsx("kbd",{children:I.chord})]},I.chord)),"."]}),p.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."})]}),U==="appearance"&&p.jsxs(p.Fragment,{children:[p.jsx(Yi,{label:"Theme",value:a.appearance.theme,options:[{value:"dark",label:"Dark"},{value:"light",label:"Light"}],onChange:I=>w("appearance",{theme:I})}),p.jsx(Yi,{label:"Terminal font",hint:"Falls back to another monospace face when the font is not installed.",value:a.appearance.font,options:y0,onChange:I=>w("appearance",{font:I})}),p.jsx(rn,{label:"Font size",value:a.appearance.fontSize,min:wt.fontSize.min,max:wt.fontSize.max,step:1,format:I=>`${I} px`,onChange:I=>w("appearance",{fontSize:I})}),p.jsx(rn,{label:"Line height",value:a.appearance.lineHeight,min:wt.lineHeight.min,max:wt.lineHeight.max,step:.05,format:I=>I.toFixed(2),onChange:I=>w("appearance",{lineHeight:I})}),p.jsx(rn,{label:"Letter spacing",value:a.appearance.letterSpacing,min:wt.letterSpacing.min,max:wt.letterSpacing.max,step:.1,format:I=>`${I.toFixed(1)} px`,onChange:I=>w("appearance",{letterSpacing:I})}),p.jsxs("div",{className:"settings-preview",style:{fontFamily:wu(a.appearance.font),fontSize:`${a.appearance.fontSize}px`,lineHeight:a.appearance.lineHeight,letterSpacing:`${a.appearance.letterSpacing}px`},children:[p.jsx("span",{children:"user@host:~$ git status --short"}),p.jsx("span",{children:" M src/renderer/settings.ts"})]})]}),U==="terminal"&&p.jsxs(p.Fragment,{children:[p.jsx(rn,{label:"Scrollback",hint:"Lines kept per pane. Larger scrollback costs memory in every open pane.",value:a.terminal.scrollback,min:wt.scrollback.min,max:5e4,step:200,format:I=>`${I.toLocaleString()} lines`,onChange:I=>w("terminal",{scrollback:I})}),p.jsx(Yi,{label:"Cursor",value:a.terminal.cursorStyle,options:[{value:"block",label:"Block"},{value:"underline",label:"Underline"},{value:"bar",label:"Bar"}],onChange:I=>w("terminal",{cursorStyle:I})}),p.jsx(ta,{label:"Blink the cursor",checked:a.terminal.cursorBlink,onChange:I=>w("terminal",{cursorBlink:I})}),p.jsx(ta,{label:"Copy on selection",hint:"Selecting text with the mouse puts it on the clipboard. Ctrl+Shift+C copies regardless.",checked:a.terminal.copyOnSelect,onChange:I=>w("terminal",{copyOnSelect:I})})]}),U==="sessions"&&p.jsxs(p.Fragment,{children:[p.jsx(Yi,{label:"Default shell",hint:"Pre-selected when opening a new local terminal.",value:Xp(a.sessions.defaultBackend,G),options:X,onChange:I=>w("sessions",{defaultBackend:I})}),p.jsxs(Ui,{label:"Default WSL distribution",hint:"Used when the default shell is WSL.",children:[p.jsx("input",{list:"settings-wsl-distributions",value:a.sessions.defaultWslDistribution,placeholder:"Ubuntu",onChange:I=>w("sessions",{defaultWslDistribution:I.target.value})}),p.jsx("datalist",{id:"settings-wsl-distributions",children:q.map(I=>p.jsx("option",{value:I},I))})]}),p.jsx(Yi,{label:"Layout at startup",value:a.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:I=>w("sessions",{defaultLayout:I})}),p.jsx(ta,{label:"Start with the sidebar collapsed",checked:a.sessions.startSidebarCollapsed,onChange:I=>w("sessions",{startSidebarCollapsed:I})})]}),U==="ai"&&p.jsxs(p.Fragment,{children:[p.jsx(Ui,{label:"Endpoint",hint:Q0(a.ai.baseUrl),children:p.jsx("input",{value:a.ai.baseUrl,placeholder:$e.ai.baseUrl,spellCheck:!1,onChange:I=>w("ai",{baseUrl:I.target.value})})}),p.jsx(Ui,{label:"Model",hint:"Any model the endpoint serves. Refresh lists what it reports having.",children:p.jsxs("div",{className:"settings-key-row",children:[p.jsx("input",{value:a.ai.model,list:"ai-models",placeholder:"qwen2.5-coder",spellCheck:!1,onChange:I=>w("ai",{model:I.target.value})}),p.jsx("datalist",{id:"ai-models",children:u.map(I=>p.jsx("option",{value:I},I))}),p.jsx("button",{type:"button",onClick:c,children:"Refresh"})]})}),p.jsx(vp,{label:"Endpoint API key",state:m,url:a.ai.baseUrl,onSave:n,onClear:h}),p.jsx(tS,{state:S,onRun:L}),p.jsx(rS,{status:y,info:T,onStart:b,onStop:R,onCopyToken:k}),p.jsx(ta,{label:"Send recent terminal output",hint:a.ai.includeOutput?ac(a.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:a.ai.includeOutput,onChange:I=>w("ai",{includeOutput:I})}),a.ai.includeOutput?p.jsx(rn,{label:"How much output",hint:"The tail of the pane, on whole lines. Enough for a stack trace is usually enough.",value:a.ai.outputChars,min:wt.outputChars.min,max:wt.outputChars.max,step:200,format:I=>`${I} characters`,onChange:I=>w("ai",{outputChars:I})}):null,p.jsx(ta,{label:"Ask before running an AI suggestion",hint:a.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:a.ai.includeOutput||a.ai.requireApproval,disabled:a.ai.includeOutput,onChange:I=>w("ai",{requireApproval:I})}),p.jsx(Yi,{label:"Voice transcripts",hint:"Neither option presses Enter for you.",value:a.ai.voiceInsert,options:[{value:"type",label:"Type into the terminal"},{value:"review",label:"Show for review first"}],onChange:I=>w("ai",{voiceInsert:I})}),p.jsx(Ui,{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:p.jsx("input",{value:a.ai.proceedPhrase,placeholder:$e.ai.proceedPhrase,onChange:I=>w("ai",{proceedPhrase:I.target.value})})}),p.jsx(eS,{enabled:a.ai.recordCommands,state:g,bindings:z,onToggle:I=>w("ai",{recordCommands:I}),onCopySnippet:x,onClear:E})]}),U==="speech"&&p.jsxs(p.Fragment,{children:[p.jsx(iS,{value:a.speech.engine,onChange:I=>w("speech",{engine:I})}),K.model?p.jsx(Yi,{label:"Model",hint:S0(a.speech.model,a.speech.precision),value:a.speech.model,options:Du.map(I=>({value:I.id,label:I.label})),onChange:I=>w("speech",{model:I})}):null,K.precision?p.jsx(Yi,{label:"Precision",hint:lp.find(I=>I.value===a.speech.precision)?.detail,value:a.speech.precision,options:lp.map(I=>({value:I.value,label:I.label})),onChange:I=>w("speech",{precision:I})}):null,K.device?p.jsx(Yi,{label:"Compute",hint:"WebGPU is faster where it works; the app falls back to WASM when it does not.",value:a.speech.device,options:[{value:"wasm",label:"CPU (WASM)"},{value:"webgpu",label:"GPU (WebGPU)"}],onChange:I=>w("speech",{device:I})}):null,K.language?p.jsx(Yi,{label:"Language",value:a.speech.language,options:qp,onChange:I=>w("speech",{language:I})}):null,K.task?p.jsx(Yi,{label:"Task",hint:"Translate produces English text from another language.",value:a.speech.task,options:[{value:"transcribe",label:"Transcribe"},{value:"translate",label:"Translate to English"}],onChange:I=>w("speech",{task:I})}):null,K.server?p.jsxs(p.Fragment,{children:[p.jsx(Ui,{label:"Server URL",hint:J0(a.speech.serverUrl),children:p.jsx("input",{value:a.speech.serverUrl,placeholder:"http://127.0.0.1:8080/v1/audio/transcriptions",onChange:I=>w("speech",{serverUrl:I.target.value})})}),p.jsx(Ui,{label:"Server model",hint:"The model name the server expects, e.g. Qwen3-ASR-0.6B.",children:p.jsx("input",{value:a.speech.serverModel,placeholder:"Qwen3-ASR-0.6B",onChange:I=>w("speech",{serverModel:I.target.value})})}),p.jsx(vp,{state:_,url:a.speech.serverUrl,onSave:v,onClear:l})]}):null,p.jsx(rn,{label:"Maximum utterance",hint:"Recording stops itself at this length so a stuck microphone cannot queue forever.",value:a.speech.maxUtteranceSeconds,min:wt.maxUtteranceSeconds.min,max:wt.maxUtteranceSeconds.max,step:5,format:I=>`${I} s`,onChange:I=>w("speech",{maxUtteranceSeconds:I})}),p.jsx(rn,{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:a.speech.silenceThreshold,min:wt.silenceThreshold.min,max:wt.silenceThreshold.max,step:5e-4,format:I=>I.toFixed(4),onChange:I=>w("speech",{silenceThreshold:I})}),p.jsx(sS,{state:r,onRun:d})]}),p.jsxs("div",{className:"settings-foot",children:[p.jsx("span",{className:"settings-hint",children:"Changes apply immediately and are remembered."}),p.jsxs("button",{type:"button",onClick:()=>A(U),children:["Reset ",re.label.toLowerCase()]})]})]})]})]})})}const an=[{kind:"local",label:"Local terminal",hint:"Shell on this machine"},{kind:"ssh",label:"SSH",hint:"Remote host"}];function gp(a){return a==="local"||a==="ssh"}const aS={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(a){return aS[a]}function oS(a,w){const A=an.findIndex(j=>j.kind===a);if(A===-1)return null;const M=an.length;switch(w){case"ArrowRight":case"ArrowDown":return an[(A+1)%M].kind;case"ArrowLeft":case"ArrowUp":return an[(A-1+M)%M].kind;case"Home":return an[0].kind;case"End":return an[M-1].kind;default:return null}}const em={"split-v":"Vertical split","split-h":"Horizontal split",grid:"Four-pane grid"},lS=[{layout:"split-v",icon:"split-v"},{layout:"split-h",icon:"split-h"},{layout:"grid",icon:"grid"}];function tm(a){return a==="split-v"?["column"]:a==="split-h"?["row"]:a==="grid"?["column","row"]:[]}function im(a,w){return tm(a).some(A=>{const M=A==="column"?w.columnRatio:w.rowRatio,j=A==="column"?$e.sessions.splitColumnRatio:$e.sessions.splitRowRatio;return Math.abs(M-j)>.005})}function cS(a){const w=tm(a);return{...w.includes("column")?{splitColumnRatio:$e.sessions.splitColumnRatio}:{},...w.includes("row")?{splitRowRatio:$e.sessions.splitRowRatio}:{}}}function sm(a){return a.maximized?{kind:"restore"}:a.layout==="stack"?{kind:"show",layout:a.lastSplit}:a.sessionCount>1?{kind:"maximize"}:{kind:"show",layout:"stack"}}function hS(a,w){return w.layout!==a||w.maximized?{kind:"show",layout:a}:im(a,w)?{kind:"reset-splits",ratios:cS(a)}:sm(w)}function uS(a,w){return w.layout!==a||w.maximized?em[a]:im(a,w)?"Reset pane sizes":w.sessionCount>1?"Maximize focused pane":"Single pane"}function dS(a){return a.maximized||a.layout==="stack"?`Back to ${em[a.lastSplit].toLowerCase()}`:a.sessionCount>1?"Maximize focused pane":"Single pane"}function Sp(a){return typeof a=="object"&&a!==null}class fS{constructor(w){this.options=w,this.worker=null,this.pending=new Map,this.nextId=1}async transcribe(w,A,M){if(A.engine==="server"){const G=this.options.now??(()=>Date.now()),q=G(),r=await this.options.resolveApiKey?.().catch(()=>null)??void 0;return{text:await F0({url:A.serverUrl,model:A.serverModel,language:A.language,audio:w,apiKey:r},this.options.fetchImpl),elapsedMs:G()-q,engine:"server"}}return{...await this.transcribeInWorker(w,A,M),engine:"builtin"}}transcribeInWorker(w,A,M){const j=this.ensureWorker(),G=this.nextId++;return new Promise((q,r)=>{this.pending.set(G,{resolve:q,reject:r,onProgress:M}),j.postMessage({type:"transcribe",id:G,audio:w,config:{model:A.model,precision:A.precision,device:A.device,language:A.language,task:A.task,multilingual:v0(A.model)}},[w.buffer])})}ensureWorker(){if(this.worker)return this.worker;const w=this.options.createWorker();return w.onmessage=A=>this.handleMessage(A.data),w.onerror=A=>{const M=Sp(A)&&typeof A.message=="string"?A.message:"Speech worker failed";this.failAll(new Error(M)),this.worker=null},this.worker=w,w}handleMessage(w){if(!Sp(w)||typeof w.id!="number")return;const A=this.pending.get(w.id);if(A){if(w.type==="loading"){A.onProgress?.({kind:"loading",progress:typeof w.progress=="number"?w.progress:null});return}if(w.type==="notice"){A.onProgress?.({kind:"notice",message:String(w.message)});return}if(w.type==="result"){this.pending.delete(w.id),A.resolve({text:typeof w.text=="string"?w.text:"",elapsedMs:typeof w.elapsedMs=="number"?w.elapsedMs:0});return}w.type==="error"&&(this.pending.delete(w.id),A.reject(new Error(typeof w.message=="string"?w.message:"Transcription failed")))}}failAll(w){for(const A of this.pending.values())A.reject(w);this.pending.clear()}dispose(){this.failAll(new Error("Speech client disposed")),this.worker?.terminate(),this.worker=null}}const _S=5;function pS(a,w,A=_S){return Math.abs(w-a)>=A}function mS(a,w){if(!a.length)return 0;for(let A=0;A<a.length;A+=1){const M=a[A];if(w<M.left+M.width/2)return A}return a.length-1}function bp(a,w,A){if(w===A||w<0||w>=a.length)return a;const M=Math.min(Math.max(A,0),a.length-1);if(M===w)return a;const j=[...a],[G]=j.splice(w,1);return j.splice(M,0,G),j}function Su(a,w){return w?a.findIndex(A=>A.id===w):-1}const vS=6;function gS(a,w,A,M=vS){return{x:yp(a.x,w.width,A.width,M),y:yp(a.y,w.height,A.height,M)}}function yp(a,w,A,M){return a+w+M<=A?Math.max(M,a):a-w-M>=0?a-w:Math.max(M,A-w-M)}function SS({at:a,items:w,label:A,onClose:M}){const j=ee.useRef(null),[G,q]=ee.useState(a);return ee.useLayoutEffect(()=>{const r=j.current?.getBoundingClientRect();r&&q(gS(a,{width:r.width,height:r.height},{width:window.innerWidth,height:window.innerHeight}))},[a,w.length]),ee.useEffect(()=>{const r=_=>{_.key==="Escape"&&(_.preventDefault(),_.stopPropagation(),M())},d=()=>M();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)}},[M]),p.jsx("div",{className:"context-menu",role:"menu","aria-label":A,ref:j,style:{left:G.x,top:G.y},onPointerDown:r=>r.stopPropagation(),children:w.map(r=>p.jsxs("button",{type:"button",role:"menuitem",className:`context-menu-item ${r.danger?"danger":""}`.trim(),disabled:r.disabled||!r.onSelect,title:r.hint??"",onClick:()=>{M(),r.onSelect?.()},children:[r.icon?p.jsx(Fe,{name:r.icon}):p.jsx("span",{className:"context-menu-gap"}),p.jsx("span",{children:r.label})]},r.label))})}function bS(a,w){let A=null,M=null,j=!1;return{handle(G){const q=G.charAt(0);if(j=!0,q==="A")return A=null,!0;if(q==="B")return A=a.cursor(),!0;if(q==="C"){if(!A)return!0;const r=a.read(A,a.cursor()).trim();return A=null,r&&(M={command:r,startedAt:a.now()}),!0}if(q==="D"){const r=M;if(M=null,!r)return!0;const d=yS(G);return w({command:r.command,...d===void 0?{}:{exitCode:d},durationMs:Math.max(0,a.now()-r.startedAt)}),!0}return!0},hasMarks(){return j},atPrompt(){return A!==null&&M===null},reset(){A=null,M=null}}}function yS(a){const w=a.split(";");if(w.length<2)return;const A=w[1].trim();if(!/^\d+$/.test(A))return;const M=Number(A);return M<=255?M:void 0}function CS(a,w,A){if(A.row<w.row||A.row===w.row&&A.col<=w.col)return"";const M=[];for(let j=w.row;j<=A.row;j+=1){const G=a(j)??"",q=j===w.row?w.col:0,r=j===A.row?A.col:G.length;M.push(G.slice(q,r))}return M.join("").replace(/\s+$/,"")}const Cp="TOKEN|KEY|SECRET|PASSWORD|PASSWD|PASSPHRASE|CREDENTIAL|AUTH|APIKEY|ACCESS_KEY|PRIVATE",wS=[{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_]*(?:${Cp})[A-Za-z0-9_]*\s*=\s*\S`,"i")},{reason:"secret-assignment",pattern:new RegExp(String.raw`(?:${Cp})[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}],xS=24;function ES(a){return a.length<xS||/[/\\]/.test(a)||!/^[A-Za-z0-9+/=_-]+$/.test(a)||/^[0-9a-f]+$/i.test(a)?!1:/[a-z]/.test(a)&&/[A-Z]/.test(a)&&/[0-9]/.test(a)}function AS(a){const w=a.trim();if(!w)return null;for(const{reason:A,pattern:M}of wS)if(M.test(w))return A;for(const A of w.split(/[\s=:,'"`]+/))if(ES(A))return"high-entropy";return null}const RS=4320*60*1e3,nn={cwd:50,host:12,recency:30,frequency:10,pick:25,failed:-20,match:40};function LS(a,w){if(!w)return[];const A=a.toLowerCase(),M=w.toLowerCase(),j=[];let G=0;for(const q of M){if(q===" ")continue;const r=A.indexOf(q,G);if(r<0)return null;j.push(r),G=r+1}return j}function MS(a,w){if(!w.length)return .5;const A=w[0],j=w[w.length-1]-A+1,G=w.length/j,q=1/(1+A),r=A===0||/\s/.test(a.charAt(A-1))?1:0;return .45*G+.35*q+.2*r}function TS(a,w){const A=w-Date.parse(a);return Number.isFinite(A)?A<=0?1:Math.pow(.5,A/RS):0}function DS(a,w,A){let M=nn.match*MS(a.command,w);return A.cwd&&a.cwd===A.cwd&&(M+=nn.cwd),A.host&&a.host===A.host&&(M+=nn.host),M+=nn.recency*TS(a.lastRun,A.now),M+=nn.frequency*Math.log1p(a.runs),M+=nn.pick*Math.log1p(a.picks),a.exitCode!==void 0&&a.exitCode!==0&&(M+=nn.failed),M}function kS(a,w){const A=new Map;for(const j of a){const G=LS(j.command,w.query);if(G===null)continue;const q={entry:j,score:DS(j,G,w),matched:G},r=A.get(j.command);(!r||q.score>r.score)&&A.set(j.command,q)}const M=[...A.values()].sort((j,G)=>G.score!==j.score?G.score-j.score:G.entry.lastRun.localeCompare(j.entry.lastRun));return w.limit===void 0?M:M.slice(0,w.limit)}function bu(a){return{phase:"asking",sessionId:a,prompt:""}}function OS(a,w,A){return!A.trim()||w||a.includeOutput?!1:!a.requireApproval}function wp(a){return!!(a.baseUrl.trim()&&a.model.trim())}function BS(a,w){const A=a.replace(/\s+$/,"");if(w<=0)return"";if(A.length<=w)return A;const M=A.slice(-w),j=M.indexOf(`
|
|
139
|
+
`);return j>=0&&j<M.length-1?M.slice(j+1):M}const jS=150,NS=3e3,xp=400;function Ar(a){return(a instanceof Error?a.message:String(a)).replace(/^Error invoking remote method '[^']*':\s*/,"").replace(/^(?:Error|TypeError):\s*/,"")}function Ep(a){return{id:a.sessionId,name:a.name,kind:a.kind,host:a.host,screenName:a.screenName,sshTarget:a.sshTarget,backend:a.backend}}const Re=()=>window.zerog;function yu(){try{return window.localStorage}catch{return null}}function Zl({session:a,active:w=!1,ghosted:A=!1,onClick:M}){const j=a.kind==="ssh"?`SSH · ${a.host}`:a.backend==="wsl"?`WSL${a.wslDistribution?` · ${a.wslDistribution}`:""} · ${a.cwd}`:a.backend&&a.backend!=="screen"?`${Gp(a.backend)} · ${a.cwd}`:a.persistence==="screen"?`screen · ${a.cwd}`:`local · process only · ${a.cwd}`;return p.jsxs("button",{type:"button",className:`session-row ${w?"active":""} ${A?"session-ghosted":""}`,onClick:M,children:[p.jsx("span",{className:`status-dot ${a.status}`}),p.jsxs("span",{className:"session-copy",children:[p.jsx("b",{children:a.name}),p.jsx("small",{children:j})]}),p.jsx("span",{className:"session-state",children:A?"↗":a.status==="connected"?"●":"○"})]})}function HS({member:a,onClick:w}){const A=a.kind==="ssh"?`SSH · ${a.host??a.sshTarget??"saved host"}`:a.screenName?`screen · ${a.screenName}`:"local";return p.jsxs("button",{type:"button",className:"session-row session-ghosted",title:`Reconnect ${a.name}`,onClick:w,children:[p.jsx("span",{className:"status-dot"}),p.jsxs("span",{className:"session-copy",children:[p.jsx("b",{children:a.name}),p.jsxs("small",{children:[A," · not connected"]})]}),p.jsx("span",{className:"session-state",children:"↻"})]})}function zS({connection:a,onConfigure:w,onConnect:A}){const M=Tp(w,A),j=a.hostName?`${a.user??""}${a.user?"@":""}${a.hostName}${a.port?`:${a.port}`:""}`:"Saved SSH connection";return p.jsxs("button",{type:"button",className:"session-row",title:`Double-click to connect ${a.alias} in a new pane`,onClick:M.onClick,onDoubleClick:M.onDoubleClick,children:[p.jsx("span",{className:"status-dot"}),p.jsxs("span",{className:"session-copy",children:[p.jsx("b",{children:a.alias}),p.jsx("small",{children:j})]}),p.jsx("span",{className:"session-state",children:"→"})]})}function US(a,w=200){if(!a)return"";const A=a.buffer.active,M=A.length,j=Math.max(0,M-w),G=[];for(let q=j;q<M;q+=1)G.push(A.getLine(q)?.translateToString(!0)??"");return G.join(`
|
|
140
|
+
`)}const IS=120,PS=1e4,$S=200;function FS(){if(!(typeof PerformanceObserver>"u"))try{new PerformanceObserver(w=>{for(const A of w.getEntries())A.duration>=$S&&console.warn(`[zerog] renderer blocked for ${Math.round(A.duration)}ms`)}).observe({entryTypes:["longtask"]})}catch{}}FS();function WS({sessionId:a,focused:w,dormant:A=!1,onStatus:M,appearance:j,terminalSettings:G,registerFocus:q,registerCapture:r,onCommand:d,registerRead:_}){const v=ee.useRef(null),l=ee.useRef(null),g=ee.useRef(M);g.current=M;const x=ee.useRef(j);x.current=j;const E=ee.useRef(G);E.current=G;const m=ee.useRef(null),n=ee.useRef(null),h=ee.useRef({}),u=ee.useRef(d);return u.current=d,ee.useEffect(()=>{if(!v.current)return;const c=v.current,S=new kv.Terminal({cursorBlink:E.current.cursorBlink,cursorStyle:E.current.cursorStyle,fontFamily:wu(x.current.font),fontSize:x.current.fontSize,lineHeight:x.current.lineHeight,letterSpacing:x.current.letterSpacing,scrollback:E.current.scrollback,allowProposedApi:!0,theme:Ap(x.current.theme),linkHandler:{activate:(se,ue)=>{const me=Re();me?.openExternal&&(g.current(`Opening ${ue}`),me.openExternal(ue).catch(Z=>{g.current(Z instanceof Error?Z.message:String(Z))}))},hover:(se,ue)=>g.current(`Link: ${ue}`),leave:()=>g.current("Ready")}});h.current={theme:x.current.theme,font:x.current.font,fontSize:x.current.fontSize,lineHeight:x.current.lineHeight,letterSpacing:x.current.letterSpacing,scrollback:E.current.scrollback,cursorStyle:E.current.cursorStyle,cursorBlink:E.current.cursorBlink};const L=new Bv.FitAddon;S.loadAddon(L),S.open(c),l.current=S;const y=Re();let T=!1,b=0,R=0,k=0,U=!1,H=0;const z=()=>{if(T||!c.isConnected||c.clientWidth<20||c.clientHeight<20)return!1;try{L.fit()}catch{return!1}return S.cols>0&&S.rows>0},V=()=>{!U||!y||!a||S.cols===R&&S.rows===k||(window.clearTimeout(H),H=window.setTimeout(()=>{T||!a||S.cols===R&&S.rows===k||(R=S.cols,k=S.rows,y.resize(a,R,k))},IS))},re=()=>{z()&&V()},K=()=>{cancelAnimationFrame(b),b=requestAnimationFrame(()=>{re(),b=requestAnimationFrame(re)})};if(m.current=K,!y)return K(),S.writeln("\x1B[90mZeroG Terminal\x1B[0m"),S.writeln("\x1B[31mPreload API unavailable. Rebuild the app.\x1B[0m"),g.current("Preload API unavailable"),()=>{T=!0,cancelAnimationFrame(b),l.current=null,n.current=null,S.dispose()};const X=y.onData((se,ue)=>{se===a&&S.write(ue)}),I=y.onStatus((se,ue)=>{se===a&&(g.current(ue),K())}),B=S.onData(se=>{a&&y.write(a,se)}),F=eg({terminal:S,clipboard:y,onError:se=>g.current(se),writeToPty:se=>{a&&y.write(a,se)},pasteEventTarget:c,isCopyOnSelectEnabled:()=>E.current.copyOnSelect}),O=bS({cursor:()=>({row:S.buffer.active.baseY+S.buffer.active.cursorY,col:S.buffer.active.cursorX}),read:(se,ue)=>CS(me=>S.buffer.active.getLine(me)?.translateToString(!0),se,ue),now:()=>Date.now()},se=>{a&&u.current?.(a,se)}),$=S.parser.registerOscHandler(133,se=>O.handle(se));a&&r?.(a,O);const te=new ResizeObserver(()=>K());if(te.observe(c),window.addEventListener("resize",K),document.fonts?.ready?.then(()=>{T||K()}).catch(()=>{}),K(),!a)S.writeln("\x1B[90mZeroG Terminal\x1B[0m"),S.writeln("\x1B[90mSelect a session or create a local/SSH connection.\x1B[0m");else{const se=z()?{cols:S.cols,rows:S.rows}:void 0;se&&(R=se.cols,k=se.rows),y.attachSession(a,se).then(ue=>{U=!0,ue.persistence==="process"?g.current(`${ue.host} · ${ue.name} · process only (install screen for persistence)`):g.current(`${ue.host} · ${ue.name}`),K()}).catch(ue=>{g.current(ue instanceof Error?ue.message:String(ue))})}return()=>{T=!0,cancelAnimationFrame(b),window.clearTimeout(H),F(),B.dispose(),X(),I(),te.disconnect(),$.dispose(),a&&r?.(a,null),window.removeEventListener("resize",K),m.current=null,l.current=null,n.current=null,S.dispose()}},[a]),ee.useEffect(()=>{const c=l.current;if(!c)return;if(A){const y=window.setTimeout(()=>{const T=n.current;n.current=null,T?.dispose()},PS);return()=>window.clearTimeout(y)}if(n.current)return;let S;try{S=new Nv.WebglAddon}catch(y){console.warn("[zerog] pane fell back to the DOM renderer",y);return}const L=S.onContextLoss(()=>{n.current===S&&(n.current=null),S.dispose()});try{c.loadAddon(S)}catch{S.dispose();return}return n.current=S,()=>L.dispose()},[a,A]),ee.useEffect(()=>{if(A)return;const c=l.current;if(!c)return;m.current?.();const S=requestAnimationFrame(()=>{c.rows>0&&c.refresh(0,c.rows-1)});return()=>cancelAnimationFrame(S)},[A]),ee.useEffect(()=>{const c=l.current;if(!c||A)return;const S=h.current;let L=!1;S.theme!==j.theme&&(S.theme=j.theme,c.options.theme=Ap(j.theme)),S.font!==j.font&&(S.font=j.font,c.options.fontFamily=wu(j.font),L=!0),S.fontSize!==j.fontSize&&(S.fontSize=j.fontSize,c.options.fontSize=j.fontSize,L=!0),S.lineHeight!==j.lineHeight&&(S.lineHeight=j.lineHeight,c.options.lineHeight=j.lineHeight,L=!0),S.letterSpacing!==j.letterSpacing&&(S.letterSpacing=j.letterSpacing,c.options.letterSpacing=j.letterSpacing,L=!0),S.scrollback!==G.scrollback&&(S.scrollback=G.scrollback,c.options.scrollback=G.scrollback),S.cursorStyle!==G.cursorStyle&&(S.cursorStyle=G.cursorStyle,c.options.cursorStyle=G.cursorStyle),S.cursorBlink!==G.cursorBlink&&(S.cursorBlink=G.cursorBlink,c.options.cursorBlink=G.cursorBlink),L&&m.current?.()},[j,G,A]),ee.useEffect(()=>{w&&l.current?.focus()},[w]),ee.useEffect(()=>{if(!(!a||!q))return q(a,()=>l.current?.focus()),()=>q(a,null)},[a,q]),ee.useEffect(()=>{if(!(!a||!_))return _(a,()=>US(l.current)),()=>_(a,null)},[a,_]),p.jsx("div",{className:"terminal",ref:v,onMouseDownCapture:c=>c.preventDefault()})}function qS({open:a,ratio:w,browser:A,onRatio:M,children:j}){const G=ee.useRef(null),[q,r]=ee.useState(null),d=q??w,_=v=>Math.min(Op,Math.max(kp,Math.round(v)));return p.jsxs("div",{className:a?"pane-body pane-body-split":"pane-body",ref:G,style:a?{gridTemplateColumns:`${d}fr ${100-d}fr`}:void 0,children:[j,a?p.jsxs(p.Fragment,{children:[p.jsx(ec,{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 l=G.current?.getBoundingClientRect();!l||l.width<=0||r(_((v.clientX-l.left)/l.width*100))},onCommit:()=>{q!==null&&M(q),r(null)},onNudge:v=>M(_(d+v*2)),onReset:()=>M(Bp)}),A]}):null]})}function ec({orientation:a,className:w,label:A,valuePercent:M,style:j,onDrag:G,onCommit:q,onNudge:r,onReset:d}){const[_,v]=ee.useState(!1),l=a==="vertical"?"ArrowLeft":"ArrowUp",g=a==="vertical"?"ArrowRight":"ArrowDown";return p.jsx("div",{role:"separator","aria-orientation":a,"aria-label":A,"aria-valuenow":Math.round(M),"aria-valuemin":0,"aria-valuemax":100,tabIndex:0,className:`${w} ${_?"dragging":""}`.trim(),style:j,title:`${A} — drag, arrow keys, or double-click to reset`,onPointerDown:x=>{x.button===0&&(x.preventDefault(),x.currentTarget.setPointerCapture(x.pointerId),v(!0))},onPointerMove:x=>{x.currentTarget.hasPointerCapture(x.pointerId)&&G(x)},onPointerUp:x=>{x.currentTarget.hasPointerCapture(x.pointerId)&&(x.currentTarget.releasePointerCapture(x.pointerId),v(!1),q())},onPointerCancel:()=>v(!1),onDoubleClick:d,onKeyDown:x=>{x.key===l?(x.preventDefault(),r(-1)):x.key===g?(x.preventDefault(),r(1)):(x.key==="Enter"||x.key==="Home")&&(x.preventDefault(),d())}})}function GS({index:a,onCreate:w}){return p.jsxs("article",{className:"pane empty-pane",children:[p.jsxs("div",{className:"pane-title",children:[p.jsxs("span",{children:["PANE ",a]}),p.jsx("span",{className:"pane-dim",children:"EMPTY"})]}),p.jsxs("div",{className:"empty-pane-body",children:[p.jsx("span",{className:"empty-glyph",children:"+"}),p.jsx("strong",{children:"Split ready"}),p.jsx("small",{children:"Open another terminal here"}),p.jsx("button",{type:"button",onClick:w,children:"Choose session"})]})]})}function KS(){const[a,w]=ee.useState(()=>k0(yu())),A=a.appearance.theme,[M,j]=ee.useState([]),[G,q]=ee.useState(()=>[V_("Workspace",a.sessions.defaultLayout)]),[r,d]=ee.useState(()=>G[0]?.id??""),[_,v]=ee.useState("Ready"),[l,g]=ee.useState({state:"disabled",capabilities:[]}),[x,E]=ee.useState([]),[m,n]=ee.useState(null),[h,u]=ee.useState(!1),[c,S]=ee.useState(a.sessions.startSidebarCollapsed),[L,y]=ee.useState("terminals"),[T,b]=ee.useState("sessions"),[R,k]=ee.useState([]),[U,H]=ee.useState(!1),[z,V]=ee.useState(null),[re,K]=ee.useState(""),[X,I]=ee.useState("local"),[B,F]=ee.useState("loopback"),[O,$]=ee.useState(""),[te,se]=ee.useState(""),[ue,me]=ee.useState(""),[Z,W]=ee.useState(!1),[ae,fe]=ee.useState(!1),[we,Ce]=ee.useState(!1),[Ne,Le]=ee.useState(!1),ze=ee.useMemo(()=>Tu(a.shortcuts),[a.shortcuts]),[rt,Be]=ee.useState(""),[It,ve]=ee.useState(0),[pe,be]=ee.useState([]),[Ee,xe]=ee.useState(!0),[ke,Je]=ee.useState(null),[Ae,Ie]=ee.useState(null),[ot,ut]=ee.useState(!1),[nt,Ke]=ee.useState("Workspace"),[Ue,Gt]=ee.useState(!1),[Mt,Qt]=ee.useState(""),[xt,fs]=ee.useState(!1),[un,ra]=ee.useState([]),[Ii,Xi]=ee.useState("term"),[Zi,Pi]=ee.useState(""),[Mr,$s]=ee.useState(""),[mt,Ft]=ee.useState(null),[na,Mi]=ee.useState({status:"idle",stored:!1,encryptionAvailable:!0,sessionOnly:!1}),[oc,aa]=ee.useState([]),[go,oa]=ee.useState({status:"idle"}),[hi,Qi]=ee.useState({status:"idle",sessionId:null}),[$i,la]=ee.useState(null),ii=ee.useRef(null),Tt=ee.useRef(null),At=ee.useRef(null),Ti=ee.useRef(void 0),[Ji,es]=ee.useState(!1),[Fs,Ws]=ee.useState(!1),[ts,Di]=ee.useState({status:"idle"}),Fi=ee.useRef(null),Wi=ee.useRef(void 0),[Tr,ui]=ee.useState({status:"idle",stored:!1,encryptionAvailable:!0,sessionOnly:!1}),Et=ee.useRef(null),[Dr,ca]=ee.useState([]),[di,_s]=ee.useState(a.sessions.defaultBackend),[So,dn]=ee.useState(a.sessions.defaultWslDistribution),[bo,ha]=ee.useState([]),[kr,ps]=ee.useState([]),[Bt,si]=ee.useState([]),[ua,da]=ee.useState([]),[yo,fa]=ee.useState(!1),qs=ee.useRef(new Map),lc=ee.useCallback((C,N)=>{N?qs.current.set(C,N):qs.current.delete(C)},[]),Kt=ee.useRef(new Map),_a=ee.useCallback((C,N)=>{N?Kt.current.set(C,N):Kt.current.delete(C)},[]),Or=ee.useRef(new Map),pa=ee.useCallback((C,N)=>{N?Or.current.set(C,N):Or.current.delete(C)},[]),[Gs,Br]=ee.useState({}),[fn,Ks]=ee.useState({}),_n=ee.useRef(l0(Re,(C,N)=>mn(Y=>Y[C]===N?Y:{...Y,[C]:N}))).current,Co=_n.listerFor,[pn,mn]=ee.useState({}),[cc,wo]=ee.useState(null),[ms,qi]=ee.useState(null);ee.useEffect(()=>{Re()?.appVersion?.().then(C=>qi(Pp(C))).catch(()=>{})},[]),ee.useEffect(()=>{const C=Re();return C?.mcpStatus?.().then(g).catch(()=>{}),C?.onMcpStatus?.(g)},[]),ee.useEffect(()=>{const C=Re();return C?.listMcpExecutions?.().then(N=>E(N.filter(Y=>"command"in Y&&Y.state==="pending"))).catch(()=>{}),C?.onMcpExecution?.(N=>{if(!("command"in N)){E(Y=>Y.filter(J=>J.requestId!==N.requestId));return}E(Y=>N.state==="pending"?[...Y.filter(J=>J.requestId!==N.requestId),N]:Y.filter(J=>J.requestId!==N.requestId))})},[]),ee.useEffect(()=>{const C=Re();if(C?.onMcpWorkspaceRestored)return C.onMcpWorkspaceRestored(N=>{const Y=N.restored.map(J=>J.session);j(J=>{const Se=new Map(J.map(ye=>[ye.id,ye]));for(const ye of Y)Se.set(ye.id,ye);return[...Se.values()]}),q(J=>{const Se=new Set(Y.map(Te=>Te.id)),ye=N.restored.map(Te=>Te.member);return J.find(Te=>Te.id===N.workspaceId)?J.map(Te=>{if(Te.id!==N.workspaceId)return Te;const dt=Te.pending.filter(lt=>!ye.some(Dt=>lt.sessionId===Dt.sessionId||lt.sshTarget&<.sshTarget===Dt.sshTarget||lt.name===Dt.name&<.kind===Dt.kind));return{...Te,sessionIds:Array.from(new Set([...Te.sessionIds,...Se])),pending:dt}}):[...J,{id:N.workspaceId,name:N.workspaceName??"Restored workspace",sessionIds:Array.from(Se),pending:[],view:vo("grid")}]}),d(N.workspaceId),v(`Restored ${Y.length} session${Y.length===1?"":"s"}`),C.listSessions().then(j).catch(()=>{})})},[]),ee.useEffect(()=>{const C=Re();if(C?.onMcpSshSessionCreated)return C.onMcpSshSessionCreated(({session:N})=>{j(Y=>[...Y.filter(J=>J.id!==N.id),N]),q(Y=>Y.map(J=>J.id===r?{...J,sessionIds:Array.from(new Set([...J.sessionIds,N.id]))}:J)),v(`Opened SSH session to ${N.host}`)})},[r]),ee.useEffect(()=>Re()?.onSftpEvent?.(N=>{N.type==="prompt"?wo(N.prompt.text.trim().split(`
|
|
141
|
+
`).pop()??null):wo(null)}),[]);const vn=ee.useRef(new Set),gn=ee.useCallback(C=>{vn.current.has(C.id)||(vn.current.add(C.id),_n.learnHome(C).then(N=>{N&&mn(Y=>({...Y,[C.id]:N}))}).catch(()=>{}))},[_n]),vs=ee.useRef(new Set),gs=ee.useCallback(C=>{if(vs.current.has(C))return;vs.current.add(C);const N=Re();N&&N.wslHome(C).then(Y=>{Y&&Ks(J=>({...J,[C]:Y}))}).catch(()=>{})},[]),fi=ee.useCallback(C=>{C&&(Oi(C),requestAnimationFrame(()=>qs.current.get(C)?.()))},[]),ma=Er(()=>Ie(null)),xo=Er(()=>{Re()?.cancelAiRequest?.(),Ft(null)}),jr=Er(()=>ut(!1)),Gi=Er(()=>fe(!1)),va=Er(()=>Ce(!1)),Nr=Er(()=>es(!1)),is=Er(()=>Rs()),ga=Er(()=>Ws(!1)),ri=ee.useCallback((C,N)=>{w(Y=>{const J=fp(Y,C,N);return dp(yu(),J),J})},[]),Sa=ee.useCallback((C,N)=>{w(Y=>fp(Y,C,N))},[]),Sn=ee.useCallback(C=>{w(N=>{const Y=B0(N,C);return dp(yu(),Y),Y})},[]);ee.useEffect(()=>{document.documentElement.dataset.theme=A},[A]);const tt=ee.useMemo(()=>G.find(C=>C.id===r)??G[0]??null,[G,r]),ki=tt?.view??vo(a.sessions.defaultLayout),et=ki.layout,jt=ki.focusedSessionId,Hr=ki.maximizedSessionId??null,Qe=ee.useMemo(()=>ki.activeSessionId?M.find(C=>C.id===ki.activeSessionId)??null:null,[ki.activeSessionId,M]),ni=ee.useCallback((C,N)=>{q(Y=>Y_(Y,N??r,C))},[r]),ss=ee.useCallback(C=>ni({activeSessionId:C?.id}),[ni]),Vs=ee.useCallback(C=>ni(N=>({layout:typeof C=="function"?C(N.layout):C})),[ni]),Oi=ee.useCallback(C=>ni({focusedSessionId:C}),[ni]),Bi=ee.useCallback(C=>ni({maximizedSessionId:C}),[ni]),St=ee.useMemo(()=>{if(!tt)return M;const C=new Set(tt.sessionIds);return M.filter(N=>C.has(N.id))},[tt,M]),Eo=tt?.pending??[],Ys=ee.useCallback(async()=>{const C=Re();if(xe(!0),Je(null),!C){Je("Preload API unavailable"),v("Preload API unavailable"),xe(!1);return}try{const N=await C.listSessions();j(N),v(N.length?`${N.length} session${N.length===1?"":"s"}`:"No sessions")}catch(N){const Y=N instanceof Error?N.message:String(N);Je(Y),v(Y)}finally{xe(!1)}},[]);ee.useEffect(()=>{Ys()},[Ys]),ee.useEffect(()=>{const C=Re();C&&C.listBackends?.().then(ca).catch(()=>ca([]))},[]),ee.useEffect(()=>{if(di!=="wsl"){ha([]),dn("");return}const C=Re();C&&C.listWslDistributions?.().then(ha).catch(()=>ha([]))},[di]),ee.useEffect(()=>{if(!ae){ps([]);return}const C=Re();C&&C.listHistory?.().then(ps).catch(()=>ps([]))},[ae]),ee.useEffect(()=>{const C=Re(),N=ds((Qe?.kind==="ssh"?Qe.host:"")||(jt?M.find(J=>J.id===jt)?.host:"")||""),Y=N?Bt.filter(J=>ds(J.hostName??"")===N||J.alias===N):[];if(Y.length===0){da([]);return}C?.discoverRemoteScreens&&(fa(!0),Promise.allSettled(Y.map(J=>C.discoverRemoteScreens(J))).then(J=>{const Se=[];J.forEach((ye,Me)=>{ye.status==="fulfilled"&&Array.isArray(ye.value)&&ye.value.forEach(Te=>{Se.push({session:Te,connection:Y[Me]})})}),da(Se)}).catch(()=>da([])).finally(()=>fa(!1)))},[Bt,Qe?.host,M,jt]),ee.useEffect(()=>{const C=Re();C&&C.listKnownConnections?.().then(si).catch(()=>si([]))},[]),ee.useEffect(()=>{a.ai.recordCommands&&Re()?.listCommandHistory?.().then(be).catch(()=>{})},[a.ai.recordCommands]),ee.useEffect(()=>{const C=Re();C?.speechApiKeyStatus&&C.speechApiKeyStatus().then(N=>ui(Y=>({...Y,stored:N.stored,encryptionAvailable:N.encryptionAvailable}))).catch(()=>{})},[]),ee.useEffect(()=>{const C=Re();C?.aiApiKeyStatus&&C.aiApiKeyStatus().then(N=>Mi(Y=>({...Y,stored:N.stored,encryptionAvailable:N.encryptionAvailable}))).catch(()=>{})},[]),ee.useEffect(()=>{Ee||!xt||q(C=>dg(C,M))},[M,Ee,xt]),ee.useEffect(()=>{const C=Re();if(!C?.loadWorkspaces){fs(!0);return}let N=!1;return C.loadWorkspaces().then(Y=>{if(N)return;const J=Eg(Y,a.sessions.defaultLayout);J.workspaces.length&&(q(J.workspaces),J.activeWorkspaceId&&d(J.activeWorkspaceId))}).catch(()=>{}).finally(()=>{N||fs(!0)}),()=>{N=!0}},[]),ee.useEffect(()=>{Ee||!xt||q(C=>vg(C,N=>{const Y=_u(Ep(N),M,Bt);return Y.kind==="attach"?Y.sessionId:void 0}))},[M,Ee,xt,Bt]),ee.useEffect(()=>{const C=Re();if(C?.onForwardEvent)return C.onForwardEvent(N=>{if(N.type==="status"){k(Y=>po(Y,N.forward));return}if(N.type==="prompt"){V({forwardId:N.forwardId,kind:N.prompt.kind,text:N.prompt.text});return}k(Y=>Y.map(J=>J.id===N.forwardId&&J.status!=="error"?{...J,status:"idle"}:J))})},[]),ee.useEffect(()=>{const C=Re();if(!C?.loadForwards){H(!0);return}let N=!1;return Promise.all([C.loadForwards(),C.listForwards?.()??[]]).then(([Y,J])=>{if(N)return;const Se=_0(Y);k(J.reduce((ye,Me)=>po(ye,Me),Se))}).catch(()=>{}).finally(()=>{N||H(!0)}),()=>{N=!0}},[]),ee.useEffect(()=>{if(!U)return;const C=Re();if(!C?.saveForwards)return;const N=setTimeout(()=>{C.saveForwards(f0(R)).catch(()=>{})},xp);return()=>clearTimeout(N)},[R,U]),ee.useEffect(()=>{if(!xt||Ee)return;const C=Re();if(!C?.saveWorkspaces)return;const N=setTimeout(()=>{C.saveWorkspaces(Cg(G,r,M)).catch(()=>{})},xp);return()=>clearTimeout(N)},[G,r,M,xt,Ee]),ee.useEffect(()=>{r&&ra(C=>C.includes(r)?C:[...C,r])},[r]),ee.useEffect(()=>{!Qe&&St.length&&ss(St[0])},[Qe,St,ss]),ee.useEffect(()=>Re()?.onLinkRefused?.(N=>v(N)),[]);const Ao=ee.useRef(new Map);ee.useEffect(()=>{const C=Re();if(C)return C.onData((N,Y)=>{const J=((Ao.current.get(N)??"")+Y).slice(-2048);Ao.current.set(N,J);const Se=a0(J);Se&&j(ye=>{const Me=ye.find(Te=>Te.id===N);return!Me||Me.cwd===Se.path?ye:ye.map(Te=>Te.id===N?{...Te,cwd:Se.path}:Te)})})},[]),ee.useEffect(()=>{const C=N=>{if(N.key==="Escape"){if(ns.current){N.preventDefault(),En();return}const J=qg({help:Ne,transfer:Fs,settings:Ji,voiceReview:!!$i,overview:ot,suggest:!!mt,modal:!!Ae,palette:we,history:ae});if(!J)return;N.preventDefault(),J==="help"&&Le(!1),J==="transfer"&&Ws(!1),J==="settings"&&es(!1),J==="voiceReview"&&Rs(),J==="overview"&&ut(!1),J==="suggest"&&(Re()?.cancelAiRequest?.(),Ft(null)),J==="modal"&&Ie(null),J==="palette"&&Ce(!1),J==="history"&&fe(!1);return}const Y=Fg({key:N.key,code:N.code,ctrlKey:N.ctrlKey,metaKey:N.metaKey,shiftKey:N.shiftKey,altKey:N.altKey,inTextField:N.target instanceof HTMLInputElement},ze);if(Y){if(N.preventDefault(),Y.action==="switch-workspace"){const J=G[Y.position-1];J&&Js(J.id);return}Y.action==="toggle-help"&&Le(J=>!J),Y.action==="toggle-overview"&&ut(J=>!J),Y.action==="new-workspace"&&(Ke(Yl(G)),Ie("workspace")),Y.action==="new-terminal"&&Ci("local"),Y.action==="ask-ai"&&Ca(),Y.action==="toggle-layout"&&ni(J=>({maximizedSessionId:null,layout:J.layout==="stack"?J.lastSplit:"stack"})),Y.action==="toggle-sidebar"&&S(J=>!J),Y.action==="toggle-settings"&&es(J=>!J),Y.action==="history-palette"&&yc()}};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[ot,mt,Ae,we,ae,Ji,Fs,Ne,$i,hi.status,G,r,tt,St,M]);const bn=hp(a.ai),yn=Ru(Qe),Ro=Ag(Qe),Cn=et==="stack"?1:et==="grid"?4:2,Lo=ee.useMemo(()=>new Set([...un,r]),[un,r]),ba=ee.useMemo(()=>lg(G.filter(C=>Lo.has(C.id)),M,r),[G,M,r,Lo]),rs=ee.useMemo(()=>ba.filter(C=>C.workspaceId===r).map(C=>C.session),[ba,r]),hc=Math.max(Cn,rs.length),Vt=rs.some(C=>C.id===Hr)?Hr:null,uc=rs.find(C=>C.id===Qe?.id)?.id??rs[0]?.id,dc=(C,N)=>et==="stack"?C.id===uc:N<Cn;ee.useEffect(()=>{Fs&&!yn&&Ws(!1)},[Fs,yn]),ee.useEffect(()=>{et==="stack"||ki.lastSplit===et||ni({lastSplit:et})},[et,ki.lastSplit,ni]);const yi=async C=>{ss(C),Oi(C.id);const N=rs.findIndex(Y=>Y.id===C.id);Vt?Bi(C.id):N>=Cn&&et!=="stack"&&Vs("grid"),v(C.persistence==="process"?`${C.host} · ${C.name} · process only (install screen for persistence)`:`${C.host} · ${C.name}`),ut(!1)},Ss=(C,N=r)=>{q(Y=>cg(Y,N,C.id))},fc=async C=>{C.preventDefault();const N=nt.trim()||Yl(G),Y=V_(N,a.sessions.defaultLayout);q(J=>[...J,Y]),d(Y.id),ss(null),Ie(null),v(`Workspace “${N}” ready`)},_c=async C=>{C.preventDefault();const N=Re();if(N){if((tt?pu(tt):St.length)>=4){v("This workspace supports up to 4 sessions."),Ie(null);return}u(!0);try{const Y=await N.createLocalSession({name:Ii,backend:di,wslDistribution:di==="wsl"?So:void 0});j(J=>[...J.filter(Se=>Se.id!==Y.id),Y]),Ss(Y),Oi(Y.id),Bi(null),Vs(mu(St.length+1)),Ie(null),await yi(Y)}catch(Y){v(Y instanceof Error?Y.message:String(Y))}finally{u(!1)}}},wn=async(C,N,Y)=>{const J=Re();if(!J||h)return null;const Se=tt?pu(tt):St.length;if(!Y?.replacingPane&&Se>=4)return v("This workspace supports up to 4 sessions."),Ie(null),null;u(!0);try{const ye=await J.createSshSession({name:N||void 0,target:C});return j(Me=>[...Me.filter(Te=>Te.id!==ye.id),ye]),Ss(ye),Oi(ye.id),Bi(null),Vs(mu(Y?.replacingPane?Math.max(Se,1):Se+1)),Ie(null),await yi(ye),ye}catch(ye){return v(ye instanceof Error?ye.message:String(ye)),null}finally{u(!1)}},pc=async C=>{C.preventDefault(),await wn(Mr,Zi)},Mo=async(C,N)=>{const Y=Re();if(!Y)return null;if(C.kind==="unavailable")return v(C.reason),null;if(C.kind==="attach"){const Se=M.find(ye=>ye.id===C.sessionId);return Se?(Ss(Se),await yi(Se),Se):null}if(C.kind==="attach-remote-screen")return gc(C.name,C.screenName,C.connection);const J=await wn(C.target,C.name,N);return!J||!C.screenCommand||(await Y.attachSession(J.id),await ya(Y,J.id),Y.write(J.id,`${C.screenCommand}\r`)),J},mc=async C=>{const N=_u(Ep(C),M,Bt);if(N.kind==="unavailable"){q(J=>Z_(J,r,C.sessionId)),v(N.reason);return}v(`Reconnecting ${C.name}…`),await Mo(N,{replacingPane:!0})&&q(J=>Z_(J,r,C.sessionId))},vc=C=>{v(`Connecting to ${C.alias}…`),wn(C.hostName??C.alias,C.alias.slice(0,48))},gc=async(C,N,Y)=>{try{const J=Re();if(!J)return null;v(`Attaching to ${C} on ${Y.alias}…`);const ye=(await J.buildRemoteScreenAttach?.(Y,N))?.args,Me=Array.isArray(ye)?ye.indexOf("--"):-1,Te=Me>0?ye[Me-1]:Y.hostName??Y.alias,lt={...await J.createSshSession({target:Te,name:C}),screenName:N,persistence:"screen",backend:"screen"};j(vt=>vt.some(Jt=>Jt.id===lt.id)?vt.map(Jt=>Jt.id===lt.id?lt:Jt):[...vt,lt]),Ss(lt),await yi(lt),await J.attachSession(lt.id);const Dt=ye&&Me>0?ye.slice(Me+1).join(" "):`screen -x ${N}`;return await ya(J,lt.id),J.write(lt.id,`${Dt}\r`),await Ys(),v(`Connected to ${C} on ${Y.alias}`),lt}catch(J){return v(J instanceof Error?J.message:String(J)),null}},ya=(C,N)=>new Promise(Y=>{let J=!1,Se="",ye,Me;const Te=()=>{J||(J=!0,clearTimeout(ye),clearTimeout(dt),Me?.(),Y())},dt=setTimeout(Te,NS);Me=C.onData((lt,Dt)=>{if(lt===N){if(Se=(Se+Dt).slice(-512),K_(Se)){Te();return}clearTimeout(ye),ye=setTimeout(Te,jS)}})}),Sc=ee.useCallback((C,N)=>{if(!a.ai.recordCommands)return;const Y=AS(N.command);if(Y){v(`Command not remembered — it looks like it carries a credential (${Y}).`);return}const J=Re();if(!J?.recordCommand)return;const Se=M.find(ye=>ye.id===C);J.recordCommand({command:N.command,...Se?.cwd?{cwd:Se.cwd}:{},...Se?.host?{host:Se.host}:{},...Se?.kind?{kind:Se.kind}:{},...N.exitCode===void 0?{}:{exitCode:N.exitCode}}).then(ye=>{ye&&be(Me=>[...Me.filter(Te=>Te.id!==ye.id),ye])}).catch(()=>{})},[a.ai.recordCommands,M]),bc=ee.useMemo(()=>{const C=[...Kt.current.values()];return{entries:pe.length,panesReporting:C.filter(N=>N.hasMarks()).length,panesOpen:C.length}},[pe,Ji,M]),yc=()=>{Be(""),ve(0),Ce(!0),Re()?.listCommandHistory?.().then(be).catch(()=>{})},Xs=ee.useMemo(()=>{if(!we)return[];const C=M.find(N=>N.id===(jt??Qe?.id));return kS(pe,{query:rt,...C?.cwd?{cwd:C.cwd}:{},...C?.host?{host:C.host}:{},now:Date.now(),limit:40})},[we,pe,rt,M,jt,Qe?.id]),Zs=C=>{const N=jt??Qe?.id;if(Ce(!1),!N){v("No terminal selected for the command");return}Re()?.write(N,C.entry.command),Re()?.pickCommand?.(C.entry.id).catch(()=>{}),v(`On the prompt: ${C.entry.command}`),fi(N)},Cc=async()=>{await Re()?.clearCommandHistory?.().catch(()=>{}),be([]),v("Remembered commands forgotten.")},Ca=()=>{if(!wp(a.ai)){es(!0),v("Set an AI endpoint and model in Settings first.");return}Ft(bu(Qe?.id??jt))},To=async C=>{const N=Re(),Y=mt;if(!N?.requestAiCommand||!Y)return;const J=Y.sessionId,Se=J?M.find(Te=>Te.id===J):void 0,ye=a.ai.includeOutput&&!!J,Me=ye&&J?BS(Or.current.get(J)?.()??"",a.ai.outputChars):"";Ft({phase:"thinking",sessionId:J,prompt:C,usedOutput:ye&&!!Me});try{const Te=await N.requestAiCommand({baseUrl:a.ai.baseUrl,model:a.ai.model},{prompt:C,...J?{sessionId:J}:{},context:{...Se?.backend?{shell:Gp(Se.backend)}:{},...Se?.cwd?{cwd:Se.cwd}:{},...Se?.host?{host:Se.host}:{},...Se?.kind?{kind:Se.kind}:{},...Me?{output:Me}:{}}}),dt=ye&&!!Me;if(OS(a.ai,dt,Te.command)&&J){N.write(J,`${Te.command}\r`),Ft(null),v(`Ran suggestion: ${Te.command}`);return}Ft({phase:"reviewing",sessionId:J,prompt:C,usedOutput:dt,suggestion:Te})}catch(Te){Ft({phase:"failed",sessionId:J,prompt:C,message:Ar(Te)})}},Do=()=>{if(mt?.phase!=="reviewing")return;const{sessionId:C,suggestion:N}=mt;Ft(null),!(!C||!N.command)&&(Re()?.write(C,`${N.command}\r`),v(`Sent: ${N.command}`),fi(C))},ko=async()=>{const C=Re();if(C?.listAiModels)try{aa(await C.listAiModels(a.ai.baseUrl))}catch(N){aa([]),v(Ar(N))}},Oo=async()=>{const C=Re();if(!C?.testAiEndpoint)return;oa({status:"testing",message:null});const N=await C.testAiEndpoint({baseUrl:a.ai.baseUrl,model:a.ai.model});oa({status:"idle",ok:N.ok,message:N.message})},bs=ee.useMemo(()=>{const C=new Set;for(const N of M)N.kind==="ssh"&&N.host&&C.add(N.host);for(const N of Bt)C.add(N.hostName??N.alias);return[...C]},[M,Bt]),wa=()=>{K(C=>C||(Qe?.kind==="ssh"?Qe.host:bs[0])||""),W(!1),Ie("forward")},Bo=async C=>{const N=Re();if(!N?.openForward)return;const Y=d0(C,R);if(Y){v(Y);return}b("ports"),k(J=>po(J,{...C,status:"connecting"}));try{const J=await N.openForward(C);k(Se=>po(Se,J)),v(`Sharing ${rp(J)}`)}catch(J){const Se=Ar(J);k(ye=>po(ye,{...C,status:"error",message:Se})),v(Se)}},wc=async C=>{C.preventDefault();const N=Number(O),Y=Number(te||O);if([N,Y].some(Se=>!Number.isInteger(Se)||Se<1||Se>65535)){v("A port must be a whole number between 1 and 65535.");return}Ie(null),await Bo({id:`forward:${crypto.randomUUID()}`,target:re.trim(),direction:X,bind:B,listenPort:N,destinationPort:Y,...ue.trim()?{destinationHost:ue.trim()}:{}})},jo=async C=>{const N=Re();k(Y=>Y.filter(J=>J.id!==C.id)),v(`Stopped sharing ${on(C)}`);try{await N?.closeForward?.(C.id)}catch{}},xa=C=>tt?.view.browsers?.[C],ys=C=>!!xa(C)?.open,zr=C=>xa(C)?.ratio??Bp,No=(C,N)=>{ni(Y=>({browsers:{...Y.browsers,[C]:{open:!1,...Y.browsers?.[C],...N}}}))},Ur=C=>{const N=!ys(C);No(C,{open:N}),N||Br(Y=>({...Y,[C]:""}))},Ho=C=>Gs[C.id]||Dg(C,zo(C)),zo=C=>C.kind==="ssh"?pn[C.id]:C.wslDistribution?fn[C.wslDistribution]:void 0,Ea=(C,N)=>{const Y=Re();if(!Y)return;const J=Rg(C);if(!J){v(`ZeroG does not know how ${C.name} quotes a path, so it will not type one.`);return}const Se=ip(C,N);if(!Se){v(`That directory is outside what ${C.name} can reach.`);return}if(!Aa(C)){v(`${C.name} is running something, so its directory was left alone.`);return}const ye=jg(J,Se);if("refused"in ye){v(ye.refused);return}Y.write(C.id,ye.command+"\r"),Br(Me=>({...Me,[C.id]:N})),v(`${C.name}: ${ye.command}`),fi(C.id)},Aa=C=>{const N=Kt.current.get(C.id);if(N?.hasMarks())return N.atPrompt();const Y=Or.current.get(C.id);if(!Y)return!1;const J=Y().trimEnd().split(`
|
|
142
|
+
`);return K_(J[J.length-1]??"")},xn=ee.useRef(new Map);ee.useEffect(()=>{const C=[];for(const N of M)xn.current.has(N.id)&&xn.current.get(N.id)!==N.cwd&&C.push(N.id),xn.current.set(N.id,N.cwd);C.length&&Br(N=>{const Y={...N};let J=!1;for(const Se of C)Y[Se]&&(delete Y[Se],J=!0);return J?Y:N})},[M]),ee.useEffect(()=>{for(const C of M){if(!ys(C.id))continue;const N=!C.cwd||C.cwd.startsWith("~");if(C.kind==="ssh"){pn[C.id]||gn(C);continue}!C.wslDistribution||!N||fn[C.wslDistribution]||gs(C.wslDistribution)}},[M,tt?.view.browsers,fn,pn,gs,gn]);const ns=ee.useRef(null),[Uo,Ra]=ee.useState(null),[La,Io]=ee.useState(null),[xc,Po]=ee.useState(null),Wt=ee.useRef(!1),Ir=()=>[...document.querySelectorAll(".workspace-tab-slot")].map(C=>{const N=C.getBoundingClientRect();return{id:C.dataset.workspaceId??"",left:N.left,width:N.width}}),$o=(C,N)=>{N.button===0&&(N.target.closest(".workspace-tab-close")||(ns.current={id:C.id,pointerId:N.pointerId,startX:N.clientX,dragging:!1,original:G},N.currentTarget.setPointerCapture?.(N.pointerId)))},Fo=C=>{const N=ns.current;if(!N||N.pointerId!==C.pointerId)return;if(!N.dragging){if(!pS(N.startX,C.clientX))return;N.dragging=!0,Wt.current=!0,Ra(N.id)}const Y=Ir();if(Y.findIndex(ye=>ye.id===N.id)<0)return;const Se=mS(Y,C.clientX);q(ye=>{const Me=Su(ye,N.id);return Me<0?ye:bp(ye,Me,Se)})},Wo=C=>{const N=ns.current;!N||N.pointerId!==C.pointerId||(C.currentTarget.releasePointerCapture?.(C.pointerId),ns.current=null,Ra(null),N.dragging&&window.setTimeout(()=>{Wt.current=!1},0))},En=()=>{const C=ns.current;C&&(ns.current=null,Ra(null),C.dragging&&q(C.original),Wt.current=!1)},Ma=C=>{const N=Su(G,C.id),Y=G.length-1,J=Se=>q(ye=>bp(ye,Su(ye,C.id),Se));return[{label:"Rename…",icon:"pencil",onSelect:()=>{Po(C.id),Ke(C.name),Ie("rename")}},{label:"Duplicate",icon:"copy",hint:"Copies the layout, and each SSH pane as one to reconnect",onSelect:()=>Ec(C)},{label:"Move left",icon:"chevron-left",disabled:N<=0,onSelect:()=>J(N-1)},{label:"Move right",icon:"chevron-right",disabled:N<0||N>=Y,onSelect:()=>J(N+1)},{label:"Close workspace",icon:"x",danger:!0,disabled:G.length<2,hint:G.length<2?"The last workspace cannot be closed":"Its terminals keep running",onSelect:()=>An(C.id)}]},Ec=C=>{const N=Yl(G),Y=_g(G,C.id,M,N);if(!Y.created)return;q(Y.workspaces),d(Y.created.id),ss(null);const J=[`Workspace “${N}” copies ${C.name}`];Y.copied&&J.push(`${Y.copied} SSH ${Y.copied===1?"pane":"panes"} to reconnect`),Y.skipped&&J.push(`${Y.skipped} local ${Y.skipped===1?"pane":"panes"} not copied`),v(J.join(" · "))},Qs=async C=>{C.preventDefault();const N=xc,Y=nt.trim();if(Ie(null),Po(null),!N||!Cu(Y))return;const J=G.find(Se=>Se.id===N)?.name;Y!==J&&(q(Se=>X_(Se,N,Y)),v(`Workspace “${J}” is now “${Y}”`))},Pr=()=>{Ke(Yl(G)),Ie("workspace")},Js=C=>{if(C===r)return;const N=G.find(Y=>Y.id===C);N&&(Gt(!1),d(C),v(`Workspace “${N.name}”`))},An=C=>{const N=G.find(Se=>Se.id===C),Y=mg(G,C,r);if(Y.workspaces===G)return;Gt(!1),q(Y.workspaces),d(Y.activeWorkspaceId);const J=Y.releasedSessionIds.length;v(J?`Closed workspace “${N?.name}” · ${J} session${J===1?"":"s"} still running`:`Closed workspace “${N?.name}”`)},qo=()=>{tt&&(Qt(tt.name),Gt(!0))},as=()=>{if(Gt(!1),!tt)return;const C=Mt.trim();!Cu(C)||C===tt.name||(q(N=>X_(N,tt.id,C)),v(`Workspace renamed to “${C}”`))},Ci=(C,N)=>{Xi(YS(tt?.name??"term",St)),_s(Xp(a.sessions.defaultBackend,Dr)),dn(a.sessions.defaultWslDistribution),N?.sshTarget!==void 0&&$s(N.sshTarget),Ie(C)},er=()=>Ci("local"),Go=()=>R.length?p.jsx("div",{className:"session-list",children:c0(R).map(C=>p.jsxs(cn.Fragment,{children:[p.jsx("div",{className:"session-group-label",children:C.host}),C.forwards.map(N=>p.jsxs("div",{className:`session-row forward-row ${N.status==="idle"?"session-ghosted":""}`,children:[p.jsx("span",{className:`status-dot ${h0(N)}`}),p.jsx("button",{type:"button",className:"forward-open",onClick:()=>N.status==="idle"||N.status==="error"?void Bo(N):void 0,title:N.status==="idle"||N.status==="error"?`Reconnect ${on(N)}`:rp(N),children:p.jsxs("span",{className:"session-copy",children:[p.jsx("b",{children:on(N)}),p.jsxs("small",{children:[N.direction==="local"?"←":"→"," ",N.destinationHost||"localhost",":",N.destinationPort,N.status==="connecting"?" · connecting…":"",N.status==="idle"?" · not connected":"",N.status==="error"?` · ${N.message??"failed"}`:""]})]})}),u0(N)&&p.jsx("span",{className:"forward-badge",title:"Reachable from your network, not just this machine",children:"LAN"}),p.jsx("button",{type:"button",className:"forward-close",onClick:()=>{jo(N)},title:`Stop sharing ${on(N)}`,"aria-label":`Stop sharing ${on(N)}`,children:"×"})]},N.id))]},C.host))}):p.jsx("div",{className:"session-list",children:p.jsxs("div",{className:"session-empty",children:[p.jsx("b",{children:"No shared ports"}),p.jsx("small",{children:"Share a port to reach a service on a remote host from this machine, or the other way round."}),p.jsx("button",{type:"button",onClick:wa,children:"Share a port"})]})}),Cs=()=>{const C=ds((Qe?.kind==="ssh"?Qe.host:"")||(jt?M.find(Me=>Me.id===jt)?.host:"")||""),N=C?ua.filter(Me=>ds(Me.connection.hostName??"")===C||Me.connection.alias===C).reduce((Me,Te)=>{const dt=Te.connection.hostName||Te.connection.alias;return(Me[dt]=Me[dt]||[]).push(Te),Me},{}):{},Y=M.filter(Me=>Me.persistence==="screen"&&!St.some(Te=>Te.id===Me.id)),J=Object.keys(N).length>0,Se=Y.length>0;if(!J&&!Se)return p.jsxs("div",{className:"session-empty",children:[p.jsx("b",{children:"No screens"}),p.jsx("small",{children:C?"No remote screens found for this host.":"Open a remote session to discover screens, or start a local screen."})]});const ye=[];if(J)for(const[Me,Te]of Object.entries(N)){const dt=Te,lt=p.jsx("div",{className:"session-group-label",children:Me},`${Me}-label`),Dt=dt.map(({session:vt})=>{const li=dt.find(Jt=>Jt.session.id===vt.id)?.connection;return p.jsx(Zl,{session:vt,ghosted:!0,onClick:async()=>{if(!li)return;v(`Attaching ${vt.name}…`);const Jt=Re();if(Jt)try{const Ls=(await Jt.buildRemoteScreenAttach?.(li,vt.screenName??vt.name))?.args,Wr=Array.isArray(Ls)?Ls.indexOf("--"):-1,Pt=Wr>0?Ls[Wr-1]:li.hostName??li.alias,Pe={...await Jt.createSshSession({target:Pt,name:vt.name}),screenName:vt.screenName??vt.name,persistence:"screen",backend:"screen"};j(ei=>ei.some(rr=>rr.id===Pe.id)?ei.map(rr=>rr.id===Pe.id?Pe:rr):[...ei,Pe]),Ss(Pe),await yi(Pe),await Jt.attachSession(Pe.id);const ls=Ls&&Wr>0?Ls.slice(Wr+1).join(" "):`screen -x ${vt.screenName??vt.name}`;await ya(Jt,Pe.id),Jt.write(Pe.id,`${ls}\r`),await Ys(),v(`Connected to ${vt.name}`)}catch(sr){v(sr instanceof Error?sr.message:String(sr))}}},vt.id)});ye.push(lt,...Dt)}return Se&&!J&&(ye.push(p.jsx("div",{className:"session-group-label",children:"local"},"local-label")),Y.forEach(Me=>{ye.push(p.jsx(Zl,{session:Me,ghosted:!0,onClick:()=>{Ss(Me),yi(Me),v(`Reconnecting to ${Me.name}…`)}},Me.id))})),p.jsx(p.Fragment,{children:ye})},Ko=et==="split-v"?"pane-grid split-v":et==="split-h"?"pane-grid split-h":et==="grid"?"pane-grid grid":"pane-grid",Ta=!Vt&&(et==="split-v"||et==="grid"),Da=!Vt&&(et==="split-h"||et==="grid"),ws=a.sessions.splitColumnRatio,xs=a.sessions.splitRowRatio,Vo=ee.useRef(null),Yo=Vt?void 0:{...Ta?{gridTemplateColumns:`${ws}fr ${1-ws}fr`}:{},...Da?{gridTemplateRows:`${xs}fr ${1-xs}fr`}:{}},ka=(C,N)=>{const Y=Vo.current?.getBoundingClientRect();if(!Y)return;const J=C==="column"?(N.clientX-Y.left)/Y.width:(N.clientY-Y.top)/Y.height;Number.isFinite(J)&&Sa("sessions",C==="column"?{splitColumnRatio:J}:{splitRowRatio:J})},Rn=(C,N)=>{const J=(C==="column"?ws:xs)+N*.02;ri("sessions",C==="column"?{splitColumnRatio:J}:{splitRowRatio:J})},_i=C=>{ri("sessions",C==="column"?{splitColumnRatio:$e.sessions.splitColumnRatio}:{splitRowRatio:$e.sessions.splitRowRatio})},Es={layout:et,maximized:!!Vt,columnRatio:ws,rowRatio:xs,sessionCount:St.length,lastSplit:ki.lastSplit},ai=ee.useRef(null),tr=C=>{const N=ai.current?.getBoundingClientRect();N&&Sa("sessions",{sidebarWidth:Math.round(C.clientX-N.left)})},Oa=C=>{ni(N=>({focusedSessionId:C,maximizedSessionId:N.maximizedSessionId===C?null:C}))},$r=C=>{if(C.kind==="restore"){Bi(null);return}if(C.kind==="show"){Bi(null),Vs(C.layout);return}if(C.kind==="reset-splits"){ri("sessions",C.ratios);return}const N=jt??Qe?.id??St[0]?.id;N&&Bi(N)},Fr=C=>{if(!Vt||St.length<2)return;const Y=(St.findIndex(Se=>Se.id===Vt)+C+St.length)%St.length,J=St[Y];Oi(J.id),ss(J),Bi(J.id)},Ln=()=>(Tt.current??=new fS({createWorker:()=>new Worker(new URL(""+new URL("voice-worker-DoNT0zEM.js",import.meta.url).href,import.meta.url),{type:"module"}),resolveApiKey:async()=>Et.current??await window.zerog?.readSpeechApiKey()??null}),Tt.current),As=async C=>{const N=Re();if(N?.saveSpeechApiKey){ui(Y=>({...Y,status:"saving",error:null,notice:null}));try{const Y=await N.saveSpeechApiKey(C);Et.current=null,ui({status:"idle",stored:Y.stored,encryptionAvailable:Y.encryptionAvailable,sessionOnly:!1,notice:Y.stored?"Key saved, encrypted by this system.":"Key cleared."})}catch(Y){Et.current=C,ui(J=>({...J,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(Y instanceof Error?Y.message:String(Y))}}},Xo=async()=>{const C=Re();if(Et.current=null,!C?.clearSpeechApiKey){ui(N=>({...N,stored:!1,sessionOnly:!1,notice:"Key cleared.",error:null}));return}try{const N=await C.clearSpeechApiKey();ui(Y=>({...Y,status:"idle",stored:N.stored,sessionOnly:!1,notice:"Key cleared.",error:null}))}catch(N){ui(Y=>({...Y,status:"idle",sessionOnly:!1,error:N instanceof Error?N.message:String(N)}))}},Mn=async C=>{const N=Re();if(N?.saveAiApiKey){Mi(Y=>({...Y,status:"saving",error:null,notice:null}));try{const Y=await N.saveAiApiKey(C);Mi({status:"idle",stored:Y.stored,encryptionAvailable:Y.encryptionAvailable,sessionOnly:!1,notice:Y.stored?"Key saved, encrypted by this system.":"Key cleared."})}catch(Y){Mi(J=>({...J,status:"idle",error:Ar(Y)}))}}},ir=async()=>{const C=Re();if(C?.clearAiApiKey)try{const N=await C.clearAiApiKey();Mi(Y=>({...Y,status:"idle",stored:N.stored,notice:"Key cleared.",error:null}))}catch(N){Mi(Y=>({...Y,status:"idle",error:Ar(N)}))}},Ac=C=>{if(C.kind==="notice"){v(C.message);return}C.progress!==null&&v(`Loading speech model… ${Math.round(C.progress)}%`)},oi=()=>{const C=At.current;window.clearTimeout(Ti.current),ii.current?.cancel(),ii.current=null,At.current=null,Qi({status:"idle",sessionId:null}),fi(C)},Rs=()=>{const C=$i?.sessionId;la(null),fi(C)},ji=async()=>{const C=ii.current,N=At.current;if(!C||!N)return;window.clearTimeout(Ti.current),ii.current=null,Qi({status:"transcribing",sessionId:N}),v("Transcribing…");const Y=await C.stop();if(!Y||W_(Y,a.speech.silenceThreshold)){At.current=null,Qi({status:"idle",sessionId:null}),v("Voice: no speech detected — lower the silence threshold in Settings if this is wrong"),fi(N);return}try{const J=await Ln().transcribe(Y,a.speech,Ac);if(At.current=null,Qi({status:"idle",sessionId:null}),!J.text){v("Voice: nothing transcribed"),fi(N);return}if(a.ai.voiceInsert==="review"){la({sessionId:N,text:J.text}),v(`Voice: review "${J.text}"`);return}Re()?.write(N,J.text),v(`Voice: "${J.text}"`),fi(N)}catch(J){At.current=null,Qi({status:"idle",sessionId:null}),v(`Voice error: ${J instanceof Error?J.message:String(J)}`),fi(N)}},Zo=async C=>{if(hi.status==="listening"&&hi.sessionId===C.id){await ji();return}if(hi.status!=="idle")return;if(ts.status!=="idle"){v("The speech test in Settings is using the microphone");return}const N=new q_;try{await N.start()}catch(Y){v(`Microphone unavailable: ${Y instanceof Error?Y.message:String(Y)}`);return}ii.current=N,At.current=C.id,Qi({status:"listening",sessionId:C.id}),fi(C.id),window.clearTimeout(Ti.current),Ti.current=window.setTimeout(()=>{ji()},a.speech.maxUtteranceSeconds*1e3),v(`Listening on ${C.name}… click the mic again to transcribe, Esc to discard`)},Tn=C=>{const N=Re();if(!N)return;const Y=hp(a.ai);N.write(C.id,`${Y}\r`),v(`Sent "${Y}" to ${C.name}`),fi(C.id)},os=async()=>{const C=Fi.current;if(!C)return;window.clearTimeout(Wi.current),Fi.current=null,Di({status:"transcribing",message:"Transcribing…",transcript:null,error:null});const N=await C.stop();if(!N){Di({status:"idle",error:"Nothing was recorded."});return}const Y=Lp(N),J=W_(N,a.speech.silenceThreshold);try{const Se=await Ln().transcribe(N,a.speech,ye=>{Di(Me=>({...Me,message:ye.kind==="notice"?ye.message:ye.progress!==null?`Loading speech model… ${Math.round(ye.progress)}%`:"Loading speech model…"}))});Di({status:"idle",transcript:Se.text,elapsedMs:Se.elapsedMs,level:Y,message:J?"Below the silence threshold — a real recording at this level would have been discarded.":Se.engine==="server"?"Transcribed by the server.":"Transcribed by the built-in engine.",error:null})}catch(Se){Di({status:"idle",level:Y,error:Se instanceof Error?Se.message:String(Se)})}},Ba=async()=>{if(ts.status==="recording"){await os();return}if(ts.status==="transcribing")return;if(hi.status!=="idle"){Di({status:"idle",error:"A terminal pane is recording — stop that first."});return}const C=new q_;try{await C.start()}catch(N){Di({status:"idle",error:`Microphone unavailable: ${N instanceof Error?N.message:String(N)}`});return}Fi.current=C,Di({status:"recording",message:"Listening… say a command, then stop.",transcript:null,error:null}),window.clearTimeout(Wi.current),Wi.current=window.setTimeout(()=>{os()},a.speech.maxUtteranceSeconds*1e3)};ee.useEffect(()=>()=>{window.clearTimeout(Ti.current),window.clearTimeout(Wi.current),ii.current?.cancel(),Fi.current?.cancel(),Tt.current?.dispose()},[]);const Qo=async C=>{hi.sessionId===C.id&&oi(),_n.forget(C.id);const N=St.filter(J=>J.id!==C.id);q(J=>{const Se=hg(J,C.id);return Y_(Se,r,ye=>({activeSessionId:ye.activeSessionId??N[0]?.id,focusedSessionId:ye.focusedSessionId??N[0]?.id,layout:mu(N.length)}))});const Y=Re();if(Y)try{await Y.closeSession(C.id)}catch(J){v(J instanceof Error?J.message:String(J));return}v(C.persistence==="screen"?`Closed ${C.name} · screen session survives`:C.kind==="ssh"?`Closed ${C.name} · SSH connection ended`:`Closed ${C.name} · process ended`),Ys()};return p.jsxs("main",{className:`app-shell ${c?"drawer-collapsed":""}`,children:[p.jsxs("header",{className:"window-bar",children:[p.jsxs("div",{className:"window-brand",title:$p(ms),children:[p.jsx("span",{className:"brand-mark",children:"ZG"}),p.jsx("span",{className:"brand-name",children:"ZeroG"}),ms&&p.jsx("span",{className:"brand-version",children:ms})]}),p.jsx("div",{className:"workspace-tabs",children:G.map((C,N)=>{const Y=G.length>1,J=pg(C,M);return p.jsxs("span",{className:`workspace-tab-slot ${Y?"closable":""} ${Uo===C.id?"dragging":""}`,"data-workspace-id":C.id,children:[p.jsxs("button",{type:"button",className:`workspace-tab ${C.id===tt?.id?"active":""}`,title:`Switch to ${C.name}${N<9?` (Ctrl+Shift+${N+1})`:""} · drag to reorder`,onPointerDown:Se=>$o(C,Se),onContextMenu:Se=>{Se.preventDefault(),En(),Io({id:C.id,at:{x:Se.clientX,y:Se.clientY}})},onPointerMove:Fo,onPointerUp:Wo,onPointerCancel:En,onClick:()=>{Wt.current||Js(C.id)},children:[p.jsx("span",{className:`status-dot ${J==="empty"?"":J}`}),C.name,p.jsx("span",{className:"tab-meta",children:pu(C)})]}),Y&&p.jsx("button",{type:"button",className:"workspace-tab-close",title:`Close ${C.name} · its terminals keep running`,"aria-label":`Close workspace ${C.name}`,onClick:()=>An(C.id),children:"×"})]},C.id)})}),p.jsxs("div",{className:"window-actions",children:[l.state==="connected"&&p.jsxs("button",{type:"button",className:"bar-button mcp-stop-button",onClick:()=>{Re()?.revokeMcpControl?.(),v("AI control revoked · panes remain available manually")},title:"Stop AI control and take over manually","aria-label":"Stop AI control and take over manually",children:[p.jsx(Fe,{name:"stop"}),p.jsx("span",{children:"Take over"})]}),x.length>0&&p.jsx("span",{className:"mcp-pending-count",title:"Commands waiting for explicit approval",children:x.map(C=>p.jsxs("span",{className:"mcp-pending-request",children:[p.jsx("span",{title:C.displayCommand,children:C.displayCommand}),p.jsx("button",{type:"button",className:"bar-button",onClick:()=>{Re()?.approveMcpExecution?.(C.requestId)},"aria-label":`Approve command ${C.displayCommand}`,children:"Approve"}),p.jsx("button",{type:"button",className:"bar-button",onClick:()=>{Re()?.rejectMcpExecution?.(C.requestId)},"aria-label":`Reject command ${C.displayCommand}`,children:"Reject"})]},C.requestId))}),p.jsxs("button",{type:"button",className:"bar-button",onClick:()=>ut(C=>!C),title:`Session overview (${bi("toggle-overview",ze)})`,children:[p.jsx(Fe,{name:"grid"}),p.jsx("span",{children:"Overview"})]}),p.jsxs("button",{type:"button",className:"bar-button",onClick:Pr,title:`New workspace (${bi("new-workspace",ze)})`,children:[p.jsx(Fe,{name:"plus"}),p.jsx("span",{children:"Workspace"})]}),p.jsxs("button",{type:"button",className:"bar-button",onClick:Ca,title:wp(a.ai)?`Ask for a command (${bi("ask-ai",ze)})`:"Set an AI endpoint in Settings first",children:[p.jsx(Fe,{name:"spark"}),p.jsx("span",{children:"Suggest"})]}),p.jsx("button",{type:"button",className:"bar-button theme-button",onClick:()=>ri("appearance",{theme:A==="dark"?"light":"dark"}),title:`Switch to ${A==="dark"?"light":"dark"} theme`,"aria-label":`Switch to ${A==="dark"?"light":"dark"} theme`,"aria-pressed":A==="light",children:p.jsx(Fe,{name:A==="dark"?"sun":"moon"})}),p.jsx("button",{type:"button",className:Ne?"bar-button active":"bar-button",onClick:()=>Le(C=>!C),title:`Features and keyboard shortcuts (${bi("toggle-help",ze)})`,"aria-label":"Help","aria-pressed":Ne,children:p.jsx(Fe,{name:"help"})})]})]}),p.jsxs("div",{className:"body-shell",children:[p.jsxs("nav",{className:"rail","aria-label":"Workspace navigation",children:[p.jsx("button",{type:"button",className:"rail-button",title:`${c?"Show":"Hide"} sessions sidebar (${bi("toggle-sidebar",ze)})`,onClick:()=>S(C=>!C),children:p.jsx(Fe,{name:c?"panel-left-open":"panel-left"})}),p.jsx("button",{type:"button",className:`rail-button ${!c&&T==="sessions"?"active":""}`,title:"Sessions",onClick:()=>{b("sessions"),S(!1)},children:p.jsx(Fe,{name:"sessions"})}),p.jsx("button",{type:"button",className:"rail-button",onClick:()=>ut(!0),title:"Overview",children:p.jsx(Fe,{name:"grid"})}),p.jsx("button",{type:"button",className:`rail-button ${!c&&T==="ports"?"active":""}`,title:"Shared ports","aria-label":"Shared ports",onClick:()=>{b("ports"),S(!1)},children:p.jsx(Fe,{name:"ports"})}),p.jsx("span",{className:"rail-spacer"}),p.jsx("button",{type:"button",className:"rail-button",onClick:wa,title:"Share a port over SSH","aria-label":"Share a port",children:p.jsx(Fe,{name:"port-plus"})}),p.jsx("button",{type:"button",className:"rail-button",onClick:er,title:`New local terminal (${bi("new-terminal",ze)})`,"aria-label":"New local terminal",children:p.jsx(Fe,{name:"terminal"})}),p.jsx("button",{type:"button",className:"rail-button",onClick:()=>Ci("ssh"),title:"Connect SSH",children:p.jsx(Fe,{name:"ssh"})}),p.jsx("button",{type:"button",className:`rail-button ${Ji?"active":""}`,title:`Settings (${bi("toggle-settings",ze)})`,"aria-label":"Settings","aria-expanded":Ji,onClick:()=>es(C=>!C),children:p.jsx(Fe,{name:"settings"})})]}),!c&&p.jsxs("aside",{className:"session-drawer",ref:ai,style:{width:a.sessions.sidebarWidth},children:[p.jsxs("div",{className:"drawer-head",children:[p.jsxs("div",{className:"drawer-head-name",children:[p.jsx("span",{className:"eyebrow",children:T==="ports"?"SHARED PORTS":"WORKSPACE"}),T==="ports"?p.jsx("h1",{children:"Ports"}):Ue&&tt?p.jsx("input",{className:"workspace-rename",autoFocus:!0,"aria-label":"Workspace name",value:Mt,pattern:Jl,onChange:C=>Qt(C.target.value),onBlur:as,onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),C.stopPropagation(),as()),C.key==="Escape"&&(C.preventDefault(),C.stopPropagation(),Gt(!1))}}):p.jsx("h1",{onDoubleClick:qo,title:tt?"Double-click to rename this workspace":void 0,children:tt?.name??"Sessions"})]}),p.jsxs("div",{className:"drawer-head-actions",children:[p.jsx("button",{type:"button",className:"square-button",onClick:()=>S(!0),title:"Hide sessions sidebar",children:p.jsx(Fe,{name:"panel-left"})}),p.jsx("button",{type:"button",className:"square-button history-button",onClick:()=>fe(C=>!C),title:"Session history","aria-label":"Open session history","aria-expanded":ae,children:p.jsx(Fe,{name:"history"})}),p.jsx("button",{type:"button",className:"square-button",onClick:Pr,title:`New workspace (${bi("new-workspace",ze)})`,"aria-label":"New workspace",children:p.jsx(Fe,{name:"plus"})})]})]}),T==="ports"?Go():p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"drawer-tools",role:"tablist","aria-label":"Session inventory",children:["terminals","screens","connections"].map(C=>{const N={terminals:"Terminals",screens:"Screens",connections:"Connections"},Y=C==="terminals"?St.length:C==="screens"?M.filter(J=>(J.persistence==="screen"||J.screenName)&&!St.some(Se=>Se.id===J.id)).length+ua.length:M.filter(J=>J.kind==="ssh").length;return p.jsxs("button",{type:"button",role:"tab","aria-selected":L===C,className:`drawer-tool ${L===C?"active":""}`,onClick:()=>y(C),children:[N[C]," ",p.jsx("span",{children:Y})]},C)})}),p.jsx("div",{className:"session-list",role:"tabpanel",children:Ee?p.jsxs("div",{className:"session-empty",children:[p.jsx("b",{children:"Loading sessions…"}),p.jsx("small",{children:"Checking available terminals and durable sessions."})]}):ke?p.jsxs("div",{className:"session-empty session-error",children:[p.jsx("b",{children:"Session inventory unavailable"}),p.jsx("small",{children:ke}),p.jsx("button",{type:"button",onClick:()=>{Ys()},children:"Retry"})]}):L==="terminals"?St.length||Eo.length?p.jsxs(p.Fragment,{children:[St.map(C=>p.jsx(Zl,{session:C,active:Qe?.id===C.id,onClick:()=>{yi(C)}},C.id)),Eo.map(C=>p.jsx(HS,{member:C,onClick:()=>{mc(C)}},C.sessionId))]}):p.jsxs("div",{className:"session-empty",children:[p.jsx("b",{children:"No terminals yet"}),p.jsx("small",{children:"Add a local terminal or SSH connection to this workspace."})]}):L==="screens"?Cs():L==="connections"?Bt.length?Bt.map(C=>p.jsx(zS,{connection:C,onConfigure:()=>Ci("ssh",{sshTarget:C.hostName??C.alias}),onConnect:()=>vc(C)},C.alias)):p.jsxs("div",{className:"session-empty",children:[p.jsx("b",{children:"No saved connections"}),p.jsx("small",{children:"Add Host entries to ~/.ssh/config to populate connections."})]}):M.filter(C=>C.kind==="ssh"&&C.scope==="remote"&&C.source==="discovered").length?M.filter(C=>C.kind==="ssh"&&C.scope==="remote"&&C.source==="discovered").map(C=>p.jsx(Zl,{session:C,ghosted:!0,onClick:async()=>{v(`Attaching remote screen ${C.name}…`);const N=Re();if(N)try{const J=(await N.buildRemoteScreenAttach?.({alias:C.host,hostName:C.host},C.screenName??C.name))?.args?.find(ye=>ye.includes("@")||!ye.startsWith("-"))??C.host,Se=await N.createSshSession({target:J,name:C.name});j(ye=>ye.map(Me=>Me.id===C.id?Se:Me)),Ss(Se),await yi(Se)}catch(Y){v(Y instanceof Error?Y.message:String(Y))}}},C.id)):p.jsxs("div",{className:"session-empty",children:[p.jsx("b",{children:"No remote screens"}),p.jsx("small",{children:"Remote screen sessions will appear here after discovery."})]})})]}),p.jsxs("div",{className:"drawer-bottom",children:[p.jsxs("button",{type:"button",className:"drawer-action",onClick:wa,children:[p.jsx(Fe,{name:"port-plus"})," Share port"]}),p.jsxs("button",{type:"button",className:"drawer-action",onClick:er,children:[p.jsx(Fe,{name:"plus"})," Local terminal ",p.jsx("kbd",{children:"⌘⇧T"})]}),p.jsxs("button",{type:"button",className:"drawer-action",onClick:()=>Ci("ssh"),children:[p.jsx(Fe,{name:"ssh"})," Connect SSH"]}),p.jsxs("div",{className:"drawer-status",children:[p.jsx("span",{className:"status-dot connected"}),_]})]})]}),!c&&p.jsx(ec,{orientation:"vertical",className:"sidebar-resizer",label:"Sidebar width",valuePercent:a.sessions.sidebarWidth/wt.sidebarWidth.max*100,onDrag:tr,onCommit:()=>ri("sessions",{sidebarWidth:a.sessions.sidebarWidth}),onNudge:C=>ri("sessions",{sidebarWidth:a.sessions.sidebarWidth+C*16}),onReset:()=>ri("sessions",{sidebarWidth:$e.sessions.sidebarWidth})}),p.jsxs("section",{className:"workspace",children:[p.jsxs("div",{className:"workspace-head",children:[p.jsxs("div",{className:"location",children:[c&&p.jsx("button",{type:"button",className:"inline-restore",onClick:()=>S(!1),title:"Show sessions sidebar",children:p.jsx(Fe,{name:"panel-left-open"})}),p.jsx("span",{className:"connection-dot"}),p.jsx("span",{children:Qe?.host??"local"}),p.jsx("span",{className:"slash",children:"/"}),p.jsx("span",{children:Qe?.cwd??"~"}),p.jsx("span",{className:"slash",children:"/"}),p.jsx("span",{className:"muted-text",children:Qe?.name??tt?.name??"no session"})]}),p.jsxs("div",{className:"head-controls",children:[p.jsxs("div",{className:"layout-controls",children:[p.jsx("span",{className:"control-label",children:"SFTP"}),p.jsx("button",{type:"button",className:Fs?"layout-button active":"layout-button",onClick:()=>Ws(C=>!C),disabled:!Ro.available||!Re()?.sftpOpen,title:Ro.reason,"aria-label":"Transfer files over SFTP",children:p.jsx(Fe,{name:"transfer"})})]}),p.jsxs("div",{className:"layout-controls",children:[p.jsx("span",{className:"control-label",children:"LAYOUT"}),p.jsx("button",{type:"button",className:et==="stack"||Vt?"layout-button active":"layout-button",onClick:()=>$r(sm(Es)),title:`${dS(Es)} (${bi("toggle-layout",ze)})`,children:p.jsx(Fe,{name:"stack"})}),lS.map(({layout:C,icon:N})=>p.jsx("button",{type:"button",className:et===C&&!Vt?"layout-button active":"layout-button",onClick:()=>$r(hS(C,Es)),title:uS(C,Es),children:p.jsx(Fe,{name:N})},C))]})]})]}),p.jsxs("div",{className:`${Ko} ${Vt?"maximized-pane-grid":""}`,ref:Vo,style:Yo,children:[Ta&&p.jsx(ec,{orientation:"vertical",className:"pane-resizer pane-resizer-column",label:"Pane column split",valuePercent:ws*100,style:{left:`calc((100% - 1px) * ${ws} + 0.5px)`},onDrag:C=>ka("column",C),onCommit:()=>ri("sessions",{splitColumnRatio:ws}),onNudge:C=>Rn("column",C),onReset:()=>_i("column")}),Da&&p.jsx(ec,{orientation:"horizontal",className:"pane-resizer pane-resizer-row",label:"Pane row split",valuePercent:xs*100,style:{top:`calc((100% - 1px) * ${xs} + 0.5px)`},onDrag:C=>ka("row",C),onCommit:()=>ri("sessions",{splitRowRatio:xs}),onNudge:C=>Rn("row",C),onReset:()=>_i("row")}),ba.map(({session:C,index:N,dormant:Y})=>{const J=hi.sessionId===C.id&&hi.status!=="idle"?hi.status:null,Se=Tg(C),ye=!!Se&&ys(C.id),Me=ye?Ho(C):null;return p.jsxs("article",{className:`pane terminal-pane ${Y?"dormant-pane":""} ${!Y&&jt===C.id?"focused":""} ${!Y&&Vt===C.id?"maximized-pane":""} ${Y||dc(C,N)?"":"overflow-pane"}`,onMouseDown:()=>Oi(C.id),children:[p.jsxs("div",{className:"pane-title",children:[p.jsxs("span",{children:[p.jsx("span",{className:"pane-live"})," ",C.name]}),p.jsxs("span",{className:"pane-actions",children:[Vt&&p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",className:"pane-nav",onClick:()=>Fr(-1),title:"Previous session",children:p.jsx(Fe,{name:"chevron-left"})}),p.jsx("button",{type:"button",className:"pane-nav",onClick:()=>Fr(1),title:"Next session",children:p.jsx(Fe,{name:"chevron-right"})})]}),h?"connecting…":J?`${J}…`:C.kind==="ssh"?"ssh":"bash",p.jsx("button",{type:"button",className:ye?"pane-browse active":"pane-browse",onClick:()=>Ur(C.id),disabled:!Se,title:Se?ye?"Hide the directory browser":"Browse directories":"ZeroG cannot tell what kind of paths this pane uses","aria-label":`${ye?"Hide":"Show"} the directory browser for ${C.name}`,"aria-pressed":ye,children:p.jsx(Fe,{name:"folder"})}),p.jsx("button",{type:"button",className:"pane-proceed",onClick:()=>Tn(C),title:`Send "${bn}" and press Enter`,"aria-label":`Send "${bn}" to ${C.name}`,children:p.jsx(Fe,{name:"check"})}),p.jsx("button",{type:"button",className:J?`pane-mic ${J}`:"pane-mic",onClick:()=>{Zo(C)},disabled:hi.status!=="idle"&&!J,title:J==="listening"?"Stop and transcribe":J==="transcribing"?"Transcribing…":"Voice input","aria-label":J==="listening"?`Stop recording ${C.name}`:`Voice input for ${C.name}`,children:p.jsx(Fe,{name:"mic"})}),p.jsx("button",{type:"button",className:"pane-maximize",onClick:()=>Oa(C.id),title:Vt?"Restore pane":"Maximize pane",children:p.jsx(Fe,{name:Vt?"restore":"maximize"})}),p.jsx("button",{type:"button",className:"pane-close",onClick:()=>{Qo(C)},title:"Close pane","aria-label":`Close ${C.name}`,children:p.jsx(Fe,{name:"x"})})]})]}),p.jsx(qS,{open:ye,ratio:zr(C.id),onRatio:Te=>No(C.id,{ratio:Te}),browser:Se?p.jsx(Hg,{session:C,path:Me,unanchored:C.kind==="ssh",pathKind:Se,shellPath:Me?ip(C,Me):null,list:Co(C),question:C.kind==="ssh"?cc:null,onOpen:Te=>Ea(C,Te),onBrowse:Te=>Br(dt=>({...dt,[C.id]:Te})),onClose:()=>Ur(C.id)}):null,children:p.jsx(WS,{sessionId:C.id,focused:!Y&&jt===C.id,dormant:Y,onStatus:v,appearance:a.appearance,terminalSettings:a.terminal,registerFocus:lc,registerCapture:_a,onCommand:Sc,registerRead:pa})})]},C.id)}),Array.from({length:Math.max(0,hc-rs.length)},(C,N)=>p.jsx(GS,{index:rs.length+N+1,onCreate:er},`placeholder-${N}`))]}),p.jsxs("footer",{className:"status-bar",children:[p.jsx("span",{children:"ZeroG"}),p.jsx("span",{className:"status-separator"}),p.jsx("span",{children:tt?.name??"Workspace"}),p.jsx("span",{className:"status-separator"}),p.jsx("span",{children:Vt?"maximized pane":et==="stack"?"1 pane":`${Cn} panes`}),p.jsx("span",{className:"status-separator"}),p.jsx("span",{children:"Esc closes overlays · ⌘⇧B sidebar"}),p.jsx("span",{className:"status-spacer"}),p.jsx("span",{children:Qe?`${Qe.kind==="ssh"?"SSH":Qe.persistence==="process"?"PROCESS":"SCREEN"} · ${Qe.persistence==="process"?"non-persistent":"persistent"}`:"no connection"})]})]})]}),La&&(()=>{const C=G.find(N=>N.id===La.id);return C?p.jsx(SS,{at:La.at,label:`${C.name} options`,items:Ma(C),onClose:()=>Io(null)}):null})(),Ne&&p.jsx(Yg,{version:ms,bindings:ze,onClose:()=>Le(!1)}),ot&&p.jsx("div",{className:"overview-layer",role:"presentation",...jr,children:p.jsxs("section",{className:"overview",children:[p.jsxs("div",{className:"overview-head",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"WORKSPACE OVERVIEW"}),p.jsx("h2",{children:tt?.name??"Choose a session"})]}),p.jsx("button",{type:"button",className:"close-button",onClick:()=>ut(!1),children:"Esc"})]}),p.jsx("div",{className:"thumbnail-grid",children:St.length?St.map(C=>p.jsxs("button",{type:"button",className:`thumbnail ${Qe?.id===C.id?"active":""}`,onClick:()=>{yi(C)},children:[p.jsxs("div",{className:"thumbnail-preview",children:[p.jsx("span",{className:"thumbnail-line cyan"}),p.jsx("span",{className:"thumbnail-line short"}),p.jsx("span",{className:"thumbnail-line green"}),p.jsx("span",{className:"thumbnail-cursor"})]}),p.jsxs("div",{className:"thumbnail-label",children:[p.jsx("b",{children:C.name}),p.jsxs("small",{children:[C.kind==="ssh"?C.host:"local screen"," · ",C.status]})]})]},C.id)):p.jsxs("div",{className:"overview-empty",children:[p.jsx("span",{children:"▦"}),p.jsx("b",{children:"No terminals in this workspace"}),p.jsx("small",{children:"Create a local terminal or connect over SSH."})]})}),p.jsxs("div",{className:"overview-foot",children:[p.jsx("button",{type:"button",onClick:()=>{ut(!1),er()},children:"+ Local terminal"}),p.jsx("button",{type:"button",onClick:()=>{ut(!1),Ci("ssh")},children:"Connect SSH"}),p.jsx("button",{type:"button",onClick:()=>{ut(!1),Pr()},children:"+ Workspace"}),p.jsx("span",{className:"overview-hint",children:"Press Esc to close"})]})]})}),we&&p.jsx("div",{className:"palette-layer",role:"presentation",...va,children:p.jsxs("div",{className:"palette",role:"dialog","aria-label":"Command history",children:[p.jsx("input",{autoFocus:!0,className:"palette-query",value:rt,placeholder:"Search commands you have run","aria-label":"Search commands you have run",onChange:C=>{Be(C.target.value),ve(0)},onKeyDown:C=>{if(C.key==="ArrowDown")C.preventDefault(),ve(N=>Math.min(N+1,Math.max(0,Xs.length-1)));else if(C.key==="ArrowUp")C.preventDefault(),ve(N=>Math.max(0,N-1));else if(C.key==="Enter"){C.preventDefault();const N=Xs[It];N&&Zs(N)}}}),a.ai.recordCommands?pe.length?Xs.length?p.jsx("div",{className:"palette-list",children:Xs.map((C,N)=>p.jsxs("button",{type:"button",className:`palette-row ${N===It?"active":""}`,onMouseEnter:()=>ve(N),onClick:()=>Zs(C),children:[p.jsx("span",{className:"palette-command",children:VS(C.entry.command,C.matched)}),p.jsxs("span",{className:"palette-meta",children:[C.entry.exitCode!==void 0&&C.entry.exitCode!==0?p.jsx("span",{className:"palette-failed",title:`Exited ${C.entry.exitCode}`,children:"failed"}):null,C.entry.cwd?p.jsx("span",{className:"palette-cwd",children:C.entry.cwd}):null]})]},C.entry.id))}):p.jsxs("div",{className:"palette-empty",children:[p.jsx("b",{children:"No match"}),p.jsxs("small",{children:[pe.length," commands remembered, none matching that."]})]}):p.jsxs("div",{className:"palette-empty",children:[p.jsx("b",{children:"Nothing remembered yet"}),p.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."}),p.jsx("button",{type:"button",onClick:()=>{Ce(!1),es(!0)},children:"Open settings"})]}):p.jsxs("div",{className:"palette-empty",children:[p.jsx("b",{children:"Commands are not being remembered"}),p.jsx("small",{children:"Turn on “Remember commands” in Settings under AI & voice. Nothing about what you type is stored until you do."}),p.jsx("button",{type:"button",onClick:()=>{Ce(!1),es(!0)},children:"Open settings"})]}),p.jsx("small",{className:"palette-note",children:"Enter puts the command on the prompt without running it. ↑↓ to choose, Esc to close."})]})}),ae&&p.jsx("div",{className:"history-layer",role:"presentation",...Gi,children:p.jsxs("div",{className:"history-popover",role:"dialog","aria-label":"Session history",children:[p.jsxs("div",{className:"history-head",children:[p.jsx("b",{children:"History"}),p.jsx("button",{type:"button",onClick:()=>fe(!1),"aria-label":"Close history",children:"×"})]}),kr.length?kr.slice().sort((C,N)=>N.timestamp.localeCompare(C.timestamp)).map(C=>p.jsxs("button",{type:"button",className:"history-item",onClick:async()=>{fe(!1);const N=_u(C.session,M,Bt);y(C.session.screenName||C.session.backend==="screen"?"screens":"terminals");const Y=await Mo(N);Y&&v(`Reconnected ${Y.name}`)},children:[p.jsxs("span",{className:"history-main",children:[p.jsx("span",{className:"history-kind",children:C.event.toUpperCase()}),p.jsxs("span",{className:"history-text",children:[p.jsx("b",{children:C.session.name}),p.jsxs("small",{children:[C.session.host," · ",C.available?"available":"unavailable"]})]})]}),p.jsx("button",{type:"button",className:"history-remove","aria-label":"Remove history entry",onClick:N=>{N.stopPropagation(),Re()?.removeHistory(C.id).then(()=>ps(Y=>Y.filter(J=>J.id!==C.id))).catch(()=>{})},children:"×"})]},C.id)):p.jsx("p",{className:"history-empty",children:"No history entries yet."}),p.jsx("small",{className:"history-note",children:"Persisted session lifecycle from the main process."})]})}),Ae&&p.jsx("div",{className:"modal-layer",role:"presentation",...ma,children:p.jsxs("form",{className:"modal-card",onSubmit:Ae==="workspace"?fc:Ae==="rename"?Qs:Ae==="forward"?wc:Ae==="local"?_c:pc,children:[p.jsxs("div",{className:"modal-head",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:gu(Ae).eyebrow}),p.jsx("h2",{children:gu(Ae).title})]}),p.jsx("button",{type:"button",className:"close-button",onClick:()=>Ie(null),children:"Esc"})]}),gp(Ae)&&p.jsx("div",{className:"dialog-tabs",role:"tablist","aria-label":"Session type",children:an.map(C=>p.jsxs("button",{type:"button",id:`session-tab-${C.kind}`,role:"tab","aria-selected":Ae===C.kind,"aria-controls":"session-dialog-panel",tabIndex:Ae===C.kind?0:-1,disabled:h,className:`dialog-tab ${Ae===C.kind?"active":""}`,onClick:()=>Ie(C.kind),onKeyDown:N=>{const Y=oS(C.kind,N.key);Y&&(N.preventDefault(),Ie(Y),document.getElementById(`session-tab-${Y}`)?.focus())},children:[p.jsx("b",{children:C.label}),p.jsx("small",{children:C.hint})]},C.kind))}),Ae==="rename"&&p.jsxs(p.Fragment,{children:[p.jsx("p",{children:"Rename this workspace. Its panes, layout and shortcuts position are unaffected."}),p.jsxs("label",{children:["Workspace name",p.jsx("input",{autoFocus:!0,value:nt,pattern:Jl,onChange:C=>Ke(C.target.value)})]})]}),Ae==="workspace"&&p.jsxs(p.Fragment,{children:[p.jsx("p",{children:"Create a separate workspace for a project or host group. Terminals stay scoped to the active workspace."}),p.jsxs("label",{children:["Workspace name",p.jsx("input",{autoFocus:!0,value:nt,onChange:C=>Ke(C.target.value),pattern:Jl,required:!0})]})]}),Ae==="forward"&&p.jsxs(p.Fragment,{children:[p.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."}),p.jsxs("label",{children:["SSH host",p.jsx("input",{autoFocus:!0,list:"forward-hosts",value:re,onChange:C=>K(C.target.value),placeholder:"user@server",required:!0}),p.jsx("datalist",{id:"forward-hosts",children:bs.map(C=>p.jsx("option",{value:C},C))})]}),p.jsxs("label",{children:["Port",p.jsx("input",{value:O,onChange:C=>$(C.target.value),inputMode:"numeric",pattern:"[0-9]{1,5}",placeholder:"3000",required:!0})]}),p.jsx("button",{type:"button",className:"dialog-disclosure",onClick:()=>W(C=>!C),"aria-expanded":Z,children:Z?"Fewer options":"More options"}),Z&&p.jsxs(p.Fragment,{children:[p.jsxs("label",{children:["Direction",p.jsxs("select",{value:X,onChange:C=>I(C.target.value),children:[p.jsx("option",{value:"local",children:"Remote port, reachable here"}),p.jsx("option",{value:"remote",children:"Port here, reachable on the remote"})]})]}),p.jsxs("label",{children:["Forward to ",p.jsx("span",{className:"muted-text",children:"optional"}),p.jsx("input",{value:ue,onChange:C=>me(C.target.value),placeholder:"localhost"})]}),p.jsxs("label",{children:["Port on that side ",p.jsx("span",{className:"muted-text",children:"defaults to the same"}),p.jsx("input",{value:te,onChange:C=>se(C.target.value),inputMode:"numeric",pattern:"[0-9]{1,5}",placeholder:O||"3000"})]}),p.jsxs("label",{className:"dialog-check",children:[p.jsx("input",{type:"checkbox",checked:B==="all",onChange:C=>F(C.target.checked?"all":"loopback")}),"Share on my network, not just this machine"]}),B==="all"&&p.jsxs("p",{className:"dialog-warning",children:["Anything on the network this machine is attached to will be able to reach",X==="local"?" the remote service":" the service running here","."]})]})]}),gp(Ae)&&p.jsxs("div",{id:"session-dialog-panel",role:"tabpanel","aria-labelledby":`session-tab-${Ae}`,children:[Ae==="local"&&p.jsxs(p.Fragment,{children:[p.jsxs("p",{children:["Start a local session inside “",tt?.name??"this workspace","”."]}),p.jsxs("label",{children:["Terminal name",p.jsx("input",{autoFocus:!0,value:Ii,onChange:C=>Xi(C.target.value),pattern:"[A-Za-z0-9](?:[A-Za-z0-9_.]|-){0,48}",required:!0})]}),p.jsxs("label",{children:["Shell backend",p.jsx("select",{value:di,onChange:C=>{const N=C.target.value;_s(N)},children:Dr.length?Dr.map(C=>p.jsx("option",{value:C.backend,children:C.label},C.backend)):p.jsx("option",{value:"bash",children:"bash"})})]}),di==="wsl"&&p.jsxs("label",{children:["WSL distribution",p.jsx("input",{value:So,onChange:C=>dn(C.target.value),placeholder:"Ubuntu"})]})]}),Ae==="ssh"&&p.jsxs(p.Fragment,{children:[p.jsxs("p",{children:["Connect a remote host into “",tt?.name??"this workspace","”."]}),p.jsxs("label",{children:["SSH target",p.jsx("input",{autoFocus:!0,value:Mr,onChange:C=>$s(C.target.value),placeholder:"user@server:22",required:!0})]}),p.jsxs("label",{children:["Session label ",p.jsx("span",{className:"muted-text",children:"optional"}),p.jsx("input",{value:Zi,onChange:C=>Pi(C.target.value),placeholder:"server"})]})]})]}),p.jsxs("div",{className:"modal-actions",children:[p.jsx("button",{type:"button",onClick:()=>Ie(null),children:"Cancel"}),p.jsx("button",{className:"primary-button",disabled:h,type:"submit",children:h?"Working…":gu(Ae).submit})]})]})}),Fs&&Qe&&yn&&Re()&&p.jsx(p0,{session:Qe,target:yn,api:Re(),onClose:()=>Ws(!1),backdrop:ga},Qe.id),Ji&&p.jsx(nS,{settings:a,onChange:ri,onReset:Sn,onClose:()=>es(!1),backdrop:Nr,backends:Dr,wslDistributions:bo,speechTest:ts,onSpeechTest:()=>{Ba()},speechKey:Tr,onSpeechKeySave:C=>{As(C)},onSpeechKeyClear:()=>{Xo()},commandHistory:bc,onCopySnippet:C=>{Re()?.copyText?.(C).then(()=>v("Shell integration snippet copied.")).catch(()=>{})},onClearCommandHistory:()=>{Cc()},aiKey:na,onAiKeySave:C=>{Mn(C)},onAiKeyClear:()=>{ir()},aiModels:oc,onAiModelsRefresh:()=>{ko()},aiTest:go,onAiTest:()=>{Oo()},mcpStatus:l,mcpInfo:m,onMcpStart:()=>{Re()?.startMcp?.().then(C=>{n(C),v("MCP enabled")}).catch(C=>v(Ar(C)))},onMcpStop:()=>{Re()?.stopMcp?.().then(()=>{n(null),v("MCP disabled")}).catch(C=>v(Ar(C)))},onMcpCopyToken:()=>{m&&Re()?.copyText?.(m.token).then(()=>v("MCP bearer token copied."))}}),$i&&p.jsx("div",{className:"modal-layer",role:"presentation",...is,children:p.jsxs("div",{className:"modal-card approval-card",children:[p.jsxs("div",{className:"modal-head",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"VOICE"}),p.jsx("h2",{children:"Insert transcript?"})]}),p.jsx("button",{type:"button",className:"close-button",onClick:()=>Rs(),children:"Esc"})]}),p.jsx("p",{children:"Review mode is on, so nothing has been typed yet. Inserting does not press Enter."}),p.jsx("code",{children:$i.text}),p.jsxs("div",{className:"modal-actions",children:[p.jsx("button",{type:"button",onClick:()=>Rs(),children:"Discard"}),p.jsx("button",{type:"button",className:"primary-button",onClick:()=>{Re()?.write($i.sessionId,$i.text),v(`Voice: "${$i.text}"`),Rs()},children:"Insert"})]})]})}),z&&p.jsx("div",{className:"modal-layer",role:"presentation",children:p.jsxs("form",{className:"modal-card approval-card",onSubmit:C=>{C.preventDefault();const N=new FormData(C.currentTarget).get("answer"),Y=Re();V(null),Y?.answerForwardPrompt?.(z.forwardId,String(N??"")).catch(J=>{v(Ar(J))})},children:[p.jsx("div",{className:"modal-head",children:p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"SHARED PORT"}),p.jsx("h2",{children:z.kind==="confirm"?"Accept this host key?":"The host is asking"})]})}),p.jsx("code",{children:z.text}),p.jsxs("label",{children:[z.kind==="confirm"?"Type yes, no, or the fingerprint":"Answer",p.jsx("input",{autoFocus:!0,name:"answer",type:z.kind==="confirm"?"text":"password",autoComplete:"off"})]}),p.jsxs("div",{className:"modal-actions",children:[p.jsx("button",{type:"button",onClick:()=>{const C=z.forwardId;V(null),Re()?.closeForward?.(C).catch(()=>{}),k(N=>N.map(Y=>Y.id===C?{...Y,status:"idle"}:Y))},children:"Cancel"}),p.jsx("button",{className:"primary-button",type:"submit",children:"Send"})]})]})}),mt&&p.jsx("div",{className:"modal-layer",role:"presentation",...xo,children:p.jsxs("div",{className:"modal-card approval-card",children:[p.jsxs("div",{className:"modal-head",children:[p.jsxs("div",{children:[p.jsx("span",{className:mt.phase==="reviewing"?"eyebrow warning-text":"eyebrow",children:mt.phase==="reviewing"?"APPROVAL REQUIRED":"AI SUGGESTION"}),p.jsx("h2",{children:mt.phase==="asking"?"What would you like to do?":mt.phase==="thinking"?"Asking the model…":mt.phase==="failed"?"No suggestion":"Run this command?"})]}),p.jsx("button",{type:"button",className:"close-button",onClick:()=>{Re()?.cancelAiRequest?.(),Ft(null)},children:"Esc"})]}),mt.phase==="asking"&&p.jsxs("form",{onSubmit:C=>{C.preventDefault();const N=String(new FormData(C.currentTarget).get("prompt")??"").trim();N&&To(N)},children:[p.jsxs("p",{children:[a.ai.model," at ",a.ai.baseUrl,"."," ",a.ai.includeOutput?"The last of this pane’s output is sent with your request.":"Only the shell, directory and host are sent."]}),p.jsxs("label",{children:["Request",p.jsx("input",{autoFocus:!0,name:"prompt",placeholder:"fix that error",autoComplete:"off"})]}),p.jsxs("div",{className:"modal-actions",children:[p.jsx("button",{type:"button",onClick:()=>Ft(null),children:"Cancel"}),p.jsx("button",{className:"primary-button",type:"submit",children:"Ask"})]})]}),mt.phase==="thinking"&&p.jsxs(p.Fragment,{children:[p.jsx("p",{children:mt.prompt}),p.jsx("p",{className:"muted-text",children:mt.usedOutput?"Sent with recent output from this pane.":"Sent without terminal output."}),p.jsx("div",{className:"modal-actions",children:p.jsx("button",{type:"button",onClick:()=>{Re()?.cancelAiRequest?.(),Ft(null)},children:"Cancel"})})]}),mt.phase==="reviewing"&&p.jsxs(p.Fragment,{children:[p.jsx("p",{children:mt.suggestion.explanation}),mt.suggestion.command?p.jsx("code",{children:mt.suggestion.command}):null,mt.usedOutput?p.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,p.jsxs("div",{className:"modal-actions",children:[p.jsx("button",{type:"button",onClick:()=>Ft(null),children:"Cancel"}),mt.suggestion.command?p.jsx("button",{type:"button",className:"primary-button",onClick:Do,children:"Run"}):p.jsx("button",{type:"button",onClick:()=>Ft(bu(mt.sessionId)),children:"Ask again"})]})]}),mt.phase==="failed"&&p.jsxs(p.Fragment,{children:[p.jsx("p",{children:mt.message}),p.jsxs("div",{className:"modal-actions",children:[p.jsx("button",{type:"button",onClick:()=>Ft(null),children:"Close"}),p.jsx("button",{type:"button",className:"primary-button",onClick:()=>Ft(bu(mt.sessionId)),children:"Try again"})]})]})]})})]})}function VS(a,w){if(!w.length)return a;const A=new Set(w),M=[];let j="",G=A.has(0);for(let q=0;q<a.length;q+=1){const r=A.has(q);r!==G&&j&&(M.push(G?p.jsx("b",{children:j},q):j),j=""),G=r,j+=a.charAt(q)}return j&&M.push(G?p.jsx("b",{children:j},"tail"):j),M}function Ap(a){return a==="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 YS(a,w){const A=a.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,24)||"term",M=new Set(w.map(G=>G.name.toLowerCase()));if(!M.has(A))return A;let j=2;for(;M.has(`${A}-${j}`);)j+=1;return`${A}-${j}`}Tv.createRoot(document.getElementById("root")).render(p.jsx(KS,{}));
|