zerogterm 0.7.0-alpha2 → 0.7.0-alpha3
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 +238 -20
- package/bin/zerogterm.cjs +23 -23
- package/dist/main/main/ai-protocol.js +225 -0
- package/dist/main/main/ai-service.js +148 -0
- package/dist/main/main/command-history-store.js +231 -0
- package/dist/main/main/main.js +156 -5
- package/dist/main/main/port-forward-protocol.js +161 -0
- package/dist/main/main/port-forward-service.js +230 -0
- package/dist/main/main/port-forward-store.js +133 -0
- package/dist/main/main/preload.cjs +30 -1
- package/dist/main/main/secret-store.js +156 -0
- package/dist/main/main/session-service.js +22 -4
- package/dist/main/main/shell-catalog.js +63 -2
- package/dist/main/main/ssh-inventory.js +11 -0
- package/dist/main/main/workspace-store.js +213 -0
- package/dist/main/main/wsl-home.js +62 -0
- package/dist/main/shared/endpoints.js +73 -0
- package/dist/main/shared/version.js +32 -0
- package/dist/renderer/assets/index-C2vLQpCh.js +85 -0
- package/dist/renderer/assets/index-Qi5a1Xc8.css +1 -0
- package/dist/renderer/index.html +7 -4
- package/package.json +1 -1
- package/dist/renderer/assets/index-BjXtNztF.css +0 -1
- package/dist/renderer/assets/index-Ogyjvi0e.js +0 -19
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
(function(){const v=document.createElement("link").relList;if(v&&v.supports&&v.supports("modulepreload"))return;for(const j of document.querySelectorAll('link[rel="modulepreload"]'))b(j);new MutationObserver(j=>{for(const I of j)if(I.type==="childList")for(const P of I.addedNodes)P.tagName==="LINK"&&P.rel==="modulepreload"&&b(P)}).observe(document,{childList:!0,subtree:!0});function y(j){const I={};return j.integrity&&(I.integrity=j.integrity),j.referrerPolicy&&(I.referrerPolicy=j.referrerPolicy),j.crossOrigin==="use-credentials"?I.credentials="include":j.crossOrigin==="anonymous"?I.credentials="omit":I.credentials="same-origin",I}function b(j){if(j.ep)return;j.ep=!0;const I=y(j);fetch(j.href,I)}})();function fv(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var rh={exports:{}},cl={};var D_;function _v(){if(D_)return cl;D_=1;var r=Symbol.for("react.transitional.element"),v=Symbol.for("react.fragment");function y(b,j,I){var P=null;if(I!==void 0&&(P=""+I),j.key!==void 0&&(P=""+j.key),"key"in j){I={};for(var o in j)o!=="key"&&(I[o]=j[o])}else I=j;return j=I.ref,{$$typeof:r,type:b,key:P,ref:j!==void 0?j:null,props:I}}return cl.Fragment=v,cl.jsx=y,cl.jsxs=y,cl}var k_;function pv(){return k_||(k_=1,rh.exports=_v()),rh.exports}var c=pv(),ah={exports:{}},Oe={};var M_;function mv(){if(M_)return Oe;M_=1;var r=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),P=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),C=Symbol.iterator;function E(k){return k===null||typeof k!="object"?null:(k=C&&k[C]||k["@@iterator"],typeof k=="function"?k:null)}var M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,d={};function u(k,z,Y){this.props=k,this.context=z,this.refs=d,this.updater=Y||M}u.prototype.isReactComponent={},u.prototype.setState=function(k,z){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,z,"setState")},u.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function l(){}l.prototype=u.prototype;function h(k,z,Y){this.props=k,this.context=z,this.refs=d,this.updater=Y||M}var S=h.prototype=new l;S.constructor=h,w(S,u.prototype),S.isPureReactComponent=!0;var T=Array.isArray;function R(){}var D={H:null,A:null,T:null,S:null},x=Object.prototype.hasOwnProperty;function B(k,z,Y){var ne=Y.ref;return{$$typeof:r,type:k,key:z,ref:ne!==void 0?ne:null,props:Y}}function K(k,z){return B(k.type,z,k.props)}function F(k){return typeof k=="object"&&k!==null&&k.$$typeof===r}function J(k){var z={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(Y){return z[Y]})}var O=/\/+/g;function te(k,z){return typeof k=="object"&&k!==null&&k.key!=null?J(""+k.key):z.toString(36)}function he(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(R,R):(k.status="pending",k.then(function(z){k.status==="pending"&&(k.status="fulfilled",k.value=z)},function(z){k.status==="pending"&&(k.status="rejected",k.reason=z)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function G(k,z,Y,ne,_e){var Se=typeof k;(Se==="undefined"||Se==="boolean")&&(k=null);var Q=!1;if(k===null)Q=!0;else switch(Se){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(k.$$typeof){case r:case v:Q=!0;break;case g:return Q=k._init,G(Q(k._payload),z,Y,ne,_e)}}if(Q)return _e=_e(k),Q=ne===""?"."+te(k,0):ne,T(_e)?(Y="",Q!=null&&(Y=Q.replace(O,"$&/")+"/"),G(_e,z,Y,"",function(me){return me})):_e!=null&&(F(_e)&&(_e=K(_e,Y+(_e.key==null||k&&k.key===_e.key?"":(""+_e.key).replace(O,"$&/")+"/")+Q)),z.push(_e)),1;Q=0;var U=ne===""?".":ne+":";if(T(k))for(var oe=0;oe<k.length;oe++)ne=k[oe],Se=U+te(ne,oe),Q+=G(ne,z,Y,Se,_e);else if(oe=E(k),typeof oe=="function")for(k=oe.call(k),oe=0;!(ne=k.next()).done;)ne=ne.value,Se=U+te(ne,oe++),Q+=G(ne,z,Y,Se,_e);else if(Se==="object"){if(typeof k.then=="function")return G(he(k),z,Y,ne,_e);throw z=String(k),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return Q}function ae(k,z,Y){if(k==null)return k;var ne=[],_e=0;return G(k,ne,"","",function(Se){return z.call(Y,Se,_e++)}),ne}function le(k){if(k._status===-1){var z=k._result;z=z(),z.then(function(Y){(k._status===0||k._status===-1)&&(k._status=1,k._result=Y)},function(Y){(k._status===0||k._status===-1)&&(k._status=2,k._result=Y)}),k._status===-1&&(k._status=0,k._result=z)}if(k._status===1)return k._result.default;throw k._result}var L=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},$={map:ae,forEach:function(k,z,Y){ae(k,function(){z.apply(this,arguments)},Y)},count:function(k){var z=0;return ae(k,function(){z++}),z},toArray:function(k){return ae(k,function(z){return z})||[]},only:function(k){if(!F(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return Oe.Activity=_,Oe.Children=$,Oe.Component=u,Oe.Fragment=y,Oe.Profiler=j,Oe.PureComponent=h,Oe.StrictMode=b,Oe.Suspense=f,Oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Oe.__COMPILER_RUNTIME={__proto__:null,c:function(k){return D.H.useMemoCache(k)}},Oe.cache=function(k){return function(){return k.apply(null,arguments)}},Oe.cacheSignal=function(){return null},Oe.cloneElement=function(k,z,Y){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var ne=w({},k.props),_e=k.key;if(z!=null)for(Se in z.key!==void 0&&(_e=""+z.key),z)!x.call(z,Se)||Se==="key"||Se==="__self"||Se==="__source"||Se==="ref"&&z.ref===void 0||(ne[Se]=z[Se]);var Se=arguments.length-2;if(Se===1)ne.children=Y;else if(1<Se){for(var Q=Array(Se),U=0;U<Se;U++)Q[U]=arguments[U+2];ne.children=Q}return B(k.type,_e,ne)},Oe.createContext=function(k){return k={$$typeof:P,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:I,_context:k},k},Oe.createElement=function(k,z,Y){var ne,_e={},Se=null;if(z!=null)for(ne in z.key!==void 0&&(Se=""+z.key),z)x.call(z,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(_e[ne]=z[ne]);var Q=arguments.length-2;if(Q===1)_e.children=Y;else if(1<Q){for(var U=Array(Q),oe=0;oe<Q;oe++)U[oe]=arguments[oe+2];_e.children=U}if(k&&k.defaultProps)for(ne in Q=k.defaultProps,Q)_e[ne]===void 0&&(_e[ne]=Q[ne]);return B(k,Se,_e)},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(k){return{$$typeof:o,render:k}},Oe.isValidElement=F,Oe.lazy=function(k){return{$$typeof:g,_payload:{_status:-1,_result:k},_init:le}},Oe.memo=function(k,z){return{$$typeof:p,type:k,compare:z===void 0?null:z}},Oe.startTransition=function(k){var z=D.T,Y={};D.T=Y;try{var ne=k(),_e=D.S;_e!==null&&_e(Y,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(R,L)}catch(Se){L(Se)}finally{z!==null&&Y.types!==null&&(z.types=Y.types),D.T=z}},Oe.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Oe.use=function(k){return D.H.use(k)},Oe.useActionState=function(k,z,Y){return D.H.useActionState(k,z,Y)},Oe.useCallback=function(k,z){return D.H.useCallback(k,z)},Oe.useContext=function(k){return D.H.useContext(k)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(k,z){return D.H.useDeferredValue(k,z)},Oe.useEffect=function(k,z){return D.H.useEffect(k,z)},Oe.useEffectEvent=function(k){return D.H.useEffectEvent(k)},Oe.useId=function(){return D.H.useId()},Oe.useImperativeHandle=function(k,z,Y){return D.H.useImperativeHandle(k,z,Y)},Oe.useInsertionEffect=function(k,z){return D.H.useInsertionEffect(k,z)},Oe.useLayoutEffect=function(k,z){return D.H.useLayoutEffect(k,z)},Oe.useMemo=function(k,z){return D.H.useMemo(k,z)},Oe.useOptimistic=function(k,z){return D.H.useOptimistic(k,z)},Oe.useReducer=function(k,z,Y){return D.H.useReducer(k,z,Y)},Oe.useRef=function(k){return D.H.useRef(k)},Oe.useState=function(k){return D.H.useState(k)},Oe.useSyncExternalStore=function(k,z,Y){return D.H.useSyncExternalStore(k,z,Y)},Oe.useTransition=function(){return D.H.useTransition()},Oe.version="19.2.8",Oe}var L_;function wh(){return L_||(L_=1,ah.exports=mv()),ah.exports}var Z=wh();const Jn=fv(Z);var lh={exports:{}},ul={},oh={exports:{}},ch={};var O_;function vv(){return O_||(O_=1,(function(r){function v(G,ae){var le=G.length;G.push(ae);e:for(;0<le;){var L=le-1>>>1,$=G[L];if(0<j($,ae))G[L]=ae,G[le]=$,le=L;else break e}}function y(G){return G.length===0?null:G[0]}function b(G){if(G.length===0)return null;var ae=G[0],le=G.pop();if(le!==ae){G[0]=le;e:for(var L=0,$=G.length,k=$>>>1;L<k;){var z=2*(L+1)-1,Y=G[z],ne=z+1,_e=G[ne];if(0>j(Y,le))ne<$&&0>j(_e,Y)?(G[L]=_e,G[ne]=le,L=ne):(G[L]=Y,G[z]=le,L=z);else if(ne<$&&0>j(_e,le))G[L]=_e,G[ne]=le,L=ne;else break e}}return ae}function j(G,ae){var le=G.sortIndex-ae.sortIndex;return le!==0?le:G.id-ae.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var I=performance;r.unstable_now=function(){return I.now()}}else{var P=Date,o=P.now();r.unstable_now=function(){return P.now()-o}}var f=[],p=[],g=1,_=null,C=3,E=!1,M=!1,w=!1,d=!1,u=typeof setTimeout=="function"?setTimeout:null,l=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;function S(G){for(var ae=y(p);ae!==null;){if(ae.callback===null)b(p);else if(ae.startTime<=G)b(p),ae.sortIndex=ae.expirationTime,v(f,ae);else break;ae=y(p)}}function T(G){if(w=!1,S(G),!M)if(y(f)!==null)M=!0,R||(R=!0,J());else{var ae=y(p);ae!==null&&he(T,ae.startTime-G)}}var R=!1,D=-1,x=5,B=-1;function K(){return d?!0:!(r.unstable_now()-B<x)}function F(){if(d=!1,R){var G=r.unstable_now();B=G;var ae=!0;try{e:{M=!1,w&&(w=!1,l(D),D=-1),E=!0;var le=C;try{t:{for(S(G),_=y(f);_!==null&&!(_.expirationTime>G&&K());){var L=_.callback;if(typeof L=="function"){_.callback=null,C=_.priorityLevel;var $=L(_.expirationTime<=G);if(G=r.unstable_now(),typeof $=="function"){_.callback=$,S(G),ae=!0;break t}_===y(f)&&b(f),S(G)}else b(f);_=y(f)}if(_!==null)ae=!0;else{var k=y(p);k!==null&&he(T,k.startTime-G),ae=!1}}break e}finally{_=null,C=le,E=!1}ae=void 0}}finally{ae?J():R=!1}}}var J;if(typeof h=="function")J=function(){h(F)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,te=O.port2;O.port1.onmessage=F,J=function(){te.postMessage(null)}}else J=function(){u(F,0)};function he(G,ae){D=u(function(){G(r.unstable_now())},ae)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(G){G.callback=null},r.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):x=0<G?Math.floor(1e3/G):5},r.unstable_getCurrentPriorityLevel=function(){return C},r.unstable_next=function(G){switch(C){case 1:case 2:case 3:var ae=3;break;default:ae=C}var le=C;C=ae;try{return G()}finally{C=le}},r.unstable_requestPaint=function(){d=!0},r.unstable_runWithPriority=function(G,ae){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var le=C;C=G;try{return ae()}finally{C=le}},r.unstable_scheduleCallback=function(G,ae,le){var L=r.unstable_now();switch(typeof le=="object"&&le!==null?(le=le.delay,le=typeof le=="number"&&0<le?L+le:L):le=L,G){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=le+$,G={id:g++,callback:ae,priorityLevel:G,startTime:le,expirationTime:$,sortIndex:-1},le>L?(G.sortIndex=le,v(p,G),y(f)===null&&G===y(p)&&(w?(l(D),D=-1):w=!0,he(T,le-L))):(G.sortIndex=$,v(f,G),M||E||(M=!0,R||(R=!0,J()))),G},r.unstable_shouldYield=K,r.unstable_wrapCallback=function(G){var ae=C;return function(){var le=C;C=ae;try{return G.apply(this,arguments)}finally{C=le}}}})(ch)),ch}var B_;function gv(){return B_||(B_=1,oh.exports=vv()),oh.exports}var uh={exports:{}},Qt={};var j_;function Sv(){if(j_)return Qt;j_=1;var r=wh();function v(f){var p="https://react.dev/errors/"+f;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)p+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+f+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function y(){}var b={d:{f:y,r:function(){throw Error(v(522))},D:y,C:y,L:y,m:y,X:y,S:y,M:y},p:0,findDOMNode:null},j=Symbol.for("react.portal");function I(f,p,g){var _=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:j,key:_==null?null:""+_,children:f,containerInfo:p,implementation:g}}var P=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(f,p){if(f==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=b,Qt.createPortal=function(f,p){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(v(299));return I(f,p,null,g)},Qt.flushSync=function(f){var p=P.T,g=b.p;try{if(P.T=null,b.p=2,f)return f()}finally{P.T=p,b.p=g,b.d.f()}},Qt.preconnect=function(f,p){typeof f=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,b.d.C(f,p))},Qt.prefetchDNS=function(f){typeof f=="string"&&b.d.D(f)},Qt.preinit=function(f,p){if(typeof f=="string"&&p&&typeof p.as=="string"){var g=p.as,_=o(g,p.crossOrigin),C=typeof p.integrity=="string"?p.integrity:void 0,E=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;g==="style"?b.d.S(f,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:_,integrity:C,fetchPriority:E}):g==="script"&&b.d.X(f,{crossOrigin:_,integrity:C,fetchPriority:E,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Qt.preinitModule=function(f,p){if(typeof f=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var g=o(p.as,p.crossOrigin);b.d.M(f,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&b.d.M(f)},Qt.preload=function(f,p){if(typeof f=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var g=p.as,_=o(g,p.crossOrigin);b.d.L(f,g,{crossOrigin:_,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Qt.preloadModule=function(f,p){if(typeof f=="string")if(p){var g=o(p.as,p.crossOrigin);b.d.m(f,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else b.d.m(f)},Qt.requestFormReset=function(f){b.d.r(f)},Qt.unstable_batchedUpdates=function(f,p){return f(p)},Qt.useFormState=function(f,p,g){return P.H.useFormState(f,p,g)},Qt.useFormStatus=function(){return P.H.useHostTransitionStatus()},Qt.version="19.2.8",Qt}var N_;function bv(){if(N_)return uh.exports;N_=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(v){console.error(v)}}return r(),uh.exports=Sv(),uh.exports}var H_;function yv(){if(H_)return ul;H_=1;var r=gv(),v=wh(),y=bv();function b(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 I(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 P(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function o(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(I(e)!==e)throw Error(b(188))}function p(e){var t=e.alternate;if(!t){if(t=I(e),t===null)throw Error(b(188));return t!==e?null:e}for(var i=e,s=t;;){var n=i.return;if(n===null)break;var a=n.alternate;if(a===null){if(s=n.return,s!==null){i=s;continue}break}if(n.child===a.child){for(a=n.child;a;){if(a===i)return f(n),e;if(a===s)return f(n),t;a=a.sibling}throw Error(b(188))}if(i.return!==s.return)i=n,s=a;else{for(var A=!1,H=n.child;H;){if(H===i){A=!0,i=n,s=a;break}if(H===s){A=!0,s=n,i=a;break}H=H.sibling}if(!A){for(H=a.child;H;){if(H===i){A=!0,i=a,s=n;break}if(H===s){A=!0,s=a,i=n;break}H=H.sibling}if(!A)throw Error(b(189))}}if(i.alternate!==s)throw Error(b(190))}if(i.tag!==3)throw Error(b(188));return i.stateNode.current===i?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var _=Object.assign,C=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),h=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function J(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var O=Symbol.for("react.client.reference");function te(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===O?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case u:return"Profiler";case d:return"StrictMode";case T:return"Suspense";case R:return"SuspenseList";case B:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case M:return"Portal";case h:return e.displayName||"Context";case l: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 D:return t=e.displayName||null,t!==null?t:te(e.type)||"Memo";case x:t=e._payload,e=e._init;try{return te(e(t))}catch{}}return null}var he=Array.isArray,G=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=y.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},L=[],$=-1;function k(e){return{current:e}}function z(e){0>$||(e.current=L[$],L[$]=null,$--)}function Y(e,t){$++,L[$]=e.current,e.current=t}var ne=k(null),_e=k(null),Se=k(null),Q=k(null);function U(e,t){switch(Y(Se,t),Y(_e,e),Y(ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Qf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Qf(t),e=Jf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}z(ne),Y(ne,e)}function oe(){z(ne),z(_e),z(Se)}function me(e){e.memoizedState!==null&&Y(Q,e);var t=ne.current,i=Jf(t,e.type);t!==i&&(Y(_e,e),Y(ne,i))}function Ce(e){_e.current===e&&(z(ne),z(_e)),Q.current===e&&(z(Q),rl._currentValue=le)}var ye,Me;function Ue(e){if(ye===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);ye=t&&t[1]||"",Me=-1<i.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+ye+e+Me}var Ve=!1;function it(e,t){if(!e||Ve)return"";Ve=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(ce){var re=ce}Reflect.construct(e,[],fe)}else{try{fe.call()}catch(ce){re=ce}e.call(fe.prototype)}}else{try{throw Error()}catch(ce){re=ce}(fe=e())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(ce){if(ce&&re&&typeof ce.stack=="string")return[ce.stack,re.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=s.DetermineComponentFrameRoot(),A=a[0],H=a[1];if(A&&H){var W=A.split(`
|
|
4
|
+
`),se=H.split(`
|
|
5
|
+
`);for(n=s=0;s<W.length&&!W[s].includes("DetermineComponentFrameRoot");)s++;for(;n<se.length&&!se[n].includes("DetermineComponentFrameRoot");)n++;if(s===W.length||n===se.length)for(s=W.length-1,n=se.length-1;1<=s&&0<=n&&W[s]!==se[n];)n--;for(;1<=s&&0<=n;s--,n--)if(W[s]!==se[n]){if(s!==1||n!==1)do if(s--,n--,0>n||W[s]!==se[n]){var ue=`
|
|
6
|
+
`+W[s].replace(" at new "," at ");return e.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",e.displayName)),ue}while(1<=s&&0<=n);break}}}finally{Ve=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?Ue(i):""}function De(e,t){switch(e.tag){case 26:case 27:case 5:return Ue(e.type);case 16:return Ue("Lazy");case 13:return e.child!==t&&t!==null?Ue("Suspense Fallback"):Ue("Suspense");case 19:return Ue("SuspenseList");case 0:case 15:return it(e.type,!1);case 11:return it(e.type.render,!1);case 1:return it(e.type,!0);case 31:return Ue("Activity");default:return""}}function ri(e){try{var t="",i=null;do t+=De(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
|
|
7
|
+
Error generating stack: `+s.message+`
|
|
8
|
+
`+s.stack}}var pe=Object.prototype.hasOwnProperty,ve=r.unstable_scheduleCallback,we=r.unstable_cancelCallback,ze=r.unstable_shouldYield,Ie=r.unstable_requestPaint,Pe=r.unstable_now,pt=r.unstable_getCurrentPriorityLevel,Ye=r.unstable_ImmediatePriority,ut=r.unstable_UserBlockingPriority,bt=r.unstable_NormalPriority,ki=r.unstable_LowPriority,xt=r.unstable_IdlePriority,Si=r.log,Ke=r.unstable_setDisableYieldValue,gs=null,Gt=null;function qi(e){if(typeof Si=="function"&&Ke(e),Gt&&typeof Gt.setStrictMode=="function")try{Gt.setStrictMode(gs,e)}catch{}}var Vt=Math.clz32?Math.clz32:_l,ic=Math.log,fl=Math.LN2;function _l(e){return e>>>=0,e===0?32:31-(ic(e)/fl|0)|0}var tt=256,Dt=262144,tr=4194304;function ai(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 ir(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var n=0,a=e.suspendedLanes,A=e.pingedLanes;e=e.warmLanes;var H=s&134217727;return H!==0?(s=H&~a,s!==0?n=ai(s):(A&=H,A!==0?n=ai(A):i||(i=H&~e,i!==0&&(n=ai(i))))):(H=s&~a,H!==0?n=ai(H):A!==0?n=ai(A):i||(i=s&~e,i!==0&&(n=ai(i)))),n===0?0:t!==0&&t!==n&&(t&a)===0&&(a=n&-n,i=t&-t,a>=i||a===32&&(i&4194048)!==0)?t:n}function Ps(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function sc(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Zr(){var e=tr;return tr<<=1,(tr&62914560)===0&&(tr=4194304),e}function li(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 ts(e,t,i,s,n,a){var A=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 H=e.entanglements,W=e.expirationTimes,se=e.hiddenUpdates;for(i=A&~i;0<i;){var ue=31-Vt(i),fe=1<<ue;H[ue]=0,W[ue]=-1;var re=se[ue];if(re!==null)for(se[ue]=null,ue=0;ue<re.length;ue++){var ce=re[ue];ce!==null&&(ce.lane&=-536870913)}i&=~fe}s!==0&&Qr(e,s,0),a!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=a&~(A&~t))}function Qr(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-Vt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function Ss(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-Vt(i),n=1<<s;n&t|e[s]&t&&(e[s]|=t),i&=~n}}function sr(e,t){var i=t&-t;return i=(i&42)!==0?1:Fi(i),(i&(e.suspendedLanes|t))!==0?0:i}function Fi(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 bs(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ys(){var e=ae.p;return e!==0?e:(e=window.event,e===void 0?32:C_(e.type))}function Wi(e,t){var i=ae.p;try{return ae.p=e,t()}finally{ae.p=i}}var Jt=Math.random().toString(36).slice(2),gt="__reactFiber$"+Jt,Bt="__reactProps$"+Jt,ei="__reactContainer$"+Jt,$s="__reactEvents$"+Jt,nr="__reactListeners$"+Jt,nc="__reactHandles$"+Jt,is="__reactResources$"+Jt,ss="__reactMarker$"+Jt;function qs(e){delete e[gt],delete e[Bt],delete e[$s],delete e[nr],delete e[nc]}function Cs(e){var t=e[gt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[ei]||i[gt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=a_(e);e!==null;){if(i=e[gt])return i;e=a_(e)}return t}e=i,i=e.parentNode}return null}function bi(e){if(e=e[gt]||e[ei]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Fs(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(b(33))}function ws(e){var t=e[is];return t||(t=e[is]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function yt(e){e[ss]=!0}var pl=new Set,rr={};function ns(e,t){Ki(e,t),Ki(e+"Capture",t)}function Ki(e,t){for(rr[e]=t,e=0;e<t.length;e++)pl.add(t[e])}var Li=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]*$"),Jr={},ea={};function ta(e){return pe.call(ea,e)?!0:pe.call(Jr,e)?!1:Li.test(e)?ea[e]=!0:(Jr[e]=!0,!1)}function ia(e,t,i){if(ta(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 wn(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 yi(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 oi(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xn(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function rc(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 n=s.get,a=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(A){i=""+A,a.call(this,A)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(A){i=""+A},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ws(e){if(!e._valueTracker){var t=xn(e)?"checked":"value";e._valueTracker=rc(e,t,""+e[t])}}function ml(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=xn(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}function ar(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 lr=/[\n"\\]/g;function Yt(e){return e.replace(lr,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function sa(e,t,i,s,n,a,A,H){e.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?e.type=A:e.removeAttribute("type"),t!=null?A==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+oi(t)):e.value!==""+oi(t)&&(e.value=""+oi(t)):A!=="submit"&&A!=="reset"||e.removeAttribute("value"),t!=null?na(e,A,oi(t)):i!=null?na(e,A,oi(i)):s!=null&&e.removeAttribute("value"),n==null&&a!=null&&(e.defaultChecked=!!a),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),H!=null&&typeof H!="function"&&typeof H!="symbol"&&typeof H!="boolean"?e.name=""+oi(H):e.removeAttribute("name")}function En(e,t,i,s,n,a,A,H){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.type=a),t!=null||i!=null){if(!(a!=="submit"&&a!=="reset"||t!=null)){Ws(e);return}i=i!=null?""+oi(i):"",t=t!=null?""+oi(t):i,H||t===e.value||(e.value=t),e.defaultValue=t}s=s??n,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=H?e.checked:!!s,e.defaultChecked=!!s,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(e.name=A),Ws(e)}function na(e,t,i){t==="number"&&ar(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function rs(e,t,i,s){if(e=e.options,t){t={};for(var n=0;n<i.length;n++)t["$"+i[n]]=!0;for(i=0;i<e.length;i++)n=t.hasOwnProperty("$"+e[i].value),e[i].selected!==n&&(e[i].selected=n),n&&s&&(e[i].defaultSelected=!0)}else{for(i=""+oi(i),t=null,n=0;n<e.length;n++){if(e[n].value===i){e[n].selected=!0,s&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function ra(e,t,i){if(t!=null&&(t=""+oi(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+oi(i):""}function vl(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(b(92));if(he(s)){if(1<s.length)throw Error(b(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=oi(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),Ws(e)}function xs(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var or=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 gl(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||or.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function aa(e,t,i){if(t!=null&&typeof t!="object")throw Error(b(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 n in t)s=t[n],t.hasOwnProperty(n)&&i[n]!==s&&gl(e,n,s)}else for(var a in t)t.hasOwnProperty(a)&&gl(e,a,t[a])}function cr(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 Sl=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"]]),bl=/^[\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 Xt(e){return bl.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Gi(){}var la=null;function oa(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ks=null,Gs=null;function yl(e){var t=bi(e);if(t&&(e=t.stateNode)){var i=e[Bt]||null;e:switch(e=t.stateNode,t.type){case"input":if(sa(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="'+Yt(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var n=s[Bt]||null;if(!n)throw Error(b(90));sa(s,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&ml(s)}break e;case"textarea":ra(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&rs(e,!!i.multiple,t,!1)}}}var ca=!1;function Cl(e,t,i){if(ca)return e(t,i);ca=!0;try{var s=e(t);return s}finally{if(ca=!1,(Ks!==null||Gs!==null)&&(bo(),Ks&&(t=Ks,e=Gs,Gs=Ks=null,yl(t),e)))for(t=0;t<e.length;t++)yl(e[t])}}function Zt(e,t){var i=e.stateNode;if(i===null)return null;var s=i[Bt]||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(b(231,t,typeof i));return i}var Oi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ua=!1;if(Oi)try{var Ze={};Object.defineProperty(Ze,"passive",{get:function(){ua=!0}}),window.addEventListener("test",Ze,Ze),window.removeEventListener("test",Ze,Ze)}catch{ua=!1}var Ht=null,St=null,It=null;function ha(){if(It)return It;var e,t=St,i=t.length,s,n="value"in Ht?Ht.value:Ht.textContent,a=n.length;for(e=0;e<i&&t[e]===n[e];e++);var A=i-e;for(s=1;s<=A&&t[i-s]===n[a-s];s++);return It=n.slice(e,1<s?1-s:void 0)}function Xe(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 zt(){return!0}function Es(){return!1}function jt(e){function t(i,s,n,a,A){this._reactName=i,this._targetInst=n,this.type=s,this.nativeEvent=a,this.target=A,this.currentTarget=null;for(var H in e)e.hasOwnProperty(H)&&(i=e[H],this[H]=i?i(a):a[H]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?zt:Es,this.isPropagationStopped=Es,this}return _(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=zt)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=zt)},persist:function(){},isPersistent:zt}),t}var ci={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bi=jt(ci),st=_({},ci,{view:0,detail:0}),wl=jt(st),as,ur,Vs,As=_({},st,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dr,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!==Vs&&(Vs&&e.type==="mousemove"?(as=e.screenX-Vs.screenX,ur=e.screenY-Vs.screenY):ur=as=0,Vs=e),as)},movementY:function(e){return"movementY"in e?e.movementY:ur}}),da=jt(As),hr=_({},As,{dataTransfer:0}),xl=jt(hr),fa=_({},st,{relatedTarget:0}),Vi=jt(fa),ac=_({},ci,{animationName:0,elapsedTime:0,pseudoElement:0}),Pt=jt(ac),lc=_({},ci,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),oc=jt(lc),Yi=_({},ci,{data:0}),ls=jt(Yi),cc={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},uc={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"},_a={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hc(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=_a[e])?!!t[e]:!1}function dr(){return hc}var dc=_({},st,{key:function(e){if(e.key){var t=cc[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Xe(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?uc[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dr,charCode:function(e){return e.type==="keypress"?Xe(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Xe(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),fc=jt(dc),_c=_({},As,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fr=jt(_c),pc=_({},st,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dr}),mc=jt(pc),vc=_({},ci,{propertyName:0,elapsedTime:0,pseudoElement:0}),_r=jt(vc),El=_({},As,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),gc=jt(El),Al=_({},ci,{newState:0,oldState:0}),Sc=jt(Al),bc=[9,13,27,32],pa=Oi&&"CompositionEvent"in window,An=null;Oi&&"documentMode"in document&&(An=document.documentMode);var Rl=Oi&&"TextEvent"in window&&!An,pr=Oi&&(!pa||An&&8<An&&11>=An),ma=" ",Tl=!1;function Dl(e,t){switch(e){case"keyup":return bc.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function va(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var os=!1;function yc(e,t){switch(e){case"compositionend":return va(t);case"keypress":return t.which!==32?null:(Tl=!0,ma);case"textInput":return e=t.data,e===ma&&Tl?null:e;default:return null}}function kl(e,t){if(os)return e==="compositionend"||!pa&&Dl(e,t)?(e=ha(),It=St=Ht=null,os=!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 pr&&t.locale!=="ko"?null:t.data;default:return null}}var Ml={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 Ll(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ml[e.type]:t==="textarea"}function Ol(e,t,i,s){Ks?Gs?Gs.push(s):Gs=[s]:Ks=s,t=Ro(t,"onChange"),0<t.length&&(i=new Bi("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var Rn=null,Tn=null;function ga(e){Kf(e,0)}function ji(e){var t=Fs(e);if(ml(t))return e}function Bl(e,t){if(e==="change")return t}var mr=!1;if(Oi){var Dn;if(Oi){var vr="oninput"in document;if(!vr){var jl=document.createElement("div");jl.setAttribute("oninput","return;"),vr=typeof jl.oninput=="function"}Dn=vr}else Dn=!1;mr=Dn&&(!document.documentMode||9<document.documentMode)}function Sa(){Rn&&(Rn.detachEvent("onpropertychange",kn),Tn=Rn=null)}function kn(e){if(e.propertyName==="value"&&ji(Tn)){var t=[];Ol(t,Tn,e,oa(e)),Cl(ga,t)}}function Cc(e,t,i){e==="focusin"?(Sa(),Rn=t,Tn=i,Rn.attachEvent("onpropertychange",kn)):e==="focusout"&&Sa()}function wc(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ji(Tn)}function xc(e,t){if(e==="click")return ji(t)}function Ec(e,t){if(e==="input"||e==="change")return ji(t)}function ba(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ti=typeof Object.is=="function"?Object.is:ba;function Mn(e,t){if(ti(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 n=i[s];if(!pe.call(t,n)||!ti(e[n],t[n]))return!1}return!0}function Nl(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gr(e,t){var i=Nl(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=Nl(i)}}function ya(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ya(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ca(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ar(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=ar(e.document)}return t}function wa(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 Hl=Oi&&"documentMode"in document&&11>=document.documentMode,Ci=null,Ys=null,Ln=null,xa=!1;function zl(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;xa||Ci==null||Ci!==ar(s)||(s=Ci,"selectionStart"in s&&wa(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}),Ln&&Mn(Ln,s)||(Ln=s,s=Ro(Ys,"onSelect"),0<s.length&&(t=new Bi("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=Ci)))}function cs(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Rs={animationend:cs("Animation","AnimationEnd"),animationiteration:cs("Animation","AnimationIteration"),animationstart:cs("Animation","AnimationStart"),transitionrun:cs("Transition","TransitionRun"),transitionstart:cs("Transition","TransitionStart"),transitioncancel:cs("Transition","TransitionCancel"),transitionend:cs("Transition","TransitionEnd")},Xi={},us={};Oi&&(us=document.createElement("div").style,"AnimationEvent"in window||(delete Rs.animationend.animation,delete Rs.animationiteration.animation,delete Rs.animationstart.animation),"TransitionEvent"in window||delete Rs.transitionend.transition);function hs(e){if(Xi[e])return Xi[e];if(!Rs[e])return e;var t=Rs[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in us)return Xi[e]=t[i];return e}var Ul=hs("animationend"),Ea=hs("animationiteration"),Aa=hs("animationstart"),Il=hs("transitionrun"),Sr=hs("transitionstart"),Pl=hs("transitioncancel"),$l=hs("transitionend"),ql=new Map,br="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(" ");br.push("scrollEnd");function ui(e,t){ql.set(e,t),ns(t,[e])}var On=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)},hi=[],Xs=0,Ra=0;function yr(){for(var e=Xs,t=Ra=Xs=0;t<e;){var i=hi[t];hi[t++]=null;var s=hi[t];hi[t++]=null;var n=hi[t];hi[t++]=null;var a=hi[t];if(hi[t++]=null,s!==null&&n!==null){var A=s.pending;A===null?n.next=n:(n.next=A.next,A.next=n),s.pending=n}a!==0&&Da(i,n,a)}}function Cr(e,t,i,s){hi[Xs++]=e,hi[Xs++]=t,hi[Xs++]=i,hi[Xs++]=s,Ra|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Ta(e,t,i,s){return Cr(e,t,i,s),wr(e)}function wi(e,t){return Cr(e,null,null,t),wr(e)}function Da(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var n=!1,a=e.return;a!==null;)a.childLanes|=i,s=a.alternate,s!==null&&(s.childLanes|=i),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(n=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,n&&t!==null&&(n=31-Vt(i),e=a.hiddenUpdates,s=e[n],s===null?e[n]=[t]:s.push(t),t.lane=i|536870912),a):null}function wr(e){if(50<Qa)throw Qa=0,Du=null,Error(b(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Zs={};function Fl(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 ii(e,t,i,s){return new Fl(e,t,i,s)}function ka(e){return e=e.prototype,!(!e||!e.isReactComponent)}function m(e,t){var i=e.alternate;return i===null?(i=ii(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 N(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 q(e,t,i,s,n,a){var A=0;if(s=e,typeof e=="function")ka(e)&&(A=1);else if(typeof e=="string")A=tv(e,i,ne.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case B:return e=ii(31,i,t,n),e.elementType=B,e.lanes=a,e;case w:return V(i.children,n,a,t);case d:A=8,n|=24;break;case u:return e=ii(12,i,t,n|2),e.elementType=u,e.lanes=a,e;case T:return e=ii(13,i,t,n),e.elementType=T,e.lanes=a,e;case R:return e=ii(19,i,t,n),e.elementType=R,e.lanes=a,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case h:A=10;break e;case l:A=9;break e;case S:A=11;break e;case D:A=14;break e;case x:A=16,s=null;break e}A=29,i=Error(b(130,e===null?"null":typeof e,"")),s=null}return t=ii(A,i,t,n),t.elementType=e,t.type=s,t.lanes=a,t}function V(e,t,i,s){return e=ii(7,e,s,t),e.lanes=i,e}function ge(e,t,i){return e=ii(6,e,null,t),e.lanes=i,e}function be(e){var t=ii(18,null,null,0);return t.stateNode=e,t}function Ee(e,t,i){return t=ii(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var je=new WeakMap;function ht(e,t){if(typeof e=="object"&&e!==null){var i=je.get(e);return i!==void 0?i:(t={value:e,source:t,stack:ri(t)},je.set(e,t),t)}return{value:e,source:t,stack:ri(t)}}var Et=[],Ni=0,At=null,Zi=0,dt=[],$t=0,di=null,si=1,Hi="";function ds(e,t){Et[Ni++]=Zi,Et[Ni++]=At,At=e,Zi=t}function zi(e,t,i){dt[$t++]=si,dt[$t++]=Hi,dt[$t++]=di,di=e;var s=si;e=Hi;var n=32-Vt(s)-1;s&=~(1<<n),i+=1;var a=32-Vt(t)+n;if(30<a){var A=n-n%5;a=(s&(1<<A)-1).toString(32),s>>=A,n-=A,si=1<<32-Vt(t)+n|i<<n|s,Hi=a+e}else si=1<<a|i<<n|s,Hi=e}function Ma(e){e.return!==null&&(ds(e,1),zi(e,1,0))}function Bn(e){for(;e===At;)At=Et[--Ni],Et[Ni]=null,Zi=Et[--Ni],Et[Ni]=null;for(;e===di;)di=dt[--$t],dt[$t]=null,Hi=dt[--$t],dt[$t]=null,si=dt[--$t],dt[$t]=null}function jn(e,t){dt[$t++]=si,dt[$t++]=Hi,dt[$t++]=di,si=t.id,Hi=t.overflow,di=e}var qt=null,ft=null,Ge=!1,Qs=null,Ui=!1,Ac=Error(b(519));function Js(e){var t=Error(b(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw La(ht(t,e)),Ac}function Lh(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[gt]=e,t[Bt]=s,i){case"dialog":qe("cancel",t),qe("close",t);break;case"iframe":case"object":case"embed":qe("load",t);break;case"video":case"audio":for(i=0;i<el.length;i++)qe(el[i],t);break;case"source":qe("error",t);break;case"img":case"image":case"link":qe("error",t),qe("load",t);break;case"details":qe("toggle",t);break;case"input":qe("invalid",t),En(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":qe("invalid",t);break;case"textarea":qe("invalid",t),vl(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||Xf(t.textContent,i)?(s.popover!=null&&(qe("beforetoggle",t),qe("toggle",t)),s.onScroll!=null&&qe("scroll",t),s.onScrollEnd!=null&&qe("scrollend",t),s.onClick!=null&&(t.onclick=Gi),t=!0):t=!1,t||Js(e,!0)}function Oh(e){for(qt=e.return;qt;)switch(qt.tag){case 5:case 31:case 13:Ui=!1;return;case 27:case 3:Ui=!0;return;default:qt=qt.return}}function xr(e){if(e!==qt)return!1;if(!Ge)return Oh(e),Ge=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Fu(e.type,e.memoizedProps)),i=!i),i&&ft&&Js(e),Oh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(b(317));ft=r_(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(b(317));ft=r_(e)}else t===27?(t=ft,_n(e.type)?(e=Yu,Yu=null,ft=e):ft=t):ft=qt?Pi(e.stateNode.nextSibling):null;return!0}function Nn(){ft=qt=null,Ge=!1}function Rc(){var e=Qs;return e!==null&&(mi===null?mi=e:mi.push.apply(mi,e),Qs=null),e}function La(e){Qs===null?Qs=[e]:Qs.push(e)}var Tc=k(null),Hn=null,Ts=null;function en(e,t,i){Y(Tc,t._currentValue),t._currentValue=i}function Ds(e){e._currentValue=Tc.current,z(Tc)}function Dc(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 kc(e,t,i,s){var n=e.child;for(n!==null&&(n.return=e);n!==null;){var a=n.dependencies;if(a!==null){var A=n.child;a=a.firstContext;e:for(;a!==null;){var H=a;a=n;for(var W=0;W<t.length;W++)if(H.context===t[W]){a.lanes|=i,H=a.alternate,H!==null&&(H.lanes|=i),Dc(a.return,i,e),s||(A=null);break e}a=H.next}}else if(n.tag===18){if(A=n.return,A===null)throw Error(b(341));A.lanes|=i,a=A.alternate,a!==null&&(a.lanes|=i),Dc(A,i,e),A=null}else A=n.child;if(A!==null)A.return=n;else for(A=n;A!==null;){if(A===e){A=null;break}if(n=A.sibling,n!==null){n.return=A.return,A=n;break}A=A.return}n=A}}function Er(e,t,i,s){e=null;for(var n=t,a=!1;n!==null;){if(!a){if((n.flags&524288)!==0)a=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var A=n.alternate;if(A===null)throw Error(b(387));if(A=A.memoizedProps,A!==null){var H=n.type;ti(n.pendingProps.value,A.value)||(e!==null?e.push(H):e=[H])}}else if(n===Q.current){if(A=n.alternate,A===null)throw Error(b(387));A.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(rl):e=[rl])}n=n.return}e!==null&&kc(t,e,i,s),t.flags|=262144}function Wl(e){for(e=e.firstContext;e!==null;){if(!ti(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function zn(e){Hn=e,Ts=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ft(e){return Bh(Hn,e)}function Kl(e,t){return Hn===null&&zn(e),Bh(e,t)}function Bh(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Ts===null){if(e===null)throw Error(b(308));Ts=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ts=Ts.next=t;return i}var Zp=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()})}},Qp=r.unstable_scheduleCallback,Jp=r.unstable_NormalPriority,kt={$$typeof:h,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Mc(){return{controller:new Zp,data:new Map,refCount:0}}function Oa(e){e.refCount--,e.refCount===0&&Qp(Jp,function(){e.controller.abort()})}var Ba=null,Lc=0,Ar=0,Rr=null;function em(e,t){if(Ba===null){var i=Ba=[];Lc=0,Ar=ju(),Rr={status:"pending",value:void 0,then:function(s){i.push(s)}}}return Lc++,t.then(jh,jh),t}function jh(){if(--Lc===0&&Ba!==null){Rr!==null&&(Rr.status="fulfilled");var e=Ba;Ba=null,Ar=0,Rr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function tm(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(n){i.push(n)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var n=0;n<i.length;n++)(0,i[n])(t)},function(n){for(s.status="rejected",s.reason=n,n=0;n<i.length;n++)(0,i[n])(void 0)}),s}var Nh=G.S;G.S=function(e,t){bf=Pe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&em(e,t),Nh!==null&&Nh(e,t)};var Un=k(null);function Oc(){var e=Un.current;return e!==null?e:ct.pooledCache}function Gl(e,t){t===null?Y(Un,Un.current):Y(Un,t.pool)}function Hh(){var e=Oc();return e===null?null:{parent:kt._currentValue,pool:e}}var Tr=Error(b(460)),Bc=Error(b(474)),Vl=Error(b(542)),Yl={then:function(){}};function zh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Uh(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Gi,Gi),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ph(e),e;default:if(typeof t.status=="string")t.then(Gi,Gi);else{if(e=ct,e!==null&&100<e.shellSuspendCounter)throw Error(b(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var n=t;n.status="fulfilled",n.value=s}},function(s){if(t.status==="pending"){var n=t;n.status="rejected",n.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ph(e),e}throw Pn=t,Tr}}function In(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Pn=i,Tr):i}}var Pn=null;function Ih(){if(Pn===null)throw Error(b(459));var e=Pn;return Pn=null,e}function Ph(e){if(e===Tr||e===Vl)throw Error(b(483))}var Dr=null,ja=0;function Xl(e){var t=ja;return ja+=1,Dr===null&&(Dr=[]),Uh(Dr,e,t)}function Na(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Zl(e,t){throw t.$$typeof===C?Error(b(525)):(e=Object.prototype.toString.call(t),Error(b(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function $h(e){function t(ee,X){if(e){var ie=ee.deletions;ie===null?(ee.deletions=[X],ee.flags|=16):ie.push(X)}}function i(ee,X){if(!e)return null;for(;X!==null;)t(ee,X),X=X.sibling;return null}function s(ee){for(var X=new Map;ee!==null;)ee.key!==null?X.set(ee.key,ee):X.set(ee.index,ee),ee=ee.sibling;return X}function n(ee,X){return ee=m(ee,X),ee.index=0,ee.sibling=null,ee}function a(ee,X,ie){return ee.index=ie,e?(ie=ee.alternate,ie!==null?(ie=ie.index,ie<X?(ee.flags|=67108866,X):ie):(ee.flags|=67108866,X)):(ee.flags|=1048576,X)}function A(ee){return e&&ee.alternate===null&&(ee.flags|=67108866),ee}function H(ee,X,ie,de){return X===null||X.tag!==6?(X=ge(ie,ee.mode,de),X.return=ee,X):(X=n(X,ie),X.return=ee,X)}function W(ee,X,ie,de){var Te=ie.type;return Te===w?ue(ee,X,ie.props.children,de,ie.key):X!==null&&(X.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===x&&In(Te)===X.type)?(X=n(X,ie.props),Na(X,ie),X.return=ee,X):(X=q(ie.type,ie.key,ie.props,null,ee.mode,de),Na(X,ie),X.return=ee,X)}function se(ee,X,ie,de){return X===null||X.tag!==4||X.stateNode.containerInfo!==ie.containerInfo||X.stateNode.implementation!==ie.implementation?(X=Ee(ie,ee.mode,de),X.return=ee,X):(X=n(X,ie.children||[]),X.return=ee,X)}function ue(ee,X,ie,de,Te){return X===null||X.tag!==7?(X=V(ie,ee.mode,de,Te),X.return=ee,X):(X=n(X,ie),X.return=ee,X)}function fe(ee,X,ie){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=ge(""+X,ee.mode,ie),X.return=ee,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case E:return ie=q(X.type,X.key,X.props,null,ee.mode,ie),Na(ie,X),ie.return=ee,ie;case M:return X=Ee(X,ee.mode,ie),X.return=ee,X;case x:return X=In(X),fe(ee,X,ie)}if(he(X)||J(X))return X=V(X,ee.mode,ie,null),X.return=ee,X;if(typeof X.then=="function")return fe(ee,Xl(X),ie);if(X.$$typeof===h)return fe(ee,Kl(ee,X),ie);Zl(ee,X)}return null}function re(ee,X,ie,de){var Te=X!==null?X.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return Te!==null?null:H(ee,X,""+ie,de);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case E:return ie.key===Te?W(ee,X,ie,de):null;case M:return ie.key===Te?se(ee,X,ie,de):null;case x:return ie=In(ie),re(ee,X,ie,de)}if(he(ie)||J(ie))return Te!==null?null:ue(ee,X,ie,de,null);if(typeof ie.then=="function")return re(ee,X,Xl(ie),de);if(ie.$$typeof===h)return re(ee,X,Kl(ee,ie),de);Zl(ee,ie)}return null}function ce(ee,X,ie,de,Te){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return ee=ee.get(ie)||null,H(X,ee,""+de,Te);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case E:return ee=ee.get(de.key===null?ie:de.key)||null,W(X,ee,de,Te);case M:return ee=ee.get(de.key===null?ie:de.key)||null,se(X,ee,de,Te);case x:return de=In(de),ce(ee,X,ie,de,Te)}if(he(de)||J(de))return ee=ee.get(ie)||null,ue(X,ee,de,Te,null);if(typeof de.then=="function")return ce(ee,X,ie,Xl(de),Te);if(de.$$typeof===h)return ce(ee,X,ie,Kl(X,de),Te);Zl(X,de)}return null}function xe(ee,X,ie,de){for(var Te=null,Qe=null,Ae=X,He=X=0,We=null;Ae!==null&&He<ie.length;He++){Ae.index>He?(We=Ae,Ae=null):We=Ae.sibling;var Je=re(ee,Ae,ie[He],de);if(Je===null){Ae===null&&(Ae=We);break}e&&Ae&&Je.alternate===null&&t(ee,Ae),X=a(Je,X,He),Qe===null?Te=Je:Qe.sibling=Je,Qe=Je,Ae=We}if(He===ie.length)return i(ee,Ae),Ge&&ds(ee,He),Te;if(Ae===null){for(;He<ie.length;He++)Ae=fe(ee,ie[He],de),Ae!==null&&(X=a(Ae,X,He),Qe===null?Te=Ae:Qe.sibling=Ae,Qe=Ae);return Ge&&ds(ee,He),Te}for(Ae=s(Ae);He<ie.length;He++)We=ce(Ae,ee,He,ie[He],de),We!==null&&(e&&We.alternate!==null&&Ae.delete(We.key===null?He:We.key),X=a(We,X,He),Qe===null?Te=We:Qe.sibling=We,Qe=We);return e&&Ae.forEach(function(Sn){return t(ee,Sn)}),Ge&&ds(ee,He),Te}function ke(ee,X,ie,de){if(ie==null)throw Error(b(151));for(var Te=null,Qe=null,Ae=X,He=X=0,We=null,Je=ie.next();Ae!==null&&!Je.done;He++,Je=ie.next()){Ae.index>He?(We=Ae,Ae=null):We=Ae.sibling;var Sn=re(ee,Ae,Je.value,de);if(Sn===null){Ae===null&&(Ae=We);break}e&&Ae&&Sn.alternate===null&&t(ee,Ae),X=a(Sn,X,He),Qe===null?Te=Sn:Qe.sibling=Sn,Qe=Sn,Ae=We}if(Je.done)return i(ee,Ae),Ge&&ds(ee,He),Te;if(Ae===null){for(;!Je.done;He++,Je=ie.next())Je=fe(ee,Je.value,de),Je!==null&&(X=a(Je,X,He),Qe===null?Te=Je:Qe.sibling=Je,Qe=Je);return Ge&&ds(ee,He),Te}for(Ae=s(Ae);!Je.done;He++,Je=ie.next())Je=ce(Ae,ee,He,Je.value,de),Je!==null&&(e&&Je.alternate!==null&&Ae.delete(Je.key===null?He:Je.key),X=a(Je,X,He),Qe===null?Te=Je:Qe.sibling=Je,Qe=Je);return e&&Ae.forEach(function(dv){return t(ee,dv)}),Ge&&ds(ee,He),Te}function ot(ee,X,ie,de){if(typeof ie=="object"&&ie!==null&&ie.type===w&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case E:e:{for(var Te=ie.key;X!==null;){if(X.key===Te){if(Te=ie.type,Te===w){if(X.tag===7){i(ee,X.sibling),de=n(X,ie.props.children),de.return=ee,ee=de;break e}}else if(X.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===x&&In(Te)===X.type){i(ee,X.sibling),de=n(X,ie.props),Na(de,ie),de.return=ee,ee=de;break e}i(ee,X);break}else t(ee,X);X=X.sibling}ie.type===w?(de=V(ie.props.children,ee.mode,de,ie.key),de.return=ee,ee=de):(de=q(ie.type,ie.key,ie.props,null,ee.mode,de),Na(de,ie),de.return=ee,ee=de)}return A(ee);case M:e:{for(Te=ie.key;X!==null;){if(X.key===Te)if(X.tag===4&&X.stateNode.containerInfo===ie.containerInfo&&X.stateNode.implementation===ie.implementation){i(ee,X.sibling),de=n(X,ie.children||[]),de.return=ee,ee=de;break e}else{i(ee,X);break}else t(ee,X);X=X.sibling}de=Ee(ie,ee.mode,de),de.return=ee,ee=de}return A(ee);case x:return ie=In(ie),ot(ee,X,ie,de)}if(he(ie))return xe(ee,X,ie,de);if(J(ie)){if(Te=J(ie),typeof Te!="function")throw Error(b(150));return ie=Te.call(ie),ke(ee,X,ie,de)}if(typeof ie.then=="function")return ot(ee,X,Xl(ie),de);if(ie.$$typeof===h)return ot(ee,X,Kl(ee,ie),de);Zl(ee,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,X!==null&&X.tag===6?(i(ee,X.sibling),de=n(X,ie),de.return=ee,ee=de):(i(ee,X),de=ge(ie,ee.mode,de),de.return=ee,ee=de),A(ee)):i(ee,X)}return function(ee,X,ie,de){try{ja=0;var Te=ot(ee,X,ie,de);return Dr=null,Te}catch(Ae){if(Ae===Tr||Ae===Vl)throw Ae;var Qe=ii(29,Ae,null,ee.mode);return Qe.lanes=de,Qe.return=ee,Qe}}}var $n=$h(!0),qh=$h(!1),tn=!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 sn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function nn(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(et&2)!==0){var n=s.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),s.pending=t,t=wr(e),Da(e,null,i),t}return Cr(e,s,t,i),wr(e)}function Ha(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,Ss(e,i)}}function Hc(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var n=null,a=null;if(i=i.firstBaseUpdate,i!==null){do{var A={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};a===null?n=a=A:a=a.next=A,i=i.next}while(i!==null);a===null?n=a=t:a=a.next=t}else n=a=t;i={baseState:s.baseState,firstBaseUpdate:n,lastBaseUpdate:a,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 za(){if(zc){var e=Rr;if(e!==null)throw e}}function Ua(e,t,i,s){zc=!1;var n=e.updateQueue;tn=!1;var a=n.firstBaseUpdate,A=n.lastBaseUpdate,H=n.shared.pending;if(H!==null){n.shared.pending=null;var W=H,se=W.next;W.next=null,A===null?a=se:A.next=se,A=W;var ue=e.alternate;ue!==null&&(ue=ue.updateQueue,H=ue.lastBaseUpdate,H!==A&&(H===null?ue.firstBaseUpdate=se:H.next=se,ue.lastBaseUpdate=W))}if(a!==null){var fe=n.baseState;A=0,ue=se=W=null,H=a;do{var re=H.lane&-536870913,ce=re!==H.lane;if(ce?(Fe&re)===re:(s&re)===re){re!==0&&re===Ar&&(zc=!0),ue!==null&&(ue=ue.next={lane:0,tag:H.tag,payload:H.payload,callback:null,next:null});e:{var xe=e,ke=H;re=t;var ot=i;switch(ke.tag){case 1:if(xe=ke.payload,typeof xe=="function"){fe=xe.call(ot,fe,re);break e}fe=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=ke.payload,re=typeof xe=="function"?xe.call(ot,fe,re):xe,re==null)break e;fe=_({},fe,re);break e;case 2:tn=!0}}re=H.callback,re!==null&&(e.flags|=64,ce&&(e.flags|=8192),ce=n.callbacks,ce===null?n.callbacks=[re]:ce.push(re))}else ce={lane:re,tag:H.tag,payload:H.payload,callback:H.callback,next:null},ue===null?(se=ue=ce,W=fe):ue=ue.next=ce,A|=re;if(H=H.next,H===null){if(H=n.shared.pending,H===null)break;ce=H,H=ce.next,ce.next=null,n.lastBaseUpdate=ce,n.shared.pending=null}}while(!0);ue===null&&(W=fe),n.baseState=W,n.firstBaseUpdate=se,n.lastBaseUpdate=ue,a===null&&(n.shared.lanes=0),cn|=A,e.lanes=A,e.memoizedState=fe}}function Fh(e,t){if(typeof e!="function")throw Error(b(191,e));e.call(t)}function Wh(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Fh(i[e],t)}var kr=k(null),Ql=k(0);function Kh(e,t){e=zs,Y(Ql,e),Y(kr,t),zs=e|t.baseLanes}function Uc(){Y(Ql,zs),Y(kr,kr.current)}function Ic(){zs=Ql.current,z(kr),z(Ql)}var xi=k(null),Ii=null;function rn(e){var t=e.alternate;Y(Rt,Rt.current&1),Y(xi,e),Ii===null&&(t===null||kr.current!==null||t.memoizedState!==null)&&(Ii=e)}function Pc(e){Y(Rt,Rt.current),Y(xi,e),Ii===null&&(Ii=e)}function Gh(e){e.tag===22?(Y(Rt,Rt.current),Y(xi,e),Ii===null&&(Ii=e)):an()}function an(){Y(Rt,Rt.current),Y(xi,xi.current)}function Ei(e){z(xi),Ii===e&&(Ii=null),z(Rt)}var Rt=k(0);function Jl(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Gu(i)||Vu(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 ks=0,Ne=null,at=null,Mt=null,eo=!1,Mr=!1,qn=!1,to=0,Ia=0,Lr=null,im=0;function Ct(){throw Error(b(321))}function $c(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!ti(e[i],t[i]))return!1;return!0}function qc(e,t,i,s,n,a){return ks=a,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,G.H=e===null||e.memoizedState===null?kd:nu,qn=!1,a=i(s,n),qn=!1,Mr&&(a=Yh(t,i,s,n)),Vh(e),a}function Vh(e){G.H=qa;var t=at!==null&&at.next!==null;if(ks=0,Mt=at=Ne=null,eo=!1,Ia=0,Lr=null,t)throw Error(b(300));e===null||Lt||(e=e.dependencies,e!==null&&Wl(e)&&(Lt=!0))}function Yh(e,t,i,s){Ne=e;var n=0;do{if(Mr&&(Lr=null),Ia=0,Mr=!1,25<=n)throw Error(b(301));if(n+=1,Mt=at=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}G.H=Md,a=t(i,s)}while(Mr);return a}function sm(){var e=G.H,t=e.useState()[0];return t=typeof t.then=="function"?Pa(t):t,e=e.useState()[0],(at!==null?at.memoizedState:null)!==e&&(Ne.flags|=1024),t}function Fc(){var e=to!==0;return to=0,e}function Wc(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function Kc(e){if(eo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}eo=!1}ks=0,Mt=at=Ne=null,Mr=!1,Ia=to=0,Lr=null}function ni(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?Ne.memoizedState=Mt=e:Mt=Mt.next=e,Mt}function Tt(){if(at===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=at.next;var t=Mt===null?Ne.memoizedState:Mt.next;if(t!==null)Mt=t,at=e;else{if(e===null)throw Ne.alternate===null?Error(b(467)):Error(b(310));at=e,e={memoizedState:at.memoizedState,baseState:at.baseState,baseQueue:at.baseQueue,queue:at.queue,next:null},Mt===null?Ne.memoizedState=Mt=e:Mt=Mt.next=e}return Mt}function io(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Pa(e){var t=Ia;return Ia+=1,Lr===null&&(Lr=[]),e=Uh(Lr,e,t),t=Ne,(Mt===null?t.memoizedState:Mt.next)===null&&(t=t.alternate,G.H=t===null||t.memoizedState===null?kd:nu),e}function so(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Pa(e);if(e.$$typeof===h)return Ft(e)}throw Error(b(438,String(e)))}function Gc(e){var t=null,i=Ne.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=Ne.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=io(),Ne.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 Ms(e,t){return typeof t=="function"?t(e):t}function no(e){var t=Tt();return Vc(t,at,e)}function Vc(e,t,i){var s=e.queue;if(s===null)throw Error(b(311));s.lastRenderedReducer=i;var n=e.baseQueue,a=s.pending;if(a!==null){if(n!==null){var A=n.next;n.next=a.next,a.next=A}t.baseQueue=n=a,s.pending=null}if(a=e.baseState,n===null)e.memoizedState=a;else{t=n.next;var H=A=null,W=null,se=t,ue=!1;do{var fe=se.lane&-536870913;if(fe!==se.lane?(Fe&fe)===fe:(ks&fe)===fe){var re=se.revertLane;if(re===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),fe===Ar&&(ue=!0);else if((ks&re)===re){se=se.next,re===Ar&&(ue=!0);continue}else fe={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},W===null?(H=W=fe,A=a):W=W.next=fe,Ne.lanes|=re,cn|=re;fe=se.action,qn&&i(a,fe),a=se.hasEagerState?se.eagerState:i(a,fe)}else re={lane:fe,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},W===null?(H=W=re,A=a):W=W.next=re,Ne.lanes|=fe,cn|=fe;se=se.next}while(se!==null&&se!==t);if(W===null?A=a:W.next=H,!ti(a,e.memoizedState)&&(Lt=!0,ue&&(i=Rr,i!==null)))throw i;e.memoizedState=a,e.baseState=A,e.baseQueue=W,s.lastRenderedState=a}return n===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Yc(e){var t=Tt(),i=t.queue;if(i===null)throw Error(b(311));i.lastRenderedReducer=e;var s=i.dispatch,n=i.pending,a=t.memoizedState;if(n!==null){i.pending=null;var A=n=n.next;do a=e(a,A.action),A=A.next;while(A!==n);ti(a,t.memoizedState)||(Lt=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),i.lastRenderedState=a}return[a,s]}function Xh(e,t,i){var s=Ne,n=Tt(),a=Ge;if(a){if(i===void 0)throw Error(b(407));i=i()}else i=t();var A=!ti((at||n).memoizedState,i);if(A&&(n.memoizedState=i,Lt=!0),n=n.queue,Qc(Jh.bind(null,s,n,e),[e]),n.getSnapshot!==t||A||Mt!==null&&Mt.memoizedState.tag&1){if(s.flags|=2048,Or(9,{destroy:void 0},Qh.bind(null,s,n,i,t),null),ct===null)throw Error(b(349));a||(ks&127)!==0||Zh(s,t,i)}return i}function Zh(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Ne.updateQueue,t===null?(t=io(),Ne.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Qh(e,t,i,s){t.value=i,t.getSnapshot=s,ed(t)&&td(e)}function Jh(e,t,i){return i(function(){ed(t)&&td(e)})}function ed(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!ti(e,i)}catch{return!0}}function td(e){var t=wi(e,2);t!==null&&vi(t,e,2)}function Xc(e){var t=ni();if(typeof e=="function"){var i=e;if(e=i(),qn){qi(!0);try{i()}finally{qi(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ms,lastRenderedState:e},t}function id(e,t,i,s){return e.baseState=i,Vc(e,at,typeof s=="function"?s:Ms)}function nm(e,t,i,s,n){if(lo(e))throw Error(b(485));if(e=t.action,e!==null){var a={payload:n,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){a.listeners.push(A)}};G.T!==null?i(!0):a.isTransition=!1,s(a),i=t.pending,i===null?(a.next=t.pending=a,sd(t,a)):(a.next=i.next,t.pending=i.next=a)}}function sd(e,t){var i=t.action,s=t.payload,n=e.state;if(t.isTransition){var a=G.T,A={};G.T=A;try{var H=i(n,s),W=G.S;W!==null&&W(A,H),nd(e,t,H)}catch(se){Zc(e,t,se)}finally{a!==null&&A.types!==null&&(a.types=A.types),G.T=a}}else try{a=i(n,s),nd(e,t,a)}catch(se){Zc(e,t,se)}}function nd(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){rd(e,t,s)},function(s){return Zc(e,t,s)}):rd(e,t,i)}function rd(e,t,i){t.status="fulfilled",t.value=i,ad(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,sd(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,ad(t),t=t.next;while(t!==s)}e.action=null}function ad(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ld(e,t){return t}function od(e,t){if(Ge){var i=ct.formState;if(i!==null){e:{var s=Ne;if(Ge){if(ft){t:{for(var n=ft,a=Ui;n.nodeType!==8;){if(!a){n=null;break t}if(n=Pi(n.nextSibling),n===null){n=null;break t}}a=n.data,n=a==="F!"||a==="F"?n:null}if(n){ft=Pi(n.nextSibling),s=n.data==="F!";break e}}Js(s)}s=!1}s&&(t=i[0])}}return i=ni(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ld,lastRenderedState:t},i.queue=s,i=Rd.bind(null,Ne,s),s.dispatch=i,s=Xc(!1),a=su.bind(null,Ne,!1,s.queue),s=ni(),n={state:t,dispatch:null,action:e,pending:null},s.queue=n,i=nm.bind(null,Ne,n,a,i),n.dispatch=i,s.memoizedState=e,[t,i,!1]}function cd(e){var t=Tt();return ud(t,at,e)}function ud(e,t,i){if(t=Vc(e,t,ld)[0],e=no(Ms)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Pa(t)}catch(A){throw A===Tr?Vl:A}else s=t;t=Tt();var n=t.queue,a=n.dispatch;return i!==t.memoizedState&&(Ne.flags|=2048,Or(9,{destroy:void 0},rm.bind(null,n,i),null)),[s,a,e]}function rm(e,t){e.action=t}function hd(e){var t=Tt(),i=at;if(i!==null)return ud(t,i,e);Tt(),t=t.memoizedState,i=Tt();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function Or(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=Ne.updateQueue,t===null&&(t=io(),Ne.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 dd(){return Tt().memoizedState}function ro(e,t,i,s){var n=ni();Ne.flags|=e,n.memoizedState=Or(1|t,{destroy:void 0},i,s===void 0?null:s)}function ao(e,t,i,s){var n=Tt();s=s===void 0?null:s;var a=n.memoizedState.inst;at!==null&&s!==null&&$c(s,at.memoizedState.deps)?n.memoizedState=Or(t,a,i,s):(Ne.flags|=e,n.memoizedState=Or(1|t,a,i,s))}function fd(e,t){ro(8390656,8,e,t)}function Qc(e,t){ao(2048,8,e,t)}function am(e){Ne.flags|=4;var t=Ne.updateQueue;if(t===null)t=io(),Ne.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function _d(e){var t=Tt().memoizedState;return am({ref:t,nextImpl:e}),function(){if((et&2)!==0)throw Error(b(440));return t.impl.apply(void 0,arguments)}}function pd(e,t){return ao(4,2,e,t)}function md(e,t){return ao(4,4,e,t)}function vd(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 gd(e,t,i){i=i!=null?i.concat([e]):null,ao(4,4,vd.bind(null,t,e),i)}function Jc(){}function Sd(e,t){var i=Tt();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 bd(e,t){var i=Tt();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&$c(t,s[1]))return s[0];if(s=e(),qn){qi(!0);try{e()}finally{qi(!1)}}return i.memoizedState=[s,t],s}function eu(e,t,i){return i===void 0||(ks&1073741824)!==0&&(Fe&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=Cf(),Ne.lanes|=e,cn|=e,i)}function yd(e,t,i,s){return ti(i,t)?i:kr.current!==null?(e=eu(e,i,s),ti(e,t)||(Lt=!0),e):(ks&42)===0||(ks&1073741824)!==0&&(Fe&261930)===0?(Lt=!0,e.memoizedState=i):(e=Cf(),Ne.lanes|=e,cn|=e,t)}function Cd(e,t,i,s,n){var a=ae.p;ae.p=a!==0&&8>a?a:8;var A=G.T,H={};G.T=H,su(e,!1,t,i);try{var W=n(),se=G.S;if(se!==null&&se(H,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var ue=tm(W,s);$a(e,t,ue,Ti(e))}else $a(e,t,s,Ti(e))}catch(fe){$a(e,t,{then:function(){},status:"rejected",reason:fe},Ti())}finally{ae.p=a,A!==null&&H.types!==null&&(A.types=H.types),G.T=A}}function lm(){}function tu(e,t,i,s){if(e.tag!==5)throw Error(b(476));var n=wd(e).queue;Cd(e,n,t,le,i===null?lm:function(){return xd(e),i(s)})}function wd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ms,lastRenderedState:le},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ms,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function xd(e){var t=wd(e);t.next===null&&(t=e.alternate.memoizedState),$a(e,t.next.queue,{},Ti())}function iu(){return Ft(rl)}function Ed(){return Tt().memoizedState}function Ad(){return Tt().memoizedState}function om(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Ti();e=sn(i);var s=nn(t,e,i);s!==null&&(vi(s,t,i),Ha(s,t,i)),t={cache:Mc()},e.payload=t;return}t=t.return}}function cm(e,t,i){var s=Ti();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},lo(e)?Td(t,i):(i=Ta(e,t,i,s),i!==null&&(vi(i,e,s),Dd(i,t,s)))}function Rd(e,t,i){var s=Ti();$a(e,t,i,s)}function $a(e,t,i,s){var n={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(lo(e))Td(t,n);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var A=t.lastRenderedState,H=a(A,i);if(n.hasEagerState=!0,n.eagerState=H,ti(H,A))return Cr(e,t,n,0),ct===null&&yr(),!1}catch{}if(i=Ta(e,t,n,s),i!==null)return vi(i,e,s),Dd(i,t,s),!0}return!1}function su(e,t,i,s){if(s={lane:2,revertLane:ju(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},lo(e)){if(t)throw Error(b(479))}else t=Ta(e,i,s,2),t!==null&&vi(t,e,2)}function lo(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function Td(e,t){Mr=eo=!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,Ss(e,i)}}var qa={readContext:Ft,use:so,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useLayoutEffect:Ct,useInsertionEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useSyncExternalStore:Ct,useId:Ct,useHostTransitionStatus:Ct,useFormState:Ct,useActionState:Ct,useOptimistic:Ct,useMemoCache:Ct,useCacheRefresh:Ct};qa.useEffectEvent=Ct;var kd={readContext:Ft,use:so,useCallback:function(e,t){return ni().memoizedState=[e,t===void 0?null:t],e},useContext:Ft,useEffect:fd,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,ro(4194308,4,vd.bind(null,t,e),i)},useLayoutEffect:function(e,t){return ro(4194308,4,e,t)},useInsertionEffect:function(e,t){ro(4,2,e,t)},useMemo:function(e,t){var i=ni();t=t===void 0?null:t;var s=e();if(qn){qi(!0);try{e()}finally{qi(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=ni();if(i!==void 0){var n=i(t);if(qn){qi(!0);try{i(t)}finally{qi(!1)}}}else n=t;return s.memoizedState=s.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},s.queue=e,e=e.dispatch=cm.bind(null,Ne,e),[s.memoizedState,e]},useRef:function(e){var t=ni();return e={current:e},t.memoizedState=e},useState:function(e){e=Xc(e);var t=e.queue,i=Rd.bind(null,Ne,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Jc,useDeferredValue:function(e,t){var i=ni();return eu(i,e,t)},useTransition:function(){var e=Xc(!1);return e=Cd.bind(null,Ne,e.queue,!0,!1),ni().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=Ne,n=ni();if(Ge){if(i===void 0)throw Error(b(407));i=i()}else{if(i=t(),ct===null)throw Error(b(349));(Fe&127)!==0||Zh(s,t,i)}n.memoizedState=i;var a={value:i,getSnapshot:t};return n.queue=a,fd(Jh.bind(null,s,a,e),[e]),s.flags|=2048,Or(9,{destroy:void 0},Qh.bind(null,s,a,i,t),null),i},useId:function(){var e=ni(),t=ct.identifierPrefix;if(Ge){var i=Hi,s=si;i=(s&~(1<<32-Vt(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=to++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=im++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:iu,useFormState:od,useActionState:od,useOptimistic:function(e){var t=ni();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=su.bind(null,Ne,!0,i),i.dispatch=t,[e,t]},useMemoCache:Gc,useCacheRefresh:function(){return ni().memoizedState=om.bind(null,Ne)},useEffectEvent:function(e){var t=ni(),i={impl:e};return t.memoizedState=i,function(){if((et&2)!==0)throw Error(b(440));return i.impl.apply(void 0,arguments)}}},nu={readContext:Ft,use:so,useCallback:Sd,useContext:Ft,useEffect:Qc,useImperativeHandle:gd,useInsertionEffect:pd,useLayoutEffect:md,useMemo:bd,useReducer:no,useRef:dd,useState:function(){return no(Ms)},useDebugValue:Jc,useDeferredValue:function(e,t){var i=Tt();return yd(i,at.memoizedState,e,t)},useTransition:function(){var e=no(Ms)[0],t=Tt().memoizedState;return[typeof e=="boolean"?e:Pa(e),t]},useSyncExternalStore:Xh,useId:Ed,useHostTransitionStatus:iu,useFormState:cd,useActionState:cd,useOptimistic:function(e,t){var i=Tt();return id(i,at,e,t)},useMemoCache:Gc,useCacheRefresh:Ad};nu.useEffectEvent=_d;var Md={readContext:Ft,use:so,useCallback:Sd,useContext:Ft,useEffect:Qc,useImperativeHandle:gd,useInsertionEffect:pd,useLayoutEffect:md,useMemo:bd,useReducer:Yc,useRef:dd,useState:function(){return Yc(Ms)},useDebugValue:Jc,useDeferredValue:function(e,t){var i=Tt();return at===null?eu(i,e,t):yd(i,at.memoizedState,e,t)},useTransition:function(){var e=Yc(Ms)[0],t=Tt().memoizedState;return[typeof e=="boolean"?e:Pa(e),t]},useSyncExternalStore:Xh,useId:Ed,useHostTransitionStatus:iu,useFormState:hd,useActionState:hd,useOptimistic:function(e,t){var i=Tt();return at!==null?id(i,at,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Gc,useCacheRefresh:Ad};Md.useEffectEvent=_d;function ru(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:_({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var au={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=Ti(),n=sn(s);n.payload=t,i!=null&&(n.callback=i),t=nn(e,n,s),t!==null&&(vi(t,e,s),Ha(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=Ti(),n=sn(s);n.tag=1,n.payload=t,i!=null&&(n.callback=i),t=nn(e,n,s),t!==null&&(vi(t,e,s),Ha(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Ti(),s=sn(i);s.tag=2,t!=null&&(s.callback=t),t=nn(e,s,i),t!==null&&(vi(t,e,i),Ha(t,e,i))}};function Ld(e,t,i,s,n,a,A){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,a,A):t.prototype&&t.prototype.isPureReactComponent?!Mn(i,s)||!Mn(n,a):!0}function Od(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&&au.enqueueReplaceState(t,t.state,null)}function Fn(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=_({},i));for(var n in e)i[n]===void 0&&(i[n]=e[n])}return i}function Bd(e){On(e)}function jd(e){console.error(e)}function Nd(e){On(e)}function oo(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Hd(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function lu(e,t,i){return i=sn(i),i.tag=3,i.payload={element:null},i.callback=function(){oo(e,t)},i}function zd(e){return e=sn(e),e.tag=3,e}function Ud(e,t,i,s){var n=i.type.getDerivedStateFromError;if(typeof n=="function"){var a=s.value;e.payload=function(){return n(a)},e.callback=function(){Hd(t,i,s)}}var A=i.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(e.callback=function(){Hd(t,i,s),typeof n!="function"&&(un===null?un=new Set([this]):un.add(this));var H=s.stack;this.componentDidCatch(s.value,{componentStack:H!==null?H:""})})}function um(e,t,i,s,n){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&Er(t,i,n,!0),i=xi.current,i!==null){switch(i.tag){case 31:case 13:return Ii===null?yo():i.alternate===null&&wt===0&&(wt=3),i.flags&=-257,i.flags|=65536,i.lanes=n,s===Yl?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),Lu(e,s,n)),!1;case 22:return i.flags|=65536,s===Yl?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)),Lu(e,s,n)),!1}throw Error(b(435,i.tag))}return Lu(e,s,n),yo(),!1}if(Ge)return t=xi.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,s!==Ac&&(e=Error(b(422),{cause:s}),La(ht(e,i)))):(s!==Ac&&(t=Error(b(423),{cause:s}),La(ht(t,i))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,s=ht(s,i),n=lu(e.stateNode,s,n),Hc(e,n),wt!==4&&(wt=2)),!1;var a=Error(b(520),{cause:s});if(a=ht(a,i),Za===null?Za=[a]:Za.push(a),wt!==4&&(wt=2),t===null)return!0;s=ht(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=n&-n,i.lanes|=e,e=lu(i.stateNode,s,e),Hc(i,e),!1;case 1:if(t=i.type,a=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(un===null||!un.has(a))))return i.flags|=65536,n&=-n,i.lanes|=n,n=zd(n),Ud(n,e,i,s),Hc(i,n),!1}i=i.return}while(i!==null);return!1}var ou=Error(b(461)),Lt=!1;function Wt(e,t,i,s){t.child=e===null?qh(t,null,i,s):$n(t,e.child,i,s)}function Id(e,t,i,s,n){i=i.render;var a=t.ref;if("ref"in s){var A={};for(var H in s)H!=="ref"&&(A[H]=s[H])}else A=s;return zn(t),s=qc(e,t,i,A,a,n),H=Fc(),e!==null&&!Lt?(Wc(e,t,n),Ls(e,t,n)):(Ge&&H&&Ma(t),t.flags|=1,Wt(e,t,s,n),t.child)}function Pd(e,t,i,s,n){if(e===null){var a=i.type;return typeof a=="function"&&!ka(a)&&a.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=a,$d(e,t,a,s,n)):(e=q(i.type,null,s,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!mu(e,n)){var A=a.memoizedProps;if(i=i.compare,i=i!==null?i:Mn,i(A,s)&&e.ref===t.ref)return Ls(e,t,n)}return t.flags|=1,e=m(a,s),e.ref=t.ref,e.return=t,t.child=e}function $d(e,t,i,s,n){if(e!==null){var a=e.memoizedProps;if(Mn(a,s)&&e.ref===t.ref)if(Lt=!1,t.pendingProps=s=a,mu(e,n))(e.flags&131072)!==0&&(Lt=!0);else return t.lanes=e.lanes,Ls(e,t,n)}return cu(e,t,i,s,n)}function qd(e,t,i,s){var n=s.children,a=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(a=a!==null?a.baseLanes|i:i,e!==null){for(s=t.child=e.child,n=0;s!==null;)n=n|s.lanes|s.childLanes,s=s.sibling;s=n&~a}else s=0,t.child=null;return Fd(e,t,a,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Gl(t,a!==null?a.cachePool:null),a!==null?Kh(t,a):Uc(),Gh(t);else return s=t.lanes=536870912,Fd(e,t,a!==null?a.baseLanes|i:i,i,s)}else a!==null?(Gl(t,a.cachePool),Kh(t,a),an(),t.memoizedState=null):(e!==null&&Gl(t,null),Uc(),an());return Wt(e,t,n,i),t.child}function Fa(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Fd(e,t,i,s,n){var a=Oc();return a=a===null?null:{parent:kt._currentValue,pool:a},t.memoizedState={baseLanes:i,cachePool:a},e!==null&&Gl(t,null),Uc(),Gh(t),e!==null&&Er(e,t,s,!0),t.childLanes=n,null}function co(e,t){return t=ho({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Wd(e,t,i){return $n(t,e.child,null,i),e=co(t,t.pendingProps),e.flags|=2,Ei(t),t.memoizedState=null,e}function hm(e,t,i){var s=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ge){if(s.mode==="hidden")return e=co(t,s),t.lanes=536870912,Fa(null,e);if(Pc(t),(e=ft)?(e=n_(e,Ui),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:di!==null?{id:si,overflow:Hi}:null,retryLane:536870912,hydrationErrors:null},i=be(e),i.return=t,t.child=i,qt=t,ft=null)):e=null,e===null)throw Js(t);return t.lanes=536870912,null}return co(t,s)}var a=e.memoizedState;if(a!==null){var A=a.dehydrated;if(Pc(t),n)if(t.flags&256)t.flags&=-257,t=Wd(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(b(558));else if(Lt||Er(e,t,i,!1),n=(i&e.childLanes)!==0,Lt||n){if(s=ct,s!==null&&(A=sr(s,i),A!==0&&A!==a.retryLane))throw a.retryLane=A,wi(e,A),vi(s,e,A),ou;yo(),t=Wd(e,t,i)}else e=a.treeContext,ft=Pi(A.nextSibling),qt=t,Ge=!0,Qs=null,Ui=!1,e!==null&&jn(t,e),t=co(t,s),t.flags|=4096;return t}return e=m(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function uo(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(b(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function cu(e,t,i,s,n){return zn(t),i=qc(e,t,i,s,void 0,n),s=Fc(),e!==null&&!Lt?(Wc(e,t,n),Ls(e,t,n)):(Ge&&s&&Ma(t),t.flags|=1,Wt(e,t,i,n),t.child)}function Kd(e,t,i,s,n,a){return zn(t),t.updateQueue=null,i=Yh(t,s,i,n),Vh(e),s=Fc(),e!==null&&!Lt?(Wc(e,t,a),Ls(e,t,a)):(Ge&&s&&Ma(t),t.flags|=1,Wt(e,t,i,a),t.child)}function Gd(e,t,i,s,n){if(zn(t),t.stateNode===null){var a=Zs,A=i.contextType;typeof A=="object"&&A!==null&&(a=Ft(A)),a=new i(s,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=au,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=s,a.state=t.memoizedState,a.refs={},jc(t),A=i.contextType,a.context=typeof A=="object"&&A!==null?Ft(A):Zs,a.state=t.memoizedState,A=i.getDerivedStateFromProps,typeof A=="function"&&(ru(t,i,A,s),a.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(A=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),A!==a.state&&au.enqueueReplaceState(a,a.state,null),Ua(t,s,a,n),za(),a.state=t.memoizedState),typeof a.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){a=t.stateNode;var H=t.memoizedProps,W=Fn(i,H);a.props=W;var se=a.context,ue=i.contextType;A=Zs,typeof ue=="object"&&ue!==null&&(A=Ft(ue));var fe=i.getDerivedStateFromProps;ue=typeof fe=="function"||typeof a.getSnapshotBeforeUpdate=="function",H=t.pendingProps!==H,ue||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(H||se!==A)&&Od(t,a,s,A),tn=!1;var re=t.memoizedState;a.state=re,Ua(t,s,a,n),za(),se=t.memoizedState,H||re!==se||tn?(typeof fe=="function"&&(ru(t,i,fe,s),se=t.memoizedState),(W=tn||Ld(t,i,W,s,re,se,A))?(ue||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=se),a.props=s,a.state=se,a.context=A,s=W):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{a=t.stateNode,Nc(e,t),A=t.memoizedProps,ue=Fn(i,A),a.props=ue,fe=t.pendingProps,re=a.context,se=i.contextType,W=Zs,typeof se=="object"&&se!==null&&(W=Ft(se)),H=i.getDerivedStateFromProps,(se=typeof H=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(A!==fe||re!==W)&&Od(t,a,s,W),tn=!1,re=t.memoizedState,a.state=re,Ua(t,s,a,n),za();var ce=t.memoizedState;A!==fe||re!==ce||tn||e!==null&&e.dependencies!==null&&Wl(e.dependencies)?(typeof H=="function"&&(ru(t,i,H,s),ce=t.memoizedState),(ue=tn||Ld(t,i,ue,s,re,ce,W)||e!==null&&e.dependencies!==null&&Wl(e.dependencies))?(se||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(s,ce,W),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(s,ce,W)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||A===e.memoizedProps&&re===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||A===e.memoizedProps&&re===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=ce),a.props=s,a.state=ce,a.context=W,s=ue):(typeof a.componentDidUpdate!="function"||A===e.memoizedProps&&re===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||A===e.memoizedProps&&re===e.memoizedState||(t.flags|=1024),s=!1)}return a=s,uo(e,t),s=(t.flags&128)!==0,a||s?(a=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:a.render(),t.flags|=1,e!==null&&s?(t.child=$n(t,e.child,null,n),t.child=$n(t,null,i,n)):Wt(e,t,i,n),t.memoizedState=a.state,e=t.child):e=Ls(e,t,n),e}function Vd(e,t,i,s){return Nn(),t.flags|=256,Wt(e,t,i,s),t.child}var uu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hu(e){return{baseLanes:e,cachePool:Hh()}}function du(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Ri),e}function Yd(e,t,i){var s=t.pendingProps,n=!1,a=(t.flags&128)!==0,A;if((A=a)||(A=e!==null&&e.memoizedState===null?!1:(Rt.current&2)!==0),A&&(n=!0,t.flags&=-129),A=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ge){if(n?rn(t):an(),(e=ft)?(e=n_(e,Ui),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:di!==null?{id:si,overflow:Hi}:null,retryLane:536870912,hydrationErrors:null},i=be(e),i.return=t,t.child=i,qt=t,ft=null)):e=null,e===null)throw Js(t);return Vu(e)?t.lanes=32:t.lanes=536870912,null}var H=s.children;return s=s.fallback,n?(an(),n=t.mode,H=ho({mode:"hidden",children:H},n),s=V(s,n,i,null),H.return=t,s.return=t,H.sibling=s,t.child=H,s=t.child,s.memoizedState=hu(i),s.childLanes=du(e,A,i),t.memoizedState=uu,Fa(null,s)):(rn(t),fu(t,H))}var W=e.memoizedState;if(W!==null&&(H=W.dehydrated,H!==null)){if(a)t.flags&256?(rn(t),t.flags&=-257,t=_u(e,t,i)):t.memoizedState!==null?(an(),t.child=e.child,t.flags|=128,t=null):(an(),H=s.fallback,n=t.mode,s=ho({mode:"visible",children:s.children},n),H=V(H,n,i,null),H.flags|=2,s.return=t,H.return=t,s.sibling=H,t.child=s,$n(t,e.child,null,i),s=t.child,s.memoizedState=hu(i),s.childLanes=du(e,A,i),t.memoizedState=uu,t=Fa(null,s));else if(rn(t),Vu(H)){if(A=H.nextSibling&&H.nextSibling.dataset,A)var se=A.dgst;A=se,s=Error(b(419)),s.stack="",s.digest=A,La({value:s,source:null,stack:null}),t=_u(e,t,i)}else if(Lt||Er(e,t,i,!1),A=(i&e.childLanes)!==0,Lt||A){if(A=ct,A!==null&&(s=sr(A,i),s!==0&&s!==W.retryLane))throw W.retryLane=s,wi(e,s),vi(A,e,s),ou;Gu(H)||yo(),t=_u(e,t,i)}else Gu(H)?(t.flags|=192,t.child=e.child,t=null):(e=W.treeContext,ft=Pi(H.nextSibling),qt=t,Ge=!0,Qs=null,Ui=!1,e!==null&&jn(t,e),t=fu(t,s.children),t.flags|=4096);return t}return n?(an(),H=s.fallback,n=t.mode,W=e.child,se=W.sibling,s=m(W,{mode:"hidden",children:s.children}),s.subtreeFlags=W.subtreeFlags&65011712,se!==null?H=m(se,H):(H=V(H,n,i,null),H.flags|=2),H.return=t,s.return=t,s.sibling=H,t.child=s,Fa(null,s),s=t.child,H=e.child.memoizedState,H===null?H=hu(i):(n=H.cachePool,n!==null?(W=kt._currentValue,n=n.parent!==W?{parent:W,pool:W}:n):n=Hh(),H={baseLanes:H.baseLanes|i,cachePool:n}),s.memoizedState=H,s.childLanes=du(e,A,i),t.memoizedState=uu,Fa(e.child,s)):(rn(t),i=e.child,e=i.sibling,i=m(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(A=t.deletions,A===null?(t.deletions=[e],t.flags|=16):A.push(e)),t.child=i,t.memoizedState=null,i)}function fu(e,t){return t=ho({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ho(e,t){return e=ii(22,e,null,t),e.lanes=0,e}function _u(e,t,i){return $n(t,e.child,null,i),e=fu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Xd(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Dc(e.return,t,i)}function pu(e,t,i,s,n,a){var A=e.memoizedState;A===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:n,treeForkCount:a}:(A.isBackwards=t,A.rendering=null,A.renderingStartTime=0,A.last=s,A.tail=i,A.tailMode=n,A.treeForkCount=a)}function Zd(e,t,i){var s=t.pendingProps,n=s.revealOrder,a=s.tail;s=s.children;var A=Rt.current,H=(A&2)!==0;if(H?(A=A&1|2,t.flags|=128):A&=1,Y(Rt,A),Wt(e,t,s,i),s=Ge?Zi:0,!H&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xd(e,i,t);else if(e.tag===19)Xd(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(n){case"forwards":for(i=t.child,n=null;i!==null;)e=i.alternate,e!==null&&Jl(e)===null&&(n=i),i=i.sibling;i=n,i===null?(n=t.child,t.child=null):(n=i.sibling,i.sibling=null),pu(t,!1,n,i,a,s);break;case"backwards":case"unstable_legacy-backwards":for(i=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&Jl(e)===null){t.child=n;break}e=n.sibling,n.sibling=i,i=n,n=e}pu(t,!0,i,null,a,s);break;case"together":pu(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Ls(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),cn|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Er(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(b(153));if(t.child!==null){for(e=t.child,i=m(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=m(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function mu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Wl(e)))}function dm(e,t,i){switch(t.tag){case 3:U(t,t.stateNode.containerInfo),en(t,kt,e.memoizedState.cache),Nn();break;case 27:case 5:me(t);break;case 4:U(t,t.stateNode.containerInfo);break;case 10:en(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?(rn(t),t.flags|=128,null):(i&t.child.childLanes)!==0?Yd(e,t,i):(rn(t),e=Ls(e,t,i),e!==null?e.sibling:null);rn(t);break;case 19:var n=(e.flags&128)!==0;if(s=(i&t.childLanes)!==0,s||(Er(e,t,i,!1),s=(i&t.childLanes)!==0),n){if(s)return Zd(e,t,i);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),Y(Rt,Rt.current),s)break;return null;case 22:return t.lanes=0,qd(e,t,i,t.pendingProps);case 24:en(t,kt,e.memoizedState.cache)}return Ls(e,t,i)}function Qd(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Lt=!0;else{if(!mu(e,i)&&(t.flags&128)===0)return Lt=!1,dm(e,t,i);Lt=(e.flags&131072)!==0}else Lt=!1,Ge&&(t.flags&1048576)!==0&&zi(t,Zi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=In(t.elementType),t.type=e,typeof e=="function")ka(e)?(s=Fn(e,s),t.tag=1,t=Gd(null,t,e,s,i)):(t.tag=0,t=cu(null,t,e,s,i));else{if(e!=null){var n=e.$$typeof;if(n===S){t.tag=11,t=Id(null,t,e,s,i);break e}else if(n===D){t.tag=14,t=Pd(null,t,e,s,i);break e}}throw t=te(e)||e,Error(b(306,t,""))}}return t;case 0:return cu(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,n=Fn(s,t.pendingProps),Gd(e,t,s,n,i);case 3:e:{if(U(t,t.stateNode.containerInfo),e===null)throw Error(b(387));s=t.pendingProps;var a=t.memoizedState;n=a.element,Nc(e,t),Ua(t,s,null,i);var A=t.memoizedState;if(s=A.cache,en(t,kt,s),s!==a.cache&&kc(t,[kt],i,!0),za(),s=A.element,a.isDehydrated)if(a={element:s,isDehydrated:!1,cache:A.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=Vd(e,t,s,i);break e}else if(s!==n){n=ht(Error(b(424)),t),La(n),t=Vd(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,ft=Pi(e.firstChild),qt=t,Ge=!0,Qs=null,Ui=!0,i=qh(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Nn(),s===n){t=Ls(e,t,i);break e}Wt(e,t,s,i)}t=t.child}return t;case 26:return uo(e,t),e===null?(i=u_(t.type,null,t.pendingProps,null))?t.memoizedState=i:Ge||(i=t.type,e=t.pendingProps,s=To(Se.current).createElement(i),s[gt]=t,s[Bt]=e,Kt(s,i,e),yt(s),t.stateNode=s):t.memoizedState=u_(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return me(t),e===null&&Ge&&(s=t.stateNode=l_(t.type,t.pendingProps,Se.current),qt=t,Ui=!0,n=ft,_n(t.type)?(Yu=n,ft=Pi(s.firstChild)):ft=n),Wt(e,t,t.pendingProps.children,i),uo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ge&&((n=s=ft)&&(s=$m(s,t.type,t.pendingProps,Ui),s!==null?(t.stateNode=s,qt=t,ft=Pi(s.firstChild),Ui=!1,n=!0):n=!1),n||Js(t)),me(t),n=t.type,a=t.pendingProps,A=e!==null?e.memoizedProps:null,s=a.children,Fu(n,a)?s=null:A!==null&&Fu(n,A)&&(t.flags|=32),t.memoizedState!==null&&(n=qc(e,t,sm,null,null,i),rl._currentValue=n),uo(e,t),Wt(e,t,s,i),t.child;case 6:return e===null&&Ge&&((e=i=ft)&&(i=qm(i,t.pendingProps,Ui),i!==null?(t.stateNode=i,qt=t,ft=null,e=!0):e=!1),e||Js(t)),null;case 13:return Yd(e,t,i);case 4:return U(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=$n(t,null,s,i):Wt(e,t,s,i),t.child;case 11:return Id(e,t,t.type,t.pendingProps,i);case 7:return Wt(e,t,t.pendingProps,i),t.child;case 8:return Wt(e,t,t.pendingProps.children,i),t.child;case 12:return Wt(e,t,t.pendingProps.children,i),t.child;case 10:return s=t.pendingProps,en(t,t.type,s.value),Wt(e,t,s.children,i),t.child;case 9:return n=t.type._context,s=t.pendingProps.children,zn(t),n=Ft(n),s=s(n),t.flags|=1,Wt(e,t,s,i),t.child;case 14:return Pd(e,t,t.type,t.pendingProps,i);case 15:return $d(e,t,t.type,t.pendingProps,i);case 19:return Zd(e,t,i);case 31:return hm(e,t,i);case 22:return qd(e,t,i,t.pendingProps);case 24:return zn(t),s=Ft(kt),e===null?(n=Oc(),n===null&&(n=ct,a=Mc(),n.pooledCache=a,a.refCount++,a!==null&&(n.pooledCacheLanes|=i),n=a),t.memoizedState={parent:s,cache:n},jc(t),en(t,kt,n)):((e.lanes&i)!==0&&(Nc(e,t),Ua(t,null,null,i),za()),n=e.memoizedState,a=t.memoizedState,n.parent!==s?(n={parent:s,cache:s},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),en(t,kt,s)):(s=a.cache,en(t,kt,s),s!==n.cache&&kc(t,[kt],i,!0))),Wt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(b(156,t.tag))}function Os(e){e.flags|=4}function vu(e,t,i,s,n){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(n&335544128)===n)if(e.stateNode.complete)e.flags|=8192;else if(Af())e.flags|=8192;else throw Pn=Yl,Bc}else e.flags&=-16777217}function Jd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!p_(t))if(Af())e.flags|=8192;else throw Pn=Yl,Bc}function fo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Zr():536870912,e.lanes|=t,Hr|=t)}function Wa(e,t){if(!Ge)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 _t(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var n=e.child;n!==null;)i|=n.lanes|n.childLanes,s|=n.subtreeFlags&65011712,s|=n.flags&65011712,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)i|=n.lanes|n.childLanes,s|=n.subtreeFlags,s|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function fm(e,t,i){var s=t.pendingProps;switch(Bn(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _t(t),null;case 1:return _t(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Ds(kt),oe(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(xr(t)?Os(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Rc())),_t(t),null;case 26:var n=t.type,a=t.memoizedState;return e===null?(Os(t),a!==null?(_t(t),Jd(t,a)):(_t(t),vu(t,n,null,s,i))):a?a!==e.memoizedState?(Os(t),_t(t),Jd(t,a)):(_t(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Os(t),_t(t),vu(t,n,e,s,i)),null;case 27:if(Ce(t),i=Se.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Os(t);else{if(!s){if(t.stateNode===null)throw Error(b(166));return _t(t),null}e=ne.current,xr(t)?Lh(t):(e=l_(n,s,i),t.stateNode=e,Os(t))}return _t(t),null;case 5:if(Ce(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Os(t);else{if(!s){if(t.stateNode===null)throw Error(b(166));return _t(t),null}if(a=ne.current,xr(t))Lh(t);else{var A=To(Se.current);switch(a){case 1:a=A.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:a=A.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":a=A.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":a=A.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":a=A.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof s.is=="string"?A.createElement("select",{is:s.is}):A.createElement("select"),s.multiple?a.multiple=!0:s.size&&(a.size=s.size);break;default:a=typeof s.is=="string"?A.createElement(n,{is:s.is}):A.createElement(n)}}a[gt]=t,a[Bt]=s;e:for(A=t.child;A!==null;){if(A.tag===5||A.tag===6)a.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===t)break e;for(;A.sibling===null;){if(A.return===null||A.return===t)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}t.stateNode=a;e:switch(Kt(a,n,s),n){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Os(t)}}return _t(t),vu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Os(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(b(166));if(e=Se.current,xr(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,n=qt,n!==null)switch(n.tag){case 27:case 5:s=n.memoizedProps}e[gt]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||Xf(e.nodeValue,i)),e||Js(t,!0)}else e=To(e).createTextNode(s),e[gt]=t,t.stateNode=e}return _t(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=xr(t),i!==null){if(e===null){if(!s)throw Error(b(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(b(557));e[gt]=t}else Nn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;_t(t),e=!1}else i=Rc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(Ei(t),t):(Ei(t),null);if((t.flags&128)!==0)throw Error(b(558))}return _t(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=xr(t),s!==null&&s.dehydrated!==null){if(e===null){if(!n)throw Error(b(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(b(317));n[gt]=t}else Nn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;_t(t),n=!1}else n=Rc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(Ei(t),t):(Ei(t),null)}return Ei(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,n=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(n=s.alternate.memoizedState.cachePool.pool),a=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),a!==n&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),fo(t,t.updateQueue),_t(t),null);case 4:return oe(),e===null&&Uu(t.stateNode.containerInfo),_t(t),null;case 10:return Ds(t.type),_t(t),null;case 19:if(z(Rt),s=t.memoizedState,s===null)return _t(t),null;if(n=(t.flags&128)!==0,a=s.rendering,a===null)if(n)Wa(s,!1);else{if(wt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(a=Jl(e),a!==null){for(t.flags|=128,Wa(s,!1),e=a.updateQueue,t.updateQueue=e,fo(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)N(i,e),i=i.sibling;return Y(Rt,Rt.current&1|2),Ge&&ds(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Pe()>go&&(t.flags|=128,n=!0,Wa(s,!1),t.lanes=4194304)}else{if(!n)if(e=Jl(a),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,fo(t,e),Wa(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!Ge)return _t(t),null}else 2*Pe()-s.renderingStartTime>go&&i!==536870912&&(t.flags|=128,n=!0,Wa(s,!1),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(e=s.last,e!==null?e.sibling=a:t.child=a,s.last=a)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Pe(),e.sibling=null,i=Rt.current,Y(Rt,n?i&1|2:i&1),Ge&&ds(t,s.treeForkCount),e):(_t(t),null);case 22:case 23:return Ei(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&&(_t(t),t.subtreeFlags&6&&(t.flags|=8192)):_t(t),i=t.updateQueue,i!==null&&fo(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&&z(Un),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Ds(kt),_t(t),null;case 25:return null;case 30:return null}throw Error(b(156,t.tag))}function _m(e,t){switch(Bn(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ds(kt),oe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ce(t),null;case 31:if(t.memoizedState!==null){if(Ei(t),t.alternate===null)throw Error(b(340));Nn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ei(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(b(340));Nn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return z(Rt),null;case 4:return oe(),null;case 10:return Ds(t.type),null;case 22:case 23:return Ei(t),Ic(),e!==null&&z(Un),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ds(kt),null;case 25:return null;default:return null}}function ef(e,t){switch(Bn(t),t.tag){case 3:Ds(kt),oe();break;case 26:case 27:case 5:Ce(t);break;case 4:oe();break;case 31:t.memoizedState!==null&&Ei(t);break;case 13:Ei(t);break;case 19:z(Rt);break;case 10:Ds(t.type);break;case 22:case 23:Ei(t),Ic(),e!==null&&z(Un);break;case 24:Ds(kt)}}function Ka(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var n=s.next;i=n;do{if((i.tag&e)===e){s=void 0;var a=i.create,A=i.inst;s=a(),A.destroy=s}i=i.next}while(i!==n)}}catch(H){rt(t,t.return,H)}}function ln(e,t,i){try{var s=t.updateQueue,n=s!==null?s.lastEffect:null;if(n!==null){var a=n.next;s=a;do{if((s.tag&e)===e){var A=s.inst,H=A.destroy;if(H!==void 0){A.destroy=void 0,n=t;var W=i,se=H;try{se()}catch(ue){rt(n,W,ue)}}}s=s.next}while(s!==a)}}catch(ue){rt(t,t.return,ue)}}function tf(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Wh(t,i)}catch(s){rt(e,e.return,s)}}}function sf(e,t,i){i.props=Fn(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){rt(e,t,s)}}function Ga(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(n){rt(e,t,n)}}function fs(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(n){rt(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(n){rt(e,t,n)}else i.current=null}function nf(e){var t=e.type,i=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break e;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(n){rt(e,e.return,n)}}function gu(e,t,i){try{var s=e.stateNode;Nm(s,e.type,i,t),s[Bt]=t}catch(n){rt(e,e.return,n)}}function rf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&_n(e.type)||e.tag===4}function Su(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||rf(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&&_n(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 bu(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=Gi));else if(s!==4&&(s===27&&_n(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(bu(e,t,i),e=e.sibling;e!==null;)bu(e,t,i),e=e.sibling}function _o(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&&_n(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(_o(e,t,i),e=e.sibling;e!==null;)_o(e,t,i),e=e.sibling}function af(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Kt(t,s,i),t[gt]=e,t[Bt]=i}catch(a){rt(e,e.return,a)}}var Bs=!1,Ot=!1,yu=!1,lf=typeof WeakSet=="function"?WeakSet:Set,Ut=null;function pm(e,t){if(e=e.containerInfo,$u=jo,e=Ca(e),wa(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 n=s.anchorOffset,a=s.focusNode;s=s.focusOffset;try{i.nodeType,a.nodeType}catch{i=null;break e}var A=0,H=-1,W=-1,se=0,ue=0,fe=e,re=null;t:for(;;){for(var ce;fe!==i||n!==0&&fe.nodeType!==3||(H=A+n),fe!==a||s!==0&&fe.nodeType!==3||(W=A+s),fe.nodeType===3&&(A+=fe.nodeValue.length),(ce=fe.firstChild)!==null;)re=fe,fe=ce;for(;;){if(fe===e)break t;if(re===i&&++se===n&&(H=A),re===a&&++ue===s&&(W=A),(ce=fe.nextSibling)!==null)break;fe=re,re=fe.parentNode}fe=ce}i=H===-1||W===-1?null:{start:H,end:W}}else i=null}i=i||{start:0,end:0}}else i=null;for(qu={focusedElem:e,selectionRange:i},jo=!1,Ut=t;Ut!==null;)if(t=Ut,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ut=e;else for(;Ut!==null;){switch(t=Ut,a=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++)n=e[i],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&a!==null){e=void 0,i=t,n=a.memoizedProps,a=a.memoizedState,s=i.stateNode;try{var xe=Fn(i.type,n);e=s.getSnapshotBeforeUpdate(xe,a),s.__reactInternalSnapshotBeforeUpdate=e}catch(ke){rt(i,i.return,ke)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)Ku(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ku(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(b(163))}if(e=t.sibling,e!==null){e.return=t.return,Ut=e;break}Ut=t.return}}function of(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:Ns(e,i),s&4&&Ka(5,i);break;case 1:if(Ns(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(A){rt(i,i.return,A)}else{var n=Fn(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(A){rt(i,i.return,A)}}s&64&&tf(i),s&512&&Ga(i,i.return);break;case 3:if(Ns(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{Wh(e,t)}catch(A){rt(i,i.return,A)}}break;case 27:t===null&&s&4&&af(i);case 26:case 5:Ns(e,i),t===null&&s&4&&nf(i),s&512&&Ga(i,i.return);break;case 12:Ns(e,i);break;case 31:Ns(e,i),s&4&&hf(e,i);break;case 13:Ns(e,i),s&4&&df(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=xm.bind(null,i),Fm(e,i))));break;case 22:if(s=i.memoizedState!==null||Bs,!s){t=t!==null&&t.memoizedState!==null||Ot,n=Bs;var a=Ot;Bs=s,(Ot=t)&&!a?Hs(e,i,(i.subtreeFlags&8772)!==0):Ns(e,i),Bs=n,Ot=a}break;case 30:break;default:Ns(e,i)}}function cf(e){var t=e.alternate;t!==null&&(e.alternate=null,cf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&qs(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var mt=null,fi=!1;function js(e,t,i){for(i=i.child;i!==null;)uf(e,t,i),i=i.sibling}function uf(e,t,i){if(Gt&&typeof Gt.onCommitFiberUnmount=="function")try{Gt.onCommitFiberUnmount(gs,i)}catch{}switch(i.tag){case 26:Ot||fs(i,t),js(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Ot||fs(i,t);var s=mt,n=fi;_n(i.type)&&(mt=i.stateNode,fi=!1),js(e,t,i),il(i.stateNode),mt=s,fi=n;break;case 5:Ot||fs(i,t);case 6:if(s=mt,n=fi,mt=null,js(e,t,i),mt=s,fi=n,mt!==null)if(fi)try{(mt.nodeType===9?mt.body:mt.nodeName==="HTML"?mt.ownerDocument.body:mt).removeChild(i.stateNode)}catch(a){rt(i,t,a)}else try{mt.removeChild(i.stateNode)}catch(a){rt(i,t,a)}break;case 18:mt!==null&&(fi?(e=mt,i_(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Wr(e)):i_(mt,i.stateNode));break;case 4:s=mt,n=fi,mt=i.stateNode.containerInfo,fi=!0,js(e,t,i),mt=s,fi=n;break;case 0:case 11:case 14:case 15:ln(2,i,t),Ot||ln(4,i,t),js(e,t,i);break;case 1:Ot||(fs(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&sf(i,t,s)),js(e,t,i);break;case 21:js(e,t,i);break;case 22:Ot=(s=Ot)||i.memoizedState!==null,js(e,t,i),Ot=s;break;default:js(e,t,i)}}function hf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wr(e)}catch(i){rt(t,t.return,i)}}}function df(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wr(e)}catch(i){rt(t,t.return,i)}}function mm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new lf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new lf),t;default:throw Error(b(435,e.tag))}}function po(e,t){var i=mm(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var n=Em.bind(null,e,s);s.then(n,n)}})}function _i(e,t){var i=t.deletions;if(i!==null)for(var s=0;s<i.length;s++){var n=i[s],a=e,A=t,H=A;e:for(;H!==null;){switch(H.tag){case 27:if(_n(H.type)){mt=H.stateNode,fi=!1;break e}break;case 5:mt=H.stateNode,fi=!1;break e;case 3:case 4:mt=H.stateNode.containerInfo,fi=!0;break e}H=H.return}if(mt===null)throw Error(b(160));uf(a,A,n),mt=null,fi=!1,a=n.alternate,a!==null&&(a.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ff(t,e),t=t.sibling}var Qi=null;function ff(e,t){var i=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:_i(t,e),pi(e),s&4&&(ln(3,e,e.return),Ka(3,e),ln(5,e,e.return));break;case 1:_i(t,e),pi(e),s&512&&(Ot||i===null||fs(i,i.return)),s&64&&Bs&&(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 n=Qi;if(_i(t,e),pi(e),s&512&&(Ot||i===null||fs(i,i.return)),s&4){var a=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,n=n.ownerDocument||n;t:switch(s){case"title":a=n.getElementsByTagName("title")[0],(!a||a[ss]||a[gt]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=n.createElement(s),n.head.insertBefore(a,n.querySelector("head > title"))),Kt(a,s,i),a[gt]=e,yt(a),s=a;break e;case"link":var A=f_("link","href",n).get(s+(i.href||""));if(A){for(var H=0;H<A.length;H++)if(a=A[H],a.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&a.getAttribute("rel")===(i.rel==null?null:i.rel)&&a.getAttribute("title")===(i.title==null?null:i.title)&&a.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){A.splice(H,1);break t}}a=n.createElement(s),Kt(a,s,i),n.head.appendChild(a);break;case"meta":if(A=f_("meta","content",n).get(s+(i.content||""))){for(H=0;H<A.length;H++)if(a=A[H],a.getAttribute("content")===(i.content==null?null:""+i.content)&&a.getAttribute("name")===(i.name==null?null:i.name)&&a.getAttribute("property")===(i.property==null?null:i.property)&&a.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&a.getAttribute("charset")===(i.charSet==null?null:i.charSet)){A.splice(H,1);break t}}a=n.createElement(s),Kt(a,s,i),n.head.appendChild(a);break;default:throw Error(b(468,s))}a[gt]=e,yt(a),s=a}e.stateNode=s}else __(n,e.type,e.stateNode);else e.stateNode=d_(n,s,e.memoizedProps);else a!==s?(a===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):a.count--,s===null?__(n,e.type,e.stateNode):d_(n,s,e.memoizedProps)):s===null&&e.stateNode!==null&&gu(e,e.memoizedProps,i.memoizedProps)}break;case 27:_i(t,e),pi(e),s&512&&(Ot||i===null||fs(i,i.return)),i!==null&&s&4&&gu(e,e.memoizedProps,i.memoizedProps);break;case 5:if(_i(t,e),pi(e),s&512&&(Ot||i===null||fs(i,i.return)),e.flags&32){n=e.stateNode;try{xs(n,"")}catch(xe){rt(e,e.return,xe)}}s&4&&e.stateNode!=null&&(n=e.memoizedProps,gu(e,n,i!==null?i.memoizedProps:n)),s&1024&&(yu=!0);break;case 6:if(_i(t,e),pi(e),s&4){if(e.stateNode===null)throw Error(b(162));s=e.memoizedProps,i=e.stateNode;try{i.nodeValue=s}catch(xe){rt(e,e.return,xe)}}break;case 3:if(Mo=null,n=Qi,Qi=Do(t.containerInfo),_i(t,e),Qi=n,pi(e),s&4&&i!==null&&i.memoizedState.isDehydrated)try{Wr(t.containerInfo)}catch(xe){rt(e,e.return,xe)}yu&&(yu=!1,_f(e));break;case 4:s=Qi,Qi=Do(e.stateNode.containerInfo),_i(t,e),pi(e),Qi=s;break;case 12:_i(t,e),pi(e);break;case 31:_i(t,e),pi(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,po(e,s)));break;case 13:_i(t,e),pi(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(vo=Pe()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,po(e,s)));break;case 22:n=e.memoizedState!==null;var W=i!==null&&i.memoizedState!==null,se=Bs,ue=Ot;if(Bs=se||n,Ot=ue||W,_i(t,e),Ot=ue,Bs=se,pi(e),s&8192)e:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(i===null||W||Bs||Ot||Wn(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){W=i=t;try{if(a=W.stateNode,n)A=a.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{H=W.stateNode;var fe=W.memoizedProps.style,re=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;H.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(xe){rt(W,W.return,xe)}}}else if(t.tag===6){if(i===null){W=t;try{W.stateNode.nodeValue=n?"":W.memoizedProps}catch(xe){rt(W,W.return,xe)}}}else if(t.tag===18){if(i===null){W=t;try{var ce=W.stateNode;n?s_(ce,!0):s_(W.stateNode,!1)}catch(xe){rt(W,W.return,xe)}}}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,po(e,i))));break;case 19:_i(t,e),pi(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,po(e,s)));break;case 30:break;case 21:break;default:_i(t,e),pi(e)}}function pi(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(rf(s)){i=s;break}s=s.return}if(i==null)throw Error(b(160));switch(i.tag){case 27:var n=i.stateNode,a=Su(e);_o(e,a,n);break;case 5:var A=i.stateNode;i.flags&32&&(xs(A,""),i.flags&=-33);var H=Su(e);_o(e,H,A);break;case 3:case 4:var W=i.stateNode.containerInfo,se=Su(e);bu(e,se,W);break;default:throw Error(b(161))}}catch(ue){rt(e,e.return,ue)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _f(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;_f(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ns(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)of(e,t.alternate,t),t=t.sibling}function Wn(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ln(4,t,t.return),Wn(t);break;case 1:fs(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&sf(t,t.return,i),Wn(t);break;case 27:il(t.stateNode);case 26:case 5:fs(t,t.return),Wn(t);break;case 22:t.memoizedState===null&&Wn(t);break;case 30:Wn(t);break;default:Wn(t)}e=e.sibling}}function Hs(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,n=e,a=t,A=a.flags;switch(a.tag){case 0:case 11:case 15:Hs(n,a,i),Ka(4,a);break;case 1:if(Hs(n,a,i),s=a,n=s.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(se){rt(s,s.return,se)}if(s=a,n=s.updateQueue,n!==null){var H=s.stateNode;try{var W=n.shared.hiddenCallbacks;if(W!==null)for(n.shared.hiddenCallbacks=null,n=0;n<W.length;n++)Fh(W[n],H)}catch(se){rt(s,s.return,se)}}i&&A&64&&tf(a),Ga(a,a.return);break;case 27:af(a);case 26:case 5:Hs(n,a,i),i&&s===null&&A&4&&nf(a),Ga(a,a.return);break;case 12:Hs(n,a,i);break;case 31:Hs(n,a,i),i&&A&4&&hf(n,a);break;case 13:Hs(n,a,i),i&&A&4&&df(n,a);break;case 22:a.memoizedState===null&&Hs(n,a,i),Ga(a,a.return);break;case 30:break;default:Hs(n,a,i)}t=t.sibling}}function Cu(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&&Oa(i))}function wu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Oa(e))}function Ji(e,t,i,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)pf(e,t,i,s),t=t.sibling}function pf(e,t,i,s){var n=t.flags;switch(t.tag){case 0:case 11:case 15:Ji(e,t,i,s),n&2048&&Ka(9,t);break;case 1:Ji(e,t,i,s);break;case 3:Ji(e,t,i,s),n&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Oa(e)));break;case 12:if(n&2048){Ji(e,t,i,s),e=t.stateNode;try{var a=t.memoizedProps,A=a.id,H=a.onPostCommit;typeof H=="function"&&H(A,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(W){rt(t,t.return,W)}}else Ji(e,t,i,s);break;case 31:Ji(e,t,i,s);break;case 13:Ji(e,t,i,s);break;case 23:break;case 22:a=t.stateNode,A=t.alternate,t.memoizedState!==null?a._visibility&2?Ji(e,t,i,s):Va(e,t):a._visibility&2?Ji(e,t,i,s):(a._visibility|=2,Br(e,t,i,s,(t.subtreeFlags&10256)!==0||!1)),n&2048&&Cu(A,t);break;case 24:Ji(e,t,i,s),n&2048&&wu(t.alternate,t);break;default:Ji(e,t,i,s)}}function Br(e,t,i,s,n){for(n=n&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var a=e,A=t,H=i,W=s,se=A.flags;switch(A.tag){case 0:case 11:case 15:Br(a,A,H,W,n),Ka(8,A);break;case 23:break;case 22:var ue=A.stateNode;A.memoizedState!==null?ue._visibility&2?Br(a,A,H,W,n):Va(a,A):(ue._visibility|=2,Br(a,A,H,W,n)),n&&se&2048&&Cu(A.alternate,A);break;case 24:Br(a,A,H,W,n),n&&se&2048&&wu(A.alternate,A);break;default:Br(a,A,H,W,n)}t=t.sibling}}function Va(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,n=s.flags;switch(s.tag){case 22:Va(i,s),n&2048&&Cu(s.alternate,s);break;case 24:Va(i,s),n&2048&&wu(s.alternate,s);break;default:Va(i,s)}t=t.sibling}}var Ya=8192;function jr(e,t,i){if(e.subtreeFlags&Ya)for(e=e.child;e!==null;)mf(e,t,i),e=e.sibling}function mf(e,t,i){switch(e.tag){case 26:jr(e,t,i),e.flags&Ya&&e.memoizedState!==null&&iv(i,Qi,e.memoizedState,e.memoizedProps);break;case 5:jr(e,t,i);break;case 3:case 4:var s=Qi;Qi=Do(e.stateNode.containerInfo),jr(e,t,i),Qi=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Ya,Ya=16777216,jr(e,t,i),Ya=s):jr(e,t,i));break;default:jr(e,t,i)}}function vf(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 Xa(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];Ut=s,Sf(s,e)}vf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)gf(e),e=e.sibling}function gf(e){switch(e.tag){case 0:case 11:case 15:Xa(e),e.flags&2048&&ln(9,e,e.return);break;case 3:Xa(e);break;case 12:Xa(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,mo(e)):Xa(e);break;default:Xa(e)}}function mo(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];Ut=s,Sf(s,e)}vf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ln(8,t,t.return),mo(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,mo(t));break;default:mo(t)}e=e.sibling}}function Sf(e,t){for(;Ut!==null;){var i=Ut;switch(i.tag){case 0:case 11:case 15:ln(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:Oa(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,Ut=s;else e:for(i=e;Ut!==null;){s=Ut;var n=s.sibling,a=s.return;if(cf(s),s===i){Ut=null;break e}if(n!==null){n.return=a,Ut=n;break e}Ut=a}}}var vm={getCacheForType:function(e){var t=Ft(kt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Ft(kt).controller.signal}},gm=typeof WeakMap=="function"?WeakMap:Map,et=0,ct=null,$e=null,Fe=0,nt=0,Ai=null,on=!1,Nr=!1,xu=!1,zs=0,wt=0,cn=0,Kn=0,Eu=0,Ri=0,Hr=0,Za=null,mi=null,Au=!1,vo=0,bf=0,go=1/0,So=null,un=null,Nt=0,hn=null,zr=null,Us=0,Ru=0,Tu=null,yf=null,Qa=0,Du=null;function Ti(){return(et&2)!==0&&Fe!==0?Fe&-Fe:G.T!==null?ju():ys()}function Cf(){if(Ri===0)if((Fe&536870912)===0||Ge){var e=Dt;Dt<<=1,(Dt&3932160)===0&&(Dt=262144),Ri=e}else Ri=536870912;return e=xi.current,e!==null&&(e.flags|=32),Ri}function vi(e,t,i){(e===ct&&(nt===2||nt===9)||e.cancelPendingCommit!==null)&&(Ur(e,0),dn(e,Fe,Ri,!1)),Mi(e,i),((et&2)===0||e!==ct)&&(e===ct&&((et&2)===0&&(Kn|=i),wt===4&&dn(e,Fe,Ri,!1)),_s(e))}function wf(e,t,i){if((et&6)!==0)throw Error(b(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Ps(e,t),n=s?ym(e,t):Mu(e,t,!0),a=s;do{if(n===0){Nr&&!s&&dn(e,t,0,!1);break}else{if(i=e.current.alternate,a&&!Sm(i)){n=Mu(e,t,!1),a=!1;continue}if(n===2){if(a=t,e.errorRecoveryDisabledLanes&a)var A=0;else A=e.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){t=A;e:{var H=e;n=Za;var W=H.current.memoizedState.isDehydrated;if(W&&(Ur(H,A).flags|=256),A=Mu(H,A,!1),A!==2){if(xu&&!W){H.errorRecoveryDisabledLanes|=a,Kn|=a,n=4;break e}a=mi,mi=n,a!==null&&(mi===null?mi=a:mi.push.apply(mi,a))}n=A}if(a=!1,n!==2)continue}}if(n===1){Ur(e,0),dn(e,t,0,!0);break}e:{switch(s=e,a=n,a){case 0:case 1:throw Error(b(345));case 4:if((t&4194048)!==t)break;case 6:dn(s,t,Ri,!on);break e;case 2:mi=null;break;case 3:case 5:break;default:throw Error(b(329))}if((t&62914560)===t&&(n=vo+300-Pe(),10<n)){if(dn(s,t,Ri,!on),ir(s,0,!0)!==0)break e;Us=t,s.timeoutHandle=e_(xf.bind(null,s,i,mi,So,Au,t,Ri,Kn,Hr,on,a,"Throttled",-0,0),n);break e}xf(s,i,mi,So,Au,t,Ri,Kn,Hr,on,a,null,-0,0)}}break}while(!0);_s(e)}function xf(e,t,i,s,n,a,A,H,W,se,ue,fe,re,ce){if(e.timeoutHandle=-1,fe=t.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Gi},mf(t,a,fe);var xe=(a&62914560)===a?vo-Pe():(a&4194048)===a?bf-Pe():0;if(xe=sv(fe,xe),xe!==null){Us=a,e.cancelPendingCommit=xe(Lf.bind(null,e,t,a,i,s,n,A,H,W,ue,fe,null,re,ce)),dn(e,a,A,!se);return}}Lf(e,t,a,i,s,n,A,H,W)}function Sm(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 n=i[s],a=n.getSnapshot;n=n.value;try{if(!ti(a(),n))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 dn(e,t,i,s){t&=~Eu,t&=~Kn,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var n=t;0<n;){var a=31-Vt(n),A=1<<a;s[a]=-1,n&=~A}i!==0&&Qr(e,i,t)}function bo(){return(et&6)===0?(Ja(0),!1):!0}function ku(){if($e!==null){if(nt===0)var e=$e.return;else e=$e,Ts=Hn=null,Kc(e),Dr=null,ja=0,e=$e;for(;e!==null;)ef(e.alternate,e),e=e.return;$e=null}}function Ur(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,Um(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Us=0,ku(),ct=e,$e=i=m(e.current,null),Fe=t,nt=0,Ai=null,on=!1,Nr=Ps(e,t),xu=!1,Hr=Ri=Eu=Kn=cn=wt=0,mi=Za=null,Au=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var n=31-Vt(s),a=1<<n;t|=e[n],s&=~a}return zs=t,yr(),i}function Ef(e,t){Ne=null,G.H=qa,t===Tr||t===Vl?(t=Ih(),nt=3):t===Bc?(t=Ih(),nt=4):nt=t===ou?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ai=t,$e===null&&(wt=1,oo(e,ht(t,e.current)))}function Af(){var e=xi.current;return e===null?!0:(Fe&4194048)===Fe?Ii===null:(Fe&62914560)===Fe||(Fe&536870912)!==0?e===Ii:!1}function Rf(){var e=G.H;return G.H=qa,e===null?qa:e}function Tf(){var e=G.A;return G.A=vm,e}function yo(){wt=4,on||(Fe&4194048)!==Fe&&xi.current!==null||(Nr=!0),(cn&134217727)===0&&(Kn&134217727)===0||ct===null||dn(ct,Fe,Ri,!1)}function Mu(e,t,i){var s=et;et|=2;var n=Rf(),a=Tf();(ct!==e||Fe!==t)&&(So=null,Ur(e,t)),t=!1;var A=wt;e:do try{if(nt!==0&&$e!==null){var H=$e,W=Ai;switch(nt){case 8:ku(),A=6;break e;case 3:case 2:case 9:case 6:xi.current===null&&(t=!0);var se=nt;if(nt=0,Ai=null,Ir(e,H,W,se),i&&Nr){A=0;break e}break;default:se=nt,nt=0,Ai=null,Ir(e,H,W,se)}}bm(),A=wt;break}catch(ue){Ef(e,ue)}while(!0);return t&&e.shellSuspendCounter++,Ts=Hn=null,et=s,G.H=n,G.A=a,$e===null&&(ct=null,Fe=0,yr()),A}function bm(){for(;$e!==null;)Df($e)}function ym(e,t){var i=et;et|=2;var s=Rf(),n=Tf();ct!==e||Fe!==t?(So=null,go=Pe()+500,Ur(e,t)):Nr=Ps(e,t);e:do try{if(nt!==0&&$e!==null){t=$e;var a=Ai;t:switch(nt){case 1:nt=0,Ai=null,Ir(e,t,a,1);break;case 2:case 9:if(zh(a)){nt=0,Ai=null,kf(t);break}t=function(){nt!==2&&nt!==9||ct!==e||(nt=7),_s(e)},a.then(t,t);break e;case 3:nt=7;break e;case 4:nt=5;break e;case 7:zh(a)?(nt=0,Ai=null,kf(t)):(nt=0,Ai=null,Ir(e,t,a,7));break;case 5:var A=null;switch($e.tag){case 26:A=$e.memoizedState;case 5:case 27:var H=$e;if(A?p_(A):H.stateNode.complete){nt=0,Ai=null;var W=H.sibling;if(W!==null)$e=W;else{var se=H.return;se!==null?($e=se,Co(se)):$e=null}break t}}nt=0,Ai=null,Ir(e,t,a,5);break;case 6:nt=0,Ai=null,Ir(e,t,a,6);break;case 8:ku(),wt=6;break e;default:throw Error(b(462))}}Cm();break}catch(ue){Ef(e,ue)}while(!0);return Ts=Hn=null,G.H=s,G.A=n,et=i,$e!==null?0:(ct=null,Fe=0,yr(),wt)}function Cm(){for(;$e!==null&&!ze();)Df($e)}function Df(e){var t=Qd(e.alternate,e,zs);e.memoizedProps=e.pendingProps,t===null?Co(e):$e=t}function kf(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Kd(i,t,t.pendingProps,t.type,void 0,Fe);break;case 11:t=Kd(i,t,t.pendingProps,t.type.render,t.ref,Fe);break;case 5:Kc(t);default:ef(i,t),t=$e=N(t,zs),t=Qd(i,t,zs)}e.memoizedProps=e.pendingProps,t===null?Co(e):$e=t}function Ir(e,t,i,s){Ts=Hn=null,Kc(t),Dr=null,ja=0;var n=t.return;try{if(um(e,n,t,i,Fe)){wt=1,oo(e,ht(i,e.current)),$e=null;return}}catch(a){if(n!==null)throw $e=n,a;wt=1,oo(e,ht(i,e.current)),$e=null;return}t.flags&32768?(Ge||s===1?e=!0:Nr||(Fe&536870912)!==0?e=!1:(on=e=!0,(s===2||s===9||s===3||s===6)&&(s=xi.current,s!==null&&s.tag===13&&(s.flags|=16384))),Mf(t,e)):Co(t)}function Co(e){var t=e;do{if((t.flags&32768)!==0){Mf(t,on);return}e=t.return;var i=fm(t.alternate,t,zs);if(i!==null){$e=i;return}if(t=t.sibling,t!==null){$e=t;return}$e=t=e}while(t!==null);wt===0&&(wt=5)}function Mf(e,t){do{var i=_m(e.alternate,e);if(i!==null){i.flags&=32767,$e=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){$e=e;return}$e=e=i}while(e!==null);wt=6,$e=null}function Lf(e,t,i,s,n,a,A,H,W){e.cancelPendingCommit=null;do wo();while(Nt!==0);if((et&6)!==0)throw Error(b(327));if(t!==null){if(t===e.current)throw Error(b(177));if(a=t.lanes|t.childLanes,a|=Ra,ts(e,i,a,A,H,W),e===ct&&($e=ct=null,Fe=0),zr=t,hn=e,Us=i,Ru=a,Tu=n,yf=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Am(bt,function(){return Hf(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=G.T,G.T=null,n=ae.p,ae.p=2,A=et,et|=4;try{pm(e,t,i)}finally{et=A,ae.p=n,G.T=s}}Nt=1,Of(),Bf(),jf()}}function Of(){if(Nt===1){Nt=0;var e=hn,t=zr,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=G.T,G.T=null;var s=ae.p;ae.p=2;var n=et;et|=4;try{ff(t,e);var a=qu,A=Ca(e.containerInfo),H=a.focusedElem,W=a.selectionRange;if(A!==H&&H&&H.ownerDocument&&ya(H.ownerDocument.documentElement,H)){if(W!==null&&wa(H)){var se=W.start,ue=W.end;if(ue===void 0&&(ue=se),"selectionStart"in H)H.selectionStart=se,H.selectionEnd=Math.min(ue,H.value.length);else{var fe=H.ownerDocument||document,re=fe&&fe.defaultView||window;if(re.getSelection){var ce=re.getSelection(),xe=H.textContent.length,ke=Math.min(W.start,xe),ot=W.end===void 0?ke:Math.min(W.end,xe);!ce.extend&&ke>ot&&(A=ot,ot=ke,ke=A);var ee=gr(H,ke),X=gr(H,ot);if(ee&&X&&(ce.rangeCount!==1||ce.anchorNode!==ee.node||ce.anchorOffset!==ee.offset||ce.focusNode!==X.node||ce.focusOffset!==X.offset)){var ie=fe.createRange();ie.setStart(ee.node,ee.offset),ce.removeAllRanges(),ke>ot?(ce.addRange(ie),ce.extend(X.node,X.offset)):(ie.setEnd(X.node,X.offset),ce.addRange(ie))}}}}for(fe=[],ce=H;ce=ce.parentNode;)ce.nodeType===1&&fe.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof H.focus=="function"&&H.focus(),H=0;H<fe.length;H++){var de=fe[H];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}jo=!!$u,qu=$u=null}finally{et=n,ae.p=s,G.T=i}}e.current=t,Nt=2}}function Bf(){if(Nt===2){Nt=0;var e=hn,t=zr,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=G.T,G.T=null;var s=ae.p;ae.p=2;var n=et;et|=4;try{of(e,t.alternate,t)}finally{et=n,ae.p=s,G.T=i}}Nt=3}}function jf(){if(Nt===4||Nt===3){Nt=0,Ie();var e=hn,t=zr,i=Us,s=yf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Nt=5:(Nt=0,zr=hn=null,Nf(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(un=null),bs(i),t=t.stateNode,Gt&&typeof Gt.onCommitFiberRoot=="function")try{Gt.onCommitFiberRoot(gs,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=G.T,n=ae.p,ae.p=2,G.T=null;try{for(var a=e.onRecoverableError,A=0;A<s.length;A++){var H=s[A];a(H.value,{componentStack:H.stack})}}finally{G.T=t,ae.p=n}}(Us&3)!==0&&wo(),_s(e),n=e.pendingLanes,(i&261930)!==0&&(n&42)!==0?e===Du?Qa++:(Qa=0,Du=e):Qa=0,Ja(0)}}function Nf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Oa(t)))}function wo(){return Of(),Bf(),jf(),Hf()}function Hf(){if(Nt!==5)return!1;var e=hn,t=Ru;Ru=0;var i=bs(Us),s=G.T,n=ae.p;try{ae.p=32>i?32:i,G.T=null,i=Tu,Tu=null;var a=hn,A=Us;if(Nt=0,zr=hn=null,Us=0,(et&6)!==0)throw Error(b(331));var H=et;if(et|=4,gf(a.current),pf(a,a.current,A,i),et=H,Ja(0,!1),Gt&&typeof Gt.onPostCommitFiberRoot=="function")try{Gt.onPostCommitFiberRoot(gs,a)}catch{}return!0}finally{ae.p=n,G.T=s,Nf(e,t)}}function zf(e,t,i){t=ht(i,t),t=lu(e.stateNode,t,2),e=nn(e,t,2),e!==null&&(Mi(e,2),_s(e))}function rt(e,t,i){if(e.tag===3)zf(e,e,i);else for(;t!==null;){if(t.tag===3){zf(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(un===null||!un.has(s))){e=ht(i,e),i=zd(2),s=nn(t,i,2),s!==null&&(Ud(i,s,t,e),Mi(s,2),_s(s));break}}t=t.return}}function Lu(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new gm;var n=new Set;s.set(t,n)}else n=s.get(t),n===void 0&&(n=new Set,s.set(t,n));n.has(i)||(xu=!0,n.add(i),e=wm.bind(null,e,t,i),t.then(e,e))}function wm(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,ct===e&&(Fe&i)===i&&(wt===4||wt===3&&(Fe&62914560)===Fe&&300>Pe()-vo?(et&2)===0&&Ur(e,0):Eu|=i,Hr===Fe&&(Hr=0)),_s(e)}function Uf(e,t){t===0&&(t=Zr()),e=wi(e,t),e!==null&&(Mi(e,t),_s(e))}function xm(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Uf(e,i)}function Em(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,n=e.memoizedState;n!==null&&(i=n.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(b(314))}s!==null&&s.delete(t),Uf(e,i)}function Am(e,t){return ve(e,t)}var xo=null,Pr=null,Ou=!1,Eo=!1,Bu=!1,fn=0;function _s(e){e!==Pr&&e.next===null&&(Pr===null?xo=Pr=e:Pr=Pr.next=e),Eo=!0,Ou||(Ou=!0,Tm())}function Ja(e,t){if(!Bu&&Eo){Bu=!0;do for(var i=!1,s=xo;s!==null;){if(e!==0){var n=s.pendingLanes;if(n===0)var a=0;else{var A=s.suspendedLanes,H=s.pingedLanes;a=(1<<31-Vt(42|e)+1)-1,a&=n&~(A&~H),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(i=!0,qf(s,a))}else a=Fe,a=ir(s,s===ct?a:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(a&3)===0||Ps(s,a)||(i=!0,qf(s,a));s=s.next}while(i);Bu=!1}}function Rm(){If()}function If(){Eo=Ou=!1;var e=0;fn!==0&&zm()&&(e=fn);for(var t=Pe(),i=null,s=xo;s!==null;){var n=s.next,a=Pf(s,t);a===0?(s.next=null,i===null?xo=n:i.next=n,n===null&&(Pr=i)):(i=s,(e!==0||(a&3)!==0)&&(Eo=!0)),s=n}Nt!==0&&Nt!==5||Ja(e),fn!==0&&(fn=0)}function Pf(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,n=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var A=31-Vt(a),H=1<<A,W=n[A];W===-1?((H&i)===0||(H&s)!==0)&&(n[A]=sc(H,t)):W<=t&&(e.expiredLanes|=H),a&=~H}if(t=ct,i=Fe,i=ir(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(nt===2||nt===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&we(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Ps(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&we(s),bs(i)){case 2:case 8:i=ut;break;case 32:i=bt;break;case 268435456:i=xt;break;default:i=bt}return s=$f.bind(null,e),i=ve(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&we(s),e.callbackPriority=2,e.callbackNode=null,2}function $f(e,t){if(Nt!==0&&Nt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(wo()&&e.callbackNode!==i)return null;var s=Fe;return s=ir(e,e===ct?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(wf(e,s,t),Pf(e,Pe()),e.callbackNode!=null&&e.callbackNode===i?$f.bind(null,e):null)}function qf(e,t){if(wo())return null;wf(e,t,!0)}function Tm(){Im(function(){(et&6)!==0?ve(Ye,Rm):If()})}function ju(){if(fn===0){var e=Ar;e===0&&(e=tt,tt<<=1,(tt&261888)===0&&(tt=256)),fn=e}return fn}function Ff(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Xt(""+e)}function Wf(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function Dm(e,t,i,s,n){if(t==="submit"&&i&&i.stateNode===n){var a=Ff((n[Bt]||null).action),A=s.submitter;A&&(t=(t=A[Bt]||null)?Ff(t.formAction):A.getAttribute("formAction"),t!==null&&(a=t,A=null));var H=new Bi("action","action",null,s,n);e.push({event:H,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(fn!==0){var W=A?Wf(n,A):new FormData(n);tu(i,{pending:!0,data:W,method:n.method,action:a},null,W)}}else typeof a=="function"&&(H.preventDefault(),W=A?Wf(n,A):new FormData(n),tu(i,{pending:!0,data:W,method:n.method,action:a},a,W))},currentTarget:n}]})}}for(var Nu=0;Nu<br.length;Nu++){var Hu=br[Nu],km=Hu.toLowerCase(),Mm=Hu[0].toUpperCase()+Hu.slice(1);ui(km,"on"+Mm)}ui(Ul,"onAnimationEnd"),ui(Ea,"onAnimationIteration"),ui(Aa,"onAnimationStart"),ui("dblclick","onDoubleClick"),ui("focusin","onFocus"),ui("focusout","onBlur"),ui(Il,"onTransitionRun"),ui(Sr,"onTransitionStart"),ui(Pl,"onTransitionCancel"),ui($l,"onTransitionEnd"),Ki("onMouseEnter",["mouseout","mouseover"]),Ki("onMouseLeave",["mouseout","mouseover"]),Ki("onPointerEnter",["pointerout","pointerover"]),Ki("onPointerLeave",["pointerout","pointerover"]),ns("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ns("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ns("onBeforeInput",["compositionend","keypress","textInput","paste"]),ns("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ns("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ns("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var el="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(" "),Lm=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(el));function Kf(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],n=s.event;s=s.listeners;e:{var a=void 0;if(t)for(var A=s.length-1;0<=A;A--){var H=s[A],W=H.instance,se=H.currentTarget;if(H=H.listener,W!==a&&n.isPropagationStopped())break e;a=H,n.currentTarget=se;try{a(n)}catch(ue){On(ue)}n.currentTarget=null,a=W}else for(A=0;A<s.length;A++){if(H=s[A],W=H.instance,se=H.currentTarget,H=H.listener,W!==a&&n.isPropagationStopped())break e;a=H,n.currentTarget=se;try{a(n)}catch(ue){On(ue)}n.currentTarget=null,a=W}}}}function qe(e,t){var i=t[$s];i===void 0&&(i=t[$s]=new Set);var s=e+"__bubble";i.has(s)||(Gf(t,e,2,!1),i.add(s))}function zu(e,t,i){var s=0;t&&(s|=4),Gf(i,e,s,t)}var Ao="_reactListening"+Math.random().toString(36).slice(2);function Uu(e){if(!e[Ao]){e[Ao]=!0,pl.forEach(function(i){i!=="selectionchange"&&(Lm.has(i)||zu(i,!1,e),zu(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ao]||(t[Ao]=!0,zu("selectionchange",!1,t))}}function Gf(e,t,i,s){switch(C_(t)){case 2:var n=av;break;case 8:n=lv;break;default:n=eh}i=n.bind(null,t,i,e),n=void 0,!ua||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),s?n!==void 0?e.addEventListener(t,i,{capture:!0,passive:n}):e.addEventListener(t,i,!0):n!==void 0?e.addEventListener(t,i,{passive:n}):e.addEventListener(t,i,!1)}function Iu(e,t,i,s,n){var a=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var A=s.tag;if(A===3||A===4){var H=s.stateNode.containerInfo;if(H===n)break;if(A===4)for(A=s.return;A!==null;){var W=A.tag;if((W===3||W===4)&&A.stateNode.containerInfo===n)return;A=A.return}for(;H!==null;){if(A=Cs(H),A===null)return;if(W=A.tag,W===5||W===6||W===26||W===27){s=a=A;continue e}H=H.parentNode}}s=s.return}Cl(function(){var se=a,ue=oa(i),fe=[];e:{var re=ql.get(e);if(re!==void 0){var ce=Bi,xe=e;switch(e){case"keypress":if(Xe(i)===0)break e;case"keydown":case"keyup":ce=fc;break;case"focusin":xe="focus",ce=Vi;break;case"focusout":xe="blur",ce=Vi;break;case"beforeblur":case"afterblur":ce=Vi;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":ce=da;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=xl;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=mc;break;case Ul:case Ea:case Aa:ce=Pt;break;case $l:ce=_r;break;case"scroll":case"scrollend":ce=wl;break;case"wheel":ce=gc;break;case"copy":case"cut":case"paste":ce=oc;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=fr;break;case"toggle":case"beforetoggle":ce=Sc}var ke=(t&4)!==0,ot=!ke&&(e==="scroll"||e==="scrollend"),ee=ke?re!==null?re+"Capture":null:re;ke=[];for(var X=se,ie;X!==null;){var de=X;if(ie=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||ie===null||ee===null||(de=Zt(X,ee),de!=null&&ke.push(tl(X,de,ie))),ot)break;X=X.return}0<ke.length&&(re=new ce(re,xe,null,i,ue),fe.push({event:re,listeners:ke}))}}if((t&7)===0){e:{if(re=e==="mouseover"||e==="pointerover",ce=e==="mouseout"||e==="pointerout",re&&i!==la&&(xe=i.relatedTarget||i.fromElement)&&(Cs(xe)||xe[ei]))break e;if((ce||re)&&(re=ue.window===ue?ue:(re=ue.ownerDocument)?re.defaultView||re.parentWindow:window,ce?(xe=i.relatedTarget||i.toElement,ce=se,xe=xe?Cs(xe):null,xe!==null&&(ot=I(xe),ke=xe.tag,xe!==ot||ke!==5&&ke!==27&&ke!==6)&&(xe=null)):(ce=null,xe=se),ce!==xe)){if(ke=da,de="onMouseLeave",ee="onMouseEnter",X="mouse",(e==="pointerout"||e==="pointerover")&&(ke=fr,de="onPointerLeave",ee="onPointerEnter",X="pointer"),ot=ce==null?re:Fs(ce),ie=xe==null?re:Fs(xe),re=new ke(de,X+"leave",ce,i,ue),re.target=ot,re.relatedTarget=ie,de=null,Cs(ue)===se&&(ke=new ke(ee,X+"enter",xe,i,ue),ke.target=ie,ke.relatedTarget=ot,de=ke),ot=de,ce&&xe)t:{for(ke=Om,ee=ce,X=xe,ie=0,de=ee;de;de=ke(de))ie++;de=0;for(var Te=X;Te;Te=ke(Te))de++;for(;0<ie-de;)ee=ke(ee),ie--;for(;0<de-ie;)X=ke(X),de--;for(;ie--;){if(ee===X||X!==null&&ee===X.alternate){ke=ee;break t}ee=ke(ee),X=ke(X)}ke=null}else ke=null;ce!==null&&Vf(fe,re,ce,ke,!1),xe!==null&&ot!==null&&Vf(fe,ot,xe,ke,!0)}}e:{if(re=se?Fs(se):window,ce=re.nodeName&&re.nodeName.toLowerCase(),ce==="select"||ce==="input"&&re.type==="file")var Qe=Bl;else if(Ll(re))if(mr)Qe=Ec;else{Qe=wc;var Ae=Cc}else ce=re.nodeName,!ce||ce.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?se&&cr(se.elementType)&&(Qe=Bl):Qe=xc;if(Qe&&(Qe=Qe(e,se))){Ol(fe,Qe,i,ue);break e}Ae&&Ae(e,re,se),e==="focusout"&&se&&re.type==="number"&&se.memoizedProps.value!=null&&na(re,"number",re.value)}switch(Ae=se?Fs(se):window,e){case"focusin":(Ll(Ae)||Ae.contentEditable==="true")&&(Ci=Ae,Ys=se,Ln=null);break;case"focusout":Ln=Ys=Ci=null;break;case"mousedown":xa=!0;break;case"contextmenu":case"mouseup":case"dragend":xa=!1,zl(fe,i,ue);break;case"selectionchange":if(Hl)break;case"keydown":case"keyup":zl(fe,i,ue)}var He;if(pa)e:{switch(e){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else os?Dl(e,i)&&(We="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(We="onCompositionStart");We&&(pr&&i.locale!=="ko"&&(os||We!=="onCompositionStart"?We==="onCompositionEnd"&&os&&(He=ha()):(Ht=ue,St="value"in Ht?Ht.value:Ht.textContent,os=!0)),Ae=Ro(se,We),0<Ae.length&&(We=new ls(We,e,null,i,ue),fe.push({event:We,listeners:Ae}),He?We.data=He:(He=va(i),He!==null&&(We.data=He)))),(He=Rl?yc(e,i):kl(e,i))&&(We=Ro(se,"onBeforeInput"),0<We.length&&(Ae=new ls("onBeforeInput","beforeinput",null,i,ue),fe.push({event:Ae,listeners:We}),Ae.data=He)),Dm(fe,e,se,i,ue)}Kf(fe,t)})}function tl(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Ro(e,t){for(var i=t+"Capture",s=[];e!==null;){var n=e,a=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||a===null||(n=Zt(e,i),n!=null&&s.unshift(tl(e,n,a)),n=Zt(e,t),n!=null&&s.push(tl(e,n,a))),e.tag===3)return s;e=e.return}return[]}function Om(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Vf(e,t,i,s,n){for(var a=t._reactName,A=[];i!==null&&i!==s;){var H=i,W=H.alternate,se=H.stateNode;if(H=H.tag,W!==null&&W===s)break;H!==5&&H!==26&&H!==27||se===null||(W=se,n?(se=Zt(i,a),se!=null&&A.unshift(tl(i,se,W))):n||(se=Zt(i,a),se!=null&&A.push(tl(i,se,W)))),i=i.return}A.length!==0&&e.push({event:t,listeners:A})}var Bm=/\r\n?/g,jm=/\u0000|\uFFFD/g;function Yf(e){return(typeof e=="string"?e:""+e).replace(Bm,`
|
|
9
|
+
`).replace(jm,"")}function Xf(e,t){return t=Yf(t),Yf(e)===t}function lt(e,t,i,s,n,a){switch(i){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||xs(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&xs(e,""+s);break;case"className":wn(e,"class",s);break;case"tabIndex":wn(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":wn(e,i,s);break;case"style":aa(e,s,a);break;case"data":if(t!=="object"){wn(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=Xt(""+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 a=="function"&&(i==="formAction"?(t!=="input"&<(e,t,"name",n.name,n,null),lt(e,t,"formEncType",n.formEncType,n,null),lt(e,t,"formMethod",n.formMethod,n,null),lt(e,t,"formTarget",n.formTarget,n,null)):(lt(e,t,"encType",n.encType,n,null),lt(e,t,"method",n.method,n,null),lt(e,t,"target",n.target,n,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=Xt(""+s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=Gi);break;case"onScroll":s!=null&&qe("scroll",e);break;case"onScrollEnd":s!=null&&qe("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(b(61));if(i=s.__html,i!=null){if(n.children!=null)throw Error(b(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=Xt(""+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":qe("beforetoggle",e),qe("toggle",e),ia(e,"popover",s);break;case"xlinkActuate":yi(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":yi(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":yi(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":yi(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":yi(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":yi(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":yi(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":yi(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":yi(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":ia(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=Sl.get(i)||i,ia(e,i,s))}}function Pu(e,t,i,s,n,a){switch(i){case"style":aa(e,s,a);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(b(61));if(i=s.__html,i!=null){if(n.children!=null)throw Error(b(60));e.innerHTML=i}}break;case"children":typeof s=="string"?xs(e,s):(typeof s=="number"||typeof s=="bigint")&&xs(e,""+s);break;case"onScroll":s!=null&&qe("scroll",e);break;case"onScrollEnd":s!=null&&qe("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Gi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!rr.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(n=i.endsWith("Capture"),t=i.slice(2,n?i.length-7:void 0),a=e[Bt]||null,a=a!=null?a[i]:null,typeof a=="function"&&e.removeEventListener(t,a,n),typeof s=="function")){typeof a!="function"&&a!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,s,n);break e}i in e?e[i]=s:s===!0?e.setAttribute(i,""):ia(e,i,s)}}}function Kt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":qe("error",e),qe("load",e);var s=!1,n=!1,a;for(a in i)if(i.hasOwnProperty(a)){var A=i[a];if(A!=null)switch(a){case"src":s=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(b(137,t));default:lt(e,t,a,A,i,null)}}n&<(e,t,"srcSet",i.srcSet,i,null),s&<(e,t,"src",i.src,i,null);return;case"input":qe("invalid",e);var H=a=A=n=null,W=null,se=null;for(s in i)if(i.hasOwnProperty(s)){var ue=i[s];if(ue!=null)switch(s){case"name":n=ue;break;case"type":A=ue;break;case"checked":W=ue;break;case"defaultChecked":se=ue;break;case"value":a=ue;break;case"defaultValue":H=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(b(137,t));break;default:lt(e,t,s,ue,i,null)}}En(e,a,H,W,se,A,n,!1);return;case"select":qe("invalid",e),s=A=a=null;for(n in i)if(i.hasOwnProperty(n)&&(H=i[n],H!=null))switch(n){case"value":a=H;break;case"defaultValue":A=H;break;case"multiple":s=H;default:lt(e,t,n,H,i,null)}t=a,i=A,e.multiple=!!s,t!=null?rs(e,!!s,t,!1):i!=null&&rs(e,!!s,i,!0);return;case"textarea":qe("invalid",e),a=n=s=null;for(A in i)if(i.hasOwnProperty(A)&&(H=i[A],H!=null))switch(A){case"value":s=H;break;case"defaultValue":n=H;break;case"children":a=H;break;case"dangerouslySetInnerHTML":if(H!=null)throw Error(b(91));break;default:lt(e,t,A,H,i,null)}vl(e,s,n,a);return;case"option":for(W in i)i.hasOwnProperty(W)&&(s=i[W],s!=null)&&(W==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":lt(e,t,W,s,i,null));return;case"dialog":qe("beforetoggle",e),qe("toggle",e),qe("cancel",e),qe("close",e);break;case"iframe":case"object":qe("load",e);break;case"video":case"audio":for(s=0;s<el.length;s++)qe(el[s],e);break;case"image":qe("error",e),qe("load",e);break;case"details":qe("toggle",e);break;case"embed":case"source":case"link":qe("error",e),qe("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(se in i)if(i.hasOwnProperty(se)&&(s=i[se],s!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(b(137,t));default:lt(e,t,se,s,i,null)}return;default:if(cr(t)){for(ue in i)i.hasOwnProperty(ue)&&(s=i[ue],s!==void 0&&Pu(e,t,ue,s,i,void 0));return}}for(H in i)i.hasOwnProperty(H)&&(s=i[H],s!=null&<(e,t,H,s,i,null))}function Nm(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 n=null,a=null,A=null,H=null,W=null,se=null,ue=null;for(ce in i){var fe=i[ce];if(i.hasOwnProperty(ce)&&fe!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":W=fe;default:s.hasOwnProperty(ce)||lt(e,t,ce,null,s,fe)}}for(var re in s){var ce=s[re];if(fe=i[re],s.hasOwnProperty(re)&&(ce!=null||fe!=null))switch(re){case"type":a=ce;break;case"name":n=ce;break;case"checked":se=ce;break;case"defaultChecked":ue=ce;break;case"value":A=ce;break;case"defaultValue":H=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(b(137,t));break;default:ce!==fe&<(e,t,re,ce,s,fe)}}sa(e,A,H,W,se,ue,a,n);return;case"select":ce=A=H=re=null;for(a in i)if(W=i[a],i.hasOwnProperty(a)&&W!=null)switch(a){case"value":break;case"multiple":ce=W;default:s.hasOwnProperty(a)||lt(e,t,a,null,s,W)}for(n in s)if(a=s[n],W=i[n],s.hasOwnProperty(n)&&(a!=null||W!=null))switch(n){case"value":re=a;break;case"defaultValue":H=a;break;case"multiple":A=a;default:a!==W&<(e,t,n,a,s,W)}t=H,i=A,s=ce,re!=null?rs(e,!!i,re,!1):!!s!=!!i&&(t!=null?rs(e,!!i,t,!0):rs(e,!!i,i?[]:"",!1));return;case"textarea":ce=re=null;for(H in i)if(n=i[H],i.hasOwnProperty(H)&&n!=null&&!s.hasOwnProperty(H))switch(H){case"value":break;case"children":break;default:lt(e,t,H,null,s,n)}for(A in s)if(n=s[A],a=i[A],s.hasOwnProperty(A)&&(n!=null||a!=null))switch(A){case"value":re=n;break;case"defaultValue":ce=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(b(91));break;default:n!==a&<(e,t,A,n,s,a)}ra(e,re,ce);return;case"option":for(var xe in i)re=i[xe],i.hasOwnProperty(xe)&&re!=null&&!s.hasOwnProperty(xe)&&(xe==="selected"?e.selected=!1:lt(e,t,xe,null,s,re));for(W in s)re=s[W],ce=i[W],s.hasOwnProperty(W)&&re!==ce&&(re!=null||ce!=null)&&(W==="selected"?e.selected=re&&typeof re!="function"&&typeof re!="symbol":lt(e,t,W,re,s,ce));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 ke in i)re=i[ke],i.hasOwnProperty(ke)&&re!=null&&!s.hasOwnProperty(ke)&<(e,t,ke,null,s,re);for(se in s)if(re=s[se],ce=i[se],s.hasOwnProperty(se)&&re!==ce&&(re!=null||ce!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(b(137,t));break;default:lt(e,t,se,re,s,ce)}return;default:if(cr(t)){for(var ot in i)re=i[ot],i.hasOwnProperty(ot)&&re!==void 0&&!s.hasOwnProperty(ot)&&Pu(e,t,ot,void 0,s,re);for(ue in s)re=s[ue],ce=i[ue],!s.hasOwnProperty(ue)||re===ce||re===void 0&&ce===void 0||Pu(e,t,ue,re,s,ce);return}}for(var ee in i)re=i[ee],i.hasOwnProperty(ee)&&re!=null&&!s.hasOwnProperty(ee)&<(e,t,ee,null,s,re);for(fe in s)re=s[fe],ce=i[fe],!s.hasOwnProperty(fe)||re===ce||re==null&&ce==null||lt(e,t,fe,re,s,ce)}function Zf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Hm(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var n=i[s],a=n.transferSize,A=n.initiatorType,H=n.duration;if(a&&H&&Zf(A)){for(A=0,H=n.responseEnd,s+=1;s<i.length;s++){var W=i[s],se=W.startTime;if(se>H)break;var ue=W.transferSize,fe=W.initiatorType;ue&&Zf(fe)&&(W=W.responseEnd,A+=ue*(W<H?1:(H-se)/(W-se)))}if(--s,t+=8*(a+A)/(n.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 $u=null,qu=null;function To(e){return e.nodeType===9?e:e.ownerDocument}function Qf(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 Jf(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 Fu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wu=null;function zm(){var e=window.event;return e&&e.type==="popstate"?e===Wu?!1:(Wu=e,!0):(Wu=null,!1)}var e_=typeof setTimeout=="function"?setTimeout:void 0,Um=typeof clearTimeout=="function"?clearTimeout:void 0,t_=typeof Promise=="function"?Promise:void 0,Im=typeof queueMicrotask=="function"?queueMicrotask:typeof t_<"u"?function(e){return t_.resolve(null).then(e).catch(Pm)}:e_;function Pm(e){setTimeout(function(){throw e})}function _n(e){return e==="head"}function i_(e,t){var i=t,s=0;do{var n=i.nextSibling;if(e.removeChild(i),n&&n.nodeType===8)if(i=n.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(n),Wr(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")il(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,il(i);for(var a=i.firstChild;a;){var A=a.nextSibling,H=a.nodeName;a[ss]||H==="SCRIPT"||H==="STYLE"||H==="LINK"&&a.rel.toLowerCase()==="stylesheet"||i.removeChild(a),a=A}}else i==="body"&&il(e.ownerDocument.body);i=n}while(i);Wr(t)}function s_(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 Ku(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":Ku(i),qs(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function $m(e,t,i,s){for(;e.nodeType===1;){var n=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[ss])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(a=e.getAttribute("rel"),a==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(a!==n.rel||e.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||e.getAttribute("title")!==(n.title==null?null:n.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(a=e.getAttribute("src"),(a!==(n.src==null?null:n.src)||e.getAttribute("type")!==(n.type==null?null:n.type)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var a=n.name==null?null:""+n.name;if(n.type==="hidden"&&e.getAttribute("name")===a)return e}else return e;if(e=Pi(e.nextSibling),e===null)break}return null}function qm(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Pi(e.nextSibling),e===null))return null;return e}function n_(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Pi(e.nextSibling),e===null))return null;return e}function Gu(e){return e.data==="$?"||e.data==="$~"}function Vu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Fm(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 Pi(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 Yu=null;function r_(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Pi(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function a_(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 l_(e,t,i){switch(t=To(i),e){case"html":if(e=t.documentElement,!e)throw Error(b(452));return e;case"head":if(e=t.head,!e)throw Error(b(453));return e;case"body":if(e=t.body,!e)throw Error(b(454));return e;default:throw Error(b(451))}}function il(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);qs(e)}var $i=new Map,o_=new Set;function Do(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Is=ae.d;ae.d={f:Wm,r:Km,D:Gm,C:Vm,L:Ym,m:Xm,X:Qm,S:Zm,M:Jm};function Wm(){var e=Is.f(),t=bo();return e||t}function Km(e){var t=bi(e);t!==null&&t.tag===5&&t.type==="form"?xd(t):Is.r(e)}var $r=typeof document>"u"?null:document;function c_(e,t,i){var s=$r;if(s&&typeof t=="string"&&t){var n=Yt(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof i=="string"&&(n+='[crossorigin="'+i+'"]'),o_.has(n)||(o_.add(n),e={rel:e,crossOrigin:i,href:t},s.querySelector(n)===null&&(t=s.createElement("link"),Kt(t,"link",e),yt(t),s.head.appendChild(t)))}}function Gm(e){Is.D(e),c_("dns-prefetch",e,null)}function Vm(e,t){Is.C(e,t),c_("preconnect",e,t)}function Ym(e,t,i){Is.L(e,t,i);var s=$r;if(s&&e&&t){var n='link[rel="preload"][as="'+Yt(t)+'"]';t==="image"&&i&&i.imageSrcSet?(n+='[imagesrcset="'+Yt(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(n+='[imagesizes="'+Yt(i.imageSizes)+'"]')):n+='[href="'+Yt(e)+'"]';var a=n;switch(t){case"style":a=qr(e);break;case"script":a=Fr(e)}$i.has(a)||(e=_({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),$i.set(a,e),s.querySelector(n)!==null||t==="style"&&s.querySelector(sl(a))||t==="script"&&s.querySelector(nl(a))||(t=s.createElement("link"),Kt(t,"link",e),yt(t),s.head.appendChild(t)))}}function Xm(e,t){Is.m(e,t);var i=$r;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+Yt(s)+'"][href="'+Yt(e)+'"]',a=n;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Fr(e)}if(!$i.has(a)&&(e=_({rel:"modulepreload",href:e},t),$i.set(a,e),i.querySelector(n)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(nl(a)))return}s=i.createElement("link"),Kt(s,"link",e),yt(s),i.head.appendChild(s)}}}function Zm(e,t,i){Is.S(e,t,i);var s=$r;if(s&&e){var n=ws(s).hoistableStyles,a=qr(e);t=t||"default";var A=n.get(a);if(!A){var H={loading:0,preload:null};if(A=s.querySelector(sl(a)))H.loading=5;else{e=_({rel:"stylesheet",href:e,"data-precedence":t},i),(i=$i.get(a))&&Xu(e,i);var W=A=s.createElement("link");yt(W),Kt(W,"link",e),W._p=new Promise(function(se,ue){W.onload=se,W.onerror=ue}),W.addEventListener("load",function(){H.loading|=1}),W.addEventListener("error",function(){H.loading|=2}),H.loading|=4,ko(A,t,s)}A={type:"stylesheet",instance:A,count:1,state:H},n.set(a,A)}}}function Qm(e,t){Is.X(e,t);var i=$r;if(i&&e){var s=ws(i).hoistableScripts,n=Fr(e),a=s.get(n);a||(a=i.querySelector(nl(n)),a||(e=_({src:e,async:!0},t),(t=$i.get(n))&&Zu(e,t),a=i.createElement("script"),yt(a),Kt(a,"link",e),i.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},s.set(n,a))}}function Jm(e,t){Is.M(e,t);var i=$r;if(i&&e){var s=ws(i).hoistableScripts,n=Fr(e),a=s.get(n);a||(a=i.querySelector(nl(n)),a||(e=_({src:e,async:!0,type:"module"},t),(t=$i.get(n))&&Zu(e,t),a=i.createElement("script"),yt(a),Kt(a,"link",e),i.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},s.set(n,a))}}function u_(e,t,i,s){var n=(n=Se.current)?Do(n):null;if(!n)throw Error(b(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=qr(i.href),i=ws(n).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=qr(i.href);var a=ws(n).hoistableStyles,A=a.get(e);if(A||(n=n.ownerDocument||n,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(e,A),(a=n.querySelector(sl(e)))&&!a._p&&(A.instance=a,A.state.loading=5),$i.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},$i.set(e,i),a||ev(n,e,i,A.state))),t&&s===null)throw Error(b(528,""));return A}if(t&&s!==null)throw Error(b(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Fr(i),i=ws(n).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(b(444,e))}}function qr(e){return'href="'+Yt(e)+'"'}function sl(e){return'link[rel="stylesheet"]['+e+"]"}function h_(e){return _({},e,{"data-precedence":e.precedence,precedence:null})}function ev(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}),Kt(t,"link",i),yt(t),e.head.appendChild(t))}function Fr(e){return'[src="'+Yt(e)+'"]'}function nl(e){return"script[async]"+e}function d_(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Yt(i.href)+'"]');if(s)return t.instance=s,yt(s),s;var n=_({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),yt(s),Kt(s,"style",n),ko(s,i.precedence,e),t.instance=s;case"stylesheet":n=qr(i.href);var a=e.querySelector(sl(n));if(a)return t.state.loading|=4,t.instance=a,yt(a),a;s=h_(i),(n=$i.get(n))&&Xu(s,n),a=(e.ownerDocument||e).createElement("link"),yt(a);var A=a;return A._p=new Promise(function(H,W){A.onload=H,A.onerror=W}),Kt(a,"link",s),t.state.loading|=4,ko(a,i.precedence,e),t.instance=a;case"script":return a=Fr(i.src),(n=e.querySelector(nl(a)))?(t.instance=n,yt(n),n):(s=i,(n=$i.get(a))&&(s=_({},i),Zu(s,n)),e=e.ownerDocument||e,n=e.createElement("script"),yt(n),Kt(n,"link",s),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(b(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,ko(s,i.precedence,e));return t.instance}function ko(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=s.length?s[s.length-1]:null,a=n,A=0;A<s.length;A++){var H=s[A];if(H.dataset.precedence===t)a=H;else if(a!==n)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Xu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Zu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Mo=null;function f_(e,t,i){if(Mo===null){var s=new Map,n=Mo=new Map;n.set(i,s)}else n=Mo,s=n.get(i),s||(s=new Map,n.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),n=0;n<i.length;n++){var a=i[n];if(!(a[ss]||a[gt]||e==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var A=a.getAttribute(t)||"";A=e+A;var H=s.get(A);H?H.push(a):s.set(A,[a])}}return s}function __(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function tv(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 p_(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function iv(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 n=qr(s.href),a=t.querySelector(sl(n));if(a){t=a._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Lo.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=a,yt(a);return}a=t.ownerDocument||t,s=h_(s),(n=$i.get(n))&&Xu(s,n),a=a.createElement("link"),yt(a);var A=a;A._p=new Promise(function(H,W){A.onload=H,A.onerror=W}),Kt(a,"link",s),i.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Lo.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Qu=0;function sv(e,t){return e.stylesheets&&e.count===0&&Bo(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&Bo(e,e.stylesheets),e.unsuspend){var a=e.unsuspend;e.unsuspend=null,a()}},6e4+t);0<e.imgBytes&&Qu===0&&(Qu=62500*Hm());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Bo(e,e.stylesheets),e.unsuspend)){var a=e.unsuspend;e.unsuspend=null,a()}},(e.imgBytes>Qu?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(n)}}:null}function Lo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Oo=null;function Bo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Oo=new Map,t.forEach(nv,e),Oo=null,Lo.call(e))}function nv(e,t){if(!(t.state.loading&4)){var i=Oo.get(e);if(i)var s=i.get(null);else{i=new Map,Oo.set(e,i);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<n.length;a++){var A=n[a];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(i.set(A.dataset.precedence,A),s=A)}s&&i.set(null,s)}n=t.instance,A=n.getAttribute("data-precedence"),a=i.get(A)||s,a===s&&i.set(null,n),i.set(A,n),this.count++,s=Lo.bind(this),n.addEventListener("load",s),n.addEventListener("error",s),a?a.parentNode.insertBefore(n,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var rl={$$typeof:h,Provider:null,Consumer:null,_currentValue:le,_currentValue2:le,_threadCount:0};function rv(e,t,i,s,n,a,A,H,W){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=li(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=li(0),this.hiddenUpdates=li(null),this.identifierPrefix=s,this.onUncaughtError=n,this.onCaughtError=a,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function m_(e,t,i,s,n,a,A,H,W,se,ue,fe){return e=new rv(e,t,i,A,W,se,ue,fe,H),t=1,a===!0&&(t|=24),a=ii(3,null,null,t),e.current=a,a.stateNode=e,t=Mc(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:s,isDehydrated:i,cache:t},jc(a),e}function v_(e){return e?(e=Zs,e):Zs}function g_(e,t,i,s,n,a){n=v_(n),s.context===null?s.context=n:s.pendingContext=n,s=sn(t),s.payload={element:i},a=a===void 0?null:a,a!==null&&(s.callback=a),i=nn(e,s,t),i!==null&&(vi(i,e,t),Ha(i,e,t))}function S_(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Ju(e,t){S_(e,t),(e=e.alternate)&&S_(e,t)}function b_(e){if(e.tag===13||e.tag===31){var t=wi(e,67108864);t!==null&&vi(t,e,67108864),Ju(e,67108864)}}function y_(e){if(e.tag===13||e.tag===31){var t=Ti();t=Fi(t);var i=wi(e,t);i!==null&&vi(i,e,t),Ju(e,t)}}var jo=!0;function av(e,t,i,s){var n=G.T;G.T=null;var a=ae.p;try{ae.p=2,eh(e,t,i,s)}finally{ae.p=a,G.T=n}}function lv(e,t,i,s){var n=G.T;G.T=null;var a=ae.p;try{ae.p=8,eh(e,t,i,s)}finally{ae.p=a,G.T=n}}function eh(e,t,i,s){if(jo){var n=th(s);if(n===null)Iu(e,t,s,No,i),w_(e,s);else if(cv(n,e,t,i,s))s.stopPropagation();else if(w_(e,s),t&4&&-1<ov.indexOf(e)){for(;n!==null;){var a=bi(n);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var A=ai(a.pendingLanes);if(A!==0){var H=a;for(H.pendingLanes|=2,H.entangledLanes|=2;A;){var W=1<<31-Vt(A);H.entanglements[1]|=W,A&=~W}_s(a),(et&6)===0&&(go=Pe()+500,Ja(0))}}break;case 31:case 13:H=wi(a,2),H!==null&&vi(H,a,2),bo(),Ju(a,2)}if(a=th(s),a===null&&Iu(e,t,s,No,i),a===n)break;n=a}n!==null&&s.stopPropagation()}else Iu(e,t,s,null,i)}}function th(e){return e=oa(e),ih(e)}var No=null;function ih(e){if(No=null,e=Cs(e),e!==null){var t=I(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=P(t),e!==null)return e;e=null}else if(i===31){if(e=o(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return No=e,null}function C_(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(pt()){case Ye:return 2;case ut:return 8;case bt:case ki:return 32;case xt:return 268435456;default:return 32}default:return 32}}var sh=!1,pn=null,mn=null,vn=null,al=new Map,ll=new Map,gn=[],ov="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 w_(e,t){switch(e){case"focusin":case"focusout":pn=null;break;case"dragenter":case"dragleave":mn=null;break;case"mouseover":case"mouseout":vn=null;break;case"pointerover":case"pointerout":al.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ll.delete(t.pointerId)}}function ol(e,t,i,s,n,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:a,targetContainers:[n]},t!==null&&(t=bi(t),t!==null&&b_(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function cv(e,t,i,s,n){switch(t){case"focusin":return pn=ol(pn,e,t,i,s,n),!0;case"dragenter":return mn=ol(mn,e,t,i,s,n),!0;case"mouseover":return vn=ol(vn,e,t,i,s,n),!0;case"pointerover":var a=n.pointerId;return al.set(a,ol(al.get(a)||null,e,t,i,s,n)),!0;case"gotpointercapture":return a=n.pointerId,ll.set(a,ol(ll.get(a)||null,e,t,i,s,n)),!0}return!1}function x_(e){var t=Cs(e.target);if(t!==null){var i=I(t);if(i!==null){if(t=i.tag,t===13){if(t=P(i),t!==null){e.blockedOn=t,Wi(e.priority,function(){y_(i)});return}}else if(t===31){if(t=o(i),t!==null){e.blockedOn=t,Wi(e.priority,function(){y_(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 Ho(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=th(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);la=s,i.target.dispatchEvent(s),la=null}else return t=bi(i),t!==null&&b_(t),e.blockedOn=i,!1;t.shift()}return!0}function E_(e,t,i){Ho(e)&&i.delete(t)}function uv(){sh=!1,pn!==null&&Ho(pn)&&(pn=null),mn!==null&&Ho(mn)&&(mn=null),vn!==null&&Ho(vn)&&(vn=null),al.forEach(E_),ll.forEach(E_)}function zo(e,t){e.blockedOn===t&&(e.blockedOn=null,sh||(sh=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,uv)))}var Uo=null;function A_(e){Uo!==e&&(Uo=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){Uo===e&&(Uo=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],n=e[t+2];if(typeof s!="function"){if(ih(s||i)===null)continue;break}var a=bi(i);a!==null&&(e.splice(t,3),t-=3,tu(a,{pending:!0,data:n,method:i.method,action:s},s,n))}}))}function Wr(e){function t(W){return zo(W,e)}pn!==null&&zo(pn,e),mn!==null&&zo(mn,e),vn!==null&&zo(vn,e),al.forEach(t),ll.forEach(t);for(var i=0;i<gn.length;i++){var s=gn[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<gn.length&&(i=gn[0],i.blockedOn===null);)x_(i),i.blockedOn===null&&gn.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var n=i[s],a=i[s+1],A=n[Bt]||null;if(typeof a=="function")A||A_(i);else if(A){var H=null;if(a&&a.hasAttribute("formAction")){if(n=a,A=a[Bt]||null)H=A.formAction;else if(ih(n)!==null)continue}else H=A.action;typeof H=="function"?i[s+1]=H:(i.splice(s,3),s-=3),A_(i)}}}function R_(){function e(a){a.canIntercept&&a.info==="react-transition"&&a.intercept({handler:function(){return new Promise(function(A){return n=A})},focusReset:"manual",scroll:"manual"})}function t(){n!==null&&(n(),n=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var a=navigation.currentEntry;a&&a.url!=null&&navigation.navigate(a.url,{state:a.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,n=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),n!==null&&(n(),n=null)}}}function nh(e){this._internalRoot=e}Io.prototype.render=nh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(b(409));var i=t.current,s=Ti();g_(i,s,e,t,null,null)},Io.prototype.unmount=nh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;g_(e.current,2,null,e,null,null),bo(),t[ei]=null}};function Io(e){this._internalRoot=e}Io.prototype.unstable_scheduleHydration=function(e){if(e){var t=ys();e={blockedOn:null,target:e,priority:t};for(var i=0;i<gn.length&&t!==0&&t<gn[i].priority;i++);gn.splice(i,0,e),i===0&&x_(e)}};var T_=v.version;if(T_!=="19.2.8")throw Error(b(527,T_,"19.2.8"));ae.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(b(188)):(e=Object.keys(e).join(","),Error(b(268,e)));return e=p(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var hv={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Po=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Po.isDisabled&&Po.supportsFiber)try{gs=Po.inject(hv),Gt=Po}catch{}}return ul.createRoot=function(e,t){if(!j(e))throw Error(b(299));var i=!1,s="",n=Bd,a=jd,A=Nd;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(A=t.onRecoverableError)),t=m_(e,1,!1,null,null,i,s,null,n,a,A,R_),e[ei]=t.current,Uu(e),new nh(t)},ul.hydrateRoot=function(e,t,i){if(!j(e))throw Error(b(299));var s=!1,n="",a=Bd,A=jd,H=Nd,W=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(n=i.identifierPrefix),i.onUncaughtError!==void 0&&(a=i.onUncaughtError),i.onCaughtError!==void 0&&(A=i.onCaughtError),i.onRecoverableError!==void 0&&(H=i.onRecoverableError),i.formState!==void 0&&(W=i.formState)),t=m_(e,1,!0,t,i??null,s,n,W,a,A,H,R_),t.context=v_(null),i=t.current,s=Ti(),s=Fi(s),n=sn(s),n.callback=null,nn(i,n,s),i=s,t.current.lanes=i,Mi(t,i),_s(t),e[ei]=t.current,Uu(e),new Io(t)},ul.version="19.2.8",ul}var z_;function Cv(){if(z_)return lh.exports;z_=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(v){console.error(v)}}return r(),lh.exports=yv(),lh.exports}var wv=Cv(),hh={exports:{}},U_;function xv(){return U_||(U_=1,(function(r,v){(function(y,b){r.exports=b()})(globalThis,(()=>(()=>{var y={4567:function(P,o,f){var p=this&&this.__decorate||function(l,h,S,T){var R,D=arguments.length,x=D<3?h:T===null?T=Object.getOwnPropertyDescriptor(h,S):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(l,h,S,T);else for(var B=l.length-1;B>=0;B--)(R=l[B])&&(x=(D<3?R(x):D>3?R(h,S,x):R(h,S))||x);return D>3&&x&&Object.defineProperty(h,S,x),x},g=this&&this.__param||function(l,h){return function(S,T){h(S,T,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const _=f(9042),C=f(9924),E=f(844),M=f(4725),w=f(2585),d=f(3656);let u=o.AccessibilityManager=class extends E.Disposable{constructor(l,h,S,T){super(),this._terminal=l,this._coreBrowserService=S,this._renderService=T,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 R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,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 C.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((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
10
|
+
`)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,d.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,E.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(l){for(let h=0;h<l;h++)this._handleChar(" ")}_handleChar(l){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==l&&(this._charsToAnnounce+=l):this._charsToAnnounce+=l,l===`
|
|
11
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=_.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(l){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(l)||this._charsToConsume.push(l)}_refreshRows(l,h){this._liveRegionDebouncer.refresh(l,h,this._terminal.rows)}_renderRows(l,h){const S=this._terminal.buffer,T=S.lines.length.toString();for(let R=l;R<=h;R++){const D=S.lines.get(S.ydisp+R),x=[],B=D?.translateToString(!0,void 0,void 0,x)||"",K=(S.ydisp+R+1).toString(),F=this._rowElements[R];F&&(B.length===0?(F.innerText=" ",this._rowColumns.set(F,[0,1])):(F.textContent=B,this._rowColumns.set(F,x)),F.setAttribute("aria-posinset",K),F.setAttribute("aria-setsize",T))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(l,h){const S=l.target,T=this._rowElements[h===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(h===0?"1":`${this._terminal.buffer.lines.length}`)||l.relatedTarget!==T)return;let R,D;if(h===0?(R=S,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(R=this._rowElements.shift(),D=S,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),h===0){const x=this._createAccessibilityTreeNode();this._rowElements.unshift(x),this._rowContainer.insertAdjacentElement("afterbegin",x)}else{const x=this._createAccessibilityTreeNode();this._rowElements.push(x),this._rowContainer.appendChild(x)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(h===0?-1:1),this._rowElements[h===0?1:this._rowElements.length-2].focus(),l.preventDefault(),l.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const l=document.getSelection();if(!l)return;if(l.isCollapsed)return void(this._rowContainer.contains(l.anchorNode)&&this._terminal.clearSelection());if(!l.anchorNode||!l.focusNode)return void console.error("anchorNode and/or focusNode are null");let h={node:l.anchorNode,offset:l.anchorOffset},S={node:l.focusNode,offset:l.focusOffset};if((h.node.compareDocumentPosition(S.node)&Node.DOCUMENT_POSITION_PRECEDING||h.node===S.node&&h.offset>S.offset)&&([h,S]=[S,h]),h.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(h={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(h.node))return;const T=this._rowElements.slice(-1)[0];if(S.node.compareDocumentPosition(T)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(S={node:T,offset:T.textContent?.length??0}),!this._rowContainer.contains(S.node))return;const R=({node:B,offset:K})=>{const F=B instanceof Text?B.parentNode:B;let J=parseInt(F?.getAttribute("aria-posinset"),10)-1;if(isNaN(J))return console.warn("row is invalid. Race condition?"),null;const O=this._rowColumns.get(F);if(!O)return console.warn("columns is null. Race condition?"),null;let te=K<O.length?O[K]:O.slice(-1)[0]+1;return te>=this._terminal.cols&&(++J,te=0),{row:J,column:te}},D=R(h),x=R(S);if(D&&x){if(D.row>x.row||D.row===x.row&&D.column>=x.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(x.row-D.row)*this._terminal.cols-D.column+x.column)}}_handleResize(l){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let h=this._rowContainer.children.length;h<this._terminal.rows;h++)this._rowElements[h]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[h]);for(;this._rowElements.length>l;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const l=this._coreBrowserService.mainDocument.createElement("div");return l.setAttribute("role","listitem"),l.tabIndex=-1,this._refreshRowDimensions(l),l}_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 l=0;l<this._terminal.rows;l++)this._refreshRowDimensions(this._rowElements[l])}}_refreshRowDimensions(l){l.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=u=p([g(1,w.IInstantiationService),g(2,M.ICoreBrowserService),g(3,M.IRenderService)],u)},3614:(P,o)=>{function f(C){return C.replace(/\r?\n/g,"\r")}function p(C,E){return E?"\x1B[200~"+C+"\x1B[201~":C}function g(C,E,M,w){C=p(C=f(C),M.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),M.triggerDataEvent(C,!0),E.value=""}function _(C,E,M){const w=M.getBoundingClientRect(),d=C.clientX-w.left-10,u=C.clientY-w.top-10;E.style.width="20px",E.style.height="20px",E.style.left=`${d}px`,E.style.top=`${u}px`,E.style.zIndex="1000",E.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=f,o.bracketTextForPaste=p,o.copyHandler=function(C,E){C.clipboardData&&C.clipboardData.setData("text/plain",E.selectionText),C.preventDefault()},o.handlePasteEvent=function(C,E,M,w){C.stopPropagation(),C.clipboardData&&g(C.clipboardData.getData("text/plain"),E,M,w)},o.paste=g,o.moveTextAreaUnderMouseCursor=_,o.rightClickHandler=function(C,E,M,w,d){_(C,E,M),d&&w.rightClickSelect(C),E.value=w.selectionText,E.select()}},7239:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const p=f(1505);o.ColorContrastCache=class{constructor(){this._color=new p.TwoKeyMap,this._css=new p.TwoKeyMap}setCss(g,_,C){this._css.set(g,_,C)}getCss(g,_){return this._css.get(g,_)}setColor(g,_,C){this._color.set(g,_,C)}getColor(g,_){return this._color.get(g,_)}clear(){this._color.clear(),this._css.clear()}}},3656:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(f,p,g,_){f.addEventListener(p,g,_);let C=!1;return{dispose:()=>{C||(C=!0,f.removeEventListener(p,g,_))}}}},3551:function(P,o,f){var p=this&&this.__decorate||function(u,l,h,S){var T,R=arguments.length,D=R<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,h):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(u,l,h,S);else for(var x=u.length-1;x>=0;x--)(T=u[x])&&(D=(R<3?T(D):R>3?T(l,h,D):T(l,h))||D);return R>3&&D&&Object.defineProperty(l,h,D),D},g=this&&this.__param||function(u,l){return function(h,S){l(h,S,u)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const _=f(3656),C=f(8460),E=f(844),M=f(2585),w=f(4725);let d=o.Linkifier=class extends E.Disposable{get currentLink(){return this._currentLink}constructor(u,l,h,S,T){super(),this._element=u,this._mouseService=l,this._renderService=h,this._bufferService=S,this._linkProviderService=T,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new C.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new C.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,E.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,E.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,_.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,_.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,_.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,_.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(u){this._lastMouseEvent=u;const l=this._positionFromMouseEvent(u,this._element,this._mouseService);if(!l)return;this._isMouseOut=!1;const h=u.composedPath();for(let S=0;S<h.length;S++){const T=h[S];if(T.classList.contains("xterm"))break;if(T.classList.contains("xterm-hover"))return}this._lastBufferCell&&l.x===this._lastBufferCell.x&&l.y===this._lastBufferCell.y||(this._handleHover(l),this._lastBufferCell=l)}_handleHover(u){if(this._activeLine!==u.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(u,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,u)||(this._clearCurrentLink(),this._askForLink(u,!0))}_askForLink(u,l){this._activeProviderReplies&&l||(this._activeProviderReplies?.forEach((S=>{S?.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=u.y);let h=!1;for(const[S,T]of this._linkProviderService.linkProviders.entries())l?this._activeProviderReplies?.get(S)&&(h=this._checkLinkProviderResult(S,u,h)):T.provideLinks(u.y,(R=>{if(this._isMouseOut)return;const D=R?.map((x=>({link:x})));this._activeProviderReplies?.set(S,D),h=this._checkLinkProviderResult(S,u,h),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(u.y,this._activeProviderReplies)}))}_removeIntersectingLinks(u,l){const h=new Set;for(let S=0;S<l.size;S++){const T=l.get(S);if(T)for(let R=0;R<T.length;R++){const D=T[R],x=D.link.range.start.y<u?0:D.link.range.start.x,B=D.link.range.end.y>u?this._bufferService.cols:D.link.range.end.x;for(let K=x;K<=B;K++){if(h.has(K)){T.splice(R--,1);break}h.add(K)}}}}_checkLinkProviderResult(u,l,h){if(!this._activeProviderReplies)return h;const S=this._activeProviderReplies.get(u);let T=!1;for(let R=0;R<u;R++)this._activeProviderReplies.has(R)&&!this._activeProviderReplies.get(R)||(T=!0);if(!T&&S){const R=S.find((D=>this._linkAtPosition(D.link,l)));R&&(h=!0,this._handleNewLink(R))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!h)for(let R=0;R<this._activeProviderReplies.size;R++){const D=this._activeProviderReplies.get(R)?.find((x=>this._linkAtPosition(x.link,l)));if(D){h=!0,this._handleNewLink(D);break}}return h}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(u){if(!this._currentLink)return;const l=this._positionFromMouseEvent(u,this._element,this._mouseService);l&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,l)&&this._currentLink.link.activate(u,this._currentLink.link.text)}_clearCurrentLink(u,l){this._currentLink&&this._lastMouseEvent&&(!u||!l||this._currentLink.link.range.start.y>=u&&this._currentLink.link.range.end.y<=l)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,E.disposeArray)(this._linkCacheDisposables))}_handleNewLink(u){if(!this._lastMouseEvent)return;const l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._linkAtPosition(u.link,l)&&(this._currentLink=u,this._currentLink.state={decorations:{underline:u.link.decorations===void 0||u.link.decorations.underline,pointerCursor:u.link.decorations===void 0||u.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,u.link,this._lastMouseEvent),u.link.decorations={},Object.defineProperties(u.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:h=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==h&&(this._currentLink.state.decorations.pointerCursor=h,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",h))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:h=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==h&&(this._currentLink.state.decorations.underline=h,this._currentLink.state.isHovered&&this._fireUnderlineEvent(u.link,h))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((h=>{if(!this._currentLink)return;const S=h.start===0?0:h.start+1+this._bufferService.buffer.ydisp,T=this._bufferService.buffer.ydisp+1+h.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=T&&(this._clearCurrentLink(S,T),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(u,l,h){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(l,!0),this._currentLink.state.decorations.pointerCursor&&u.classList.add("xterm-cursor-pointer")),l.hover&&l.hover(h,l.text)}_fireUnderlineEvent(u,l){const h=u.range,S=this._bufferService.buffer.ydisp,T=this._createLinkUnderlineEvent(h.start.x-1,h.start.y-S-1,h.end.x,h.end.y-S-1,void 0);(l?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(T)}_linkLeave(u,l,h){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(l,!1),this._currentLink.state.decorations.pointerCursor&&u.classList.remove("xterm-cursor-pointer")),l.leave&&l.leave(h,l.text)}_linkAtPosition(u,l){const h=u.range.start.y*this._bufferService.cols+u.range.start.x,S=u.range.end.y*this._bufferService.cols+u.range.end.x,T=l.y*this._bufferService.cols+l.x;return h<=T&&T<=S}_positionFromMouseEvent(u,l,h){const S=h.getCoords(u,l,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(u,l,h,S,T){return{x1:u,y1:l,x2:h,y2:S,cols:this._bufferService.cols,fg:T}}};o.Linkifier=d=p([g(1,w.IMouseService),g(2,w.IRenderService),g(3,M.IBufferService),g(4,w.ILinkProviderService)],d)},9042:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(P,o,f){var p=this&&this.__decorate||function(w,d,u,l){var h,S=arguments.length,T=S<3?d:l===null?l=Object.getOwnPropertyDescriptor(d,u):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,d,u,l);else for(var R=w.length-1;R>=0;R--)(h=w[R])&&(T=(S<3?h(T):S>3?h(d,u,T):h(d,u))||T);return S>3&&T&&Object.defineProperty(d,u,T),T},g=this&&this.__param||function(w,d){return function(u,l){d(u,l,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const _=f(511),C=f(2585);let E=o.OscLinkProvider=class{constructor(w,d,u){this._bufferService=w,this._optionsService=d,this._oscLinkService=u}provideLinks(w,d){const u=this._bufferService.buffer.lines.get(w-1);if(!u)return void d(void 0);const l=[],h=this._optionsService.rawOptions.linkHandler,S=new _.CellData,T=u.getTrimmedLength();let R=-1,D=-1,x=!1;for(let B=0;B<T;B++)if(D!==-1||u.hasContent(B)){if(u.loadCell(B,S),S.hasExtendedAttrs()&&S.extended.urlId){if(D===-1){D=B,R=S.extended.urlId;continue}x=S.extended.urlId!==R}else D!==-1&&(x=!0);if(x||D!==-1&&B===T-1){const K=this._oscLinkService.getLinkData(R)?.uri;if(K){const F={start:{x:D+1,y:w},end:{x:B+(x||B!==T-1?0:1),y:w}};let J=!1;if(!h?.allowNonHttpProtocols)try{const O=new URL(K);["http:","https:"].includes(O.protocol)||(J=!0)}catch{J=!0}J||l.push({text:K,range:F,activate:(O,te)=>h?h.activate(O,te,F):M(0,te),hover:(O,te)=>h?.hover?.(O,te,F),leave:(O,te)=>h?.leave?.(O,te,F)})}x=!1,S.hasExtendedAttrs()&&S.extended.urlId?(D=B,R=S.extended.urlId):(D=-1,R=-1)}}d(l)}};function M(w,d){if(confirm(`Do you want to navigate to ${d}?
|
|
12
|
+
|
|
13
|
+
WARNING: This link could potentially be dangerous`)){const u=window.open();if(u){try{u.opener=null}catch{}u.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=E=p([g(0,C.IBufferService),g(1,C.IOptionsService),g(2,C.IOscLinkService)],E)},6193:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(f,p){this._renderCallback=f,this._coreBrowserService=p,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(f){return this._refreshCallbacks.push(f),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(f,p,g){this._rowCount=g,f=f!==void 0?f:0,p=p!==void 0?p:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,f):f,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,p):p,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 f=Math.max(this._rowStart,0),p=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(f,p),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const f of this._refreshCallbacks)f(0);this._refreshCallbacks=[]}}},3236:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const p=f(3614),g=f(3656),_=f(3551),C=f(9042),E=f(3730),M=f(1680),w=f(3107),d=f(5744),u=f(2950),l=f(1296),h=f(428),S=f(4269),T=f(5114),R=f(8934),D=f(3230),x=f(9312),B=f(4725),K=f(6731),F=f(8055),J=f(8969),O=f(8460),te=f(844),he=f(6114),G=f(8437),ae=f(2584),le=f(7399),L=f(5941),$=f(9074),k=f(2585),z=f(5435),Y=f(4567),ne=f(779);class _e extends J.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(Q={}){super(Q),this.browser=he,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new te.MutableDisposable),this._onCursorMove=this.register(new O.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new O.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new O.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new O.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new O.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new O.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new O.EventEmitter),this._onBlur=this.register(new O.EventEmitter),this._onA11yCharEmitter=this.register(new O.EventEmitter),this._onA11yTabEmitter=this.register(new O.EventEmitter),this._onWillOpen=this.register(new O.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance($.DecorationService),this._instantiationService.setService(k.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ne.LinkProviderService),this._instantiationService.setService(B.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(E.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((U,oe)=>this.refresh(U,oe)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((U=>this._reportWindowsOptions(U)))),this.register(this._inputHandler.onColor((U=>this._handleColorEvent(U)))),this.register((0,O.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,O.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,O.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,O.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((U=>this._afterResize(U.cols,U.rows)))),this.register((0,te.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(Q){if(this._themeService)for(const U of Q){let oe,me="";switch(U.index){case 256:oe="foreground",me="10";break;case 257:oe="background",me="11";break;case 258:oe="cursor",me="12";break;default:oe="ansi",me="4;"+U.index}switch(U.type){case 0:const Ce=F.color.toColorRGB(oe==="ansi"?this._themeService.colors.ansi[U.index]:this._themeService.colors[oe]);this.coreService.triggerDataEvent(`${ae.C0.ESC}]${me};${(0,L.toRgbString)(Ce)}${ae.C1_ESCAPED.ST}`);break;case 1:if(oe==="ansi")this._themeService.modifyColors((ye=>ye.ansi[U.index]=F.channels.toColor(...U.color)));else{const ye=oe;this._themeService.modifyColors((Me=>Me[ye]=F.channels.toColor(...U.color)))}break;case 2:this._themeService.restoreColor(U.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Q){Q?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Y.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Q){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ae.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(ae.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const Q=this.buffer.ybase+this.buffer.y,U=this.buffer.lines.get(Q);if(!U)return;const oe=Math.min(this.buffer.x,this.cols-1),me=this._renderService.dimensions.css.cell.height,Ce=U.getWidth(oe),ye=this._renderService.dimensions.css.cell.width*Ce,Me=this.buffer.y*this._renderService.dimensions.css.cell.height,Ue=oe*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ue+"px",this.textarea.style.top=Me+"px",this.textarea.style.width=ye+"px",this.textarea.style.height=me+"px",this.textarea.style.lineHeight=me+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",(U=>{this.hasSelection()&&(0,p.copyHandler)(U,this._selectionService)})));const Q=U=>(0,p.handlePasteEvent)(U,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",Q)),this.register((0,g.addDisposableDomListener)(this.element,"paste",Q)),he.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(U=>{U.button===2&&(0,p.rightClickHandler)(U,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",(U=>{(0,p.rightClickHandler)(U,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),he.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",(U=>{U.button===1&&(0,p.moveTextAreaUnderMouseCursor)(U,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",(Q=>this._keyUp(Q)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",(Q=>this._keyDown(Q)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",(Q=>this._keyPress(Q)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",(Q=>this._compositionHelper.compositionupdate(Q)))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,g.addDisposableDomListener)(this.textarea,"input",(Q=>this._inputEvent(Q)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Q){if(!Q)throw new Error("Terminal requires a parent element.");if(Q.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Q.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),Q.appendChild(this.element);const U=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),U.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,g.addDisposableDomListener)(this.screenElement,"mousemove",(oe=>this.updateCursorStyle(oe)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),U.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",C.promptLabel),he.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(T.CoreBrowserService,this.textarea,Q.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(B.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(h.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(B.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(K.ThemeService),this._instantiationService.setService(B.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(B.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(B.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((oe=>this._onRender.fire(oe)))),this.onResize((oe=>this._renderService.resize(oe.cols,oe.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(u.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(B.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(_.Linkifier,this.screenElement)),this.element.appendChild(U);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(M.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.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(x.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(B.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((oe=>this._renderService.handleSelectionChanged(oe.start,oe.end,oe.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((oe=>{this.textarea.value=oe,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((oe=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(w.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(oe=>this._selectionService.handleMouseDown(oe)))),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(Y.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(d.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(d.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(l.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Q=this,U=this.element;function oe(ye){const Me=Q._mouseService.getMouseReportCoords(ye,Q.screenElement);if(!Me)return!1;let Ue,Ve;switch(ye.overrideType||ye.type){case"mousemove":Ve=32,ye.buttons===void 0?(Ue=3,ye.button!==void 0&&(Ue=ye.button<3?ye.button:3)):Ue=1&ye.buttons?0:4&ye.buttons?1:2&ye.buttons?2:3;break;case"mouseup":Ve=0,Ue=ye.button<3?ye.button:3;break;case"mousedown":Ve=1,Ue=ye.button<3?ye.button:3;break;case"wheel":if(Q._customWheelEventHandler&&Q._customWheelEventHandler(ye)===!1||Q.viewport.getLinesScrolled(ye)===0)return!1;Ve=ye.deltaY<0?0:1,Ue=4;break;default:return!1}return!(Ve===void 0||Ue===void 0||Ue>4)&&Q.coreMouseService.triggerMouseEvent({col:Me.col,row:Me.row,x:Me.x,y:Me.y,button:Ue,action:Ve,ctrl:ye.ctrlKey,alt:ye.altKey,shift:ye.shiftKey})}const me={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Ce={mouseup:ye=>(oe(ye),ye.buttons||(this._document.removeEventListener("mouseup",me.mouseup),me.mousedrag&&this._document.removeEventListener("mousemove",me.mousedrag)),this.cancel(ye)),wheel:ye=>(oe(ye),this.cancel(ye,!0)),mousedrag:ye=>{ye.buttons&&oe(ye)},mousemove:ye=>{ye.buttons||oe(ye)}};this.register(this.coreMouseService.onProtocolChange((ye=>{ye?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ye)),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&ye?me.mousemove||(U.addEventListener("mousemove",Ce.mousemove),me.mousemove=Ce.mousemove):(U.removeEventListener("mousemove",me.mousemove),me.mousemove=null),16&ye?me.wheel||(U.addEventListener("wheel",Ce.wheel,{passive:!1}),me.wheel=Ce.wheel):(U.removeEventListener("wheel",me.wheel),me.wheel=null),2&ye?me.mouseup||(me.mouseup=Ce.mouseup):(this._document.removeEventListener("mouseup",me.mouseup),me.mouseup=null),4&ye?me.mousedrag||(me.mousedrag=Ce.mousedrag):(this._document.removeEventListener("mousemove",me.mousedrag),me.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(U,"mousedown",(ye=>{if(ye.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ye))return oe(ye),me.mouseup&&this._document.addEventListener("mouseup",me.mouseup),me.mousedrag&&this._document.addEventListener("mousemove",me.mousedrag),this.cancel(ye)}))),this.register((0,g.addDisposableDomListener)(U,"wheel",(ye=>{if(!me.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ye)===!1)return!1;if(!this.buffer.hasScrollback){const Me=this.viewport.getLinesScrolled(ye);if(Me===0)return;const Ue=ae.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ye.deltaY<0?"A":"B");let Ve="";for(let it=0;it<Math.abs(Me);it++)Ve+=Ue;return this.coreService.triggerDataEvent(Ve,!0),this.cancel(ye,!0)}return this.viewport.handleWheel(ye)?this.cancel(ye):void 0}}),{passive:!1})),this.register((0,g.addDisposableDomListener)(U,"touchstart",(ye=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ye),this.cancel(ye)}),{passive:!0})),this.register((0,g.addDisposableDomListener)(U,"touchmove",(ye=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ye)?void 0:this.cancel(ye)}),{passive:!1}))}refresh(Q,U){this._renderService?.refreshRows(Q,U)}updateCursorStyle(Q){this._selectionService?.shouldColumnSelect(Q)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(Q,U,oe=0){oe===1?(super.scrollLines(Q,U,oe),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(Q)}paste(Q){(0,p.paste)(Q,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Q){this._customKeyEventHandler=Q}attachCustomWheelEventHandler(Q){this._customWheelEventHandler=Q}registerLinkProvider(Q){return this._linkProviderService.registerLinkProvider(Q)}registerCharacterJoiner(Q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const U=this._characterJoinerService.register(Q);return this.refresh(0,this.rows-1),U}deregisterCharacterJoiner(Q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Q)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Q){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Q)}registerDecoration(Q){return this._decorationService.registerDecoration(Q)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Q,U,oe){this._selectionService.setSelection(Q,U,oe)}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(Q,U){this._selectionService?.selectLines(Q,U)}_keyDown(Q){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;const U=this.browser.isMac&&this.options.macOptionIsMeta&&Q.altKey;if(!U&&!this._compositionHelper.keydown(Q))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;U||Q.key!=="Dead"&&Q.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const oe=(0,le.evaluateKeyboardEvent)(Q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Q),oe.type===3||oe.type===2){const me=this.rows-1;return this.scrollLines(oe.type===2?-me:me),this.cancel(Q,!0)}return oe.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Q)||(oe.cancel&&this.cancel(Q,!0),!oe.key||!!(Q.key&&!Q.ctrlKey&&!Q.altKey&&!Q.metaKey&&Q.key.length===1&&Q.key.charCodeAt(0)>=65&&Q.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(oe.key!==ae.C0.ETX&&oe.key!==ae.C0.CR||(this.textarea.value=""),this._onKey.fire({key:oe.key,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(oe.key,!0),!this.optionsService.rawOptions.screenReaderMode||Q.altKey||Q.ctrlKey?this.cancel(Q,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Q,U){const oe=Q.isMac&&!this.options.macOptionIsMeta&&U.altKey&&!U.ctrlKey&&!U.metaKey||Q.isWindows&&U.altKey&&U.ctrlKey&&!U.metaKey||Q.isWindows&&U.getModifierState("AltGraph");return U.type==="keypress"?oe:oe&&(!U.keyCode||U.keyCode>47)}_keyUp(Q){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1||((function(U){return U.keyCode===16||U.keyCode===17||U.keyCode===18})(Q)||this.focus(),this.updateCursorStyle(Q),this._keyPressHandled=!1)}_keyPress(Q){let U;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;if(this.cancel(Q),Q.charCode)U=Q.charCode;else if(Q.which===null||Q.which===void 0)U=Q.keyCode;else{if(Q.which===0||Q.charCode===0)return!1;U=Q.which}return!(!U||(Q.altKey||Q.ctrlKey||Q.metaKey)&&!this._isThirdLevelShift(this.browser,Q)||(U=String.fromCharCode(U),this._onKey.fire({key:U,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(U,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Q){if(Q.data&&Q.inputType==="insertText"&&(!Q.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const U=Q.data;return this.coreService.triggerDataEvent(U,!0),this.cancel(Q),!0}return!1}resize(Q,U){Q!==this.cols||U!==this.rows?super.resize(Q,U):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Q,U){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 Q=1;Q<this.rows;Q++)this.buffer.lines.push(this.buffer.getBlankLine(G.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const Q=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=Q,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(ae.C0.ESC+"[I"):this.coreService.triggerDataEvent(ae.C0.ESC+"[O")}_reportWindowsOptions(Q){if(this._renderService)switch(Q){case z.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const U=this._renderService.dimensions.css.canvas.width.toFixed(0),oe=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ae.C0.ESC}[4;${oe};${U}t`);break;case z.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const me=this._renderService.dimensions.css.cell.width.toFixed(0),Ce=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ae.C0.ESC}[6;${Ce};${me}t`)}}cancel(Q,U){if(this.options.cancelEvents||U)return Q.preventDefault(),Q.stopPropagation(),!1}}o.Terminal=_e},9924:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(f,p=1e3){this._renderCallback=f,this._debounceThresholdMS=p,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(f,p,g){this._rowCount=g,f=f!==void 0?f:0,p=p!==void 0?p:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,f):f,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,p):p;const _=Date.now();if(_-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=_,this._innerRefresh();else if(!this._additionalRefreshRequested){const C=_-this._lastRefreshMs,E=this._debounceThresholdMS-C;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),E)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const f=Math.max(this._rowStart,0),p=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(f,p)}}},1680:function(P,o,f){var p=this&&this.__decorate||function(u,l,h,S){var T,R=arguments.length,D=R<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,h):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(u,l,h,S);else for(var x=u.length-1;x>=0;x--)(T=u[x])&&(D=(R<3?T(D):R>3?T(l,h,D):T(l,h))||D);return R>3&&D&&Object.defineProperty(l,h,D),D},g=this&&this.__param||function(u,l){return function(h,S){l(h,S,u)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const _=f(3656),C=f(4725),E=f(8460),M=f(844),w=f(2585);let d=o.Viewport=class extends M.Disposable{constructor(u,l,h,S,T,R,D,x){super(),this._viewportElement=u,this._scrollArea=l,this._bufferService=h,this._optionsService=S,this._charSizeService=T,this._renderService=R,this._coreBrowserService=D,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 E.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((B=>this._activeBuffer=B.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((B=>this._renderDimensions=B))),this._handleThemeChange(x.colors),this.register(x.onChangeColors((B=>this._handleThemeChange(B)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(u){this._viewportElement.style.backgroundColor=u.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(u){if(u)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 l=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==l&&(this._lastRecordedBufferHeight=l,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const u=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==u&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=u),this._refreshAnimationFrame=null}syncScrollArea(u=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(u);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(u)}_handleScroll(u){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 l=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:l,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const u=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(u*(this._smoothScrollState.target-this._smoothScrollState.origin)),u<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(u,l){const h=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(l<0&&this._viewportElement.scrollTop!==0||l>0&&h<this._lastRecordedBufferHeight)||(u.cancelable&&u.preventDefault(),!1)}handleWheel(u){const l=this._getPixelsScrolled(u);return l!==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+l:this._smoothScrollState.target+=l,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=l,this._bubbleScroll(u,l))}scrollLines(u){if(u!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const l=u*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+l,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:u,suppressScrollEvent:!1})}_getPixelsScrolled(u){if(u.deltaY===0||u.shiftKey)return 0;let l=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_LINE?l*=this._currentRowHeight:u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._currentRowHeight*this._bufferService.rows),l}getBufferElements(u,l){let h,S="";const T=[],R=l??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let x=u;x<R;x++){const B=D.get(x);if(!B)continue;const K=D.get(x+1)?.isWrapped;if(S+=B.translateToString(!K),!K||x===D.length-1){const F=document.createElement("div");F.textContent=S,T.push(F),S.length>0&&(h=F),S=""}}return{bufferElements:T,cursorElement:h}}getLinesScrolled(u){if(u.deltaY===0||u.shiftKey)return 0;let l=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(l/=this._currentRowHeight+0,this._wheelPartialScroll+=l,l=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._bufferService.rows),l}_applyScrollModifier(u,l){const h=this._optionsService.rawOptions.fastScrollModifier;return h==="alt"&&l.altKey||h==="ctrl"&&l.ctrlKey||h==="shift"&&l.shiftKey?u*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:u*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(u){this._lastTouchY=u.touches[0].pageY}handleTouchMove(u){const l=this._lastTouchY-u.touches[0].pageY;return this._lastTouchY=u.touches[0].pageY,l!==0&&(this._viewportElement.scrollTop+=l,this._bubbleScroll(u,l))}};o.Viewport=d=p([g(2,w.IBufferService),g(3,w.IOptionsService),g(4,C.ICharSizeService),g(5,C.IRenderService),g(6,C.ICoreBrowserService),g(7,C.IThemeService)],d)},3107:function(P,o,f){var p=this&&this.__decorate||function(w,d,u,l){var h,S=arguments.length,T=S<3?d:l===null?l=Object.getOwnPropertyDescriptor(d,u):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,d,u,l);else for(var R=w.length-1;R>=0;R--)(h=w[R])&&(T=(S<3?h(T):S>3?h(d,u,T):h(d,u))||T);return S>3&&T&&Object.defineProperty(d,u,T),T},g=this&&this.__param||function(w,d){return function(u,l){d(u,l,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const _=f(4725),C=f(844),E=f(2585);let M=o.BufferDecorationRenderer=class extends C.Disposable{constructor(w,d,u,l,h){super(),this._screenElement=w,this._bufferService=d,this._coreBrowserService=u,this._decorationService=l,this._renderService=h,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,C.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 w of this._decorationService.decorations)this._renderDecoration(w);this._dimensionsChanged=!1}_renderDecoration(w){this._refreshStyle(w),this._dimensionsChanged&&this._refreshXPosition(w)}_createElement(w){const d=this._coreBrowserService.mainDocument.createElement("div");d.classList.add("xterm-decoration"),d.classList.toggle("xterm-decoration-top-layer",w?.options?.layer==="top"),d.style.width=`${Math.round((w.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,d.style.height=(w.options.height||1)*this._renderService.dimensions.css.cell.height+"px",d.style.top=(w.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",d.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const u=w.options.x??0;return u&&u>this._bufferService.cols&&(d.style.display="none"),this._refreshXPosition(w,d),d}_refreshStyle(w){const d=w.marker.line-this._bufferService.buffers.active.ydisp;if(d<0||d>=this._bufferService.rows)w.element&&(w.element.style.display="none",w.onRenderEmitter.fire(w.element));else{let u=this._decorationElements.get(w);u||(u=this._createElement(w),w.element=u,this._decorationElements.set(w,u),this._container.appendChild(u),w.onDispose((()=>{this._decorationElements.delete(w),u.remove()}))),u.style.top=d*this._renderService.dimensions.css.cell.height+"px",u.style.display=this._altBufferIsActive?"none":"block",w.onRenderEmitter.fire(u)}}_refreshXPosition(w,d=w.element){if(!d)return;const u=w.options.x??0;(w.options.anchor||"left")==="right"?d.style.right=u?u*this._renderService.dimensions.css.cell.width+"px":"":d.style.left=u?u*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(w){this._decorationElements.get(w)?.remove(),this._decorationElements.delete(w),w.dispose()}};o.BufferDecorationRenderer=M=p([g(1,E.IBufferService),g(2,_.ICoreBrowserService),g(3,E.IDecorationService),g(4,_.IRenderService)],M)},5871:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(f){if(f.options.overviewRulerOptions){for(const p of this._zones)if(p.color===f.options.overviewRulerOptions.color&&p.position===f.options.overviewRulerOptions.position){if(this._lineIntersectsZone(p,f.marker.line))return;if(this._lineAdjacentToZone(p,f.marker.line,f.options.overviewRulerOptions.position))return void this._addLineToZone(p,f.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=f.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=f.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=f.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=f.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:f.options.overviewRulerOptions.color,position:f.options.overviewRulerOptions.position,startBufferLine:f.marker.line,endBufferLine:f.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(f){this._linePadding=f}_lineIntersectsZone(f,p){return p>=f.startBufferLine&&p<=f.endBufferLine}_lineAdjacentToZone(f,p,g){return p>=f.startBufferLine-this._linePadding[g||"full"]&&p<=f.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(f,p){f.startBufferLine=Math.min(f.startBufferLine,p),f.endBufferLine=Math.max(f.endBufferLine,p)}}},5744:function(P,o,f){var p=this&&this.__decorate||function(h,S,T,R){var D,x=arguments.length,B=x<3?S:R===null?R=Object.getOwnPropertyDescriptor(S,T):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(h,S,T,R);else for(var K=h.length-1;K>=0;K--)(D=h[K])&&(B=(x<3?D(B):x>3?D(S,T,B):D(S,T))||B);return x>3&&B&&Object.defineProperty(S,T,B),B},g=this&&this.__param||function(h,S){return function(T,R){S(T,R,h)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const _=f(5871),C=f(4725),E=f(844),M=f(2585),w={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0};let l=o.OverviewRulerRenderer=class extends E.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(h,S,T,R,D,x,B){super(),this._viewportElement=h,this._screenElement=S,this._bufferService=T,this._decorationService=R,this._renderService=D,this._optionsService=x,this._coreBrowserService=B,this._colorZoneStore=new _.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,E.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 h=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);d.full=this._canvas.width,d.left=h,d.center=S,d.right=h,this._refreshDrawHeightConstants(),u.full=0,u.left=0,u.center=d.left,u.right=d.left+d.center}_refreshDrawHeightConstants(){w.full=Math.round(2*this._coreBrowserService.dpr);const h=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(h,12),6)*this._coreBrowserService.dpr);w.left=S,w.center=S,w.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.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 h=this._colorZoneStore.zones;for(const S of h)S.position!=="full"&&this._renderColorZone(S);for(const S of h)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(h){this._ctx.fillStyle=h.color,this._ctx.fillRect(u[h.position||"full"],Math.round((this._canvas.height-1)*(h.startBufferLine/this._bufferService.buffers.active.lines.length)-w[h.position||"full"]/2),d[h.position||"full"],Math.round((this._canvas.height-1)*((h.endBufferLine-h.startBufferLine)/this._bufferService.buffers.active.lines.length)+w[h.position||"full"]))}_queueRefresh(h,S){this._shouldUpdateDimensions=h||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=l=p([g(2,M.IBufferService),g(3,M.IDecorationService),g(4,C.IRenderService),g(5,M.IOptionsService),g(6,C.ICoreBrowserService)],l)},2950:function(P,o,f){var p=this&&this.__decorate||function(w,d,u,l){var h,S=arguments.length,T=S<3?d:l===null?l=Object.getOwnPropertyDescriptor(d,u):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,d,u,l);else for(var R=w.length-1;R>=0;R--)(h=w[R])&&(T=(S<3?h(T):S>3?h(d,u,T):h(d,u))||T);return S>3&&T&&Object.defineProperty(d,u,T),T},g=this&&this.__param||function(w,d){return function(u,l){d(u,l,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const _=f(4725),C=f(2585),E=f(2584);let M=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(w,d,u,l,h,S){this._textarea=w,this._compositionView=d,this._bufferService=u,this._optionsService=l,this._coreService=h,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(w){this._compositionView.textContent=w.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(w){if(this._isComposing||this._isSendingComposition){if(w.keyCode===229||w.keyCode===16||w.keyCode===17||w.keyCode===18)return!1;this._finalizeComposition(!1)}return w.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(w){if(this._compositionView.classList.remove("active"),this._isComposing=!1,w){const d={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let u;this._isSendingComposition=!1,d.start+=this._dataAlreadySent.length,u=this._isComposing?this._textarea.value.substring(d.start,d.end):this._textarea.value.substring(d.start),u.length>0&&this._coreService.triggerDataEvent(u,!0)}}),0)}else{this._isSendingComposition=!1;const d=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(d,!0)}}_handleAnyTextareaChanges(){const w=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const d=this._textarea.value,u=d.replace(w,"");this._dataAlreadySent=u,d.length>w.length?this._coreService.triggerDataEvent(u,!0):d.length<w.length?this._coreService.triggerDataEvent(`${E.C0.DEL}`,!0):d.length===w.length&&d!==w&&this._coreService.triggerDataEvent(d,!0)}}),0)}updateCompositionElements(w){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const d=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),u=this._renderService.dimensions.css.cell.height,l=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,h=d*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=h+"px",this._compositionView.style.top=l+"px",this._compositionView.style.height=u+"px",this._compositionView.style.lineHeight=u+"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=h+"px",this._textarea.style.top=l+"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"}w||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};o.CompositionHelper=M=p([g(2,C.IBufferService),g(3,C.IOptionsService),g(4,C.ICoreService),g(5,_.IRenderService)],M)},9806:(P,o)=>{function f(p,g,_){const C=_.getBoundingClientRect(),E=p.getComputedStyle(_),M=parseInt(E.getPropertyValue("padding-left")),w=parseInt(E.getPropertyValue("padding-top"));return[g.clientX-C.left-M,g.clientY-C.top-w]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=f,o.getCoords=function(p,g,_,C,E,M,w,d,u){if(!M)return;const l=f(p,g,_);return l?(l[0]=Math.ceil((l[0]+(u?w/2:0))/w),l[1]=Math.ceil(l[1]/d),l[0]=Math.min(Math.max(l[0],1),C+(u?1:0)),l[1]=Math.min(Math.max(l[1],1),E),l):void 0}},9504:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const p=f(2584);function g(d,u,l,h){const S=d-_(d,l),T=u-_(u,l),R=Math.abs(S-T)-(function(D,x,B){let K=0;const F=D-_(D,B),J=x-_(x,B);for(let O=0;O<Math.abs(F-J);O++){const te=C(D,x)==="A"?-1:1;B.buffer.lines.get(F+te*O)?.isWrapped&&K++}return K})(d,u,l);return w(R,M(C(d,u),h))}function _(d,u){let l=0,h=u.buffer.lines.get(d),S=h?.isWrapped;for(;S&&d>=0&&d<u.rows;)l++,h=u.buffer.lines.get(--d),S=h?.isWrapped;return l}function C(d,u){return d>u?"A":"B"}function E(d,u,l,h,S,T){let R=d,D=u,x="";for(;R!==l||D!==h;)R+=S?1:-1,S&&R>T.cols-1?(x+=T.buffer.translateBufferLineToString(D,!1,d,R),R=0,d=0,D++):!S&&R<0&&(x+=T.buffer.translateBufferLineToString(D,!1,0,d+1),R=T.cols-1,d=R,D--);return x+T.buffer.translateBufferLineToString(D,!1,d,R)}function M(d,u){const l=u?"O":"[";return p.C0.ESC+l+d}function w(d,u){d=Math.floor(d);let l="";for(let h=0;h<d;h++)l+=u;return l}o.moveToCellSequence=function(d,u,l,h){const S=l.buffer.x,T=l.buffer.y;if(!l.buffer.hasScrollback)return(function(x,B,K,F,J,O){return g(B,F,J,O).length===0?"":w(E(x,B,x,B-_(B,J),!1,J).length,M("D",O))})(S,T,0,u,l,h)+g(T,u,l,h)+(function(x,B,K,F,J,O){let te;te=g(B,F,J,O).length>0?F-_(F,J):B;const he=F,G=(function(ae,le,L,$,k,z){let Y;return Y=g(L,$,k,z).length>0?$-_($,k):le,ae<L&&Y<=$||ae>=L&&Y<$?"C":"D"})(x,B,K,F,J,O);return w(E(x,te,K,he,G==="C",J).length,M(G,O))})(S,T,d,u,l,h);let R;if(T===u)return R=S>d?"D":"C",w(Math.abs(S-d),M(R,h));R=T>u?"D":"C";const D=Math.abs(T-u);return w((function(x,B){return B.cols-x})(T>u?d:S,l)+(D-1)*l.cols+1+((T>u?S:d)-1),M(R,h))}},1296:function(P,o,f){var p=this&&this.__decorate||function(O,te,he,G){var ae,le=arguments.length,L=le<3?te:G===null?G=Object.getOwnPropertyDescriptor(te,he):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(O,te,he,G);else for(var $=O.length-1;$>=0;$--)(ae=O[$])&&(L=(le<3?ae(L):le>3?ae(te,he,L):ae(te,he))||L);return le>3&&L&&Object.defineProperty(te,he,L),L},g=this&&this.__param||function(O,te){return function(he,G){te(he,G,O)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const _=f(3787),C=f(2550),E=f(2223),M=f(6171),w=f(6052),d=f(4725),u=f(8055),l=f(8460),h=f(844),S=f(2585),T="xterm-dom-renderer-owner-",R="xterm-rows",D="xterm-fg-",x="xterm-bg-",B="xterm-focus",K="xterm-selection";let F=1,J=o.DomRenderer=class extends h.Disposable{constructor(O,te,he,G,ae,le,L,$,k,z,Y,ne,_e){super(),this._terminal=O,this._document=te,this._element=he,this._screenElement=G,this._viewportElement=ae,this._helperContainer=le,this._linkifier2=L,this._charSizeService=k,this._optionsService=z,this._bufferService=Y,this._coreBrowserService=ne,this._themeService=_e,this._terminalClass=F++,this._rowElements=[],this._selectionRenderModel=(0,w.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new l.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(R),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,M.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((Se=>this._injectCss(Se)))),this._injectCss(this._themeService.colors),this._rowFactory=$.createInstance(_.DomRendererRowFactory,document),this._element.classList.add(T+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((Se=>this._handleLinkHover(Se)))),this.register(this._linkifier2.onHideLinkUnderline((Se=>this._handleLinkLeave(Se)))),this.register((0,h.toDisposable)((()=>{this._element.classList.remove(T+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new C.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 O=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*O,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*O),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/O),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/O),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 he of this._rowElements)he.style.width=`${this.dimensions.css.canvas.width}px`,he.style.height=`${this.dimensions.css.cell.height}px`,he.style.lineHeight=`${this.dimensions.css.cell.height}px`,he.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const te=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=te,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(O){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let te=`${this._terminalSelector} .${R} { color: ${O.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;te+=`${this._terminalSelector} .${R} .xterm-dim { color: ${u.color.multiplyOpacity(O.foreground,.5).css};}`,te+=`${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 he=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,ae=`blink_block_${this._terminalClass}`;te+=`@keyframes ${he} { 50% { border-bottom-style: hidden; }}`,te+=`@keyframes ${G} { 50% { box-shadow: none; }}`,te+=`@keyframes ${ae} { 0% { background-color: ${O.cursor.css}; color: ${O.cursorAccent.css}; } 50% { background-color: inherit; color: ${O.cursor.css}; }}`,te+=`${this._terminalSelector} .${R}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${he} 1s step-end infinite;}${this._terminalSelector} .${R}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${R}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${ae} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${O.cursor.css}; color: ${O.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${O.cursor.css} !important; color: ${O.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${O.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${O.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${O.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,te+=`${this._terminalSelector} .${K} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${K} div { position: absolute; background-color: ${O.selectionBackgroundOpaque.css};}${this._terminalSelector} .${K} div { position: absolute; background-color: ${O.selectionInactiveBackgroundOpaque.css};}`;for(const[le,L]of O.ansi.entries())te+=`${this._terminalSelector} .${D}${le} { color: ${L.css}; }${this._terminalSelector} .${D}${le}.xterm-dim { color: ${u.color.multiplyOpacity(L,.5).css}; }${this._terminalSelector} .${x}${le} { background-color: ${L.css}; }`;te+=`${this._terminalSelector} .${D}${E.INVERTED_DEFAULT_COLOR} { color: ${u.color.opaque(O.background).css}; }${this._terminalSelector} .${D}${E.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${u.color.multiplyOpacity(u.color.opaque(O.background),.5).css}; }${this._terminalSelector} .${x}${E.INVERTED_DEFAULT_COLOR} { background-color: ${O.foreground.css}; }`,this._themeStyleElement.textContent=te}_setDefaultSpacing(){const O=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${O}px`,this._rowFactory.defaultSpacing=O}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(O,te){for(let he=this._rowElements.length;he<=te;he++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>te;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(O,te){this._refreshRowElements(O,te),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(B),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(B),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(O,te,he){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(O,te,he),this.renderRows(0,this._bufferService.rows-1),!O||!te)return;this._selectionRenderModel.update(this._terminal,O,te,he);const G=this._selectionRenderModel.viewportStartRow,ae=this._selectionRenderModel.viewportEndRow,le=this._selectionRenderModel.viewportCappedStartRow,L=this._selectionRenderModel.viewportCappedEndRow;if(le>=this._bufferService.rows||L<0)return;const $=this._document.createDocumentFragment();if(he){const k=O[0]>te[0];$.appendChild(this._createSelectionElement(le,k?te[0]:O[0],k?O[0]:te[0],L-le+1))}else{const k=G===le?O[0]:0,z=le===ae?te[0]:this._bufferService.cols;$.appendChild(this._createSelectionElement(le,k,z));const Y=L-le-1;if($.appendChild(this._createSelectionElement(le+1,0,this._bufferService.cols,Y)),le!==L){const ne=ae===L?te[0]:this._bufferService.cols;$.appendChild(this._createSelectionElement(L,0,ne))}}this._selectionContainer.appendChild($)}_createSelectionElement(O,te,he,G=1){const ae=this._document.createElement("div"),le=te*this.dimensions.css.cell.width;let L=this.dimensions.css.cell.width*(he-te);return le+L>this.dimensions.css.canvas.width&&(L=this.dimensions.css.canvas.width-le),ae.style.height=G*this.dimensions.css.cell.height+"px",ae.style.top=O*this.dimensions.css.cell.height+"px",ae.style.left=`${le}px`,ae.style.width=`${L}px`,ae}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 O of this._rowElements)O.replaceChildren()}renderRows(O,te){const he=this._bufferService.buffer,G=he.ybase+he.y,ae=Math.min(he.x,this._bufferService.cols-1),le=this._optionsService.rawOptions.cursorBlink,L=this._optionsService.rawOptions.cursorStyle,$=this._optionsService.rawOptions.cursorInactiveStyle;for(let k=O;k<=te;k++){const z=k+he.ydisp,Y=this._rowElements[k],ne=he.lines.get(z);if(!Y||!ne)break;Y.replaceChildren(...this._rowFactory.createRow(ne,z,z===G,L,$,ae,le,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${T}${this._terminalClass}`}_handleLinkHover(O){this._setCellUnderline(O.x1,O.x2,O.y1,O.y2,O.cols,!0)}_handleLinkLeave(O){this._setCellUnderline(O.x1,O.x2,O.y1,O.y2,O.cols,!1)}_setCellUnderline(O,te,he,G,ae,le){he<0&&(O=0),G<0&&(te=0);const L=this._bufferService.rows-1;he=Math.max(Math.min(he,L),0),G=Math.max(Math.min(G,L),0),ae=Math.min(ae,this._bufferService.cols);const $=this._bufferService.buffer,k=$.ybase+$.y,z=Math.min($.x,ae-1),Y=this._optionsService.rawOptions.cursorBlink,ne=this._optionsService.rawOptions.cursorStyle,_e=this._optionsService.rawOptions.cursorInactiveStyle;for(let Se=he;Se<=G;++Se){const Q=Se+$.ydisp,U=this._rowElements[Se],oe=$.lines.get(Q);if(!U||!oe)break;U.replaceChildren(...this._rowFactory.createRow(oe,Q,Q===k,ne,_e,z,Y,this.dimensions.css.cell.width,this._widthCache,le?Se===he?O:0:-1,le?(Se===G?te:ae)-1:-1))}}};o.DomRenderer=J=p([g(7,S.IInstantiationService),g(8,d.ICharSizeService),g(9,S.IOptionsService),g(10,S.IBufferService),g(11,d.ICoreBrowserService),g(12,d.IThemeService)],J)},3787:function(P,o,f){var p=this&&this.__decorate||function(R,D,x,B){var K,F=arguments.length,J=F<3?D:B===null?B=Object.getOwnPropertyDescriptor(D,x):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(R,D,x,B);else for(var O=R.length-1;O>=0;O--)(K=R[O])&&(J=(F<3?K(J):F>3?K(D,x,J):K(D,x))||J);return F>3&&J&&Object.defineProperty(D,x,J),J},g=this&&this.__param||function(R,D){return function(x,B){D(x,B,R)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const _=f(2223),C=f(643),E=f(511),M=f(2585),w=f(8055),d=f(4725),u=f(4269),l=f(6171),h=f(3734);let S=o.DomRendererRowFactory=class{constructor(R,D,x,B,K,F,J){this._document=R,this._characterJoinerService=D,this._optionsService=x,this._coreBrowserService=B,this._coreService=K,this._decorationService=F,this._themeService=J,this._workCell=new E.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,D,x){this._selectionStart=R,this._selectionEnd=D,this._columnSelectMode=x}createRow(R,D,x,B,K,F,J,O,te,he,G){const ae=[],le=this._characterJoinerService.getJoinedCharacters(D),L=this._themeService.colors;let $,k=R.getNoBgTrimmedLength();x&&k<F+1&&(k=F+1);let z=0,Y="",ne=0,_e=0,Se=0,Q=!1,U=0,oe=!1,me=0;const Ce=[],ye=he!==-1&&G!==-1;for(let Me=0;Me<k;Me++){R.loadCell(Me,this._workCell);let Ue=this._workCell.getWidth();if(Ue===0)continue;let Ve=!1,it=Me,De=this._workCell;if(le.length>0&&Me===le[0][0]){Ve=!0;const Ke=le.shift();De=new u.JoinedCellData(this._workCell,R.translateToString(!0,Ke[0],Ke[1]),Ke[1]-Ke[0]),it=Ke[1]-1,Ue=De.getWidth()}const ri=this._isCellInSelection(Me,D),pe=x&&Me===F,ve=ye&&Me>=he&&Me<=G;let we=!1;this._decorationService.forEachDecorationAtCell(Me,D,void 0,(Ke=>{we=!0}));let ze=De.getChars()||C.WHITESPACE_CELL_CHAR;if(ze===" "&&(De.isUnderline()||De.isOverline())&&(ze=" "),me=Ue*O-te.get(ze,De.isBold(),De.isItalic()),$){if(z&&(ri&&oe||!ri&&!oe&&De.bg===ne)&&(ri&&oe&&L.selectionForeground||De.fg===_e)&&De.extended.ext===Se&&ve===Q&&me===U&&!pe&&!Ve&&!we){De.isInvisible()?Y+=C.WHITESPACE_CELL_CHAR:Y+=ze,z++;continue}z&&($.textContent=Y),$=this._document.createElement("span"),z=0,Y=""}else $=this._document.createElement("span");if(ne=De.bg,_e=De.fg,Se=De.extended.ext,Q=ve,U=me,oe=ri,Ve&&F>=Me&&F<=it&&(F=Me),!this._coreService.isCursorHidden&&pe&&this._coreService.isCursorInitialized){if(Ce.push("xterm-cursor"),this._coreBrowserService.isFocused)J&&Ce.push("xterm-cursor-blink"),Ce.push(B==="bar"?"xterm-cursor-bar":B==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(K)switch(K){case"outline":Ce.push("xterm-cursor-outline");break;case"block":Ce.push("xterm-cursor-block");break;case"bar":Ce.push("xterm-cursor-bar");break;case"underline":Ce.push("xterm-cursor-underline")}}if(De.isBold()&&Ce.push("xterm-bold"),De.isItalic()&&Ce.push("xterm-italic"),De.isDim()&&Ce.push("xterm-dim"),Y=De.isInvisible()?C.WHITESPACE_CELL_CHAR:De.getChars()||C.WHITESPACE_CELL_CHAR,De.isUnderline()&&(Ce.push(`xterm-underline-${De.extended.underlineStyle}`),Y===" "&&(Y=" "),!De.isUnderlineColorDefault()))if(De.isUnderlineColorRGB())$.style.textDecorationColor=`rgb(${h.AttributeData.toColorRGB(De.getUnderlineColor()).join(",")})`;else{let Ke=De.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&De.isBold()&&Ke<8&&(Ke+=8),$.style.textDecorationColor=L.ansi[Ke].css}De.isOverline()&&(Ce.push("xterm-overline"),Y===" "&&(Y=" ")),De.isStrikethrough()&&Ce.push("xterm-strikethrough"),ve&&($.style.textDecoration="underline");let Ie=De.getFgColor(),Pe=De.getFgColorMode(),pt=De.getBgColor(),Ye=De.getBgColorMode();const ut=!!De.isInverse();if(ut){const Ke=Ie;Ie=pt,pt=Ke;const gs=Pe;Pe=Ye,Ye=gs}let bt,ki,xt,Si=!1;switch(this._decorationService.forEachDecorationAtCell(Me,D,void 0,(Ke=>{Ke.options.layer!=="top"&&Si||(Ke.backgroundColorRGB&&(Ye=50331648,pt=Ke.backgroundColorRGB.rgba>>8&16777215,bt=Ke.backgroundColorRGB),Ke.foregroundColorRGB&&(Pe=50331648,Ie=Ke.foregroundColorRGB.rgba>>8&16777215,ki=Ke.foregroundColorRGB),Si=Ke.options.layer==="top")})),!Si&&ri&&(bt=this._coreBrowserService.isFocused?L.selectionBackgroundOpaque:L.selectionInactiveBackgroundOpaque,pt=bt.rgba>>8&16777215,Ye=50331648,Si=!0,L.selectionForeground&&(Pe=50331648,Ie=L.selectionForeground.rgba>>8&16777215,ki=L.selectionForeground)),Si&&Ce.push("xterm-decoration-top"),Ye){case 16777216:case 33554432:xt=L.ansi[pt],Ce.push(`xterm-bg-${pt}`);break;case 50331648:xt=w.channels.toColor(pt>>16,pt>>8&255,255&pt),this._addStyle($,`background-color:#${T((pt>>>0).toString(16),"0",6)}`);break;default:ut?(xt=L.foreground,Ce.push(`xterm-bg-${_.INVERTED_DEFAULT_COLOR}`)):xt=L.background}switch(bt||De.isDim()&&(bt=w.color.multiplyOpacity(xt,.5)),Pe){case 16777216:case 33554432:De.isBold()&&Ie<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Ie+=8),this._applyMinimumContrast($,xt,L.ansi[Ie],De,bt,void 0)||Ce.push(`xterm-fg-${Ie}`);break;case 50331648:const Ke=w.channels.toColor(Ie>>16&255,Ie>>8&255,255&Ie);this._applyMinimumContrast($,xt,Ke,De,bt,ki)||this._addStyle($,`color:#${T(Ie.toString(16),"0",6)}`);break;default:this._applyMinimumContrast($,xt,L.foreground,De,bt,ki)||ut&&Ce.push(`xterm-fg-${_.INVERTED_DEFAULT_COLOR}`)}Ce.length&&($.className=Ce.join(" "),Ce.length=0),pe||Ve||we?$.textContent=Y:z++,me!==this.defaultSpacing&&($.style.letterSpacing=`${me}px`),ae.push($),Me=it}return $&&z&&($.textContent=Y),ae}_applyMinimumContrast(R,D,x,B,K,F){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,l.treatGlyphAsBackgroundColor)(B.getCode()))return!1;const J=this._getContrastCache(B);let O;if(K||F||(O=J.getColor(D.rgba,x.rgba)),O===void 0){const te=this._optionsService.rawOptions.minimumContrastRatio/(B.isDim()?2:1);O=w.color.ensureContrastRatio(K||D,F||x,te),J.setColor((K||D).rgba,(F||x).rgba,O??null)}return!!O&&(this._addStyle(R,`color:${O.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,D){R.setAttribute("style",`${R.getAttribute("style")||""}${D};`)}_isCellInSelection(R,D){const x=this._selectionStart,B=this._selectionEnd;return!(!x||!B)&&(this._columnSelectMode?x[0]<=B[0]?R>=x[0]&&D>=x[1]&&R<B[0]&&D<=B[1]:R<x[0]&&D>=x[1]&&R>=B[0]&&D<=B[1]:D>x[1]&&D<B[1]||x[1]===B[1]&&D===x[1]&&R>=x[0]&&R<B[0]||x[1]<B[1]&&D===B[1]&&R<B[0]||x[1]<B[1]&&D===x[1]&&R>=x[0])}};function T(R,D,x){for(;R.length<x;)R=D+R;return R}o.DomRendererRowFactory=S=p([g(1,d.ICharacterJoinerService),g(2,M.IOptionsService),g(3,d.ICoreBrowserService),g(4,M.ICoreService),g(5,M.IDecorationService),g(6,d.IThemeService)],S)},2550:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(f,p){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=f.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const g=f.createElement("span");g.classList.add("xterm-char-measure-element");const _=f.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontWeight="bold";const C=f.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontStyle="italic";const E=f.createElement("span");E.classList.add("xterm-char-measure-element"),E.style.fontWeight="bold",E.style.fontStyle="italic",this._measureElements=[g,_,C,E],this._container.appendChild(g),this._container.appendChild(_),this._container.appendChild(C),this._container.appendChild(E),p.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(f,p,g,_){f===this._font&&p===this._fontSize&&g===this._weight&&_===this._weightBold||(this._font=f,this._fontSize=p,this._weight=g,this._weightBold=_,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${_}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${_}`,this.clear())}get(f,p,g){let _=0;if(!p&&!g&&f.length===1&&(_=f.charCodeAt(0))<256){if(this._flat[_]!==-9999)return this._flat[_];const M=this._measure(f,0);return M>0&&(this._flat[_]=M),M}let C=f;p&&(C+="B"),g&&(C+="I");let E=this._holey.get(C);if(E===void 0){let M=0;p&&(M|=1),g&&(M|=2),E=this._measure(f,M),E>0&&this._holey.set(C,E)}return E}_measure(f,p){const g=this._measureElements[p];return g.textContent=f.repeat(32),g.offsetWidth/32}}},2223:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const p=f(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=p.isFirefox||p.isLegacyEdge?"bottom":"ideographic"},6171:(P,o)=>{function f(g){return 57508<=g&&g<=57558}function p(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},o.isPowerlineGlyph=f,o.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},o.isEmoji=p,o.allowRescaling=function(g,_,C,E){return _===1&&C>Math.ceil(1.5*E)&&g!==void 0&&g>255&&!p(g)&&!f(g)&&!(function(M){return 57344<=M&&M<=63743})(g)},o.treatGlyphAsBackgroundColor=function(g){return f(g)||(function(_){return 9472<=_&&_<=9631})(g)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(g,_,C=0){return(g-(2*Math.round(_)-C))%(2*Math.round(_))}},6052:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class f{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(g,_,C,E=!1){if(this.selectionStart=_,this.selectionEnd=C,!_||!C||_[0]===C[0]&&_[1]===C[1])return void this.clear();const M=g.buffers.active.ydisp,w=_[1]-M,d=C[1]-M,u=Math.max(w,0),l=Math.min(d,g.rows-1);u>=g.rows||l<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=E,this.viewportStartRow=w,this.viewportEndRow=d,this.viewportCappedStartRow=u,this.viewportCappedEndRow=l,this.startCol=_[0],this.endCol=C[0])}isCellSelected(g,_,C){return!!this.hasSelection&&(C-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?_>=this.startCol&&C>=this.viewportCappedStartRow&&_<this.endCol&&C<=this.viewportCappedEndRow:_<this.startCol&&C>=this.viewportCappedStartRow&&_>=this.endCol&&C<=this.viewportCappedEndRow:C>this.viewportStartRow&&C<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&C===this.viewportStartRow&&_>=this.startCol&&_<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportEndRow&&_<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportStartRow&&_>=this.startCol)}}o.createSelectionRenderModel=function(){return new f}},456:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(f){this._bufferService=f,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 f=this.selectionStart[0]+this.selectionStartLength;return f>this._bufferService.cols?f%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(f/this._bufferService.cols)-1]:[f%this._bufferService.cols,this.selectionStart[1]+Math.floor(f/this._bufferService.cols)]:[f,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const f=this.selectionStart[0]+this.selectionStartLength;return f>this._bufferService.cols?[f%this._bufferService.cols,this.selectionStart[1]+Math.floor(f/this._bufferService.cols)]:[Math.max(f,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const f=this.selectionStart,p=this.selectionEnd;return!(!f||!p)&&(f[1]>p[1]||f[1]===p[1]&&f[0]>p[0])}handleTrim(f){return this.selectionStart&&(this.selectionStart[1]-=f),this.selectionEnd&&(this.selectionEnd[1]-=f),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(P,o,f){var p=this&&this.__decorate||function(l,h,S,T){var R,D=arguments.length,x=D<3?h:T===null?T=Object.getOwnPropertyDescriptor(h,S):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(l,h,S,T);else for(var B=l.length-1;B>=0;B--)(R=l[B])&&(x=(D<3?R(x):D>3?R(h,S,x):R(h,S))||x);return D>3&&x&&Object.defineProperty(h,S,x),x},g=this&&this.__param||function(l,h){return function(S,T){h(S,T,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const _=f(2585),C=f(8460),E=f(844);let M=o.CharSizeService=class extends E.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(l,h,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new C.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new u(this._optionsService))}catch{this._measureStrategy=this.register(new d(l,h,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const l=this._measureStrategy.measure();l.width===this.width&&l.height===this.height||(this.width=l.width,this.height=l.height,this._onCharSizeChange.fire())}};o.CharSizeService=M=p([g(2,_.IOptionsService)],M);class w extends E.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(h,S){h!==void 0&&h>0&&S!==void 0&&S>0&&(this._result.width=h,this._result.height=S)}}class d extends w{constructor(h,S,T){super(),this._document=h,this._parentElement=S,this._optionsService=T,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 u extends w{constructor(h){super(),this._optionsService=h,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 h=this._ctx.measureText("W");return this._validateAndSet(h.width,h.fontBoundingBoxAscent+h.fontBoundingBoxDescent),this._result}}},4269:function(P,o,f){var p=this&&this.__decorate||function(u,l,h,S){var T,R=arguments.length,D=R<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,h):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(u,l,h,S);else for(var x=u.length-1;x>=0;x--)(T=u[x])&&(D=(R<3?T(D):R>3?T(l,h,D):T(l,h))||D);return R>3&&D&&Object.defineProperty(l,h,D),D},g=this&&this.__param||function(u,l){return function(h,S){l(h,S,u)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const _=f(3734),C=f(643),E=f(511),M=f(2585);class w extends _.AttributeData{constructor(l,h,S){super(),this.content=0,this.combinedData="",this.fg=l.fg,this.bg=l.bg,this.combinedData=h,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(l){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=w;let d=o.CharacterJoinerService=class yp{constructor(l){this._bufferService=l,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new E.CellData}register(l){const h={id:this._nextCharacterJoinerId++,handler:l};return this._characterJoiners.push(h),h.id}deregister(l){for(let h=0;h<this._characterJoiners.length;h++)if(this._characterJoiners[h].id===l)return this._characterJoiners.splice(h,1),!0;return!1}getJoinedCharacters(l){if(this._characterJoiners.length===0)return[];const h=this._bufferService.buffer.lines.get(l);if(!h||h.length===0)return[];const S=[],T=h.translateToString(!0);let R=0,D=0,x=0,B=h.getFg(0),K=h.getBg(0);for(let F=0;F<h.getTrimmedLength();F++)if(h.loadCell(F,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==B||this._workCell.bg!==K){if(F-R>1){const J=this._getJoinedRanges(T,x,D,h,R);for(let O=0;O<J.length;O++)S.push(J[O])}R=F,x=D,B=this._workCell.fg,K=this._workCell.bg}D+=this._workCell.getChars().length||C.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const F=this._getJoinedRanges(T,x,D,h,R);for(let J=0;J<F.length;J++)S.push(F[J])}return S}_getJoinedRanges(l,h,S,T,R){const D=l.substring(h,S);let x=[];try{x=this._characterJoiners[0].handler(D)}catch(B){console.error(B)}for(let B=1;B<this._characterJoiners.length;B++)try{const K=this._characterJoiners[B].handler(D);for(let F=0;F<K.length;F++)yp._mergeRanges(x,K[F])}catch(K){console.error(K)}return this._stringRangesToCellRanges(x,T,R),x}_stringRangesToCellRanges(l,h,S){let T=0,R=!1,D=0,x=l[T];if(x){for(let B=S;B<this._bufferService.cols;B++){const K=h.getWidth(B),F=h.getString(B).length||C.WHITESPACE_CELL_CHAR.length;if(K!==0){if(!R&&x[0]<=D&&(x[0]=B,R=!0),x[1]<=D){if(x[1]=B,x=l[++T],!x)break;x[0]<=D?(x[0]=B,R=!0):R=!1}D+=F}}x&&(x[1]=this._bufferService.cols)}}static _mergeRanges(l,h){let S=!1;for(let T=0;T<l.length;T++){const R=l[T];if(S){if(h[1]<=R[0])return l[T-1][1]=h[1],l;if(h[1]<=R[1])return l[T-1][1]=Math.max(h[1],R[1]),l.splice(T,1),l;l.splice(T,1),T--}else{if(h[1]<=R[0])return l.splice(T,0,h),l;if(h[1]<=R[1])return R[0]=Math.min(h[0],R[0]),l;h[0]<R[1]&&(R[0]=Math.min(h[0],R[0]),S=!0)}}return S?l[l.length-1][1]=h[1]:l.push(h),l}};o.CharacterJoinerService=d=p([g(0,M.IBufferService)],d)},5114:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const p=f(844),g=f(8460),_=f(3656);class C extends p.Disposable{constructor(w,d,u){super(),this._textarea=w,this._window=d,this.mainDocument=u,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new E(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((l=>this._screenDprMonitor.setWindow(l)))),this.register((0,g.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(w){this._window!==w&&(this._window=w,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=C;class E extends p.Disposable{constructor(w){super(),this._parentWindow=w,this._windowResizeListener=this.register(new p.MutableDisposable),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,p.toDisposable)((()=>this.clearListener())))}setWindow(w){this._parentWindow=w,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,_.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:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const p=f(844);class g extends p.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,p.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(C){return this.linkProviders.push(C),{dispose:()=>{const E=this.linkProviders.indexOf(C);E!==-1&&this.linkProviders.splice(E,1)}}}}o.LinkProviderService=g},8934:function(P,o,f){var p=this&&this.__decorate||function(M,w,d,u){var l,h=arguments.length,S=h<3?w:u===null?u=Object.getOwnPropertyDescriptor(w,d):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(M,w,d,u);else for(var T=M.length-1;T>=0;T--)(l=M[T])&&(S=(h<3?l(S):h>3?l(w,d,S):l(w,d))||S);return h>3&&S&&Object.defineProperty(w,d,S),S},g=this&&this.__param||function(M,w){return function(d,u){w(d,u,M)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const _=f(4725),C=f(9806);let E=o.MouseService=class{constructor(M,w){this._renderService=M,this._charSizeService=w}getCoords(M,w,d,u,l){return(0,C.getCoords)(window,M,w,d,u,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,l)}getMouseReportCoords(M,w){const d=(0,C.getCoordsRelativeToElement)(window,M,w);if(this._charSizeService.hasValidSize)return d[0]=Math.min(Math.max(d[0],0),this._renderService.dimensions.css.canvas.width-1),d[1]=Math.min(Math.max(d[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(d[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(d[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(d[0]),y:Math.floor(d[1])}}};o.MouseService=E=p([g(0,_.IRenderService),g(1,_.ICharSizeService)],E)},3230:function(P,o,f){var p=this&&this.__decorate||function(l,h,S,T){var R,D=arguments.length,x=D<3?h:T===null?T=Object.getOwnPropertyDescriptor(h,S):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(l,h,S,T);else for(var B=l.length-1;B>=0;B--)(R=l[B])&&(x=(D<3?R(x):D>3?R(h,S,x):R(h,S))||x);return D>3&&x&&Object.defineProperty(h,S,x),x},g=this&&this.__param||function(l,h){return function(S,T){h(S,T,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const _=f(6193),C=f(4725),E=f(8460),M=f(844),w=f(7226),d=f(2585);let u=o.RenderService=class extends M.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(l,h,S,T,R,D,x,B){super(),this._rowCount=l,this._charSizeService=T,this._renderer=this.register(new M.MutableDisposable),this._pausedResizeTask=new w.DebouncedIdleTask,this._observerDisposable=this.register(new M.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 E.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new E.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new E.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new E.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new _.RenderDebouncer(((K,F)=>this._renderRows(K,F)),x),this.register(this._renderDebouncer),this.register(x.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(S.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(S.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(S.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(B.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(x.window,h),this.register(x.onWindowChange((K=>this._registerIntersectionObserver(K,h))))}_registerIntersectionObserver(l,h){if("IntersectionObserver"in l){const S=new l.IntersectionObserver((T=>this._handleIntersectionChange(T[T.length-1])),{threshold:0});S.observe(h),this._observerDisposable.value=(0,M.toDisposable)((()=>S.disconnect()))}}_handleIntersectionChange(l){this._isPaused=l.isIntersecting===void 0?l.intersectionRatio===0:!l.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(l,h,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(l,h,this._rowCount))}_renderRows(l,h){this._renderer.value&&(l=Math.min(l,this._rowCount-1),h=Math.min(h,this._rowCount-1),this._renderer.value.renderRows(l,h),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:l,end:h}),this._onRender.fire({start:l,end:h}),this._isNextRenderRedrawOnly=!0)}resize(l,h){this._rowCount=h,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(l){this._renderer.value=l,this._renderer.value&&(this._renderer.value.onRequestRedraw((h=>this.refreshRows(h.start,h.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(l){return this._renderDebouncer.addRefreshCallback(l)}_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(l,h){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(l,h))):this._renderer.value.handleResize(l,h),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(l,h,S){this._selectionState.start=l,this._selectionState.end=h,this._selectionState.columnSelectMode=S,this._renderer.value?.handleSelectionChanged(l,h,S)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};o.RenderService=u=p([g(2,d.IOptionsService),g(3,C.ICharSizeService),g(4,d.IDecorationService),g(5,d.IBufferService),g(6,C.ICoreBrowserService),g(7,C.IThemeService)],u)},9312:function(P,o,f){var p=this&&this.__decorate||function(x,B,K,F){var J,O=arguments.length,te=O<3?B:F===null?F=Object.getOwnPropertyDescriptor(B,K):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")te=Reflect.decorate(x,B,K,F);else for(var he=x.length-1;he>=0;he--)(J=x[he])&&(te=(O<3?J(te):O>3?J(B,K,te):J(B,K))||te);return O>3&&te&&Object.defineProperty(B,K,te),te},g=this&&this.__param||function(x,B){return function(K,F){B(K,F,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const _=f(9806),C=f(9504),E=f(456),M=f(4725),w=f(8460),d=f(844),u=f(6114),l=f(4841),h=f(511),S=f(2585),T=" ",R=new RegExp(T,"g");let D=o.SelectionService=class extends d.Disposable{constructor(x,B,K,F,J,O,te,he,G){super(),this._element=x,this._screenElement=B,this._linkifier=K,this._bufferService=F,this._coreService=J,this._mouseService=O,this._optionsService=te,this._renderService=he,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new h.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new w.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new w.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=ae=>this._handleMouseMove(ae),this._mouseUpListener=ae=>this._handleMouseUp(ae),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((ae=>this._handleTrim(ae))),this.register(this._bufferService.buffers.onBufferActivate((ae=>this._handleBufferActivate(ae)))),this.enable(),this._model=new E.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,d.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 x=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!x||!B||x[0]===B[0]&&x[1]===B[1])}get selectionText(){const x=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;if(!x||!B)return"";const K=this._bufferService.buffer,F=[];if(this._activeSelectionMode===3){if(x[0]===B[0])return"";const J=x[0]<B[0]?x[0]:B[0],O=x[0]<B[0]?B[0]:x[0];for(let te=x[1];te<=B[1];te++){const he=K.translateBufferLineToString(te,!0,J,O);F.push(he)}}else{const J=x[1]===B[1]?B[0]:void 0;F.push(K.translateBufferLineToString(x[1],!0,x[0],J));for(let O=x[1]+1;O<=B[1]-1;O++){const te=K.lines.get(O),he=K.translateBufferLineToString(O,!0);te?.isWrapped?F[F.length-1]+=he:F.push(he)}if(x[1]!==B[1]){const O=K.lines.get(B[1]),te=K.translateBufferLineToString(B[1],!0,0,B[0]);O&&O.isWrapped?F[F.length-1]+=te:F.push(te)}}return F.map((J=>J.replace(R," "))).join(u.isWindows?`\r
|
|
14
|
+
`:`
|
|
15
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(x){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),u.isLinux&&x&&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(x){const B=this._getMouseBufferCoords(x),K=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!!(K&&F&&B)&&this._areCoordsInSelection(B,K,F)}isCellInSelection(x,B){const K=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!(!K||!F)&&this._areCoordsInSelection([x,B],K,F)}_areCoordsInSelection(x,B,K){return x[1]>B[1]&&x[1]<K[1]||B[1]===K[1]&&x[1]===B[1]&&x[0]>=B[0]&&x[0]<K[0]||B[1]<K[1]&&x[1]===K[1]&&x[0]<K[0]||B[1]<K[1]&&x[1]===B[1]&&x[0]>=B[0]}_selectWordAtCursor(x,B){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,l.getRangeLength)(K,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const F=this._getMouseBufferCoords(x);return!!F&&(this._selectWordAt(F,B),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(x,B){this._model.clearSelection(),x=Math.max(x,0),B=Math.min(B,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,x],this._model.selectionEnd=[this._bufferService.cols,B],this.refresh(),this._onSelectionChange.fire()}_handleTrim(x){this._model.handleTrim(x)&&this.refresh()}_getMouseBufferCoords(x){const B=this._mouseService.getCoords(x,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(B)return B[0]--,B[1]--,B[1]+=this._bufferService.buffer.ydisp,B}_getMouseEventScrollAmount(x){let B=(0,_.getCoordsRelativeToElement)(this._coreBrowserService.window,x,this._screenElement)[1];const K=this._renderService.dimensions.css.canvas.height;return B>=0&&B<=K?0:(B>K&&(B-=K),B=Math.min(Math.max(B,-50),50),B/=50,B/Math.abs(B)+Math.round(14*B))}shouldForceSelection(x){return u.isMac?x.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:x.shiftKey}handleMouseDown(x){if(this._mouseDownTimeStamp=x.timeStamp,(x.button!==2||!this.hasSelection)&&x.button===0){if(!this._enabled){if(!this.shouldForceSelection(x))return;x.stopPropagation()}x.preventDefault(),this._dragScrollAmount=0,this._enabled&&x.shiftKey?this._handleIncrementalClick(x):x.detail===1?this._handleSingleClick(x):x.detail===2?this._handleDoubleClick(x):x.detail===3&&this._handleTripleClick(x),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(x){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(x))}_handleSingleClick(x){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(x)?3:0,this._model.selectionStart=this._getMouseBufferCoords(x),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const B=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);B&&B.length!==this._model.selectionStart[0]&&B.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(x){this._selectWordAtCursor(x,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(x){const B=this._getMouseBufferCoords(x);B&&(this._activeSelectionMode=2,this._selectLineAt(B[1]))}shouldColumnSelect(x){return x.altKey&&!(u.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(x){if(x.stopImmediatePropagation(),!this._model.selectionStart)return;const B=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(x),!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(x),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 F=K.lines.get(this._model.selectionEnd[1]);F&&F.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}B&&B[0]===this._model.selectionEnd[0]&&B[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 x=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(x.ydisp+this._bufferService.rows,x.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=x.ydisp),this.refresh()}}_handleMouseUp(x){const B=x.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&B<500&&x.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const K=this._mouseService.getCoords(x,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(K&&K[0]!==void 0&&K[1]!==void 0){const F=(0,C.moveToCellSequence)(K[0]-1,K[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(F,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const x=this._model.finalSelectionStart,B=this._model.finalSelectionEnd,K=!(!x||!B||x[0]===B[0]&&x[1]===B[1]);K?x&&B&&(this._oldSelectionStart&&this._oldSelectionEnd&&x[0]===this._oldSelectionStart[0]&&x[1]===this._oldSelectionStart[1]&&B[0]===this._oldSelectionEnd[0]&&B[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(x,B,K)):this._oldHasSelection&&this._fireOnSelectionChange(x,B,K)}_fireOnSelectionChange(x,B,K){this._oldSelectionStart=x,this._oldSelectionEnd=B,this._oldHasSelection=K,this._onSelectionChange.fire()}_handleBufferActivate(x){this.clearSelection(),this._trimListener.dispose(),this._trimListener=x.activeBuffer.lines.onTrim((B=>this._handleTrim(B)))}_convertViewportColToCharacterIndex(x,B){let K=B;for(let F=0;B>=F;F++){const J=x.loadCell(F,this._workCell).getChars().length;this._workCell.getWidth()===0?K--:J>1&&B!==F&&(K+=J-1)}return K}setSelection(x,B,K){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[x,B],this._model.selectionStartLength=K,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(x){this._isClickInSelection(x)||(this._selectWordAtCursor(x,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(x,B,K=!0,F=!0){if(x[0]>=this._bufferService.cols)return;const J=this._bufferService.buffer,O=J.lines.get(x[1]);if(!O)return;const te=J.translateBufferLineToString(x[1],!1);let he=this._convertViewportColToCharacterIndex(O,x[0]),G=he;const ae=x[0]-he;let le=0,L=0,$=0,k=0;if(te.charAt(he)===" "){for(;he>0&&te.charAt(he-1)===" ";)he--;for(;G<te.length&&te.charAt(G+1)===" ";)G++}else{let ne=x[0],_e=x[0];O.getWidth(ne)===0&&(le++,ne--),O.getWidth(_e)===2&&(L++,_e++);const Se=O.getString(_e).length;for(Se>1&&(k+=Se-1,G+=Se-1);ne>0&&he>0&&!this._isCharWordSeparator(O.loadCell(ne-1,this._workCell));){O.loadCell(ne-1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===0?(le++,ne--):Q>1&&($+=Q-1,he-=Q-1),he--,ne--}for(;_e<O.length&&G+1<te.length&&!this._isCharWordSeparator(O.loadCell(_e+1,this._workCell));){O.loadCell(_e+1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===2?(L++,_e++):Q>1&&(k+=Q-1,G+=Q-1),G++,_e++}}G++;let z=he+ae-le+$,Y=Math.min(this._bufferService.cols,G-he+le+L-$-k);if(B||te.slice(he,G).trim()!==""){if(K&&z===0&&O.getCodePoint(0)!==32){const ne=J.lines.get(x[1]-1);if(ne&&O.isWrapped&&ne.getCodePoint(this._bufferService.cols-1)!==32){const _e=this._getWordAt([this._bufferService.cols-1,x[1]-1],!1,!0,!1);if(_e){const Se=this._bufferService.cols-_e.start;z-=Se,Y+=Se}}}if(F&&z+Y===this._bufferService.cols&&O.getCodePoint(this._bufferService.cols-1)!==32){const ne=J.lines.get(x[1]+1);if(ne?.isWrapped&&ne.getCodePoint(0)!==32){const _e=this._getWordAt([0,x[1]+1],!1,!1,!0);_e&&(Y+=_e.length)}}return{start:z,length:Y}}}_selectWordAt(x,B){const K=this._getWordAt(x,B);if(K){for(;K.start<0;)K.start+=this._bufferService.cols,x[1]--;this._model.selectionStart=[K.start,x[1]],this._model.selectionStartLength=K.length}}_selectToWordAt(x){const B=this._getWordAt(x,!0);if(B){let K=x[1];for(;B.start<0;)B.start+=this._bufferService.cols,K--;if(!this._model.areSelectionValuesReversed())for(;B.start+B.length>this._bufferService.cols;)B.length-=this._bufferService.cols,K++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?B.start:B.start+B.length,K]}}_isCharWordSeparator(x){return x.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(x.getChars())>=0}_selectLineAt(x){const B=this._bufferService.buffer.getWrappedRangeForLine(x),K={start:{x:0,y:B.first},end:{x:this._bufferService.cols-1,y:B.last}};this._model.selectionStart=[0,B.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,l.getRangeLength)(K,this._bufferService.cols)}};o.SelectionService=D=p([g(3,S.IBufferService),g(4,S.ICoreService),g(5,M.IMouseService),g(6,S.IOptionsService),g(7,M.IRenderService),g(8,M.ICoreBrowserService)],D)},4725:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const p=f(8343);o.ICharSizeService=(0,p.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,p.createDecorator)("CoreBrowserService"),o.IMouseService=(0,p.createDecorator)("MouseService"),o.IRenderService=(0,p.createDecorator)("RenderService"),o.ISelectionService=(0,p.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,p.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,p.createDecorator)("ThemeService"),o.ILinkProviderService=(0,p.createDecorator)("LinkProviderService")},6731:function(P,o,f){var p=this&&this.__decorate||function(D,x,B,K){var F,J=arguments.length,O=J<3?x:K===null?K=Object.getOwnPropertyDescriptor(x,B):K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(D,x,B,K);else for(var te=D.length-1;te>=0;te--)(F=D[te])&&(O=(J<3?F(O):J>3?F(x,B,O):F(x,B))||O);return J>3&&O&&Object.defineProperty(x,B,O),O},g=this&&this.__param||function(D,x){return function(B,K){x(B,K,D)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const _=f(7239),C=f(8055),E=f(8460),M=f(844),w=f(2585),d=C.css.toColor("#ffffff"),u=C.css.toColor("#000000"),l=C.css.toColor("#ffffff"),h=C.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[C.css.toColor("#2e3436"),C.css.toColor("#cc0000"),C.css.toColor("#4e9a06"),C.css.toColor("#c4a000"),C.css.toColor("#3465a4"),C.css.toColor("#75507b"),C.css.toColor("#06989a"),C.css.toColor("#d3d7cf"),C.css.toColor("#555753"),C.css.toColor("#ef2929"),C.css.toColor("#8ae234"),C.css.toColor("#fce94f"),C.css.toColor("#729fcf"),C.css.toColor("#ad7fa8"),C.css.toColor("#34e2e2"),C.css.toColor("#eeeeec")],x=[0,95,135,175,215,255];for(let B=0;B<216;B++){const K=x[B/36%6|0],F=x[B/6%6|0],J=x[B%6];D.push({css:C.channels.toCss(K,F,J),rgba:C.channels.toRgba(K,F,J)})}for(let B=0;B<24;B++){const K=8+10*B;D.push({css:C.channels.toCss(K,K,K),rgba:C.channels.toRgba(K,K,K)})}return D})());let T=o.ThemeService=class extends M.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new _.ColorContrastCache,this._halfContrastCache=new _.ColorContrastCache,this._onChangeColors=this.register(new E.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:d,background:u,cursor:l,cursorAccent:h,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:C.color.blend(u,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:C.color.blend(u,S),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(D={}){const x=this._colors;if(x.foreground=R(D.foreground,d),x.background=R(D.background,u),x.cursor=R(D.cursor,l),x.cursorAccent=R(D.cursorAccent,h),x.selectionBackgroundTransparent=R(D.selectionBackground,S),x.selectionBackgroundOpaque=C.color.blend(x.background,x.selectionBackgroundTransparent),x.selectionInactiveBackgroundTransparent=R(D.selectionInactiveBackground,x.selectionBackgroundTransparent),x.selectionInactiveBackgroundOpaque=C.color.blend(x.background,x.selectionInactiveBackgroundTransparent),x.selectionForeground=D.selectionForeground?R(D.selectionForeground,C.NULL_COLOR):void 0,x.selectionForeground===C.NULL_COLOR&&(x.selectionForeground=void 0),C.color.isOpaque(x.selectionBackgroundTransparent)&&(x.selectionBackgroundTransparent=C.color.opacity(x.selectionBackgroundTransparent,.3)),C.color.isOpaque(x.selectionInactiveBackgroundTransparent)&&(x.selectionInactiveBackgroundTransparent=C.color.opacity(x.selectionInactiveBackgroundTransparent,.3)),x.ansi=o.DEFAULT_ANSI_COLORS.slice(),x.ansi[0]=R(D.black,o.DEFAULT_ANSI_COLORS[0]),x.ansi[1]=R(D.red,o.DEFAULT_ANSI_COLORS[1]),x.ansi[2]=R(D.green,o.DEFAULT_ANSI_COLORS[2]),x.ansi[3]=R(D.yellow,o.DEFAULT_ANSI_COLORS[3]),x.ansi[4]=R(D.blue,o.DEFAULT_ANSI_COLORS[4]),x.ansi[5]=R(D.magenta,o.DEFAULT_ANSI_COLORS[5]),x.ansi[6]=R(D.cyan,o.DEFAULT_ANSI_COLORS[6]),x.ansi[7]=R(D.white,o.DEFAULT_ANSI_COLORS[7]),x.ansi[8]=R(D.brightBlack,o.DEFAULT_ANSI_COLORS[8]),x.ansi[9]=R(D.brightRed,o.DEFAULT_ANSI_COLORS[9]),x.ansi[10]=R(D.brightGreen,o.DEFAULT_ANSI_COLORS[10]),x.ansi[11]=R(D.brightYellow,o.DEFAULT_ANSI_COLORS[11]),x.ansi[12]=R(D.brightBlue,o.DEFAULT_ANSI_COLORS[12]),x.ansi[13]=R(D.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),x.ansi[14]=R(D.brightCyan,o.DEFAULT_ANSI_COLORS[14]),x.ansi[15]=R(D.brightWhite,o.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const B=Math.min(x.ansi.length-16,D.extendedAnsi.length);for(let K=0;K<B;K++)x.ansi[K+16]=R(D.extendedAnsi[K],o.DEFAULT_ANSI_COLORS[K+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){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[D]=this._restoreColors.ansi[D]}else for(let x=0;x<this._restoreColors.ansi.length;++x)this._colors.ansi[x]=this._restoreColors.ansi[x]}modifyColors(D){D(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 R(D,x){if(D!==void 0)try{return C.css.toColor(D)}catch{}return x}o.ThemeService=T=p([g(0,w.IOptionsService)],T)},6349:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const p=f(8460),g=f(844);class _ extends g.Disposable{constructor(E){super(),this._maxLength=E,this.onDeleteEmitter=this.register(new p.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new p.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new p.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(E){if(this._maxLength===E)return;const M=new Array(E);for(let w=0;w<Math.min(E,this.length);w++)M[w]=this._array[this._getCyclicIndex(w)];this._array=M,this._maxLength=E,this._startIndex=0}get length(){return this._length}set length(E){if(E>this._length)for(let M=this._length;M<E;M++)this._array[M]=void 0;this._length=E}get(E){return this._array[this._getCyclicIndex(E)]}set(E,M){this._array[this._getCyclicIndex(E)]=M}push(E){this._array[this._getCyclicIndex(this._length)]=E,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(E,M,...w){if(M){for(let d=E;d<this._length-M;d++)this._array[this._getCyclicIndex(d)]=this._array[this._getCyclicIndex(d+M)];this._length-=M,this.onDeleteEmitter.fire({index:E,amount:M})}for(let d=this._length-1;d>=E;d--)this._array[this._getCyclicIndex(d+w.length)]=this._array[this._getCyclicIndex(d)];for(let d=0;d<w.length;d++)this._array[this._getCyclicIndex(E+d)]=w[d];if(w.length&&this.onInsertEmitter.fire({index:E,amount:w.length}),this._length+w.length>this._maxLength){const d=this._length+w.length-this._maxLength;this._startIndex+=d,this._length=this._maxLength,this.onTrimEmitter.fire(d)}else this._length+=w.length}trimStart(E){E>this._length&&(E=this._length),this._startIndex+=E,this._length-=E,this.onTrimEmitter.fire(E)}shiftElements(E,M,w){if(!(M<=0)){if(E<0||E>=this._length)throw new Error("start argument out of range");if(E+w<0)throw new Error("Cannot shift elements in list beyond index 0");if(w>0){for(let u=M-1;u>=0;u--)this.set(E+u+w,this.get(E+u));const d=E+M+w-this._length;if(d>0)for(this._length+=d;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let d=0;d<M;d++)this.set(E+d+w,this.get(E+d))}}_getCyclicIndex(E){return(this._startIndex+E)%this._maxLength}}o.CircularList=_},1439:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function f(p,g=5){if(typeof p!="object")return p;const _=Array.isArray(p)?[]:{};for(const C in p)_[C]=g<=1?p[C]:p[C]&&f(p[C],g-1);return _}},8055:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let f=0,p=0,g=0,_=0;var C,E,M,w,d;function u(h){const S=h.toString(16);return S.length<2?"0"+S:S}function l(h,S){return h<S?(S+.05)/(h+.05):(h+.05)/(S+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(h){h.toCss=function(S,T,R,D){return D!==void 0?`#${u(S)}${u(T)}${u(R)}${u(D)}`:`#${u(S)}${u(T)}${u(R)}`},h.toRgba=function(S,T,R,D=255){return(S<<24|T<<16|R<<8|D)>>>0},h.toColor=function(S,T,R,D){return{css:h.toCss(S,T,R,D),rgba:h.toRgba(S,T,R,D)}}})(C||(o.channels=C={})),(function(h){function S(T,R){return _=Math.round(255*R),[f,p,g]=d.toChannels(T.rgba),{css:C.toCss(f,p,g,_),rgba:C.toRgba(f,p,g,_)}}h.blend=function(T,R){if(_=(255&R.rgba)/255,_===1)return{css:R.css,rgba:R.rgba};const D=R.rgba>>24&255,x=R.rgba>>16&255,B=R.rgba>>8&255,K=T.rgba>>24&255,F=T.rgba>>16&255,J=T.rgba>>8&255;return f=K+Math.round((D-K)*_),p=F+Math.round((x-F)*_),g=J+Math.round((B-J)*_),{css:C.toCss(f,p,g),rgba:C.toRgba(f,p,g)}},h.isOpaque=function(T){return(255&T.rgba)==255},h.ensureContrastRatio=function(T,R,D){const x=d.ensureContrastRatio(T.rgba,R.rgba,D);if(x)return C.toColor(x>>24&255,x>>16&255,x>>8&255)},h.opaque=function(T){const R=(255|T.rgba)>>>0;return[f,p,g]=d.toChannels(R),{css:C.toCss(f,p,g),rgba:R}},h.opacity=S,h.multiplyOpacity=function(T,R){return _=255&T.rgba,S(T,_*R/255)},h.toColorRGB=function(T){return[T.rgba>>24&255,T.rgba>>16&255,T.rgba>>8&255]}})(E||(o.color=E={})),(function(h){let S,T;try{const R=document.createElement("canvas");R.width=1,R.height=1;const D=R.getContext("2d",{willReadFrequently:!0});D&&(S=D,S.globalCompositeOperation="copy",T=S.createLinearGradient(0,0,1,1))}catch{}h.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return f=parseInt(R.slice(1,2).repeat(2),16),p=parseInt(R.slice(2,3).repeat(2),16),g=parseInt(R.slice(3,4).repeat(2),16),C.toColor(f,p,g);case 5:return f=parseInt(R.slice(1,2).repeat(2),16),p=parseInt(R.slice(2,3).repeat(2),16),g=parseInt(R.slice(3,4).repeat(2),16),_=parseInt(R.slice(4,5).repeat(2),16),C.toColor(f,p,g,_);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const D=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return f=parseInt(D[1]),p=parseInt(D[2]),g=parseInt(D[3]),_=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),C.toColor(f,p,g,_);if(!S||!T)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=T,S.fillStyle=R,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[f,p,g,_]=S.getImageData(0,0,1,1).data,_!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:C.toRgba(f,p,g,_),css:R}}})(M||(o.css=M={})),(function(h){function S(T,R,D){const x=T/255,B=R/255,K=D/255;return .2126*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))+.7152*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))+.0722*(K<=.03928?K/12.92:Math.pow((K+.055)/1.055,2.4))}h.relativeLuminance=function(T){return S(T>>16&255,T>>8&255,255&T)},h.relativeLuminance2=S})(w||(o.rgb=w={})),(function(h){function S(R,D,x){const B=R>>24&255,K=R>>16&255,F=R>>8&255;let J=D>>24&255,O=D>>16&255,te=D>>8&255,he=l(w.relativeLuminance2(J,O,te),w.relativeLuminance2(B,K,F));for(;he<x&&(J>0||O>0||te>0);)J-=Math.max(0,Math.ceil(.1*J)),O-=Math.max(0,Math.ceil(.1*O)),te-=Math.max(0,Math.ceil(.1*te)),he=l(w.relativeLuminance2(J,O,te),w.relativeLuminance2(B,K,F));return(J<<24|O<<16|te<<8|255)>>>0}function T(R,D,x){const B=R>>24&255,K=R>>16&255,F=R>>8&255;let J=D>>24&255,O=D>>16&255,te=D>>8&255,he=l(w.relativeLuminance2(J,O,te),w.relativeLuminance2(B,K,F));for(;he<x&&(J<255||O<255||te<255);)J=Math.min(255,J+Math.ceil(.1*(255-J))),O=Math.min(255,O+Math.ceil(.1*(255-O))),te=Math.min(255,te+Math.ceil(.1*(255-te))),he=l(w.relativeLuminance2(J,O,te),w.relativeLuminance2(B,K,F));return(J<<24|O<<16|te<<8|255)>>>0}h.blend=function(R,D){if(_=(255&D)/255,_===1)return D;const x=D>>24&255,B=D>>16&255,K=D>>8&255,F=R>>24&255,J=R>>16&255,O=R>>8&255;return f=F+Math.round((x-F)*_),p=J+Math.round((B-J)*_),g=O+Math.round((K-O)*_),C.toRgba(f,p,g)},h.ensureContrastRatio=function(R,D,x){const B=w.relativeLuminance(R>>8),K=w.relativeLuminance(D>>8);if(l(B,K)<x){if(K<B){const O=S(R,D,x),te=l(B,w.relativeLuminance(O>>8));if(te<x){const he=T(R,D,x);return te>l(B,w.relativeLuminance(he>>8))?O:he}return O}const F=T(R,D,x),J=l(B,w.relativeLuminance(F>>8));if(J<x){const O=S(R,D,x);return J>l(B,w.relativeLuminance(O>>8))?F:O}return F}},h.reduceLuminance=S,h.increaseLuminance=T,h.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(d||(o.rgba=d={})),o.toPaddedHex=u,o.contrastRatio=l},8969:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const p=f(844),g=f(2585),_=f(4348),C=f(7866),E=f(744),M=f(7302),w=f(6975),d=f(8460),u=f(1753),l=f(1480),h=f(7994),S=f(9282),T=f(5435),R=f(5981),D=f(2660);let x=!1;class B extends p.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new d.EventEmitter),this._onScroll.event((F=>{this._onScrollApi?.fire(F.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(F){for(const J in F)this.optionsService.options[J]=F[J]}constructor(F){super(),this._windowsWrappingHeuristics=this.register(new p.MutableDisposable),this._onBinary=this.register(new d.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new d.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new d.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new d.EventEmitter),this._instantiationService=new _.InstantiationService,this.optionsService=this.register(new M.OptionsService(F)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(E.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(C.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(w.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(u.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(l.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(h.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new T.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,d.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,d.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,d.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,d.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((J=>{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((J=>{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 R.WriteBuffer(((J,O)=>this._inputHandler.parse(J,O)))),this.register((0,d.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(F,J){this._writeBuffer.write(F,J)}writeSync(F,J){this._logService.logLevel<=g.LogLevelEnum.WARN&&!x&&(this._logService.warn("writeSync is unreliable and will be removed soon."),x=!0),this._writeBuffer.writeSync(F,J)}input(F,J=!0){this.coreService.triggerDataEvent(F,J)}resize(F,J){isNaN(F)||isNaN(J)||(F=Math.max(F,E.MINIMUM_COLS),J=Math.max(J,E.MINIMUM_ROWS),this._bufferService.resize(F,J))}scroll(F,J=!1){this._bufferService.scroll(F,J)}scrollLines(F,J,O){this._bufferService.scrollLines(F,J,O)}scrollPages(F){this.scrollLines(F*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(F){const J=F-this._bufferService.buffer.ydisp;J!==0&&this.scrollLines(J)}registerEscHandler(F,J){return this._inputHandler.registerEscHandler(F,J)}registerDcsHandler(F,J){return this._inputHandler.registerDcsHandler(F,J)}registerCsiHandler(F,J){return this._inputHandler.registerCsiHandler(F,J)}registerOscHandler(F,J){return this._inputHandler.registerOscHandler(F,J)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let F=!1;const J=this.optionsService.rawOptions.windowsPty;J&&J.buildNumber!==void 0&&J.buildNumber!==void 0?F=J.backend==="conpty"&&J.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(F=!0),F?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const F=[];F.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),F.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,p.toDisposable)((()=>{for(const J of F)J.dispose()}))}}}o.CoreTerminal=B},8460:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=f=>(this._listeners.push(f),{dispose:()=>{if(!this._disposed){for(let p=0;p<this._listeners.length;p++)if(this._listeners[p]===f)return void this._listeners.splice(p,1)}}})),this._event}fire(f,p){const g=[];for(let _=0;_<this._listeners.length;_++)g.push(this._listeners[_]);for(let _=0;_<g.length;_++)g[_].call(void 0,f,p)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(f,p){return f((g=>p.fire(g)))},o.runAndSubscribe=function(f,p){return p(void 0),f((g=>p(g)))}},5435:function(P,o,f){var p=this&&this.__decorate||function(le,L,$,k){var z,Y=arguments.length,ne=Y<3?L:k===null?k=Object.getOwnPropertyDescriptor(L,$):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ne=Reflect.decorate(le,L,$,k);else for(var _e=le.length-1;_e>=0;_e--)(z=le[_e])&&(ne=(Y<3?z(ne):Y>3?z(L,$,ne):z(L,$))||ne);return Y>3&&ne&&Object.defineProperty(L,$,ne),ne},g=this&&this.__param||function(le,L){return function($,k){L($,k,le)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const _=f(2584),C=f(7116),E=f(2015),M=f(844),w=f(482),d=f(8437),u=f(8460),l=f(643),h=f(511),S=f(3734),T=f(2585),R=f(1480),D=f(6242),x=f(6351),B=f(5941),K={"(":0,")":1,"*":2,"+":3,"-":1,".":2},F=131072;function J(le,L){if(le>24)return L.setWinLines||!1;switch(le){case 1:return!!L.restoreWin;case 2:return!!L.minimizeWin;case 3:return!!L.setWinPosition;case 4:return!!L.setWinSizePixels;case 5:return!!L.raiseWin;case 6:return!!L.lowerWin;case 7:return!!L.refreshWin;case 8:return!!L.setWinSizeChars;case 9:return!!L.maximizeWin;case 10:return!!L.fullscreenWin;case 11:return!!L.getWinState;case 13:return!!L.getWinPosition;case 14:return!!L.getWinSizePixels;case 15:return!!L.getScreenSizePixels;case 16:return!!L.getCellSizePixels;case 18:return!!L.getWinSizeChars;case 19:return!!L.getScreenSizeChars;case 20:return!!L.getIconTitle;case 21:return!!L.getWinTitle;case 22:return!!L.pushTitle;case 23:return!!L.popTitle;case 24:return!!L.setWinLines}return!1}var O;(function(le){le[le.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",le[le.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(O||(o.WindowsOptionsReportType=O={}));let te=0;class he extends M.Disposable{getAttrData(){return this._curAttrData}constructor(L,$,k,z,Y,ne,_e,Se,Q=new E.EscapeSequenceParser){super(),this._bufferService=L,this._charsetService=$,this._coreService=k,this._logService=z,this._optionsService=Y,this._oscLinkService=ne,this._coreMouseService=_e,this._unicodeService=Se,this._parser=Q,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new w.StringToUtf32,this._utf8Decoder=new w.Utf8ToUtf32,this._workCell=new h.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new u.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new u.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new u.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new u.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new u.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new u.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new u.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new u.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new u.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new u.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new u.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((U=>this._activeBuffer=U.activeBuffer))),this._parser.setCsiHandlerFallback(((U,oe)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(U),params:oe.toArray()})})),this._parser.setEscHandlerFallback((U=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(U)})})),this._parser.setExecuteHandlerFallback((U=>{this._logService.debug("Unknown EXECUTE code: ",{code:U})})),this._parser.setOscHandlerFallback(((U,oe,me)=>{this._logService.debug("Unknown OSC code: ",{identifier:U,action:oe,data:me})})),this._parser.setDcsHandlerFallback(((U,oe,me)=>{oe==="HOOK"&&(me=me.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(U),action:oe,payload:me})})),this._parser.setPrintHandler(((U,oe,me)=>this.print(U,oe,me))),this._parser.registerCsiHandler({final:"@"},(U=>this.insertChars(U))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(U=>this.scrollLeft(U))),this._parser.registerCsiHandler({final:"A"},(U=>this.cursorUp(U))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(U=>this.scrollRight(U))),this._parser.registerCsiHandler({final:"B"},(U=>this.cursorDown(U))),this._parser.registerCsiHandler({final:"C"},(U=>this.cursorForward(U))),this._parser.registerCsiHandler({final:"D"},(U=>this.cursorBackward(U))),this._parser.registerCsiHandler({final:"E"},(U=>this.cursorNextLine(U))),this._parser.registerCsiHandler({final:"F"},(U=>this.cursorPrecedingLine(U))),this._parser.registerCsiHandler({final:"G"},(U=>this.cursorCharAbsolute(U))),this._parser.registerCsiHandler({final:"H"},(U=>this.cursorPosition(U))),this._parser.registerCsiHandler({final:"I"},(U=>this.cursorForwardTab(U))),this._parser.registerCsiHandler({final:"J"},(U=>this.eraseInDisplay(U,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(U=>this.eraseInDisplay(U,!0))),this._parser.registerCsiHandler({final:"K"},(U=>this.eraseInLine(U,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(U=>this.eraseInLine(U,!0))),this._parser.registerCsiHandler({final:"L"},(U=>this.insertLines(U))),this._parser.registerCsiHandler({final:"M"},(U=>this.deleteLines(U))),this._parser.registerCsiHandler({final:"P"},(U=>this.deleteChars(U))),this._parser.registerCsiHandler({final:"S"},(U=>this.scrollUp(U))),this._parser.registerCsiHandler({final:"T"},(U=>this.scrollDown(U))),this._parser.registerCsiHandler({final:"X"},(U=>this.eraseChars(U))),this._parser.registerCsiHandler({final:"Z"},(U=>this.cursorBackwardTab(U))),this._parser.registerCsiHandler({final:"`"},(U=>this.charPosAbsolute(U))),this._parser.registerCsiHandler({final:"a"},(U=>this.hPositionRelative(U))),this._parser.registerCsiHandler({final:"b"},(U=>this.repeatPrecedingCharacter(U))),this._parser.registerCsiHandler({final:"c"},(U=>this.sendDeviceAttributesPrimary(U))),this._parser.registerCsiHandler({prefix:">",final:"c"},(U=>this.sendDeviceAttributesSecondary(U))),this._parser.registerCsiHandler({final:"d"},(U=>this.linePosAbsolute(U))),this._parser.registerCsiHandler({final:"e"},(U=>this.vPositionRelative(U))),this._parser.registerCsiHandler({final:"f"},(U=>this.hVPosition(U))),this._parser.registerCsiHandler({final:"g"},(U=>this.tabClear(U))),this._parser.registerCsiHandler({final:"h"},(U=>this.setMode(U))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(U=>this.setModePrivate(U))),this._parser.registerCsiHandler({final:"l"},(U=>this.resetMode(U))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(U=>this.resetModePrivate(U))),this._parser.registerCsiHandler({final:"m"},(U=>this.charAttributes(U))),this._parser.registerCsiHandler({final:"n"},(U=>this.deviceStatus(U))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(U=>this.deviceStatusPrivate(U))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(U=>this.softReset(U))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(U=>this.setCursorStyle(U))),this._parser.registerCsiHandler({final:"r"},(U=>this.setScrollRegion(U))),this._parser.registerCsiHandler({final:"s"},(U=>this.saveCursor(U))),this._parser.registerCsiHandler({final:"t"},(U=>this.windowOptions(U))),this._parser.registerCsiHandler({final:"u"},(U=>this.restoreCursor(U))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(U=>this.insertColumns(U))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(U=>this.deleteColumns(U))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(U=>this.selectProtected(U))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(U=>this.requestMode(U,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(U=>this.requestMode(U,!1))),this._parser.setExecuteHandler(_.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(_.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(_.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(_.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(_.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(_.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(_.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(_.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(_.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(_.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(_.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(_.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler((U=>(this.setTitle(U),this.setIconName(U),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((U=>this.setIconName(U)))),this._parser.registerOscHandler(2,new D.OscHandler((U=>this.setTitle(U)))),this._parser.registerOscHandler(4,new D.OscHandler((U=>this.setOrReportIndexedColor(U)))),this._parser.registerOscHandler(8,new D.OscHandler((U=>this.setHyperlink(U)))),this._parser.registerOscHandler(10,new D.OscHandler((U=>this.setOrReportFgColor(U)))),this._parser.registerOscHandler(11,new D.OscHandler((U=>this.setOrReportBgColor(U)))),this._parser.registerOscHandler(12,new D.OscHandler((U=>this.setOrReportCursorColor(U)))),this._parser.registerOscHandler(104,new D.OscHandler((U=>this.restoreIndexedColor(U)))),this._parser.registerOscHandler(110,new D.OscHandler((U=>this.restoreFgColor(U)))),this._parser.registerOscHandler(111,new D.OscHandler((U=>this.restoreBgColor(U)))),this._parser.registerOscHandler(112,new D.OscHandler((U=>this.restoreCursorColor(U)))),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 U in C.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:U},(()=>this.selectCharset("("+U))),this._parser.registerEscHandler({intermediates:")",final:U},(()=>this.selectCharset(")"+U))),this._parser.registerEscHandler({intermediates:"*",final:U},(()=>this.selectCharset("*"+U))),this._parser.registerEscHandler({intermediates:"+",final:U},(()=>this.selectCharset("+"+U))),this._parser.registerEscHandler({intermediates:"-",final:U},(()=>this.selectCharset("-"+U))),this._parser.registerEscHandler({intermediates:".",final:U},(()=>this.selectCharset("."+U))),this._parser.registerEscHandler({intermediates:"/",final:U},(()=>this.selectCharset("/"+U)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((U=>(this._logService.error("Parsing error: ",U),U))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new x.DcsHandler(((U,oe)=>this.requestStatusString(U,oe))))}_preserveStack(L,$,k,z){this._parseStack.paused=!0,this._parseStack.cursorStartX=L,this._parseStack.cursorStartY=$,this._parseStack.decodedLength=k,this._parseStack.position=z}_logSlowResolvingAsync(L){this._logService.logLevel<=T.LogLevelEnum.WARN&&Promise.race([L,new Promise((($,k)=>setTimeout((()=>k("#SLOW_TIMEOUT")),5e3)))]).catch(($=>{if($!=="#SLOW_TIMEOUT")throw $;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(L,$){let k,z=this._activeBuffer.x,Y=this._activeBuffer.y,ne=0;const _e=this._parseStack.paused;if(_e){if(k=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,$))return this._logSlowResolvingAsync(k),k;z=this._parseStack.cursorStartX,Y=this._parseStack.cursorStartY,this._parseStack.paused=!1,L.length>F&&(ne=this._parseStack.position+F)}if(this._logService.logLevel<=T.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof L=="string"?` "${L}"`:` "${Array.prototype.map.call(L,(U=>String.fromCharCode(U))).join("")}"`),typeof L=="string"?L.split("").map((U=>U.charCodeAt(0))):L),this._parseBuffer.length<L.length&&this._parseBuffer.length<F&&(this._parseBuffer=new Uint32Array(Math.min(L.length,F))),_e||this._dirtyRowTracker.clearRange(),L.length>F)for(let U=ne;U<L.length;U+=F){const oe=U+F<L.length?U+F:L.length,me=typeof L=="string"?this._stringDecoder.decode(L.substring(U,oe),this._parseBuffer):this._utf8Decoder.decode(L.subarray(U,oe),this._parseBuffer);if(k=this._parser.parse(this._parseBuffer,me))return this._preserveStack(z,Y,me,U),this._logSlowResolvingAsync(k),k}else if(!_e){const U=typeof L=="string"?this._stringDecoder.decode(L,this._parseBuffer):this._utf8Decoder.decode(L,this._parseBuffer);if(k=this._parser.parse(this._parseBuffer,U))return this._preserveStack(z,Y,U,0),this._logSlowResolvingAsync(k),k}this._activeBuffer.x===z&&this._activeBuffer.y===Y||this._onCursorMove.fire();const Se=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Q=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Q<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Q,this._bufferService.rows-1),Math.min(Se,this._bufferService.rows-1))}print(L,$,k){let z,Y;const ne=this._charsetService.charset,_e=this._optionsService.rawOptions.screenReaderMode,Se=this._bufferService.cols,Q=this._coreService.decPrivateModes.wraparound,U=this._coreService.modes.insertMode,oe=this._curAttrData;let me=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&k-$>0&&me.getWidth(this._activeBuffer.x-1)===2&&me.setCellFromCodepoint(this._activeBuffer.x-1,0,1,oe);let Ce=this._parser.precedingJoinState;for(let ye=$;ye<k;++ye){if(z=L[ye],z<127&&ne){const it=ne[String.fromCharCode(z)];it&&(z=it.charCodeAt(0))}const Me=this._unicodeService.charProperties(z,Ce);Y=R.UnicodeService.extractWidth(Me);const Ue=R.UnicodeService.extractShouldJoin(Me),Ve=Ue?R.UnicodeService.extractWidth(Ce):0;if(Ce=Me,_e&&this._onA11yChar.fire((0,w.stringFromCodePoint)(z)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Y-Ve>Se){if(Q){const it=me;let De=this._activeBuffer.x-Ve;for(this._activeBuffer.x=Ve,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),me=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ve>0&&me instanceof d.BufferLine&&me.copyCellsFrom(it,De,0,Ve,!1);De<Se;)it.setCellFromCodepoint(De++,0,1,oe)}else if(this._activeBuffer.x=Se-1,Y===2)continue}if(Ue&&this._activeBuffer.x){const it=me.getWidth(this._activeBuffer.x-1)?1:2;me.addCodepointToCell(this._activeBuffer.x-it,z,Y);for(let De=Y-Ve;--De>=0;)me.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}else if(U&&(me.insertCells(this._activeBuffer.x,Y-Ve,this._activeBuffer.getNullCell(oe)),me.getWidth(Se-1)===2&&me.setCellFromCodepoint(Se-1,l.NULL_CELL_CODE,l.NULL_CELL_WIDTH,oe)),me.setCellFromCodepoint(this._activeBuffer.x++,z,Y,oe),Y>0)for(;--Y;)me.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}this._parser.precedingJoinState=Ce,this._activeBuffer.x<Se&&k-$>0&&me.getWidth(this._activeBuffer.x)===0&&!me.hasContent(this._activeBuffer.x)&&me.setCellFromCodepoint(this._activeBuffer.x,0,1,oe),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(L,$){return L.final!=="t"||L.prefix||L.intermediates?this._parser.registerCsiHandler(L,$):this._parser.registerCsiHandler(L,(k=>!J(k.params[0],this._optionsService.rawOptions.windowOptions)||$(k)))}registerDcsHandler(L,$){return this._parser.registerDcsHandler(L,new x.DcsHandler($))}registerEscHandler(L,$){return this._parser.registerEscHandler(L,$)}registerOscHandler(L,$){return this._parser.registerOscHandler(L,new D.OscHandler($))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);L.hasWidth(this._activeBuffer.x)&&!L.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const L=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-L),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(L=this._bufferService.cols-1){this._activeBuffer.x=Math.min(L,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(L,$){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=L,this._activeBuffer.y=this._activeBuffer.scrollTop+$):(this._activeBuffer.x=L,this._activeBuffer.y=$),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(L,$){this._restrictCursor(),this._setCursor(this._activeBuffer.x+L,this._activeBuffer.y+$)}cursorUp(L){const $=this._activeBuffer.y-this._activeBuffer.scrollTop;return $>=0?this._moveCursor(0,-Math.min($,L.params[0]||1)):this._moveCursor(0,-(L.params[0]||1)),!0}cursorDown(L){const $=this._activeBuffer.scrollBottom-this._activeBuffer.y;return $>=0?this._moveCursor(0,Math.min($,L.params[0]||1)):this._moveCursor(0,L.params[0]||1),!0}cursorForward(L){return this._moveCursor(L.params[0]||1,0),!0}cursorBackward(L){return this._moveCursor(-(L.params[0]||1),0),!0}cursorNextLine(L){return this.cursorDown(L),this._activeBuffer.x=0,!0}cursorPrecedingLine(L){return this.cursorUp(L),this._activeBuffer.x=0,!0}cursorCharAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(L){return this._setCursor(L.length>=2?(L.params[1]||1)-1:0,(L.params[0]||1)-1),!0}charPosAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(L){return this._moveCursor(L.params[0]||1,0),!0}linePosAbsolute(L){return this._setCursor(this._activeBuffer.x,(L.params[0]||1)-1),!0}vPositionRelative(L){return this._moveCursor(0,L.params[0]||1),!0}hVPosition(L){return this.cursorPosition(L),!0}tabClear(L){const $=L.params[0];return $===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:$===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let $=L.params[0]||1;for(;$--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let $=L.params[0]||1;for(;$--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(L){const $=L.params[0];return $===1&&(this._curAttrData.bg|=536870912),$!==2&&$!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(L,$,k,z=!1,Y=!1){const ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);ne.replaceCells($,k,this._activeBuffer.getNullCell(this._eraseAttrData()),Y),z&&(ne.isWrapped=!1)}_resetBufferLine(L,$=!1){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);k&&(k.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),$),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+L),k.isWrapped=!1)}eraseInDisplay(L,$=!1){let k;switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:for(k=this._activeBuffer.y,this._dirtyRowTracker.markDirty(k),this._eraseInBufferLine(k++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,$);k<this._bufferService.rows;k++)this._resetBufferLine(k,$);this._dirtyRowTracker.markDirty(k);break;case 1:for(k=this._activeBuffer.y,this._dirtyRowTracker.markDirty(k),this._eraseInBufferLine(k,0,this._activeBuffer.x+1,!0,$),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(k+1).isWrapped=!1);k--;)this._resetBufferLine(k,$);this._dirtyRowTracker.markDirty(0);break;case 2:for(k=this._bufferService.rows,this._dirtyRowTracker.markDirty(k-1);k--;)this._resetBufferLine(k,$);this._dirtyRowTracker.markDirty(0);break;case 3:const z=this._activeBuffer.lines.length-this._bufferService.rows;z>0&&(this._activeBuffer.lines.trimStart(z),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-z,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-z,0),this._onScroll.fire(0))}return!0}eraseInLine(L,$=!1){switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,$);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,$);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,$)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(L){this._restrictCursor();let $=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const k=this._activeBuffer.ybase+this._activeBuffer.y,z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Y=this._bufferService.rows-1+this._activeBuffer.ybase-z+1;for(;$--;)this._activeBuffer.lines.splice(Y-1,1),this._activeBuffer.lines.splice(k,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(L){this._restrictCursor();let $=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const k=this._activeBuffer.ybase+this._activeBuffer.y;let z;for(z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,z=this._bufferService.rows-1+this._activeBuffer.ybase-z;$--;)this._activeBuffer.lines.splice(k,1),this._activeBuffer.lines.splice(z,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(L){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.insertCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(L){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.deleteCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(L){let $=L.params[0]||1;for(;$--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(L){let $=L.params[0]||1;for(;$--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(d.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=L.params[0]||1;for(let k=this._activeBuffer.scrollTop;k<=this._activeBuffer.scrollBottom;++k){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);z.deleteCells(0,$,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=L.params[0]||1;for(let k=this._activeBuffer.scrollTop;k<=this._activeBuffer.scrollBottom;++k){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);z.insertCells(0,$,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=L.params[0]||1;for(let k=this._activeBuffer.scrollTop;k<=this._activeBuffer.scrollBottom;++k){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);z.insertCells(this._activeBuffer.x,$,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=L.params[0]||1;for(let k=this._activeBuffer.scrollTop;k<=this._activeBuffer.scrollBottom;++k){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);z.deleteCells(this._activeBuffer.x,$,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(L){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(L.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(L){const $=this._parser.precedingJoinState;if(!$)return!0;const k=L.params[0]||1,z=R.UnicodeService.extractWidth($),Y=this._activeBuffer.x-z,ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Y),_e=new Uint32Array(ne.length*k);let Se=0;for(let U=0;U<ne.length;){const oe=ne.codePointAt(U)||0;_e[Se++]=oe,U+=oe>65535?2:1}let Q=Se;for(let U=1;U<k;++U)_e.copyWithin(Q,0,Se),Q+=Se;return this.print(_e,0,Q),!0}sendDeviceAttributesPrimary(L){return L.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(_.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(_.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(L){return L.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(_.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(_.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(L.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(_.C0.ESC+"[>83;40003;0c")),!0}_is(L){return(this._optionsService.rawOptions.termName+"").indexOf(L)===0}setMode(L){for(let $=0;$<L.length;$++)switch(L.params[$]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(L){for(let $=0;$<L.length;$++)switch(L.params[$]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,C.DEFAULT_CHARSET),this._charsetService.setgCharset(1,C.DEFAULT_CHARSET),this._charsetService.setgCharset(2,C.DEFAULT_CHARSET),this._charsetService.setgCharset(3,C.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(L){for(let $=0;$<L.length;$++)switch(L.params[$]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(L){for(let $=0;$<L.length;$++)switch(L.params[$]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),L.params[$]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(L,$){const k=this._coreService.decPrivateModes,{activeProtocol:z,activeEncoding:Y}=this._coreMouseService,ne=this._coreService,{buffers:_e,cols:Se}=this._bufferService,{active:Q,alt:U}=_e,oe=this._optionsService.rawOptions,me=Ue=>Ue?1:2,Ce=L.params[0];return ye=Ce,Me=$?Ce===2?4:Ce===4?me(ne.modes.insertMode):Ce===12?3:Ce===20?me(oe.convertEol):0:Ce===1?me(k.applicationCursorKeys):Ce===3?oe.windowOptions.setWinLines?Se===80?2:Se===132?1:0:0:Ce===6?me(k.origin):Ce===7?me(k.wraparound):Ce===8?3:Ce===9?me(z==="X10"):Ce===12?me(oe.cursorBlink):Ce===25?me(!ne.isCursorHidden):Ce===45?me(k.reverseWraparound):Ce===66?me(k.applicationKeypad):Ce===67?4:Ce===1e3?me(z==="VT200"):Ce===1002?me(z==="DRAG"):Ce===1003?me(z==="ANY"):Ce===1004?me(k.sendFocus):Ce===1005?4:Ce===1006?me(Y==="SGR"):Ce===1015?4:Ce===1016?me(Y==="SGR_PIXELS"):Ce===1048?1:Ce===47||Ce===1047||Ce===1049?me(Q===U):Ce===2004?me(k.bracketedPasteMode):0,ne.triggerDataEvent(`${_.C0.ESC}[${$?"":"?"}${ye};${Me}$y`),!0;var ye,Me}_updateAttrColor(L,$,k,z,Y){return $===2?(L|=50331648,L&=-16777216,L|=S.AttributeData.fromColorRGB([k,z,Y])):$===5&&(L&=-50331904,L|=33554432|255&k),L}_extractColor(L,$,k){const z=[0,0,-1,0,0,0];let Y=0,ne=0;do{if(z[ne+Y]=L.params[$+ne],L.hasSubParams($+ne)){const _e=L.getSubParams($+ne);let Se=0;do z[1]===5&&(Y=1),z[ne+Se+1+Y]=_e[Se];while(++Se<_e.length&&Se+ne+1+Y<z.length);break}if(z[1]===5&&ne+Y>=2||z[1]===2&&ne+Y>=5)break;z[1]&&(Y=1)}while(++ne+$<L.length&&ne+Y<z.length);for(let _e=2;_e<z.length;++_e)z[_e]===-1&&(z[_e]=0);switch(z[0]){case 38:k.fg=this._updateAttrColor(k.fg,z[1],z[3],z[4],z[5]);break;case 48:k.bg=this._updateAttrColor(k.bg,z[1],z[3],z[4],z[5]);break;case 58:k.extended=k.extended.clone(),k.extended.underlineColor=this._updateAttrColor(k.extended.underlineColor,z[1],z[3],z[4],z[5])}return ne}_processUnderline(L,$){$.extended=$.extended.clone(),(!~L||L>5)&&(L=1),$.extended.underlineStyle=L,$.fg|=268435456,L===0&&($.fg&=-268435457),$.updateExtended()}_processSGR0(L){L.fg=d.DEFAULT_ATTR_DATA.fg,L.bg=d.DEFAULT_ATTR_DATA.bg,L.extended=L.extended.clone(),L.extended.underlineStyle=0,L.extended.underlineColor&=-67108864,L.updateExtended()}charAttributes(L){if(L.length===1&&L.params[0]===0)return this._processSGR0(this._curAttrData),!0;const $=L.length;let k;const z=this._curAttrData;for(let Y=0;Y<$;Y++)k=L.params[Y],k>=30&&k<=37?(z.fg&=-50331904,z.fg|=16777216|k-30):k>=40&&k<=47?(z.bg&=-50331904,z.bg|=16777216|k-40):k>=90&&k<=97?(z.fg&=-50331904,z.fg|=16777224|k-90):k>=100&&k<=107?(z.bg&=-50331904,z.bg|=16777224|k-100):k===0?this._processSGR0(z):k===1?z.fg|=134217728:k===3?z.bg|=67108864:k===4?(z.fg|=268435456,this._processUnderline(L.hasSubParams(Y)?L.getSubParams(Y)[0]:1,z)):k===5?z.fg|=536870912:k===7?z.fg|=67108864:k===8?z.fg|=1073741824:k===9?z.fg|=2147483648:k===2?z.bg|=134217728:k===21?this._processUnderline(2,z):k===22?(z.fg&=-134217729,z.bg&=-134217729):k===23?z.bg&=-67108865:k===24?(z.fg&=-268435457,this._processUnderline(0,z)):k===25?z.fg&=-536870913:k===27?z.fg&=-67108865:k===28?z.fg&=-1073741825:k===29?z.fg&=2147483647:k===39?(z.fg&=-67108864,z.fg|=16777215&d.DEFAULT_ATTR_DATA.fg):k===49?(z.bg&=-67108864,z.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):k===38||k===48||k===58?Y+=this._extractColor(L,Y,z):k===53?z.bg|=1073741824:k===55?z.bg&=-1073741825:k===59?(z.extended=z.extended.clone(),z.extended.underlineColor=-1,z.updateExtended()):k===100?(z.fg&=-67108864,z.fg|=16777215&d.DEFAULT_ATTR_DATA.fg,z.bg&=-67108864,z.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",k);return!0}deviceStatus(L){switch(L.params[0]){case 5:this._coreService.triggerDataEvent(`${_.C0.ESC}[0n`);break;case 6:const $=this._activeBuffer.y+1,k=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${_.C0.ESC}[${$};${k}R`)}return!0}deviceStatusPrivate(L){if(L.params[0]===6){const $=this._activeBuffer.y+1,k=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${_.C0.ESC}[?${$};${k}R`)}return!0}softReset(L){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=d.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(L){const $=L.params[0]||1;switch($){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const k=$%2==1;return this._optionsService.options.cursorBlink=k,!0}setScrollRegion(L){const $=L.params[0]||1;let k;return(L.length<2||(k=L.params[1])>this._bufferService.rows||k===0)&&(k=this._bufferService.rows),k>$&&(this._activeBuffer.scrollTop=$-1,this._activeBuffer.scrollBottom=k-1,this._setCursor(0,0)),!0}windowOptions(L){if(!J(L.params[0],this._optionsService.rawOptions.windowOptions))return!0;const $=L.length>1?L.params[1]:0;switch(L.params[0]){case 14:$!==2&&this._onRequestWindowsOptionsReport.fire(O.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(O.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${_.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:$!==0&&$!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),$!==0&&$!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:$!==0&&$!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),$!==0&&$!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(L){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(L){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(L){return this._windowTitle=L,this._onTitleChange.fire(L),!0}setIconName(L){return this._iconName=L,!0}setOrReportIndexedColor(L){const $=[],k=L.split(";");for(;k.length>1;){const z=k.shift(),Y=k.shift();if(/^\d+$/.exec(z)){const ne=parseInt(z);if(ae(ne))if(Y==="?")$.push({type:0,index:ne});else{const _e=(0,B.parseColor)(Y);_e&&$.push({type:1,index:ne,color:_e})}}}return $.length&&this._onColor.fire($),!0}setHyperlink(L){const $=L.split(";");return!($.length<2)&&($[1]?this._createHyperlink($[0],$[1]):!$[0]&&this._finishHyperlink())}_createHyperlink(L,$){this._getCurrentLinkId()&&this._finishHyperlink();const k=L.split(":");let z;const Y=k.findIndex((ne=>ne.startsWith("id=")));return Y!==-1&&(z=k[Y].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:z,uri:$}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(L,$){const k=L.split(";");for(let z=0;z<k.length&&!($>=this._specialColors.length);++z,++$)if(k[z]==="?")this._onColor.fire([{type:0,index:this._specialColors[$]}]);else{const Y=(0,B.parseColor)(k[z]);Y&&this._onColor.fire([{type:1,index:this._specialColors[$],color:Y}])}return!0}setOrReportFgColor(L){return this._setOrReportSpecialColor(L,0)}setOrReportBgColor(L){return this._setOrReportSpecialColor(L,1)}setOrReportCursorColor(L){return this._setOrReportSpecialColor(L,2)}restoreIndexedColor(L){if(!L)return this._onColor.fire([{type:2}]),!0;const $=[],k=L.split(";");for(let z=0;z<k.length;++z)if(/^\d+$/.exec(k[z])){const Y=parseInt(k[z]);ae(Y)&&$.push({type:2,index:Y})}return $.length&&this._onColor.fire($),!0}restoreFgColor(L){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(L){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(L){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,C.DEFAULT_CHARSET),!0}selectCharset(L){return L.length!==2?(this.selectDefaultCharset(),!0):(L[0]==="/"||this._charsetService.setgCharset(K[L[0]],C.CHARSETS[L[1]]||C.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 L=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,L,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=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(L){return this._charsetService.setgLevel(L),!0}screenAlignmentPattern(){const L=new h.CellData;L.content=4194373,L.fg=this._curAttrData.fg,L.bg=this._curAttrData.bg,this._setCursor(0,0);for(let $=0;$<this._bufferService.rows;++$){const k=this._activeBuffer.ybase+this._activeBuffer.y+$,z=this._activeBuffer.lines.get(k);z&&(z.fill(L),z.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(L,$){const k=this._bufferService.buffer,z=this._optionsService.rawOptions;return(Y=>(this._coreService.triggerDataEvent(`${_.C0.ESC}${Y}${_.C0.ESC}\\`),!0))(L==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:L==='"p'?'P1$r61;1"p':L==="r"?`P1$r${k.scrollTop+1};${k.scrollBottom+1}r`:L==="m"?"P1$r0m":L===" q"?`P1$r${{block:2,underline:4,bar:6}[z.cursorStyle]-(z.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(L,$){this._dirtyRowTracker.markRangeDirty(L,$)}}o.InputHandler=he;let G=class{constructor(le){this._bufferService=le,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(le){le<this.start?this.start=le:le>this.end&&(this.end=le)}markRangeDirty(le,L){le>L&&(te=le,le=L,L=te),le<this.start&&(this.start=le),L>this.end&&(this.end=L)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function ae(le){return 0<=le&&le<256}G=p([g(0,T.IBufferService)],G)},844:(P,o)=>{function f(p){for(const g of p)g.dispose();p.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const p of this._disposables)p.dispose();this._disposables.length=0}register(p){return this._disposables.push(p),p}unregister(p){const g=this._disposables.indexOf(p);g!==-1&&this._disposables.splice(g,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(p){this._isDisposed||p===this._value||(this._value?.dispose(),this._value=p)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},o.toDisposable=function(p){return{dispose:p}},o.disposeArray=f,o.getDisposeArrayDisposable=function(p){return{dispose:()=>f(p)}}},1505:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class f{constructor(){this._data={}}set(g,_,C){this._data[g]||(this._data[g]={}),this._data[g][_]=C}get(g,_){return this._data[g]?this._data[g][_]:void 0}clear(){this._data={}}}o.TwoKeyMap=f,o.FourKeyMap=class{constructor(){this._data=new f}set(p,g,_,C,E){this._data.get(p,g)||this._data.set(p,g,new f),this._data.get(p,g).set(_,C,E)}get(p,g,_,C){return this._data.get(p,g)?.get(_,C)}clear(){this._data.clear()}}},6114:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const f=o.isNode?"node":navigator.userAgent,p=o.isNode?"node":navigator.platform;o.isFirefox=f.includes("Firefox"),o.isLegacyEdge=f.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(f),o.getSafariVersion=function(){if(!o.isSafari)return 0;const g=f.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(p),o.isIpad=p==="iPad",o.isIphone=p==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(p),o.isLinux=p.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(f)},6106:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let f=0;o.SortedList=class{constructor(p){this._getKey=p,this._array=[]}clear(){this._array.length=0}insert(p){this._array.length!==0?(f=this._search(this._getKey(p)),this._array.splice(f,0,p)):this._array.push(p)}delete(p){if(this._array.length===0)return!1;const g=this._getKey(p);if(g===void 0||(f=this._search(g),f===-1)||this._getKey(this._array[f])!==g)return!1;do if(this._array[f]===p)return this._array.splice(f,1),!0;while(++f<this._array.length&&this._getKey(this._array[f])===g);return!1}*getKeyIterator(p){if(this._array.length!==0&&(f=this._search(p),!(f<0||f>=this._array.length)&&this._getKey(this._array[f])===p))do yield this._array[f];while(++f<this._array.length&&this._getKey(this._array[f])===p)}forEachByKey(p,g){if(this._array.length!==0&&(f=this._search(p),!(f<0||f>=this._array.length)&&this._getKey(this._array[f])===p))do g(this._array[f]);while(++f<this._array.length&&this._getKey(this._array[f])===p)}values(){return[...this._array].values()}_search(p){let g=0,_=this._array.length-1;for(;_>=g;){let C=g+_>>1;const E=this._getKey(this._array[C]);if(E>p)_=C-1;else{if(!(E<p)){for(;C>0&&this._getKey(this._array[C-1])===p;)C--;return C}g=C+1}}return g}}},7226:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const p=f(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(E){this._tasks.push(E),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(E){this._idleCallback=void 0;let M=0,w=0,d=E.timeRemaining(),u=0;for(;this._i<this._tasks.length;){if(M=Date.now(),this._tasks[this._i]()||this._i++,M=Math.max(1,Date.now()-M),w=Math.max(M,w),u=E.timeRemaining(),1.5*w>u)return d-M<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(d-M))}ms`),void this._start();d=u}this.clear()}}class _ extends g{_requestCallback(E){return setTimeout((()=>E(this._createDeadline(16))))}_cancelCallback(E){clearTimeout(E)}_createDeadline(E){const M=Date.now()+E;return{timeRemaining:()=>Math.max(0,M-Date.now())}}}o.PriorityTaskQueue=_,o.IdleTaskQueue=!p.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(C){return requestIdleCallback(C)}_cancelCallback(C){cancelIdleCallback(C)}}:_,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(C){this._queue.clear(),this._queue.enqueue(C)}flush(){this._queue.flush()}}},9282:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const p=f(643);o.updateWindowsModeWrappedState=function(g){const _=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),C=_?.get(g.cols-1),E=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);E&&C&&(E.isWrapped=C[p.CHAR_DATA_CODE_INDEX]!==p.NULL_CELL_CODE&&C[p.CHAR_DATA_CODE_INDEX]!==p.WHITESPACE_CELL_CODE)}},3734:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class f{constructor(){this.fg=0,this.bg=0,this.extended=new p}static toColorRGB(_){return[_>>>16&255,_>>>8&255,255&_]}static fromColorRGB(_){return(255&_[0])<<16|(255&_[1])<<8|255&_[2]}clone(){const _=new f;return _.fg=this.fg,_.bg=this.bg,_.extended=this.extended.clone(),_}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=f;class p{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(_){this._ext=_}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(_){this._ext&=-469762049,this._ext|=_<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(_){this._ext&=-67108864,this._ext|=67108863&_}get urlId(){return this._urlId}set urlId(_){this._urlId=_}get underlineVariantOffset(){const _=(3758096384&this._ext)>>29;return _<0?4294967288^_:_}set underlineVariantOffset(_){this._ext&=536870911,this._ext|=_<<29&3758096384}constructor(_=0,C=0){this._ext=0,this._urlId=0,this._ext=_,this._urlId=C}clone(){return new p(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=p},9092:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const p=f(6349),g=f(7226),_=f(3734),C=f(8437),E=f(4634),M=f(511),w=f(643),d=f(4863),u=f(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(l,h,S){this._hasScrollback=l,this._optionsService=h,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=C.DEFAULT_ATTR_DATA.clone(),this.savedCharset=u.DEFAULT_CHARSET,this.markers=[],this._nullCell=M.CellData.fromCharData([0,w.NULL_CELL_CHAR,w.NULL_CELL_WIDTH,w.NULL_CELL_CODE]),this._whitespaceCell=M.CellData.fromCharData([0,w.WHITESPACE_CELL_CHAR,w.WHITESPACE_CELL_WIDTH,w.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new p.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(l){return l?(this._nullCell.fg=l.fg,this._nullCell.bg=l.bg,this._nullCell.extended=l.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new _.ExtendedAttrs),this._nullCell}getWhitespaceCell(l){return l?(this._whitespaceCell.fg=l.fg,this._whitespaceCell.bg=l.bg,this._whitespaceCell.extended=l.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new _.ExtendedAttrs),this._whitespaceCell}getBlankLine(l,h){return new C.BufferLine(this._bufferService.cols,this.getNullCell(l),h)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const l=this.ybase+this.y-this.ydisp;return l>=0&&l<this._rows}_getCorrectBufferLength(l){if(!this._hasScrollback)return l;const h=l+this._optionsService.rawOptions.scrollback;return h>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:h}fillViewportRows(l){if(this.lines.length===0){l===void 0&&(l=C.DEFAULT_ATTR_DATA);let h=this._rows;for(;h--;)this.lines.push(this.getBlankLine(l))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new p.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(l,h){const S=this.getNullCell(C.DEFAULT_ATTR_DATA);let T=0;const R=this._getCorrectBufferLength(h);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<l)for(let x=0;x<this.lines.length;x++)T+=+this.lines.get(x).resize(l,S);let D=0;if(this._rows<h)for(let x=this._rows;x<h;x++)this.lines.length<h+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new C.BufferLine(l,S)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new C.BufferLine(l,S)));else for(let x=this._rows;x>h;x--)this.lines.length>h+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const x=this.lines.length-R;x>0&&(this.lines.trimStart(x),this.ybase=Math.max(this.ybase-x,0),this.ydisp=Math.max(this.ydisp-x,0),this.savedY=Math.max(this.savedY-x,0)),this.lines.maxLength=R}this.x=Math.min(this.x,l-1),this.y=Math.min(this.y,h-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,l-1),this.scrollTop=0}if(this.scrollBottom=h-1,this._isReflowEnabled&&(this._reflow(l,h),this._cols>l))for(let D=0;D<this.lines.length;D++)T+=+this.lines.get(D).resize(l,S);this._cols=l,this._rows=h,this._memoryCleanupQueue.clear(),T>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let l=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,l=!1);let h=0;for(;this._memoryCleanupPosition<this.lines.length;)if(h+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),h>100)return!0;return l}get _isReflowEnabled(){const l=this._optionsService.rawOptions.windowsPty;return l&&l.buildNumber?this._hasScrollback&&l.backend==="conpty"&&l.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(l,h){this._cols!==l&&(l>this._cols?this._reflowLarger(l,h):this._reflowSmaller(l,h))}_reflowLarger(l,h){const S=(0,E.reflowLargerGetLinesToRemove)(this.lines,this._cols,l,this.ybase+this.y,this.getNullCell(C.DEFAULT_ATTR_DATA));if(S.length>0){const T=(0,E.reflowLargerCreateNewLayout)(this.lines,S);(0,E.reflowLargerApplyNewLayout)(this.lines,T.layout),this._reflowLargerAdjustViewport(l,h,T.countRemoved)}}_reflowLargerAdjustViewport(l,h,S){const T=this.getNullCell(C.DEFAULT_ATTR_DATA);let R=S;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<h&&this.lines.push(new C.BufferLine(l,T))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(l,h){const S=this.getNullCell(C.DEFAULT_ATTR_DATA),T=[];let R=0;for(let D=this.lines.length-1;D>=0;D--){let x=this.lines.get(D);if(!x||!x.isWrapped&&x.getTrimmedLength()<=l)continue;const B=[x];for(;x.isWrapped&&D>0;)x=this.lines.get(--D),B.unshift(x);const K=this.ybase+this.y;if(K>=D&&K<D+B.length)continue;const F=B[B.length-1].getTrimmedLength(),J=(0,E.reflowSmallerGetNewLineLengths)(B,this._cols,l),O=J.length-B.length;let te;te=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+O):Math.max(0,this.lines.length-this.lines.maxLength+O);const he=[];for(let k=0;k<O;k++){const z=this.getBlankLine(C.DEFAULT_ATTR_DATA,!0);he.push(z)}he.length>0&&(T.push({start:D+B.length+R,newLines:he}),R+=he.length),B.push(...he);let G=J.length-1,ae=J[G];ae===0&&(G--,ae=J[G]);let le=B.length-O-1,L=F;for(;le>=0;){const k=Math.min(L,ae);if(B[G]===void 0)break;if(B[G].copyCellsFrom(B[le],L-k,ae-k,k,!0),ae-=k,ae===0&&(G--,ae=J[G]),L-=k,L===0){le--;const z=Math.max(le,0);L=(0,E.getWrappedLineTrimmedLength)(B,z,this._cols)}}for(let k=0;k<B.length;k++)J[k]<l&&B[k].setCell(J[k],S);let $=O-te;for(;$-- >0;)this.ybase===0?this.y<h-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+R)-h&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+O,this.ybase+h-1)}if(T.length>0){const D=[],x=[];for(let G=0;G<this.lines.length;G++)x.push(this.lines.get(G));const B=this.lines.length;let K=B-1,F=0,J=T[F];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let O=0;for(let G=Math.min(this.lines.maxLength-1,B+R-1);G>=0;G--)if(J&&J.start>K+O){for(let ae=J.newLines.length-1;ae>=0;ae--)this.lines.set(G--,J.newLines[ae]);G++,D.push({index:K+1,amount:J.newLines.length}),O+=J.newLines.length,J=T[++F]}else this.lines.set(G,x[K--]);let te=0;for(let G=D.length-1;G>=0;G--)D[G].index+=te,this.lines.onInsertEmitter.fire(D[G]),te+=D[G].amount;const he=Math.max(0,B+R-this.lines.maxLength);he>0&&this.lines.onTrimEmitter.fire(he)}}translateBufferLineToString(l,h,S=0,T){const R=this.lines.get(l);return R?R.translateToString(h,S,T):""}getWrappedRangeForLine(l){let h=l,S=l;for(;h>0&&this.lines.get(h).isWrapped;)h--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:h,last:S}}setupTabStops(l){for(l!=null?this.tabs[l]||(l=this.prevStop(l)):(this.tabs={},l=0);l<this._cols;l+=this._optionsService.rawOptions.tabStopWidth)this.tabs[l]=!0}prevStop(l){for(l==null&&(l=this.x);!this.tabs[--l]&&l>0;);return l>=this._cols?this._cols-1:l<0?0:l}nextStop(l){for(l==null&&(l=this.x);!this.tabs[++l]&&l<this._cols;);return l>=this._cols?this._cols-1:l<0?0:l}clearMarkers(l){this._isClearing=!0;for(let h=0;h<this.markers.length;h++)this.markers[h].line===l&&(this.markers[h].dispose(),this.markers.splice(h--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let l=0;l<this.markers.length;l++)this.markers[l].dispose(),this.markers.splice(l--,1);this._isClearing=!1}addMarker(l){const h=new d.Marker(l);return this.markers.push(h),h.register(this.lines.onTrim((S=>{h.line-=S,h.line<0&&h.dispose()}))),h.register(this.lines.onInsert((S=>{h.line>=S.index&&(h.line+=S.amount)}))),h.register(this.lines.onDelete((S=>{h.line>=S.index&&h.line<S.index+S.amount&&h.dispose(),h.line>S.index&&(h.line-=S.amount)}))),h.register(h.onDispose((()=>this._removeMarker(h)))),h}_removeMarker(l){this._isClearing||this.markers.splice(this.markers.indexOf(l),1)}}},8437:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const p=f(3734),g=f(511),_=f(643),C=f(482);o.DEFAULT_ATTR_DATA=Object.freeze(new p.AttributeData);let E=0;class M{constructor(d,u,l=!1){this.isWrapped=l,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*d);const h=u||g.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]);for(let S=0;S<d;++S)this.setCell(S,h);this.length=d}get(d){const u=this._data[3*d+0],l=2097151&u;return[this._data[3*d+1],2097152&u?this._combined[d]:l?(0,C.stringFromCodePoint)(l):"",u>>22,2097152&u?this._combined[d].charCodeAt(this._combined[d].length-1):l]}set(d,u){this._data[3*d+1]=u[_.CHAR_DATA_ATTR_INDEX],u[_.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[d]=u[1],this._data[3*d+0]=2097152|d|u[_.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*d+0]=u[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|u[_.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(d){return this._data[3*d+0]>>22}hasWidth(d){return 12582912&this._data[3*d+0]}getFg(d){return this._data[3*d+1]}getBg(d){return this._data[3*d+2]}hasContent(d){return 4194303&this._data[3*d+0]}getCodePoint(d){const u=this._data[3*d+0];return 2097152&u?this._combined[d].charCodeAt(this._combined[d].length-1):2097151&u}isCombined(d){return 2097152&this._data[3*d+0]}getString(d){const u=this._data[3*d+0];return 2097152&u?this._combined[d]:2097151&u?(0,C.stringFromCodePoint)(2097151&u):""}isProtected(d){return 536870912&this._data[3*d+2]}loadCell(d,u){return E=3*d,u.content=this._data[E+0],u.fg=this._data[E+1],u.bg=this._data[E+2],2097152&u.content&&(u.combinedData=this._combined[d]),268435456&u.bg&&(u.extended=this._extendedAttrs[d]),u}setCell(d,u){2097152&u.content&&(this._combined[d]=u.combinedData),268435456&u.bg&&(this._extendedAttrs[d]=u.extended),this._data[3*d+0]=u.content,this._data[3*d+1]=u.fg,this._data[3*d+2]=u.bg}setCellFromCodepoint(d,u,l,h){268435456&h.bg&&(this._extendedAttrs[d]=h.extended),this._data[3*d+0]=u|l<<22,this._data[3*d+1]=h.fg,this._data[3*d+2]=h.bg}addCodepointToCell(d,u,l){let h=this._data[3*d+0];2097152&h?this._combined[d]+=(0,C.stringFromCodePoint)(u):2097151&h?(this._combined[d]=(0,C.stringFromCodePoint)(2097151&h)+(0,C.stringFromCodePoint)(u),h&=-2097152,h|=2097152):h=u|4194304,l&&(h&=-12582913,h|=l<<22),this._data[3*d+0]=h}insertCells(d,u,l){if((d%=this.length)&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,l),u<this.length-d){const h=new g.CellData;for(let S=this.length-d-u-1;S>=0;--S)this.setCell(d+u+S,this.loadCell(d+S,h));for(let S=0;S<u;++S)this.setCell(d+S,l)}else for(let h=d;h<this.length;++h)this.setCell(h,l);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,l)}deleteCells(d,u,l){if(d%=this.length,u<this.length-d){const h=new g.CellData;for(let S=0;S<this.length-d-u;++S)this.setCell(d+S,this.loadCell(d+u+S,h));for(let S=this.length-u;S<this.length;++S)this.setCell(S,l)}else for(let h=d;h<this.length;++h)this.setCell(h,l);d&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,l),this.getWidth(d)!==0||this.hasContent(d)||this.setCellFromCodepoint(d,0,1,l)}replaceCells(d,u,l,h=!1){if(h)for(d&&this.getWidth(d-1)===2&&!this.isProtected(d-1)&&this.setCellFromCodepoint(d-1,0,1,l),u<this.length&&this.getWidth(u-1)===2&&!this.isProtected(u)&&this.setCellFromCodepoint(u,0,1,l);d<u&&d<this.length;)this.isProtected(d)||this.setCell(d,l),d++;else for(d&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,l),u<this.length&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u,0,1,l);d<u&&d<this.length;)this.setCell(d++,l)}resize(d,u){if(d===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const l=3*d;if(d>this.length){if(this._data.buffer.byteLength>=4*l)this._data=new Uint32Array(this._data.buffer,0,l);else{const h=new Uint32Array(l);h.set(this._data),this._data=h}for(let h=this.length;h<d;++h)this.setCell(h,u)}else{this._data=this._data.subarray(0,l);const h=Object.keys(this._combined);for(let T=0;T<h.length;T++){const R=parseInt(h[T],10);R>=d&&delete this._combined[R]}const S=Object.keys(this._extendedAttrs);for(let T=0;T<S.length;T++){const R=parseInt(S[T],10);R>=d&&delete this._extendedAttrs[R]}}return this.length=d,4*l*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const d=new Uint32Array(this._data.length);return d.set(this._data),this._data=d,1}return 0}fill(d,u=!1){if(u)for(let l=0;l<this.length;++l)this.isProtected(l)||this.setCell(l,d);else{this._combined={},this._extendedAttrs={};for(let l=0;l<this.length;++l)this.setCell(l,d)}}copyFrom(d){this.length!==d.length?this._data=new Uint32Array(d._data):this._data.set(d._data),this.length=d.length,this._combined={};for(const u in d._combined)this._combined[u]=d._combined[u];this._extendedAttrs={};for(const u in d._extendedAttrs)this._extendedAttrs[u]=d._extendedAttrs[u];this.isWrapped=d.isWrapped}clone(){const d=new M(0);d._data=new Uint32Array(this._data),d.length=this.length;for(const u in this._combined)d._combined[u]=this._combined[u];for(const u in this._extendedAttrs)d._extendedAttrs[u]=this._extendedAttrs[u];return d.isWrapped=this.isWrapped,d}getTrimmedLength(){for(let d=this.length-1;d>=0;--d)if(4194303&this._data[3*d+0])return d+(this._data[3*d+0]>>22);return 0}getNoBgTrimmedLength(){for(let d=this.length-1;d>=0;--d)if(4194303&this._data[3*d+0]||50331648&this._data[3*d+2])return d+(this._data[3*d+0]>>22);return 0}copyCellsFrom(d,u,l,h,S){const T=d._data;if(S)for(let D=h-1;D>=0;D--){for(let x=0;x<3;x++)this._data[3*(l+D)+x]=T[3*(u+D)+x];268435456&T[3*(u+D)+2]&&(this._extendedAttrs[l+D]=d._extendedAttrs[u+D])}else for(let D=0;D<h;D++){for(let x=0;x<3;x++)this._data[3*(l+D)+x]=T[3*(u+D)+x];268435456&T[3*(u+D)+2]&&(this._extendedAttrs[l+D]=d._extendedAttrs[u+D])}const R=Object.keys(d._combined);for(let D=0;D<R.length;D++){const x=parseInt(R[D],10);x>=u&&(this._combined[x-u+l]=d._combined[x])}}translateToString(d,u,l,h){u=u??0,l=l??this.length,d&&(l=Math.min(l,this.getTrimmedLength())),h&&(h.length=0);let S="";for(;u<l;){const T=this._data[3*u+0],R=2097151&T,D=2097152&T?this._combined[u]:R?(0,C.stringFromCodePoint)(R):_.WHITESPACE_CELL_CHAR;if(S+=D,h)for(let x=0;x<D.length;++x)h.push(u);u+=T>>22||1}return h&&h.push(u),S}}o.BufferLine=M},4841:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(f,p){if(f.start.y>f.end.y)throw new Error(`Buffer range end (${f.end.x}, ${f.end.y}) cannot be before start (${f.start.x}, ${f.start.y})`);return p*(f.end.y-f.start.y)+(f.end.x-f.start.x+1)}},4634:(P,o)=>{function f(p,g,_){if(g===p.length-1)return p[g].getTrimmedLength();const C=!p[g].hasContent(_-1)&&p[g].getWidth(_-1)===1,E=p[g+1].getWidth(0)===2;return C&&E?_-1:_}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(p,g,_,C,E){const M=[];for(let w=0;w<p.length-1;w++){let d=w,u=p.get(++d);if(!u.isWrapped)continue;const l=[p.get(w)];for(;d<p.length&&u.isWrapped;)l.push(u),u=p.get(++d);if(C>=w&&C<d){w+=l.length-1;continue}let h=0,S=f(l,h,g),T=1,R=0;for(;T<l.length;){const x=f(l,T,g),B=x-R,K=_-S,F=Math.min(B,K);l[h].copyCellsFrom(l[T],R,S,F,!1),S+=F,S===_&&(h++,S=0),R+=F,R===x&&(T++,R=0),S===0&&h!==0&&l[h-1].getWidth(_-1)===2&&(l[h].copyCellsFrom(l[h-1],_-1,S++,1,!1),l[h-1].setCell(_-1,E))}l[h].replaceCells(S,_,E);let D=0;for(let x=l.length-1;x>0&&(x>h||l[x].getTrimmedLength()===0);x--)D++;D>0&&(M.push(w+l.length-D),M.push(D)),w+=l.length-1}return M},o.reflowLargerCreateNewLayout=function(p,g){const _=[];let C=0,E=g[C],M=0;for(let w=0;w<p.length;w++)if(E===w){const d=g[++C];p.onDeleteEmitter.fire({index:w-M,amount:d}),w+=d-1,M+=d,E=g[++C]}else _.push(w);return{layout:_,countRemoved:M}},o.reflowLargerApplyNewLayout=function(p,g){const _=[];for(let C=0;C<g.length;C++)_.push(p.get(g[C]));for(let C=0;C<_.length;C++)p.set(C,_[C]);p.length=g.length},o.reflowSmallerGetNewLineLengths=function(p,g,_){const C=[],E=p.map(((u,l)=>f(p,l,g))).reduce(((u,l)=>u+l));let M=0,w=0,d=0;for(;d<E;){if(E-d<_){C.push(E-d);break}M+=_;const u=f(p,w,g);M>u&&(M-=u,w++);const l=p[w].getWidth(M-1)===2;l&&M--;const h=l?_-1:_;C.push(h),d+=h}return C},o.getWrappedLineTrimmedLength=f},5295:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const p=f(8460),g=f(844),_=f(9092);class C extends g.Disposable{constructor(M,w){super(),this._optionsService=M,this._bufferService=w,this._onBufferActivate=this.register(new p.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 _.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new _.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(M){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(M),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(M,w){this._normal.resize(M,w),this._alt.resize(M,w),this.setupTabStops(M)}setupTabStops(M){this._normal.setupTabStops(M),this._alt.setupTabStops(M)}}o.BufferSet=C},511:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const p=f(482),g=f(643),_=f(3734);class C extends _.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new _.ExtendedAttrs,this.combinedData=""}static fromCharData(M){const w=new C;return w.setFromCharData(M),w}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,p.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(M){this.fg=M[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(M[g.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(M[g.CHAR_DATA_CHAR_INDEX].length===2){const d=M[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=d&&d<=56319){const u=M[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=u&&u<=57343?this.content=1024*(d-55296)+u-56320+65536|M[g.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=M[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|M[g.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=M[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|M[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=C},643:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const p=f(8460),g=f(844);class _{get id(){return this._id}constructor(E){this.line=E,this.isDisposed=!1,this._disposables=[],this._id=_._nextId++,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(E){return this._disposables.push(E),E}}o.Marker=_,_._nextId=1},7116:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(P,o)=>{var f,p,g;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(_){_.NUL="\0",_.SOH="",_.STX="",_.ETX="",_.EOT="",_.ENQ="",_.ACK="",_.BEL="\x07",_.BS="\b",_.HT=" ",_.LF=`
|
|
16
|
+
`,_.VT="\v",_.FF="\f",_.CR="\r",_.SO="",_.SI="",_.DLE="",_.DC1="",_.DC2="",_.DC3="",_.DC4="",_.NAK="",_.SYN="",_.ETB="",_.CAN="",_.EM="",_.SUB="",_.ESC="\x1B",_.FS="",_.GS="",_.RS="",_.US="",_.SP=" ",_.DEL=""})(f||(o.C0=f={})),(function(_){_.PAD="",_.HOP="",_.BPH="",_.NBH="",_.IND="",_.NEL="
",_.SSA="",_.ESA="",_.HTS="",_.HTJ="",_.VTS="",_.PLD="",_.PLU="",_.RI="",_.SS2="",_.SS3="",_.DCS="",_.PU1="",_.PU2="",_.STS="",_.CCH="",_.MW="",_.SPA="",_.EPA="",_.SOS="",_.SGCI="",_.SCI="",_.CSI="",_.ST="",_.OSC="",_.PM="",_.APC=""})(p||(o.C1=p={})),(function(_){_.ST=`${f.ESC}\\`})(g||(o.C1_ESCAPED=g={}))},7399:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const p=f(2584),g={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(_,C,E,M){const w={type:0,cancel:!1,key:void 0},d=(_.shiftKey?1:0)|(_.altKey?2:0)|(_.ctrlKey?4:0)|(_.metaKey?8:0);switch(_.keyCode){case 0:_.key==="UIKeyInputUpArrow"?w.key=C?p.C0.ESC+"OA":p.C0.ESC+"[A":_.key==="UIKeyInputLeftArrow"?w.key=C?p.C0.ESC+"OD":p.C0.ESC+"[D":_.key==="UIKeyInputRightArrow"?w.key=C?p.C0.ESC+"OC":p.C0.ESC+"[C":_.key==="UIKeyInputDownArrow"&&(w.key=C?p.C0.ESC+"OB":p.C0.ESC+"[B");break;case 8:w.key=_.ctrlKey?"\b":p.C0.DEL,_.altKey&&(w.key=p.C0.ESC+w.key);break;case 9:if(_.shiftKey){w.key=p.C0.ESC+"[Z";break}w.key=p.C0.HT,w.cancel=!0;break;case 13:w.key=_.altKey?p.C0.ESC+p.C0.CR:p.C0.CR,w.cancel=!0;break;case 27:w.key=p.C0.ESC,_.altKey&&(w.key=p.C0.ESC+p.C0.ESC),w.cancel=!0;break;case 37:if(_.metaKey)break;d?(w.key=p.C0.ESC+"[1;"+(d+1)+"D",w.key===p.C0.ESC+"[1;3D"&&(w.key=p.C0.ESC+(E?"b":"[1;5D"))):w.key=C?p.C0.ESC+"OD":p.C0.ESC+"[D";break;case 39:if(_.metaKey)break;d?(w.key=p.C0.ESC+"[1;"+(d+1)+"C",w.key===p.C0.ESC+"[1;3C"&&(w.key=p.C0.ESC+(E?"f":"[1;5C"))):w.key=C?p.C0.ESC+"OC":p.C0.ESC+"[C";break;case 38:if(_.metaKey)break;d?(w.key=p.C0.ESC+"[1;"+(d+1)+"A",E||w.key!==p.C0.ESC+"[1;3A"||(w.key=p.C0.ESC+"[1;5A")):w.key=C?p.C0.ESC+"OA":p.C0.ESC+"[A";break;case 40:if(_.metaKey)break;d?(w.key=p.C0.ESC+"[1;"+(d+1)+"B",E||w.key!==p.C0.ESC+"[1;3B"||(w.key=p.C0.ESC+"[1;5B")):w.key=C?p.C0.ESC+"OB":p.C0.ESC+"[B";break;case 45:_.shiftKey||_.ctrlKey||(w.key=p.C0.ESC+"[2~");break;case 46:w.key=d?p.C0.ESC+"[3;"+(d+1)+"~":p.C0.ESC+"[3~";break;case 36:w.key=d?p.C0.ESC+"[1;"+(d+1)+"H":C?p.C0.ESC+"OH":p.C0.ESC+"[H";break;case 35:w.key=d?p.C0.ESC+"[1;"+(d+1)+"F":C?p.C0.ESC+"OF":p.C0.ESC+"[F";break;case 33:_.shiftKey?w.type=2:_.ctrlKey?w.key=p.C0.ESC+"[5;"+(d+1)+"~":w.key=p.C0.ESC+"[5~";break;case 34:_.shiftKey?w.type=3:_.ctrlKey?w.key=p.C0.ESC+"[6;"+(d+1)+"~":w.key=p.C0.ESC+"[6~";break;case 112:w.key=d?p.C0.ESC+"[1;"+(d+1)+"P":p.C0.ESC+"OP";break;case 113:w.key=d?p.C0.ESC+"[1;"+(d+1)+"Q":p.C0.ESC+"OQ";break;case 114:w.key=d?p.C0.ESC+"[1;"+(d+1)+"R":p.C0.ESC+"OR";break;case 115:w.key=d?p.C0.ESC+"[1;"+(d+1)+"S":p.C0.ESC+"OS";break;case 116:w.key=d?p.C0.ESC+"[15;"+(d+1)+"~":p.C0.ESC+"[15~";break;case 117:w.key=d?p.C0.ESC+"[17;"+(d+1)+"~":p.C0.ESC+"[17~";break;case 118:w.key=d?p.C0.ESC+"[18;"+(d+1)+"~":p.C0.ESC+"[18~";break;case 119:w.key=d?p.C0.ESC+"[19;"+(d+1)+"~":p.C0.ESC+"[19~";break;case 120:w.key=d?p.C0.ESC+"[20;"+(d+1)+"~":p.C0.ESC+"[20~";break;case 121:w.key=d?p.C0.ESC+"[21;"+(d+1)+"~":p.C0.ESC+"[21~";break;case 122:w.key=d?p.C0.ESC+"[23;"+(d+1)+"~":p.C0.ESC+"[23~";break;case 123:w.key=d?p.C0.ESC+"[24;"+(d+1)+"~":p.C0.ESC+"[24~";break;default:if(!_.ctrlKey||_.shiftKey||_.altKey||_.metaKey)if(E&&!M||!_.altKey||_.metaKey)!E||_.altKey||_.ctrlKey||_.shiftKey||!_.metaKey?_.key&&!_.ctrlKey&&!_.altKey&&!_.metaKey&&_.keyCode>=48&&_.key.length===1?w.key=_.key:_.key&&_.ctrlKey&&(_.key==="_"&&(w.key=p.C0.US),_.key==="@"&&(w.key=p.C0.NUL)):_.keyCode===65&&(w.type=1);else{const u=g[_.keyCode],l=u?.[_.shiftKey?1:0];if(l)w.key=p.C0.ESC+l;else if(_.keyCode>=65&&_.keyCode<=90){const h=_.ctrlKey?_.keyCode-64:_.keyCode+32;let S=String.fromCharCode(h);_.shiftKey&&(S=S.toUpperCase()),w.key=p.C0.ESC+S}else if(_.keyCode===32)w.key=p.C0.ESC+(_.ctrlKey?p.C0.NUL:" ");else if(_.key==="Dead"&&_.code.startsWith("Key")){let h=_.code.slice(3,4);_.shiftKey||(h=h.toLowerCase()),w.key=p.C0.ESC+h,w.cancel=!0}}else _.keyCode>=65&&_.keyCode<=90?w.key=String.fromCharCode(_.keyCode-64):_.keyCode===32?w.key=p.C0.NUL:_.keyCode>=51&&_.keyCode<=55?w.key=String.fromCharCode(_.keyCode-51+27):_.keyCode===56?w.key=p.C0.DEL:_.keyCode===219?w.key=p.C0.ESC:_.keyCode===220?w.key=p.C0.FS:_.keyCode===221&&(w.key=p.C0.GS)}return w}},482:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(f){return f>65535?(f-=65536,String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):String.fromCharCode(f)},o.utf32ToString=function(f,p=0,g=f.length){let _="";for(let C=p;C<g;++C){let E=f[C];E>65535?(E-=65536,_+=String.fromCharCode(55296+(E>>10))+String.fromCharCode(E%1024+56320)):_+=String.fromCharCode(E)}return _},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(f,p){const g=f.length;if(!g)return 0;let _=0,C=0;if(this._interim){const E=f.charCodeAt(C++);56320<=E&&E<=57343?p[_++]=1024*(this._interim-55296)+E-56320+65536:(p[_++]=this._interim,p[_++]=E),this._interim=0}for(let E=C;E<g;++E){const M=f.charCodeAt(E);if(55296<=M&&M<=56319){if(++E>=g)return this._interim=M,_;const w=f.charCodeAt(E);56320<=w&&w<=57343?p[_++]=1024*(M-55296)+w-56320+65536:(p[_++]=M,p[_++]=w)}else M!==65279&&(p[_++]=M)}return _}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(f,p){const g=f.length;if(!g)return 0;let _,C,E,M,w=0,d=0,u=0;if(this.interim[0]){let S=!1,T=this.interim[0];T&=(224&T)==192?31:(240&T)==224?15:7;let R,D=0;for(;(R=63&this.interim[++D])&&D<4;)T<<=6,T|=R;const x=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,B=x-D;for(;u<B;){if(u>=g)return 0;if(R=f[u++],(192&R)!=128){u--,S=!0;break}this.interim[D++]=R,T<<=6,T|=63&R}S||(x===2?T<128?u--:p[w++]=T:x===3?T<2048||T>=55296&&T<=57343||T===65279||(p[w++]=T):T<65536||T>1114111||(p[w++]=T)),this.interim.fill(0)}const l=g-4;let h=u;for(;h<g;){for(;!(!(h<l)||128&(_=f[h])||128&(C=f[h+1])||128&(E=f[h+2])||128&(M=f[h+3]));)p[w++]=_,p[w++]=C,p[w++]=E,p[w++]=M,h+=4;if(_=f[h++],_<128)p[w++]=_;else if((224&_)==192){if(h>=g)return this.interim[0]=_,w;if(C=f[h++],(192&C)!=128){h--;continue}if(d=(31&_)<<6|63&C,d<128){h--;continue}p[w++]=d}else if((240&_)==224){if(h>=g)return this.interim[0]=_,w;if(C=f[h++],(192&C)!=128){h--;continue}if(h>=g)return this.interim[0]=_,this.interim[1]=C,w;if(E=f[h++],(192&E)!=128){h--;continue}if(d=(15&_)<<12|(63&C)<<6|63&E,d<2048||d>=55296&&d<=57343||d===65279)continue;p[w++]=d}else if((248&_)==240){if(h>=g)return this.interim[0]=_,w;if(C=f[h++],(192&C)!=128){h--;continue}if(h>=g)return this.interim[0]=_,this.interim[1]=C,w;if(E=f[h++],(192&E)!=128){h--;continue}if(h>=g)return this.interim[0]=_,this.interim[1]=C,this.interim[2]=E,w;if(M=f[h++],(192&M)!=128){h--;continue}if(d=(7&_)<<18|(63&C)<<12|(63&E)<<6|63&M,d<65536||d>1114111)continue;p[w++]=d}}return w}}},225:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const p=f(1480),g=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],_=[[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 C;o.UnicodeV6=class{constructor(){if(this.version="6",!C){C=new Uint8Array(65536),C.fill(1),C[0]=0,C.fill(0,1,32),C.fill(0,127,160),C.fill(2,4352,4448),C[9001]=2,C[9002]=2,C.fill(2,11904,42192),C[12351]=1,C.fill(2,44032,55204),C.fill(2,63744,64256),C.fill(2,65040,65050),C.fill(2,65072,65136),C.fill(2,65280,65377),C.fill(2,65504,65511);for(let E=0;E<g.length;++E)C.fill(0,g[E][0],g[E][1]+1)}}wcwidth(E){return E<32?0:E<127?1:E<65536?C[E]:(function(M,w){let d,u=0,l=w.length-1;if(M<w[0][0]||M>w[l][1])return!1;for(;l>=u;)if(d=u+l>>1,M>w[d][1])u=d+1;else{if(!(M<w[d][0]))return!0;l=d-1}return!1})(E,_)?0:E>=131072&&E<=196605||E>=196608&&E<=262141?2:1}charProperties(E,M){let w=this.wcwidth(E),d=w===0&&M!==0;if(d){const u=p.UnicodeService.extractWidth(M);u===0?d=!1:u>w&&(w=u)}return p.UnicodeService.createPropertyValue(0,w,d)}}},5981:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const p=f(8460),g=f(844);class _ extends g.Disposable{constructor(E){super(),this._action=E,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new p.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(E,M){if(M!==void 0&&this._syncCalls>M)return void(this._syncCalls=0);if(this._pendingData+=E.length,this._writeBuffer.push(E),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const d=this._callbacks.shift();d&&d()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(E,M){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+=E.length,this._writeBuffer.push(E),this._callbacks.push(M),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=E.length,this._writeBuffer.push(E),this._callbacks.push(M)}_innerWrite(E=0,M=!0){const w=E||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const d=this._writeBuffer[this._bufferOffset],u=this._action(d,M);if(u){const h=S=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(w,S);return void u.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(h)}const l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=d.length,Date.now()-w>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=_},5941:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const f=/^([\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})$/,p=/^[\da-f]+$/;function g(_,C){const E=_.toString(16),M=E.length<2?"0"+E:E;switch(C){case 4:return E[0];case 8:return M;case 12:return(M+M).slice(0,3);default:return M+M}}o.parseColor=function(_){if(!_)return;let C=_.toLowerCase();if(C.indexOf("rgb:")===0){C=C.slice(4);const E=f.exec(C);if(E){const M=E[1]?15:E[4]?255:E[7]?4095:65535;return[Math.round(parseInt(E[1]||E[4]||E[7]||E[10],16)/M*255),Math.round(parseInt(E[2]||E[5]||E[8]||E[11],16)/M*255),Math.round(parseInt(E[3]||E[6]||E[9]||E[12],16)/M*255)]}}else if(C.indexOf("#")===0&&(C=C.slice(1),p.exec(C)&&[3,6,9,12].includes(C.length))){const E=C.length/3,M=[0,0,0];for(let w=0;w<3;++w){const d=parseInt(C.slice(E*w,E*w+E),16);M[w]=E===1?d<<4:E===2?d:E===3?d>>4:d>>8}return M}},o.toRgbString=function(_,C=16){const[E,M,w]=_;return`rgb:${g(E,C)}/${g(M,C)}/${g(w,C)}`}},5770:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const p=f(482),g=f(8742),_=f(5770),C=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=C,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=C}registerHandler(M,w){this._handlers[M]===void 0&&(this._handlers[M]=[]);const d=this._handlers[M];return d.push(w),{dispose:()=>{const u=d.indexOf(w);u!==-1&&d.splice(u,1)}}}clearHandler(M){this._handlers[M]&&delete this._handlers[M]}setHandlerFallback(M){this._handlerFb=M}reset(){if(this._active.length)for(let M=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;M>=0;--M)this._active[M].unhook(!1);this._stack.paused=!1,this._active=C,this._ident=0}hook(M,w){if(this.reset(),this._ident=M,this._active=this._handlers[M]||C,this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(M,w,d){if(this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].put(M,w,d);else this._handlerFb(this._ident,"PUT",(0,p.utf32ToString)(M,w,d))}unhook(M,w=!0){if(this._active.length){let d=!1,u=this._active.length-1,l=!1;if(this._stack.paused&&(u=this._stack.loopPosition-1,d=w,l=this._stack.fallThrough,this._stack.paused=!1),!l&&d===!1){for(;u>=0&&(d=this._active[u].unhook(M),d!==!0);u--)if(d instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!1,d;u--}for(;u>=0;u--)if(d=this._active[u].unhook(!1),d instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!0,d}else this._handlerFb(this._ident,"UNHOOK",M);this._active=C,this._ident=0}};const E=new g.Params;E.addParam(0),o.DcsHandler=class{constructor(M){this._handler=M,this._data="",this._params=E,this._hitLimit=!1}hook(M){this._params=M.length>1||M.params[0]?M.clone():E,this._data="",this._hitLimit=!1}put(M,w,d){this._hitLimit||(this._data+=(0,p.utf32ToString)(M,w,d),this._data.length>_.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(M){let w=!1;if(this._hitLimit)w=!1;else if(M&&(w=this._handler(this._data,this._params),w instanceof Promise))return w.then((d=>(this._params=E,this._data="",this._hitLimit=!1,d)));return this._params=E,this._data="",this._hitLimit=!1,w}}},2015:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const p=f(844),g=f(8742),_=f(6242),C=f(6351);class E{constructor(u){this.table=new Uint8Array(u)}setDefault(u,l){this.table.fill(u<<4|l)}add(u,l,h,S){this.table[l<<8|u]=h<<4|S}addMany(u,l,h,S){for(let T=0;T<u.length;T++)this.table[l<<8|u[T]]=h<<4|S}}o.TransitionTable=E;const M=160;o.VT500_TRANSITION_TABLE=(function(){const d=new E(4095),u=Array.apply(null,Array(256)).map(((D,x)=>x)),l=(D,x)=>u.slice(D,x),h=l(32,127),S=l(0,24);S.push(25),S.push.apply(S,l(28,32));const T=l(0,14);let R;for(R in d.setDefault(1,0),d.addMany(h,0,2,0),T)d.addMany([24,26,153,154],R,3,0),d.addMany(l(128,144),R,3,0),d.addMany(l(144,152),R,3,0),d.add(156,R,0,0),d.add(27,R,11,1),d.add(157,R,4,8),d.addMany([152,158,159],R,0,7),d.add(155,R,11,3),d.add(144,R,11,9);return d.addMany(S,0,3,0),d.addMany(S,1,3,1),d.add(127,1,0,1),d.addMany(S,8,0,8),d.addMany(S,3,3,3),d.add(127,3,0,3),d.addMany(S,4,3,4),d.add(127,4,0,4),d.addMany(S,6,3,6),d.addMany(S,5,3,5),d.add(127,5,0,5),d.addMany(S,2,3,2),d.add(127,2,0,2),d.add(93,1,4,8),d.addMany(h,8,5,8),d.add(127,8,5,8),d.addMany([156,27,24,26,7],8,6,0),d.addMany(l(28,32),8,0,8),d.addMany([88,94,95],1,0,7),d.addMany(h,7,0,7),d.addMany(S,7,0,7),d.add(156,7,0,0),d.add(127,7,0,7),d.add(91,1,11,3),d.addMany(l(64,127),3,7,0),d.addMany(l(48,60),3,8,4),d.addMany([60,61,62,63],3,9,4),d.addMany(l(48,60),4,8,4),d.addMany(l(64,127),4,7,0),d.addMany([60,61,62,63],4,0,6),d.addMany(l(32,64),6,0,6),d.add(127,6,0,6),d.addMany(l(64,127),6,0,0),d.addMany(l(32,48),3,9,5),d.addMany(l(32,48),5,9,5),d.addMany(l(48,64),5,0,6),d.addMany(l(64,127),5,7,0),d.addMany(l(32,48),4,9,5),d.addMany(l(32,48),1,9,2),d.addMany(l(32,48),2,9,2),d.addMany(l(48,127),2,10,0),d.addMany(l(48,80),1,10,0),d.addMany(l(81,88),1,10,0),d.addMany([89,90,92],1,10,0),d.addMany(l(96,127),1,10,0),d.add(80,1,11,9),d.addMany(S,9,0,9),d.add(127,9,0,9),d.addMany(l(28,32),9,0,9),d.addMany(l(32,48),9,9,12),d.addMany(l(48,60),9,8,10),d.addMany([60,61,62,63],9,9,10),d.addMany(S,11,0,11),d.addMany(l(32,128),11,0,11),d.addMany(l(28,32),11,0,11),d.addMany(S,10,0,10),d.add(127,10,0,10),d.addMany(l(28,32),10,0,10),d.addMany(l(48,60),10,8,10),d.addMany([60,61,62,63],10,0,11),d.addMany(l(32,48),10,9,12),d.addMany(S,12,0,12),d.add(127,12,0,12),d.addMany(l(28,32),12,0,12),d.addMany(l(32,48),12,9,12),d.addMany(l(48,64),12,0,11),d.addMany(l(64,127),12,12,13),d.addMany(l(64,127),10,12,13),d.addMany(l(64,127),9,12,13),d.addMany(S,13,13,13),d.addMany(h,13,13,13),d.add(127,13,0,13),d.addMany([27,156,24,26],13,14,0),d.add(M,0,2,0),d.add(M,8,5,8),d.add(M,6,0,6),d.add(M,11,0,11),d.add(M,13,13,13),d})();class w extends p.Disposable{constructor(u=o.VT500_TRANSITION_TABLE){super(),this._transitions=u,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(l,h,S)=>{},this._executeHandlerFb=l=>{},this._csiHandlerFb=(l,h)=>{},this._escHandlerFb=l=>{},this._errorHandlerFb=l=>l,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,p.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new _.OscParser),this._dcsParser=this.register(new C.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(u,l=[64,126]){let h=0;if(u.prefix){if(u.prefix.length>1)throw new Error("only one byte as prefix supported");if(h=u.prefix.charCodeAt(0),h&&60>h||h>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(u.intermediates){if(u.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let T=0;T<u.intermediates.length;++T){const R=u.intermediates.charCodeAt(T);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");h<<=8,h|=R}}if(u.final.length!==1)throw new Error("final must be a single byte");const S=u.final.charCodeAt(0);if(l[0]>S||S>l[1])throw new Error(`final must be in range ${l[0]} .. ${l[1]}`);return h<<=8,h|=S,h}identToString(u){const l=[];for(;u;)l.push(String.fromCharCode(255&u)),u>>=8;return l.reverse().join("")}setPrintHandler(u){this._printHandler=u}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(u,l){const h=this._identifier(u,[48,126]);this._escHandlers[h]===void 0&&(this._escHandlers[h]=[]);const S=this._escHandlers[h];return S.push(l),{dispose:()=>{const T=S.indexOf(l);T!==-1&&S.splice(T,1)}}}clearEscHandler(u){this._escHandlers[this._identifier(u,[48,126])]&&delete this._escHandlers[this._identifier(u,[48,126])]}setEscHandlerFallback(u){this._escHandlerFb=u}setExecuteHandler(u,l){this._executeHandlers[u.charCodeAt(0)]=l}clearExecuteHandler(u){this._executeHandlers[u.charCodeAt(0)]&&delete this._executeHandlers[u.charCodeAt(0)]}setExecuteHandlerFallback(u){this._executeHandlerFb=u}registerCsiHandler(u,l){const h=this._identifier(u);this._csiHandlers[h]===void 0&&(this._csiHandlers[h]=[]);const S=this._csiHandlers[h];return S.push(l),{dispose:()=>{const T=S.indexOf(l);T!==-1&&S.splice(T,1)}}}clearCsiHandler(u){this._csiHandlers[this._identifier(u)]&&delete this._csiHandlers[this._identifier(u)]}setCsiHandlerFallback(u){this._csiHandlerFb=u}registerDcsHandler(u,l){return this._dcsParser.registerHandler(this._identifier(u),l)}clearDcsHandler(u){this._dcsParser.clearHandler(this._identifier(u))}setDcsHandlerFallback(u){this._dcsParser.setHandlerFallback(u)}registerOscHandler(u,l){return this._oscParser.registerHandler(u,l)}clearOscHandler(u){this._oscParser.clearHandler(u)}setOscHandlerFallback(u){this._oscParser.setHandlerFallback(u)}setErrorHandler(u){this._errorHandler=u}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(u,l,h,S,T){this._parseStack.state=u,this._parseStack.handlers=l,this._parseStack.handlerPos=h,this._parseStack.transition=S,this._parseStack.chunkPos=T}parse(u,l,h){let S,T=0,R=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(h===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const x=this._parseStack.handlers;let B=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(h===!1&&B>-1){for(;B>=0&&(S=x[B](this._params),S!==!0);B--)if(S instanceof Promise)return this._parseStack.handlerPos=B,S}this._parseStack.handlers=[];break;case 4:if(h===!1&&B>-1){for(;B>=0&&(S=x[B](),S!==!0);B--)if(S instanceof Promise)return this._parseStack.handlerPos=B,S}this._parseStack.handlers=[];break;case 6:if(T=u[this._parseStack.chunkPos],S=this._dcsParser.unhook(T!==24&&T!==26,h),S)return S;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(T=u[this._parseStack.chunkPos],S=this._oscParser.end(T!==24&&T!==26,h),S)return S;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let x=D;x<l;++x){switch(T=u[x],R=this._transitions.table[this.currentState<<8|(T<160?T:M)],R>>4){case 2:for(let O=x+1;;++O){if(O>=l||(T=u[O])<32||T>126&&T<M){this._printHandler(u,x,O),x=O-1;break}if(++O>=l||(T=u[O])<32||T>126&&T<M){this._printHandler(u,x,O),x=O-1;break}if(++O>=l||(T=u[O])<32||T>126&&T<M){this._printHandler(u,x,O),x=O-1;break}if(++O>=l||(T=u[O])<32||T>126&&T<M){this._printHandler(u,x,O),x=O-1;break}}break;case 3:this._executeHandlers[T]?this._executeHandlers[T]():this._executeHandlerFb(T),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:x,code:T,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const B=this._csiHandlers[this._collect<<8|T];let K=B?B.length-1:-1;for(;K>=0&&(S=B[K](this._params),S!==!0);K--)if(S instanceof Promise)return this._preserveStack(3,B,K,R,x),S;K<0&&this._csiHandlerFb(this._collect<<8|T,this._params),this.precedingJoinState=0;break;case 8:do switch(T){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(T-48)}while(++x<l&&(T=u[x])>47&&T<60);x--;break;case 9:this._collect<<=8,this._collect|=T;break;case 10:const F=this._escHandlers[this._collect<<8|T];let J=F?F.length-1:-1;for(;J>=0&&(S=F[J](),S!==!0);J--)if(S instanceof Promise)return this._preserveStack(4,F,J,R,x),S;J<0&&this._escHandlerFb(this._collect<<8|T),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|T,this._params);break;case 13:for(let O=x+1;;++O)if(O>=l||(T=u[O])===24||T===26||T===27||T>127&&T<M){this._dcsParser.put(u,x,O),x=O-1;break}break;case 14:if(S=this._dcsParser.unhook(T!==24&&T!==26),S)return this._preserveStack(6,[],0,R,x),S;T===27&&(R|=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 O=x+1;;O++)if(O>=l||(T=u[O])<32||T>127&&T<M){this._oscParser.put(u,x,O),x=O-1;break}break;case 6:if(S=this._oscParser.end(T!==24&&T!==26),S)return this._preserveStack(5,[],0,R,x),S;T===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}o.EscapeSequenceParser=w},6242:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const p=f(5770),g=f(482),_=[];o.OscParser=class{constructor(){this._state=0,this._active=_,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(C,E){this._handlers[C]===void 0&&(this._handlers[C]=[]);const M=this._handlers[C];return M.push(E),{dispose:()=>{const w=M.indexOf(E);w!==-1&&M.splice(w,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}reset(){if(this._state===2)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].end(!1);this._stack.paused=!1,this._active=_,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||_,this._active.length)for(let C=this._active.length-1;C>=0;C--)this._active[C].start();else this._handlerFb(this._id,"START")}_put(C,E,M){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(C,E,M);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(C,E,M))}start(){this.reset(),this._state=1}put(C,E,M){if(this._state!==3){if(this._state===1)for(;E<M;){const w=C[E++];if(w===59){this._state=2,this._start();break}if(w<48||57<w)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+w-48}this._state===2&&M-E>0&&this._put(C,E,M)}}end(C,E=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let M=!1,w=this._active.length-1,d=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,M=E,d=this._stack.fallThrough,this._stack.paused=!1),!d&&M===!1){for(;w>=0&&(M=this._active[w].end(C),M!==!0);w--)if(M instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!1,M;w--}for(;w>=0;w--)if(M=this._active[w].end(!1),M instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!0,M}else this._handlerFb(this._id,"END",C);this._active=_,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(C){this._handler=C,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(C,E,M){this._hitLimit||(this._data+=(0,g.utf32ToString)(C,E,M),this._data.length>p.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(C){let E=!1;if(this._hitLimit)E=!1;else if(C&&(E=this._handler(this._data),E instanceof Promise))return E.then((M=>(this._data="",this._hitLimit=!1,M)));return this._data="",this._hitLimit=!1,E}}},8742:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const f=2147483647;class p{static fromArray(_){const C=new p;if(!_.length)return C;for(let E=Array.isArray(_[0])?1:0;E<_.length;++E){const M=_[E];if(Array.isArray(M))for(let w=0;w<M.length;++w)C.addSubParam(M[w]);else C.addParam(M)}return C}constructor(_=32,C=32){if(this.maxLength=_,this.maxSubParamsLength=C,C>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(_),this.length=0,this._subParams=new Int32Array(C),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(_),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const _=new p(this.maxLength,this.maxSubParamsLength);return _.params.set(this.params),_.length=this.length,_._subParams.set(this._subParams),_._subParamsLength=this._subParamsLength,_._subParamsIdx.set(this._subParamsIdx),_._rejectDigits=this._rejectDigits,_._rejectSubDigits=this._rejectSubDigits,_._digitIsSub=this._digitIsSub,_}toArray(){const _=[];for(let C=0;C<this.length;++C){_.push(this.params[C]);const E=this._subParamsIdx[C]>>8,M=255&this._subParamsIdx[C];M-E>0&&_.push(Array.prototype.slice.call(this._subParams,E,M))}return _}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(_){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(_<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=_>f?f:_}}addSubParam(_){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(_<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=_>f?f:_,this._subParamsIdx[this.length-1]++}}hasSubParams(_){return(255&this._subParamsIdx[_])-(this._subParamsIdx[_]>>8)>0}getSubParams(_){const C=this._subParamsIdx[_]>>8,E=255&this._subParamsIdx[_];return E-C>0?this._subParams.subarray(C,E):null}getSubParamsAll(){const _={};for(let C=0;C<this.length;++C){const E=this._subParamsIdx[C]>>8,M=255&this._subParamsIdx[C];M-E>0&&(_[C]=this._subParams.slice(E,M))}return _}addDigit(_){let C;if(this._rejectDigits||!(C=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const E=this._digitIsSub?this._subParams:this.params,M=E[C-1];E[C-1]=~M?Math.min(10*M+_,f):_}}o.Params=p},5741:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let f=this._addons.length-1;f>=0;f--)this._addons[f].instance.dispose()}loadAddon(f,p){const g={instance:p,dispose:p.dispose,isDisposed:!1};this._addons.push(g),p.dispose=()=>this._wrappedAddonDispose(g),p.activate(f)}_wrappedAddonDispose(f){if(f.isDisposed)return;let p=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===f){p=g;break}if(p===-1)throw new Error("Could not dispose an addon that has not been loaded");f.isDisposed=!0,f.dispose.apply(f.instance),this._addons.splice(p,1)}}},8771:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const p=f(3785),g=f(511);o.BufferApiView=class{constructor(_,C){this._buffer=_,this.type=C}init(_){return this._buffer=_,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(_){const C=this._buffer.lines.get(_);if(C)return new p.BufferLineApiView(C)}getNullCell(){return new g.CellData}}},3785:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const p=f(511);o.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,_){if(!(g<0||g>=this._line.length))return _?(this._line.loadCell(g,_),_):this._line.loadCell(g,new p.CellData)}translateToString(g,_,C){return this._line.translateToString(g,_,C)}}},8285:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const p=f(8771),g=f(8460),_=f(844);class C extends _.Disposable{constructor(M){super(),this._core=M,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new p.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new p.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=C},7975:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(f){this._core=f}registerCsiHandler(f,p){return this._core.registerCsiHandler(f,(g=>p(g.toArray())))}addCsiHandler(f,p){return this.registerCsiHandler(f,p)}registerDcsHandler(f,p){return this._core.registerDcsHandler(f,((g,_)=>p(g,_.toArray())))}addDcsHandler(f,p){return this.registerDcsHandler(f,p)}registerEscHandler(f,p){return this._core.registerEscHandler(f,p)}addEscHandler(f,p){return this.registerEscHandler(f,p)}registerOscHandler(f,p){return this._core.registerOscHandler(f,p)}addOscHandler(f,p){return this.registerOscHandler(f,p)}}},7090:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(f){this._core=f}register(f){this._core.unicodeService.register(f)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(f){this._core.unicodeService.activeVersion=f}}},744:function(P,o,f){var p=this&&this.__decorate||function(d,u,l,h){var S,T=arguments.length,R=T<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,l):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(d,u,l,h);else for(var D=d.length-1;D>=0;D--)(S=d[D])&&(R=(T<3?S(R):T>3?S(u,l,R):S(u,l))||R);return T>3&&R&&Object.defineProperty(u,l,R),R},g=this&&this.__param||function(d,u){return function(l,h){u(l,h,d)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const _=f(8460),C=f(844),E=f(5295),M=f(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let w=o.BufferService=class extends C.Disposable{get buffer(){return this.buffers.active}constructor(d){super(),this.isUserScrolling=!1,this._onResize=this.register(new _.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new _.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(d.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(d.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new E.BufferSet(d,this))}resize(d,u){this.cols=d,this.rows=u,this.buffers.resize(d,u),this._onResize.fire({cols:d,rows:u})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(d,u=!1){const l=this.buffer;let h;h=this._cachedBlankLine,h&&h.length===this.cols&&h.getFg(0)===d.fg&&h.getBg(0)===d.bg||(h=l.getBlankLine(d,u),this._cachedBlankLine=h),h.isWrapped=u;const S=l.ybase+l.scrollTop,T=l.ybase+l.scrollBottom;if(l.scrollTop===0){const R=l.lines.isFull;T===l.lines.length-1?R?l.lines.recycle().copyFrom(h):l.lines.push(h.clone()):l.lines.splice(T+1,0,h.clone()),R?this.isUserScrolling&&(l.ydisp=Math.max(l.ydisp-1,0)):(l.ybase++,this.isUserScrolling||l.ydisp++)}else{const R=T-S+1;l.lines.shiftElements(S+1,R-1,-1),l.lines.set(T,h.clone())}this.isUserScrolling||(l.ydisp=l.ybase),this._onScroll.fire(l.ydisp)}scrollLines(d,u,l){const h=this.buffer;if(d<0){if(h.ydisp===0)return;this.isUserScrolling=!0}else d+h.ydisp>=h.ybase&&(this.isUserScrolling=!1);const S=h.ydisp;h.ydisp=Math.max(Math.min(h.ydisp+d,h.ybase),0),S!==h.ydisp&&(u||this._onScroll.fire(h.ydisp))}};o.BufferService=w=p([g(0,M.IOptionsService)],w)},7994:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(f){this.glevel=f,this.charset=this._charsets[f]}setgCharset(f,p){this._charsets[f]=p,this.glevel===f&&(this.charset=p)}}},1753:function(P,o,f){var p=this&&this.__decorate||function(h,S,T,R){var D,x=arguments.length,B=x<3?S:R===null?R=Object.getOwnPropertyDescriptor(S,T):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(h,S,T,R);else for(var K=h.length-1;K>=0;K--)(D=h[K])&&(B=(x<3?D(B):x>3?D(S,T,B):D(S,T))||B);return x>3&&B&&Object.defineProperty(S,T,B),B},g=this&&this.__param||function(h,S){return function(T,R){S(T,R,h)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const _=f(2585),C=f(8460),E=f(844),M={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:h=>h.button!==4&&h.action===1&&(h.ctrl=!1,h.alt=!1,h.shift=!1,!0)},VT200:{events:19,restrict:h=>h.action!==32},DRAG:{events:23,restrict:h=>h.action!==32||h.button!==3},ANY:{events:31,restrict:h=>!0}};function w(h,S){let T=(h.ctrl?16:0)|(h.shift?4:0)|(h.alt?8:0);return h.button===4?(T|=64,T|=h.action):(T|=3&h.button,4&h.button&&(T|=64),8&h.button&&(T|=128),h.action===32?T|=32:h.action!==0||S||(T|=3)),T}const d=String.fromCharCode,u={DEFAULT:h=>{const S=[w(h,!1)+32,h.col+32,h.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${d(S[0])}${d(S[1])}${d(S[2])}`},SGR:h=>{const S=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${w(h,!0)};${h.col};${h.row}${S}`},SGR_PIXELS:h=>{const S=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${w(h,!0)};${h.x};${h.y}${S}`}};let l=o.CoreMouseService=class extends E.Disposable{constructor(h,S){super(),this._bufferService=h,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new C.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const T of Object.keys(M))this.addProtocol(T,M[T]);for(const T of Object.keys(u))this.addEncoding(T,u[T]);this.reset()}addProtocol(h,S){this._protocols[h]=S}addEncoding(h,S){this._encodings[h]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(h){if(!this._protocols[h])throw new Error(`unknown protocol "${h}"`);this._activeProtocol=h,this._onProtocolChange.fire(this._protocols[h].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(h){if(!this._encodings[h])throw new Error(`unknown encoding "${h}"`);this._activeEncoding=h}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(h){if(h.col<0||h.col>=this._bufferService.cols||h.row<0||h.row>=this._bufferService.rows||h.button===4&&h.action===32||h.button===3&&h.action!==32||h.button!==4&&(h.action===2||h.action===3)||(h.col++,h.row++,h.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,h,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(h))return!1;const S=this._encodings[this._activeEncoding](h);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=h,!0}explainEvents(h){return{down:!!(1&h),up:!!(2&h),drag:!!(4&h),move:!!(8&h),wheel:!!(16&h)}}_equalEvents(h,S,T){if(T){if(h.x!==S.x||h.y!==S.y)return!1}else if(h.col!==S.col||h.row!==S.row)return!1;return h.button===S.button&&h.action===S.action&&h.ctrl===S.ctrl&&h.alt===S.alt&&h.shift===S.shift}};o.CoreMouseService=l=p([g(0,_.IBufferService),g(1,_.ICoreService)],l)},6975:function(P,o,f){var p=this&&this.__decorate||function(l,h,S,T){var R,D=arguments.length,x=D<3?h:T===null?T=Object.getOwnPropertyDescriptor(h,S):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(l,h,S,T);else for(var B=l.length-1;B>=0;B--)(R=l[B])&&(x=(D<3?R(x):D>3?R(h,S,x):R(h,S))||x);return D>3&&x&&Object.defineProperty(h,S,x),x},g=this&&this.__param||function(l,h){return function(S,T){h(S,T,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const _=f(1439),C=f(8460),E=f(844),M=f(2585),w=Object.freeze({insertMode:!1}),d=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let u=o.CoreService=class extends E.Disposable{constructor(l,h,S){super(),this._bufferService=l,this._logService=h,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new C.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new C.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new C.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new C.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,_.clone)(w),this.decPrivateModes=(0,_.clone)(d)}reset(){this.modes=(0,_.clone)(w),this.decPrivateModes=(0,_.clone)(d)}triggerDataEvent(l,h=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;h&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),h&&this._onUserInput.fire(),this._logService.debug(`sending data "${l}"`,(()=>l.split("").map((T=>T.charCodeAt(0))))),this._onData.fire(l)}triggerBinaryEvent(l){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${l}"`,(()=>l.split("").map((h=>h.charCodeAt(0))))),this._onBinary.fire(l))}};o.CoreService=u=p([g(0,M.IBufferService),g(1,M.ILogService),g(2,M.IOptionsService)],u)},9074:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const p=f(8055),g=f(8460),_=f(844),C=f(6106);let E=0,M=0;class w extends _.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new C.SortedList((l=>l?.marker.line)),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,_.toDisposable)((()=>this.reset())))}registerDecoration(l){if(l.marker.isDisposed)return;const h=new d(l);if(h){const S=h.marker.onDispose((()=>h.dispose()));h.onDispose((()=>{h&&(this._decorations.delete(h)&&this._onDecorationRemoved.fire(h),S.dispose())})),this._decorations.insert(h),this._onDecorationRegistered.fire(h)}return h}reset(){for(const l of this._decorations.values())l.dispose();this._decorations.clear()}*getDecorationsAtCell(l,h,S){let T=0,R=0;for(const D of this._decorations.getKeyIterator(h))T=D.options.x??0,R=T+(D.options.width??1),l>=T&&l<R&&(!S||(D.options.layer??"bottom")===S)&&(yield D)}forEachDecorationAtCell(l,h,S,T){this._decorations.forEachByKey(h,(R=>{E=R.options.x??0,M=E+(R.options.width??1),l>=E&&l<M&&(!S||(R.options.layer??"bottom")===S)&&T(R)}))}}o.DecorationService=w;class d extends _.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=p.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=p.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(l){super(),this.options=l,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=l.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const p=f(2585),g=f(8343);class _{constructor(...E){this._entries=new Map;for(const[M,w]of E)this.set(M,w)}set(E,M){const w=this._entries.get(E);return this._entries.set(E,M),w}forEach(E){for(const[M,w]of this._entries.entries())E(M,w)}has(E){return this._entries.has(E)}get(E){return this._entries.get(E)}}o.ServiceCollection=_,o.InstantiationService=class{constructor(){this._services=new _,this._services.set(p.IInstantiationService,this)}setService(C,E){this._services.set(C,E)}getService(C){return this._services.get(C)}createInstance(C,...E){const M=(0,g.getServiceDependencies)(C).sort(((u,l)=>u.index-l.index)),w=[];for(const u of M){const l=this._services.get(u.id);if(!l)throw new Error(`[createInstance] ${C.name} depends on UNKNOWN service ${u.id}.`);w.push(l)}const d=M.length>0?M[0].index:E.length;if(E.length!==d)throw new Error(`[createInstance] First service dependency of ${C.name} at position ${d+1} conflicts with ${E.length} static arguments`);return new C(...E,...w)}}},7866:function(P,o,f){var p=this&&this.__decorate||function(d,u,l,h){var S,T=arguments.length,R=T<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,l):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(d,u,l,h);else for(var D=d.length-1;D>=0;D--)(S=d[D])&&(R=(T<3?S(R):T>3?S(u,l,R):S(u,l))||R);return T>3&&R&&Object.defineProperty(u,l,R),R},g=this&&this.__param||function(d,u){return function(l,h){u(l,h,d)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const _=f(844),C=f(2585),E={trace:C.LogLevelEnum.TRACE,debug:C.LogLevelEnum.DEBUG,info:C.LogLevelEnum.INFO,warn:C.LogLevelEnum.WARN,error:C.LogLevelEnum.ERROR,off:C.LogLevelEnum.OFF};let M,w=o.LogService=class extends _.Disposable{get logLevel(){return this._logLevel}constructor(d){super(),this._optionsService=d,this._logLevel=C.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),M=this}_updateLogLevel(){this._logLevel=E[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(d){for(let u=0;u<d.length;u++)typeof d[u]=="function"&&(d[u]=d[u]())}_log(d,u,l){this._evalLazyOptionalParams(l),d.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+u,...l)}trace(d,...u){this._logLevel<=C.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,d,u)}debug(d,...u){this._logLevel<=C.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,d,u)}info(d,...u){this._logLevel<=C.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,d,u)}warn(d,...u){this._logLevel<=C.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,d,u)}error(d,...u){this._logLevel<=C.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,d,u)}};o.LogService=w=p([g(0,C.IOptionsService)],w),o.setTraceLogger=function(d){M=d},o.traceCall=function(d,u,l){if(typeof l.value!="function")throw new Error("not supported");const h=l.value;l.value=function(...S){if(M.logLevel!==C.LogLevelEnum.TRACE)return h.apply(this,S);M.trace(`GlyphRenderer#${h.name}(${S.map((R=>JSON.stringify(R))).join(", ")})`);const T=h.apply(this,S);return M.trace(`GlyphRenderer#${h.name} return`,T),T}}},7302:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const p=f(8460),g=f(844),_=f(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:_.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const C=["normal","bold","100","200","300","400","500","600","700","800","900"];class E extends g.Disposable{constructor(w){super(),this._onOptionChange=this.register(new p.EventEmitter),this.onOptionChange=this._onOptionChange.event;const d={...o.DEFAULT_OPTIONS};for(const u in w)if(u in d)try{const l=w[u];d[u]=this._sanitizeAndValidateOption(u,l)}catch(l){console.error(l)}this.rawOptions=d,this.options={...d},this._setupOptions(),this.register((0,g.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,d){return this.onOptionChange((u=>{u===w&&d(this.rawOptions[w])}))}onMultipleOptionChange(w,d){return this.onOptionChange((u=>{w.indexOf(u)!==-1&&d()}))}_setupOptions(){const w=u=>{if(!(u in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);return this.rawOptions[u]},d=(u,l)=>{if(!(u in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);l=this._sanitizeAndValidateOption(u,l),this.rawOptions[u]!==l&&(this.rawOptions[u]=l,this._onOptionChange.fire(u))};for(const u in this.rawOptions){const l={get:w.bind(this,u),set:d.bind(this,u)};Object.defineProperty(this.options,u,l)}}_sanitizeAndValidateOption(w,d){switch(w){case"cursorStyle":if(d||(d=o.DEFAULT_OPTIONS[w]),!(function(u){return u==="block"||u==="underline"||u==="bar"})(d))throw new Error(`"${d}" is not a valid value for ${w}`);break;case"wordSeparator":d||(d=o.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof d=="number"&&1<=d&&d<=1e3)break;d=C.includes(d)?d:o.DEFAULT_OPTIONS[w];break;case"cursorWidth":d=Math.floor(d);case"lineHeight":case"tabStopWidth":if(d<1)throw new Error(`${w} cannot be less than 1, value: ${d}`);break;case"minimumContrastRatio":d=Math.max(1,Math.min(21,Math.round(10*d)/10));break;case"scrollback":if((d=Math.min(d,4294967295))<0)throw new Error(`${w} cannot be less than 0, value: ${d}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(d<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${d}`);break;case"rows":case"cols":if(!d&&d!==0)throw new Error(`${w} must be numeric, value: ${d}`);break;case"windowsPty":d=d??{}}return d}}o.OptionsService=E},2660:function(P,o,f){var p=this&&this.__decorate||function(E,M,w,d){var u,l=arguments.length,h=l<3?M:d===null?d=Object.getOwnPropertyDescriptor(M,w):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(E,M,w,d);else for(var S=E.length-1;S>=0;S--)(u=E[S])&&(h=(l<3?u(h):l>3?u(M,w,h):u(M,w))||h);return l>3&&h&&Object.defineProperty(M,w,h),h},g=this&&this.__param||function(E,M){return function(w,d){M(w,d,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const _=f(2585);let C=o.OscLinkService=class{constructor(E){this._bufferService=E,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(E){const M=this._bufferService.buffer;if(E.id===void 0){const S=M.addMarker(M.ybase+M.y),T={data:E,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(T,S))),this._dataByLinkId.set(T.id,T),T.id}const w=E,d=this._getEntryIdKey(w),u=this._entriesWithId.get(d);if(u)return this.addLineToLink(u.id,M.ybase+M.y),u.id;const l=M.addMarker(M.ybase+M.y),h={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[l]};return l.onDispose((()=>this._removeMarkerFromLink(h,l))),this._entriesWithId.set(h.key,h),this._dataByLinkId.set(h.id,h),h.id}addLineToLink(E,M){const w=this._dataByLinkId.get(E);if(w&&w.lines.every((d=>d.line!==M))){const d=this._bufferService.buffer.addMarker(M);w.lines.push(d),d.onDispose((()=>this._removeMarkerFromLink(w,d)))}}getLinkData(E){return this._dataByLinkId.get(E)?.data}_getEntryIdKey(E){return`${E.id};;${E.uri}`}_removeMarkerFromLink(E,M){const w=E.lines.indexOf(M);w!==-1&&(E.lines.splice(w,1),E.lines.length===0&&(E.data.id!==void 0&&this._entriesWithId.delete(E.key),this._dataByLinkId.delete(E.id)))}};o.OscLinkService=C=p([g(0,_.IBufferService)],C)},8343:(P,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const f="di$target",p="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(g){return g[p]||[]},o.createDecorator=function(g){if(o.serviceRegistry.has(g))return o.serviceRegistry.get(g);const _=function(C,E,M){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,d,u){d[f]===d?d[p].push({id:w,index:u}):(d[p]=[{id:w,index:u}],d[f]=d)})(_,C,M)};return _.toString=()=>g,o.serviceRegistry.set(g,_),_}},2585:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const p=f(8343);var g;o.IBufferService=(0,p.createDecorator)("BufferService"),o.ICoreMouseService=(0,p.createDecorator)("CoreMouseService"),o.ICoreService=(0,p.createDecorator)("CoreService"),o.ICharsetService=(0,p.createDecorator)("CharsetService"),o.IInstantiationService=(0,p.createDecorator)("InstantiationService"),(function(_){_[_.TRACE=0]="TRACE",_[_.DEBUG=1]="DEBUG",_[_.INFO=2]="INFO",_[_.WARN=3]="WARN",_[_.ERROR=4]="ERROR",_[_.OFF=5]="OFF"})(g||(o.LogLevelEnum=g={})),o.ILogService=(0,p.createDecorator)("LogService"),o.IOptionsService=(0,p.createDecorator)("OptionsService"),o.IOscLinkService=(0,p.createDecorator)("OscLinkService"),o.IUnicodeService=(0,p.createDecorator)("UnicodeService"),o.IDecorationService=(0,p.createDecorator)("DecorationService")},1480:(P,o,f)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const p=f(8460),g=f(225);class _{static extractShouldJoin(E){return(1&E)!=0}static extractWidth(E){return E>>1&3}static extractCharKind(E){return E>>3}static createPropertyValue(E,M,w=!1){return(16777215&E)<<3|(3&M)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new p.EventEmitter,this.onChange=this._onChange.event;const E=new g.UnicodeV6;this.register(E),this._active=E.version,this._activeProvider=E}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(E){if(!this._providers[E])throw new Error(`unknown Unicode version "${E}"`);this._active=E,this._activeProvider=this._providers[E],this._onChange.fire(E)}register(E){this._providers[E.version]=E}wcwidth(E){return this._activeProvider.wcwidth(E)}getStringCellWidth(E){let M=0,w=0;const d=E.length;for(let u=0;u<d;++u){let l=E.charCodeAt(u);if(55296<=l&&l<=56319){if(++u>=d)return M+this.wcwidth(l);const T=E.charCodeAt(u);56320<=T&&T<=57343?l=1024*(l-55296)+T-56320+65536:M+=this.wcwidth(T)}const h=this.charProperties(l,w);let S=_.extractWidth(h);_.extractShouldJoin(h)&&(S-=_.extractWidth(w)),M+=S,w=h}return M}charProperties(E,M){return this._activeProvider.charProperties(E,M)}}o.UnicodeService=_}},b={};function j(P){var o=b[P];if(o!==void 0)return o.exports;var f=b[P]={exports:{}};return y[P].call(f.exports,f,f.exports,j),f.exports}var I={};return(()=>{var P=I;Object.defineProperty(P,"__esModule",{value:!0}),P.Terminal=void 0;const o=j(9042),f=j(3236),p=j(844),g=j(5741),_=j(8285),C=j(7975),E=j(7090),M=["cols","rows"];class w extends p.Disposable{constructor(u){super(),this._core=this.register(new f.Terminal(u)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const l=S=>this._core.options[S],h=(S,T)=>{this._checkReadonlyOptions(S),this._core.options[S]=T};for(const S in this._core.options){const T={get:l.bind(this,S),set:h.bind(this,S)};Object.defineProperty(this._publicOptions,S,T)}}_checkReadonlyOptions(u){if(M.includes(u))throw new Error(`Option "${u}" 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 C.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new E.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 _.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const u=this._core.coreService.decPrivateModes;let l="none";switch(this._core.coreMouseService.activeProtocol){case"X10":l="x10";break;case"VT200":l="vt200";break;case"DRAG":l="drag";break;case"ANY":l="any"}return{applicationCursorKeysMode:u.applicationCursorKeys,applicationKeypadMode:u.applicationKeypad,bracketedPasteMode:u.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:l,originMode:u.origin,reverseWraparoundMode:u.reverseWraparound,sendFocusMode:u.sendFocus,wraparoundMode:u.wraparound}}get options(){return this._publicOptions}set options(u){for(const l in u)this._publicOptions[l]=u[l]}blur(){this._core.blur()}focus(){this._core.focus()}input(u,l=!0){this._core.input(u,l)}resize(u,l){this._verifyIntegers(u,l),this._core.resize(u,l)}open(u){this._core.open(u)}attachCustomKeyEventHandler(u){this._core.attachCustomKeyEventHandler(u)}attachCustomWheelEventHandler(u){this._core.attachCustomWheelEventHandler(u)}registerLinkProvider(u){return this._core.registerLinkProvider(u)}registerCharacterJoiner(u){return this._checkProposedApi(),this._core.registerCharacterJoiner(u)}deregisterCharacterJoiner(u){this._checkProposedApi(),this._core.deregisterCharacterJoiner(u)}registerMarker(u=0){return this._verifyIntegers(u),this._core.registerMarker(u)}registerDecoration(u){return this._checkProposedApi(),this._verifyPositiveIntegers(u.x??0,u.width??0,u.height??0),this._core.registerDecoration(u)}hasSelection(){return this._core.hasSelection()}select(u,l,h){this._verifyIntegers(u,l,h),this._core.select(u,l,h)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(u,l){this._verifyIntegers(u,l),this._core.selectLines(u,l)}dispose(){super.dispose()}scrollLines(u){this._verifyIntegers(u),this._core.scrollLines(u)}scrollPages(u){this._verifyIntegers(u),this._core.scrollPages(u)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(u){this._verifyIntegers(u),this._core.scrollToLine(u)}clear(){this._core.clear()}write(u,l){this._core.write(u,l)}writeln(u,l){this._core.write(u),this._core.write(`\r
|
|
17
|
+
`,l)}paste(u){this._core.paste(u)}refresh(u,l){this._verifyIntegers(u,l),this._core.refresh(u,l)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(u){this._addonManager.loadAddon(this,u)}static get strings(){return o}_verifyIntegers(...u){for(const l of u)if(l===1/0||isNaN(l)||l%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...u){for(const l of u)if(l&&(l===1/0||isNaN(l)||l%1!=0||l<0))throw new Error("This API only accepts positive integers")}}P.Terminal=w})(),I})()))})(hh)),hh.exports}var Ev=xv(),dh={exports:{}},I_;function Av(){return I_||(I_=1,(function(r,v){(function(y,b){r.exports=b()})(self,(()=>(()=>{var y={};return(()=>{var b=y;Object.defineProperty(b,"__esModule",{value:!0}),b.FitAddon=void 0,b.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 I=this._terminal._core;this._terminal.rows===j.rows&&this._terminal.cols===j.cols||(I._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,I=j._renderService.dimensions;if(I.css.cell.width===0||I.css.cell.height===0)return;const P=this._terminal.options.scrollback===0?0:j.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),f=parseInt(o.getPropertyValue("height")),p=Math.max(0,parseInt(o.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),_=f-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),C=p-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-P;return{cols:Math.max(2,Math.floor(C/I.css.cell.width)),rows:Math.max(1,Math.floor(_/I.css.cell.height))}}}})(),y})()))})(dh)),dh.exports}var Rv=Av();const Vo=16e3,Tv=.004,Dv=["audio/webm;codecs=opus","audio/webm","audio/mp4"];function Cp(r){if(!r.length)return 0;let v=0;for(const y of r)v+=y*y;return Math.sqrt(v/r.length)}function P_(r,v=Tv){return Cp(r)<v}async function kv(r){const v=new AudioContext;try{const y=await v.decodeAudioData(await r.arrayBuffer()),b=Math.max(1,Math.ceil(y.duration*Vo)),j=new OfflineAudioContext(1,b,Vo),I=j.createBufferSource();return I.buffer=y,I.connect(j.destination),I.start(),(await j.startRendering()).getChannelData(0)}finally{v.close()}}class $_{constructor(){this.stream=null,this.recorder=null,this.chunks=[]}async start(){this.stream=await navigator.mediaDevices.getUserMedia({audio:!0});const v=Dv.find(y=>MediaRecorder.isTypeSupported(y));this.recorder=new MediaRecorder(this.stream,v?{mimeType:v}:void 0),this.chunks=[],this.recorder.ondataavailable=y=>{y.data.size&&this.chunks.push(y.data)},this.recorder.start()}stop(){return new Promise(v=>{const y=this.recorder;if(!y||y.state==="inactive"){this.dispose(),v(null);return}y.onstop=()=>{const b=new Blob(this.chunks,{type:y.mimeType||"audio/webm"});if(this.dispose(),!b.size){v(null);return}kv(b).then(v,()=>v(null))},y.stop()})}cancel(){const v=this.recorder;v&&v.state!=="inactive"&&(v.onstop=null,v.stop()),this.dispose()}dispose(){this.stream?.getTracks().forEach(v=>v.stop()),this.stream=null,this.recorder=null,this.chunks=[]}}function vs(r){const v=r.replace(/^.*@/,""),y=v.replace(/:\d+$/,"");return y.includes(":")?v:y}const Wo="\x1B",q_="\x07",Mv=new RegExp(Wo+"\\][^"+q_+Wo+"]*(?:"+q_+"|"+Wo+"\\\\)","g"),Lv=new RegExp(Wo+"\\[[0-9;?]*[A-Za-z]","g");function F_(r){return/[#$%>]\s*$/.test(r.replace(Mv,"").replace(Lv,""))}const Ov=60,Bv=200;function jv(r){if(r.type!=="keydown"||!(r.ctrlKey||r.metaKey)||!r.shiftKey)return null;const v=r.key.toLowerCase();return v==="c"?"copy":v==="v"?"paste":null}function Yo(r){return r instanceof Error?r.message:String(r)}function Nv(r,v,y){if(v.mark(),typeof r.terminal.paste=="function"){r.terminal.paste(y);return}r.writeToPty?.(y)}function wp(r=()=>Date.now()){let v=Number.NEGATIVE_INFINITY;return{mark(){v=r()},isDuplicate(){return r()-v<Bv}}}function Hv(r,v){const y=b=>{v.isDuplicate()&&(b.preventDefault(),b.stopPropagation(),b.stopImmediatePropagation?.())};return r.addEventListener("paste",y,!0),()=>r.removeEventListener("paste",y,!0)}function zv(r,v=wp()){return y=>{const b=jv(y);if(!b)return!0;if(y.preventDefault(),y.stopPropagation(),b==="copy"){const j=r.terminal.getSelection();return j&&r.clipboard.copyText(j).catch(I=>{r.onError(Yo(I))}),!1}return r.clipboard.readText().then(j=>{j&&Nv(r,v,j)}).catch(j=>{r.onError(Yo(j))}),!1}}const Uv=new Set(["c","p","s"]);function Iv(r){return r?[...r].some(v=>Uv.has(v)):!0}function Pv(r){const v=r.replace(/\s+/g,"");if(!/^[A-Za-z0-9+/]*={0,2}$/.test(v))return null;try{const y=atob(v),b=Uint8Array.from(y,j=>j.charCodeAt(0));return new TextDecoder().decode(b)}catch{return null}}function $v(r){const v=r.indexOf(";");if(v===-1||!Iv(r.slice(0,v)))return null;const y=r.slice(v+1);return y==="?"||!y?null:Pv(y)}function qv(r){const v=r.terminal.parser;if(!v)return()=>{};const y=v.registerOscHandler(52,b=>{const j=$v(b);return j!==null&&r.clipboard.copyText(j).catch(I=>{r.onError(Yo(I))}),!0});return()=>{y&&typeof y.dispose=="function"&&y.dispose()}}function Fv(r){const{terminal:v}=r;if(typeof v.onSelectionChange!="function")return()=>{};let y,b=null;const j=v.onSelectionChange(()=>{y&&clearTimeout(y),y=setTimeout(()=>{if(y=void 0,r.isCopyOnSelectEnabled&&!r.isCopyOnSelectEnabled())return;const I=v.getSelection();!I||I===b||(b=I,r.clipboard.copyText(I).catch(P=>{b=null,r.onError(Yo(P))}))},Ov)});return()=>{y&&clearTimeout(y),j&&typeof j.dispose=="function"&&j.dispose()}}function Wv(r){const v=wp();r.terminal.attachCustomKeyEventHandler(zv(r,v));const y=[qv(r),Fv(r),r.pasteEventTarget?Hv(r.pasteEventTarget,v):()=>{}];return()=>{for(const b of y.reverse())b()}}function Kv(r){let v=!1;return{onMouseDown(y){v=y.target===y.currentTarget},onClick(y){const b=v&&y.target===y.currentTarget;v=!1,b&&r()}}}function bn(r){const v=Z.useRef(r);v.current=r;const y=Z.useRef(null);return y.current||(y.current=Kv(()=>v.current())),y.current}const Gv=250,Vv={setTimeout:(r,v)=>setTimeout(r,v),clearTimeout:r=>clearTimeout(r)};function Yv(r){const v=r.windowMs??Gv,y=r.timers??Vv;let b=null,j=null;const I=()=>{b!==null&&(y.clearTimeout(b),b=null)},P=()=>{j!==null&&y.clearTimeout(j),j=y.setTimeout(()=>{j=null},v)};return{onClick(){if(j!==null){P();return}I(),b=y.setTimeout(()=>{b=null,r.onSingleClick()},v)},onDoubleClick(){I(),P(),r.onDoubleClick()},cancel(){I(),j!==null&&(y.clearTimeout(j),j=null)}}}function xp(r,v){const y=Z.useRef({onSingleClick:r,onDoubleClick:v});y.current={onSingleClick:r,onDoubleClick:v};const b=Z.useRef(null);b.current||(b.current=Yv({onSingleClick:()=>y.current.onSingleClick(),onDoubleClick:()=>y.current.onDoubleClick()}));const j=b.current;return Z.useEffect(()=>()=>j.cancel(),[j]),j}const Ep=25,Ap=85,Rp=60;function fh(r){return r.sessionIds.length+r.pending.length}const Xv=4;function Zv(r,v,y){const b=new Map(v.map(j=>[j.id,j]));return r.flatMap(j=>j.sessionIds.map(I=>b.get(I)).filter(I=>I!==void 0).slice(0,Xv).map((I,P)=>({session:I,workspaceId:j.id,index:P,dormant:j.id!==y})))}function Qo(r){return{layout:r,lastSplit:r==="stack"?"split-v":r,maximizedSessionId:null}}function W_(r,v,y=[]){return{id:`ws-${crypto.randomUUID()}`,name:r,sessionIds:y,pending:[],view:Qo(v)}}function _h(r){return r<=1?"stack":r===2?"split-v":"grid"}function K_(r,v,y){return r.map(b=>{if(b.id!==v)return b;const j={...b.view,...typeof y=="function"?y(b.view):y};return{...b,view:j}})}function Qv(r,v,y){return r.map(b=>b.id!==v?b.sessionIds.includes(y)?{...b,sessionIds:b.sessionIds.filter(j=>j!==y)}:b:b.sessionIds.includes(y)?b:{...b,sessionIds:[...b.sessionIds,y]})}function Jv(r,v){return r.map(y=>{if(!y.sessionIds.includes(v))return y;const b=y.sessionIds.filter(j=>j!==v);return{...y,sessionIds:b,view:Eh(y.view,xh({...y,sessionIds:b}))}})}function xh(r){return[...r.sessionIds,...r.pending.map(v=>v.sessionId)]}function Eh(r,v){const y=new Set(v),b=r.activeSessionId&&y.has(r.activeSessionId)?r.activeSessionId:void 0,j=r.focusedSessionId&&y.has(r.focusedSessionId)?r.focusedSessionId:void 0,I=r.maximizedSessionId&&y.has(r.maximizedSessionId)?r.maximizedSessionId:null,P=eg(r.browsers,y);return b===r.activeSessionId&&j===r.focusedSessionId&&I===(r.maximizedSessionId??null)&&P===r.browsers?r:{...r,activeSessionId:b,focusedSessionId:j,maximizedSessionId:I,browsers:P}}function eg(r,v){if(!r)return r;const y=Object.keys(r),b=y.filter(j=>v.has(j));return b.length===y.length?r:Object.fromEntries(b.map(j=>[j,r[j]]))}function tg(r,v){const y=new Set(v.map(I=>I.id));let b=!1;const j=r.map(I=>{const P=I.sessionIds.filter(f=>y.has(f)),o=Eh(I.view,xh({...I,sessionIds:P}));return P.length===I.sessionIds.length&&o===I.view?I:(b=!0,{...I,sessionIds:P,view:o})});return b?j:r}const Ko="[A-Za-z0-9](?:[A-Za-z0-9_.]|-| ){0,48}",ig=new RegExp(`^(?:${Ko})$`);function yh(r){return ig.test(r)}function $o(r){let v=r.length+1;const y=new Set(r.map(b=>b.name.toLowerCase()));for(;y.has(`workspace ${v}`);)v+=1;return`Workspace ${v}`}function G_(r,v,y){const b=y.trim();return yh(b)?r.map(j=>j.id===v?{...j,name:b}:j):r}function sg(r,v,y,b,j=()=>`pending-${crypto.randomUUID()}`){const I=r.findIndex(E=>E.id===v);if(I<0)return{workspaces:r,created:null,copied:0,skipped:0};const P=r[I],o=new Map(y.map(E=>[E.id,E])),f=[...P.sessionIds.map(E=>o.get(E)).filter(E=>E!==void 0).map(Tp),...P.pending],p=f.filter(E=>E.kind==="ssh"),g=p.map(E=>{const{screenName:M,...w}=E;return{...w,sessionId:j()}}),_={id:`ws-${crypto.randomUUID()}`,name:b,sessionIds:[],pending:g,view:{...Qo(P.view.layout),lastSplit:P.view.lastSplit,maximizedSessionId:null}},C=[...r];return C.splice(I+1,0,_),{workspaces:C,created:_,copied:g.length,skipped:f.length-p.length}}function ng(r,v){const y=v.filter(b=>r.sessionIds.includes(b.id));return y.some(b=>b.status==="connected")?"connected":y.length||r.pending.length?"detached":"empty"}function rg(r,v,y){const b=r.findIndex(f=>f.id===v),j={workspaces:r,activeWorkspaceId:y,releasedSessionIds:[]};if(b<0||r.length<2)return j;const I=r[b],P=r.filter(f=>f.id!==v),o=y===v?(P[Math.max(0,b-1)]??P[0]).id:y;return{workspaces:P,activeWorkspaceId:o,releasedSessionIds:[...I.sessionIds]}}function V_(r,v,y){return r.map(b=>{if(b.id!==v||!b.pending.some(I=>I.sessionId===y))return b;const j={...b,pending:b.pending.filter(I=>I.sessionId!==y)};return{...j,view:Eh(j.view,xh(j))}})}function ag(r,v){let y=!1;const b=r.map(j=>{if(!j.pending.length)return j;const I=[],P=[...j.sessionIds];let o=j.view,f=!1;for(const p of j.pending){const g=v(p);if(!g){I.push(p);continue}P.includes(g)||P.push(g),o=lg(o,p.sessionId,g),f=!0}return f?(y=!0,{...j,sessionIds:P,pending:I,view:o}):j});return y?b:r}function lg(r,v,y){return r.activeSessionId!==v&&r.focusedSessionId!==v&&r.maximizedSessionId!==v?r:{...r,activeSessionId:r.activeSessionId===v?y:r.activeSessionId,focusedSessionId:r.focusedSessionId===v?y:r.focusedSessionId,maximizedSessionId:r.maximizedSessionId===v?y:r.maximizedSessionId}}const og=1,cg=["stack","split-v","split-h","grid"],ug=["split-v","split-h","grid"];function hg(r,v,y){const b=new Map(y.map(j=>[j.id,j]));return{version:og,activeWorkspaceId:v,workspaces:r.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(I=>b.get(I)).filter(I=>I!==void 0).map(Tp),...j.pending]}))}}function Tp(r){const v={sessionId:r.id,kind:r.kind,name:r.name};return r.host&&(v.host=r.host),r.screenName&&(v.screenName=r.screenName),r.sshTarget&&(v.sshTarget=r.sshTarget),r.backend&&(v.backend=r.backend),v}function dg(r){if(!r||typeof r!="object"||Array.isArray(r))return;const v={};for(const[y,b]of Object.entries(r)){if(!y||!b||typeof b!="object")continue;const j=b;if(typeof j.open!="boolean")continue;const I=typeof j.ratio=="number"&&Number.isFinite(j.ratio)&&j.ratio>=Ep&&j.ratio<=Ap?j.ratio:void 0;v[y]=I===void 0?{open:j.open}:{open:j.open,ratio:I}}return Object.keys(v).length?v:void 0}function fg(r,v){const y=r.workspaces.map(j=>{const I=cg.find(o=>o===j.view?.layout)??v,P=Qo(I);return{id:j.id,name:j.name,sessionIds:[],pending:[...j.members??[]],view:{...P,lastSplit:ug.find(o=>o===j.view?.lastSplit)??P.lastSplit,activeSessionId:j.view?.activeSessionId,focusedSessionId:j.view?.focusedSessionId,maximizedSessionId:j.view?.maximizedSessionId??null,browsers:dg(j.view?.browsers)}}}),b=y.some(j=>j.id===r.activeWorkspaceId)?r.activeWorkspaceId:y[0]?.id;return{workspaces:y,activeWorkspaceId:b}}function Be({name:r,className:v=""}){const y={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",className:`icon-svg ${v}`.trim(),"aria-hidden":!0};switch(r){case"plus":return c.jsx("svg",{...y,children:c.jsx("path",{d:"M12 5v14M5 12h14"})});case"panel-left":return c.jsxs("svg",{...y,children:[c.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),c.jsx("path",{d:"M9 4v16"})]});case"panel-left-open":return c.jsxs("svg",{...y,children:[c.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),c.jsx("path",{d:"M9 4v16M6 9l2 3-2 3"})]});case"grid":return c.jsxs("svg",{...y,children:[c.jsx("rect",{x:"4",y:"4",width:"7",height:"7",rx:"1"}),c.jsx("rect",{x:"13",y:"4",width:"7",height:"7",rx:"1"}),c.jsx("rect",{x:"4",y:"13",width:"7",height:"7",rx:"1"}),c.jsx("rect",{x:"13",y:"13",width:"7",height:"7",rx:"1"})]});case"sessions":return c.jsx("svg",{...y,children:c.jsx("path",{d:"M4 7h16M4 12h16M4 17h10"})});case"terminal":return c.jsxs("svg",{...y,children:[c.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),c.jsx("path",{d:"M7 9l3 3-3 3M13 15h4"})]});case"ssh":return c.jsx("svg",{...y,children:c.jsx("path",{d:"M7 17l5-5-5-5M12 17h7"})});case"history":return c.jsxs("svg",{...y,children:[c.jsx("path",{d:"M4 12a8 8 0 1 0 2.3-5.7L4 8.5M4 4v4.5h4.5"}),c.jsx("path",{d:"M12 7v5l3 2"})]});case"spark":return c.jsx("svg",{...y,children:c.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 c.jsxs("svg",{...y,children:[c.jsx("circle",{cx:"12",cy:"12",r:"3"}),c.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 c.jsxs("svg",{...y,children:[c.jsx("circle",{cx:"12",cy:"12",r:"4"}),c.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 c.jsx("svg",{...y,children:c.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 c.jsx("svg",{...y,children:c.jsx("rect",{x:"5",y:"5",width:"14",height:"14",rx:"1.5"})});case"maximize":return c.jsx("svg",{...y,children:c.jsx("path",{d:"M8 4H4v4M16 4h4v4M4 16v4h4M20 16v4h-4"})});case"restore":return c.jsx("svg",{...y,children:c.jsx("path",{d:"M8 8h12v12H8zM4 16V4h12"})});case"chevron-left":return c.jsx("svg",{...y,children:c.jsx("path",{d:"M15 5l-7 7 7 7"})});case"chevron-right":return c.jsx("svg",{...y,children:c.jsx("path",{d:"M9 5l7 7-7 7"})});case"split-v":return c.jsxs("svg",{...y,children:[c.jsx("rect",{x:"4",y:"5",width:"7",height:"14",rx:"1"}),c.jsx("rect",{x:"13",y:"5",width:"7",height:"14",rx:"1"})]});case"split-h":return c.jsxs("svg",{...y,children:[c.jsx("rect",{x:"4",y:"4",width:"16",height:"7",rx:"1"}),c.jsx("rect",{x:"4",y:"13",width:"16",height:"7",rx:"1"})]});case"x":return c.jsx("svg",{...y,children:c.jsx("path",{d:"M6 6l12 12M18 6L6 18"})});case"mic":return c.jsxs("svg",{...y,children:[c.jsx("rect",{x:"9",y:"2.5",width:"6",height:"12",rx:"3"}),c.jsx("path",{d:"M5 11.5a7 7 0 0 0 14 0"}),c.jsx("path",{d:"M12 18.5V21"})]});case"check":return c.jsx("svg",{...y,children:c.jsx("path",{d:"M5 13l4.5 4.5L19 7"})});case"transfer":return c.jsxs("svg",{...y,children:[c.jsx("path",{d:"M8 20V6M8 6L4.5 9.5M8 6l3.5 3.5"}),c.jsx("path",{d:"M16 4v14M16 18l3.5-3.5M16 18l-3.5-3.5"})]});case"ports":return c.jsxs("svg",{...y,children:[c.jsx("rect",{x:"2.5",y:"8.5",width:"5",height:"7",rx:"1"}),c.jsx("rect",{x:"16.5",y:"8.5",width:"5",height:"7",rx:"1"}),c.jsx("path",{d:"M7.5 12h9M14 9.5l2.5 2.5L14 14.5"})]});case"port-plus":return c.jsxs("svg",{...y,children:[c.jsx("rect",{x:"2.5",y:"8.5",width:"5",height:"7",rx:"1"}),c.jsx("path",{d:"M7.5 12h7"}),c.jsx("path",{d:"M18.5 8v8M14.5 12h8"})]});case"folder":return c.jsx("svg",{...y,children:c.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 c.jsxs("svg",{...y,children:[c.jsx("path",{d:"M6 3.5h7L18 8v12.5H6z"}),c.jsx("path",{d:"M13 3.5V8h5"})]});case"link":return c.jsxs("svg",{...y,children:[c.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"}),c.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 c.jsxs("svg",{...y,children:[c.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"}),c.jsx("path",{d:"M11 11v5M8.5 13.5h5"})]});case"trash":return c.jsx("svg",{...y,children:c.jsx("path",{d:"M4.5 7h15M9 7V4.5h6V7M6.5 7l1 13h9l1-13"})});case"pencil":return c.jsx("svg",{...y,children:c.jsx("path",{d:"M4 20h4L20 8l-4-4L4 16z"})});case"refresh":return c.jsx("svg",{...y,children:c.jsx("path",{d:"M20 12a8 8 0 1 1-2.3-5.7L20 8.5M20 4v4.5h-4.5"})});case"arrow-up":return c.jsx("svg",{...y,children:c.jsx("path",{d:"M12 20V4M12 4l-6 6M12 4l6 6"})});case"arrow-down":return c.jsx("svg",{...y,children:c.jsx("path",{d:"M12 4v16M12 20l-6-6M12 20l6-6"})});case"level-up":return c.jsxs("svg",{...y,children:[c.jsx("path",{d:"M5 12l7-7 7 7"}),c.jsx("path",{d:"M12 5v14"})]});case"help":return c.jsxs("svg",{...y,children:[c.jsx("circle",{cx:"12",cy:"12",r:"9"}),c.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"}),c.jsx("path",{d:"M12 17.2h.01"})]});case"copy":return c.jsxs("svg",{...y,children:[c.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),c.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 c.jsxs("svg",{...y,children:[c.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),c.jsx("path",{d:"M8 12h7"}),c.jsx("path",{d:"M12.5 9l2.5 3-2.5 3"})]});case"info":return c.jsxs("svg",{...y,children:[c.jsx("circle",{cx:"12",cy:"12",r:"9"}),c.jsx("path",{d:"M12 11v5"}),c.jsx("path",{d:"M12 8h.01"})]});default:return c.jsx("span",{className:"icon","aria-hidden":"true",children:"•"})}}function Ah(r){if(!r||r.kind!=="ssh")return null;const v=r.sshTarget||r.host;return v&&v!=="local"?v:null}function _g(r){return r?Ah(r)?{available:!0,reason:`Transfer files with ${r.host}`}:{available:!1,reason:`${r.name} is a local session — SFTP needs an SSH connection`}:{available:!1,reason:"Open an SSH session to transfer files"}}function Xr(r){return r.kind==="directory"||r.kind==="symlink"}function Y_(r,v,y=!1){return r.filter(b=>v.has(b.name)&&(y||b.kind!=="directory"))}function X_(r,v,y="file"){return v===0?r:`${r} ${v} ${v===1?y:`${y}s`}`}function Z_(r,v,y,b,j){if(b&&j){const P=j.indexOf(b),o=j.indexOf(v);if(P>=0&&o>=0){const f=y?new Set(r):new Set,p=Math.min(P,o),g=Math.max(P,o);for(const _ of j.slice(p,g+1))f.add(_);return f}}if(!y)return new Set([v]);const I=new Set(r);return I.has(v)?I.delete(v):I.add(v),I}const Dp=["\\\\wsl.localhost\\","\\\\wsl$\\"];function pg(r){if(!r)return null;if(r.kind==="ssh")return"posix";switch(r.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 Rh(r){return!!(r&&r.kind==="local"&&r.backend==="wsl"&&r.wslDistribution)}function mg(r,v){const b=v.replace(/\/+$/,"").split("/").filter(Boolean),j=b.length?b.join("\\"):".";return`${Dp[0]}${r}\\${j}`}function vg(r,v){const y=v.replace(/\//g,"\\");for(const b of Dp){const j=`${b}${r}`;if(!y.toLowerCase().startsWith(j.toLowerCase()))continue;return`/${y.slice(j.length).replace(/^\\+/,"").split("\\").filter(o=>o&&o!==".").join("/")}`}return null}function gg(r){return r?r.kind==="ssh"?"posix":Rh(r)?"unc":r.backend===void 0?null:r.host==="local"&&/^[A-Za-z]:/.test(r.cwd??"")?"windows":"posix":null}function Q_(r,v){if(!r)return null;const y=bg(r.cwd,v);return y?Rh(r)?y.startsWith("/")?mg(r.wslDistribution,y):null:y:null}function Sg(r,v){const y=Q_(r,v);return y||(!r||!v?null:Q_({...r,cwd:v},v))}function J_(r,v){return r?Rh(r)?vg(r.wslDistribution,v):v:null}function bg(r,v){return r?r==="~"?v??null:r.startsWith("~/")?v?`${v.replace(/\/+$/,"")}/${r.slice(2)}`:null:r:null}function yg(r,v){if(v==="posix"){const o=r.replace(/\/+$/,"");if(!o||o==="")return null;const f=o.lastIndexOf("/");return f<0?null:f===0?"/":o.slice(0,f)}if(v==="windows"){const o=r.replace(/[\\/]+$/,"");if(/^[A-Za-z]:$/.test(o))return null;const f=Math.max(o.lastIndexOf("\\"),o.lastIndexOf("/"));if(f<0)return null;const p=o.slice(0,f);return/^[A-Za-z]:$/.test(p)?`${p}\\`:p}const b=r.replace(/\//g,"\\").replace(/\\+$/,"").match(/^(\\\\[^\\]+\\[^\\]+)(?:\\(.*))?$/);if(!b)return null;const[,j,I=""]=b,P=I.split("\\").filter(o=>o&&o!==".");return P.length?(P.pop(),P.length?`${j}\\${P.join("\\")}`:`${j}\\.`):null}const Cg=new RegExp(`[
|
|
18
|
+
\r]`);function wg(r,v){return v?Cg.test(v)?{refused:"That directory name contains a line break, which cannot be typed safely."}:r==="posix"?{command:`cd '${v.split("'").join(String.raw`'\''`)}'`}:r==="powershell"?{command:`Set-Location -LiteralPath '${v.split("'").join("''")}'`}:v.includes('"')?{refused:"Command Prompt cannot quote a directory name containing a double quote."}:{command:`cd /d "${v}"`}:{refused:"That directory has no path."}}function xg(r,v,y){return y==="posix"?r==="/"?`/${v}`:`${r.replace(/\/+$/,"")}/${v}`:`${r.replace(/\\\.$/,"").replace(/[\\/]+$/,"")}\\${v}`}function Eg({session:r,path:v,unanchored:y=!1,pathKind:b,shellPath:j,list:I,question:P,onOpen:o,onBrowse:f,onClose:p}){const[g,_]=Z.useState({phase:"idle"}),C=Z.useCallback(u=>{let l=!1;return _({phase:"loading",path:u??""}),I(u??void 0).then(h=>{l||_({phase:"ready",path:u??h.path,listing:h})}).catch(h=>{l||_({phase:"failed",path:u??"",message:h instanceof Error?h.message:String(h)})}),()=>{l=!0}},[I]);Z.useEffect(()=>{if(!v&&!y){_({phase:"idle"});return}return C(v)},[v,y,C]);const E=g.phase==="ready"?g.listing.path:v,M=E?yg(E,b):null,d=[...g.phase==="ready"?g.listing.entries:[]].sort((u,l)=>{const h=Xr(u)?0:1,S=Xr(l)?0:1;return h===S?u.name.localeCompare(l.name):h-S});return c.jsxs("div",{className:"pane-browser","aria-label":`Directories on ${r.host}`,children:[c.jsxs("div",{className:"pane-browser-head",children:[c.jsx("span",{className:"pane-browser-path",title:E??"",children:j??E??"connecting…"}),c.jsxs("span",{className:"pane-browser-actions",children:[c.jsx("button",{type:"button",className:"pane-browser-icon",disabled:g.phase!=="ready"&&g.phase!=="failed",onClick:()=>C(E??v),title:"Refresh","aria-label":"Refresh",children:c.jsx(Be,{name:"refresh"})}),c.jsx("button",{type:"button",className:"pane-browser-icon",onClick:p,title:"Close the browser","aria-label":"Close the browser",children:c.jsx(Be,{name:"x"})})]})]}),c.jsx("div",{className:"pane-browser-list",children:P&&g.phase==="loading"?c.jsxs("p",{className:"pane-browser-note pane-browser-asking",children:[P,c.jsx("br",{}),"Answer it in the transfer panel (⇅), then refresh."]}):g.phase==="idle"?c.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."}):g.phase==="failed"?c.jsx("p",{className:"pane-browser-note pane-browser-error",children:g.message}):c.jsxs(c.Fragment,{children:[M?c.jsx(ep,{label:"..",icon:"level-up",target:M,navigable:!0,className:"pane-browser-parent",onOpen:o,onBrowse:f},".."):null,d.map(u=>c.jsx(ep,{label:u.name,icon:Xr(u)?"folder":"file",target:xg(E??"",u.name,b),navigable:Xr(u),link:u.kind==="symlink",onOpen:o,onBrowse:f},u.name)),g.phase==="ready"&&!d.length?c.jsx("p",{className:"pane-browser-note",children:"Nothing here."}):null,g.phase==="loading"?c.jsx("p",{className:"pane-browser-note",children:"Listing…"}):null]})}),c.jsxs("div",{className:"pane-browser-foot",children:[c.jsx("small",{children:"Double-click a folder to take the shell there."}),c.jsx("button",{type:"button",className:"pane-browser-send",disabled:!E,onClick:()=>E&&o(E),title:"Take the shell to this directory","aria-label":"Take the shell to this directory",children:c.jsx(Be,{name:"send-right"})})]})]})}function ep({label:r,icon:v,target:y,navigable:b,link:j,className:I="",onOpen:P,onBrowse:o}){const f=xp(()=>b&&o(y),()=>b&&P(y));return c.jsxs("button",{type:"button",className:`pane-browser-row ${b?"":"pane-browser-file"} ${I}`.trim(),disabled:!b,onClick:f.onClick,onDoubleClick:f.onDoubleClick,onKeyDown:p=>{p.key!=="Enter"||!b||(p.preventDefault(),f.cancel(),P(y))},title:b?`${r} — double-click to take the shell there`:r,children:[c.jsx(Be,{name:v}),c.jsx("span",{className:"pane-browser-name",children:r}),j?c.jsx("span",{className:"pane-browser-kind",children:"link"}):null]})}const Cn=[{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"}],Th=[{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"}],Ag=[{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"}],Rg=[[/^Key([A-Z])$/,r=>r[1]],[/^Digit([0-9])$/,r=>r[1]],[/^F([1-9]|1[0-2])$/,r=>`F${r[1]}`],[/^Comma$/,()=>","],[/^Period$/,()=>"."],[/^Slash$/,()=>"/"],[/^Semicolon$/,()=>";"],[/^Quote$/,()=>"'"],[/^BracketLeft$/,()=>"["],[/^BracketRight$/,()=>"]"],[/^Minus$/,()=>"-"],[/^Equal$/,()=>"="],[/^Backquote$/,()=>"`"],[/^(Space|Enter|Tab|Backspace|Home|End|PageUp|PageDown|Insert|Delete)$/,r=>r[1]],[/^Arrow(Up|Down|Left|Right)$/,r=>r[1]]];function Tg(r){for(const[v,y]of Rg){const b=v.exec(r);if(b)return y(b)}return null}function kp(r){const v=r.ctrlKey||r.metaKey,y=!!r.altKey;if(!v||!(r.shiftKey||y))return null;const b=Tg(r.code);return b?["Ctrl",...y?["Alt"]:[],...r.shiftKey?["Shift"]:[],b].join("+"):null}const Dg=/^([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 Mp(r){if(typeof r!="string"||!r||r.length>40)return!1;const v=r.split("+"),y=v.pop();if(!Dg.test(y)||v[0]!=="Ctrl")return!1;const b=v.slice(1).join("+");return b==="Shift"||b==="Alt"||b==="Alt+Shift"}const Xo=Object.freeze(Object.fromEntries(Cn.map(r=>[r.action,r.chord]))),Lp=/^Ctrl\+Shift\+([1-9])$/;function Op(r,v,y={}){if(!Mp(r))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 b=Th.find(I=>I.chord===r);if(b)return`${r} is reserved: ${b.reason}.`;if(Lp.test(r))return`${r} switches to a workspace by position.`;const j=y[r];if(j&&j!==v){const I=Cn.find(P=>P.action===j)?.description??j;return`${r} is already ${I}.`}return null}function Dh(r={}){const v={...Xo},y=[],b=new Map;for(const{action:j}of Cn){const I=r?.[j];if(typeof I!="string"||!I||I===v[j])continue;const P=Op(I,j);if(P){y.push({action:j,chord:I,reason:P});continue}b.set(j,I)}for(const[j,I]of b)v[j]=I;for(const{action:j}of[...Cn].reverse()){const I=v[j],P=Object.entries(v).find(([f,p])=>f!==j&&p===I);if(!P||!b.has(j))continue;v[j]=Xo[j];const o=Cn.find(f=>f.action===P[0])?.description??P[0];y.push({action:j,chord:I,reason:`${I} is already ${o}.`})}return{chords:v,rejected:y}}const Jo=Dh();function gi(r,v=Jo){return v.chords[r]??Xo[r]}function kg(r,v=Jo){return gi(r,v)!==Xo[r]}function Mg(r,v=Jo){if(r.inTextField)return null;const y=kp(r);if(!y)return null;const b=Lp.exec(y);if(b)return{action:"switch-workspace",position:Number(b[1])};for(const[j,I]of Object.entries(v.chords))if(I===y)return{action:j};return null}const Lg=["help","transfer","settings","voiceReview","overview","suggest","modal","palette","history"];function Og(r){return Lg.find(v=>r[v])??null}function Bg(r=Jo){return[...Cn.map(({action:v,description:y})=>({chord:gi(v,r),description:y})),{chord:"Ctrl+Shift+1 … 9",description:"switch to a workspace by position"},...Th.map(v=>({chord:v.chord,description:v.description})),{chord:"Esc",description:"close whatever is open, or cancel a recording"}]}const jg=40;function Bp(r){if(typeof r!="string")return null;const v=r.trim();return!v||v.length>jg?null:v.startsWith("v")||v.startsWith("V")?v:`v${v}`}function jp(r){const v=Bp(r);return v?`ZeroG Terminal ${v}`:"ZeroG Terminal"}const Ng=r=>[{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:`${gi("history-palette",r)} 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 Hg({version:r,bindings:v,onClose:y}){const b=Ag.filter(j=>Object.values(v.chords).includes(j.chord));return c.jsx("div",{className:"modal-layer",role:"dialog","aria-modal":"true","aria-label":"Help",children:c.jsxs("div",{className:"help-card",children:[c.jsxs("div",{className:"modal-head",children:[c.jsxs("div",{children:[c.jsx("span",{className:"eyebrow",children:"HELP"}),c.jsx("h2",{children:jp(r)})]}),c.jsx("button",{type:"button",className:"close-button",onClick:y,children:"Esc"})]}),c.jsxs("div",{className:"help-body",children:[c.jsxs("section",{className:"help-keys","aria-label":"Keyboard shortcuts",children:[c.jsx("h3",{children:"Keyboard"}),c.jsx("table",{children:c.jsx("tbody",{children:Bg(v).map(j=>c.jsxs("tr",{children:[c.jsx("th",{scope:"row",children:c.jsx("kbd",{children:j.chord})}),c.jsx("td",{children:j.description})]},j.chord))})}),c.jsxs("p",{className:"help-note",children:[c.jsx(Be,{name:"info"}),c.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",b.length?", and ":". ",b.map((j,I)=>c.jsxs(Jn.Fragment,{children:[I>0?"; ":"",c.jsx("kbd",{children:j.chord})," is also ",j.owner]},j.chord)),b.length?". ":"","Any of them can be moved in Settings, and every one has a button that does the same job."]})]})]}),c.jsxs("section",{className:"help-features","aria-label":"Features",children:[c.jsx("h3",{children:"What is here"}),c.jsx("dl",{children:Ng(v).map(j=>c.jsxs(Jn.Fragment,{children:[c.jsx("dt",{children:j.title}),c.jsx("dd",{children:j.body})]},j.title))})]})]}),c.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 yn(r,v){return v.startsWith("/")?v:r==="/"?`/${v}`:`${r.replace(/\/+$/,"")}/${v}`}function zg(r){const v=r.replace(/\/+$/,""),y=v.lastIndexOf("/");return y<=0?"/":v.slice(0,y)}function Np(r){return/^[A-Za-z]:/.test(r)||r.startsWith("\\\\")||r.includes("\\")}function Kr(r,v){const y=Np(r)?"\\":"/";return`${r.replace(/[\\/]+$/,"")}${y}${v}`}function Ug(r){const v=Np(r),y=r.replace(/[\\/]+$/,""),b=Math.max(y.lastIndexOf("/"),y.lastIndexOf("\\"));if(b<0)return r;if(!v)return b===0?"/":y.slice(0,b);const j=y.slice(0,b);return/^[A-Za-z]:$/.test(j)?`${j}\\`:j||"\\"}function Ig(r){const v=r.split(/[\\/]/).filter(Boolean);return v[v.length-1]??r}function Pg(r){if(r.kind==="directory")return"—";const v=["B","KB","MB","GB","TB"];let y=r.size,b=0;for(;y>=1024&&b<v.length-1;)y/=1024,b+=1;return`${b===0?y:y.toFixed(y<10?1:0)} ${v[b]}`}function $g(r){if(!r)return"";const v=r.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/);if(!v)return r;const[,y,b,j,I,P]=v;return`${y}-${b}-${j} ${I}:${P}`}const er="\x1B",Zo="\x07",qg=new RegExp(er+"\\]7;([^"+Zo+er+"]*)(?:"+Zo+"|"+er+"\\\\)","g"),Fg=new RegExp(er+"\\][^"+Zo+er+"]*(?:"+Zo+"|"+er+"\\\\)","g"),Wg=new RegExp(er+"\\[[0-9;?]*[ -/]*[@-~]","g");function Kg(r){const v=r.match(/^file:\/\/[^/]*(\/.*)$/);if(!v)return null;try{const y=decodeURIComponent(v[1]);return y.includes("\0")?null:y}catch{return null}}function Gg(r){const y=r.replace(Fg,"").replace(Wg,"").replace(/\r/g,`
|
|
19
|
+
`).split(`
|
|
20
|
+
`).filter(P=>P.trim()),b=y[y.length-1];if(!b)return null;const j=b.match(/(?:^|[:\s])(~|~\/[^\s:]*|\/[^\s:]*)\s*[#$%>]\s*$/);return j?j[1].replace(/\/+$/,"")||"/":null}function Vg(r){let v=null;for(const b of r.matchAll(qg))v=b[1];if(v){const b=Kg(v);if(b)return{path:b,source:"osc7"}}const y=Gg(r);return y?{path:y,source:"prompt"}:null}function Hp(r){return!r||r==="~"||r==="~/"?{}:r.startsWith("/")?{absolute:r}:r.startsWith("~/")?{homeRelative:r.slice(2)}:{}}const Yg=/connection is closed|not connected|no such connection/i;function Xg(r,v){const y=new Map,b=new Map,j=new Map;function I(){const p=r();if(!p)throw new Error("The terminal bridge is not available.");return p}async function P(p,g=!1){g&&(b.delete(p.id),j.delete(p.id));const _=b.get(p.id);if(_)return _;const C=j.get(p.id);if(C!==void 0)return C;const E=Ah(p);if(!E)throw new Error(`${p.name} has no SSH host to list.`);const M=I().sftpOpen(E).then(w=>{const d={handle:w.id,home:w.cwd};return b.set(p.id,d),v?.(p.id,w.cwd),d}).finally(()=>{j.delete(p.id)});return j.set(p.id,M),M}function o(p,g){if(!p)return;const _=Hp(p);return _.absolute?_.absolute:_.homeRelative?yn(g,_.homeRelative):g}async function f(p,g){const _=await P(p);try{return await I().sftpList(_.handle,o(g,_.home))}catch(C){const E=C instanceof Error?C.message:String(C);if(!Yg.test(E))throw C;const M=await P(p,!0);return await I().sftpList(M.handle,o(g,M.home))}}return{listerFor(p){const g=y.get(p.id);if(g)return g;const _=C=>p.kind==="ssh"?f(p,C):Promise.resolve().then(()=>I().listLocalDirectory(C));return y.set(p.id,_),_},homeFor(p){return b.get(p)?.home},async learnHome(p){if(p.kind!=="ssh")return;const g=b.get(p.id);return g?g.home:(await P(p)).home},forget(p){y.delete(p),b.delete(p),j.delete(p)}}}function Zg(r,v){if(!r)return;const y=vs(r);if(y)return v.find(b=>vs(b.hostName??"")===y||b.alias===y)}function Qg(r){return r.screenName?r.screenName:r.backend==="screen"?r.name:void 0}function Jg(r,v,y){return y.find(b=>b.screenName===r&&b.kind===v)??y.find(b=>b.screenName===r)}function ph(r,v,y){if(r.id){const I=v.find(P=>P.id===r.id);if(I)return{kind:"attach",sessionId:I.id}}const b=Qg(r);if(b){const I=Jg(b,r.kind,v);if(I)return{kind:"attach",sessionId:I.id};if(r.kind==="local")return{kind:"unavailable",reason:`No local screen session named ${b} is running`};const P=Zg(r.host,y);if(P)return{kind:"attach-remote-screen",connection:P,screenName:b,name:r.name};const o=r.sshTarget||r.host;return o?{kind:"create-ssh",target:o,name:r.name,screenCommand:`screen -x ${b}`}:{kind:"unavailable",reason:`No host recorded for ${r.name}`}}if(r.kind==="local")return{kind:"unavailable",reason:`${r.name} was not persistent and did not survive`};const j=r.sshTarget||r.host;return j?{kind:"create-ssh",target:j,name:r.name}:{kind:"unavailable",reason:`No host recorded for ${r.name}`}}function eS(r){const v=new Map;for(const y of r){const b=vs(y.target)||y.target,j=v.get(b)??{host:b,forwards:[]};j.forwards.push(y),v.set(b,j)}return[...v.values()]}function tS(r){return r.status==="open"?"connected":r.status==="error"?"error":r.status==="connecting"?"detached":""}function tp(r){const v=`${r.destinationHost||"localhost"}:${r.destinationPort}`;return r.direction==="local"?`${Zn(r)} → ${v}`:`${Zn(r)} → ${v} here`}function Zn(r){if(r.direction==="local")return`${r.bind==="all"?"0.0.0.0":"localhost"}:${r.listenPort}`;const v=vs(r.target)||r.target;return`${r.bind==="all"?`${v} (all)`:v}:${r.listenPort}`}function iS(r){return r.bind==="all"}function sS(r,v){const y=v.find(b=>b.id===r.id||b.listenPort!==r.listenPort||b.direction!==r.direction?!1:r.direction==="local"?!0:vs(b.target)===vs(r.target));return y?r.direction==="local"?`Port ${r.listenPort} is already shared from ${y.target}.`:`Port ${r.listenPort} is already shared to ${y.target}.`:null}function hl(r,v){const y=r.findIndex(j=>j.id===v.id);if(y<0)return[...r,v];const b=[...r];return b[y]=v,b}function nS(r){return{version:1,forwards:r.map(({status:v,message:y,...b})=>b)}}function rS(r){return r.forwards.map(v=>({...v,status:"idle"}))}function aS({session:r,target:v,api:y,onClose:b,backdrop:j}){const[I,P]=Z.useState(null),[o,f]=Z.useState(null),[p,g]=Z.useState(null),[_,C]=Z.useState({local:!0,remote:!0}),[E,M]=Z.useState({local:new Set,remote:new Set}),[w,d]=Z.useState({local:"",remote:""}),[u,l]=Z.useState("Connecting…"),[h,S]=Z.useState({}),[T,R]=Z.useState(null),[D,x]=Z.useState(null),[B,K]=Z.useState(""),[F,J]=Z.useState(null),[O,te]=Z.useState(null),[he,G]=Z.useState(null),ae=Z.useRef({local:null,remote:null}),le=Z.useRef(null),L=Z.useRef(void 0),$=Z.useRef(void 0);L.current=I?.path,$.current=o?.path;const k=Z.useRef(!0);Z.useEffect(()=>()=>{k.current=!1},[]);const z=Z.useCallback(pe=>{const ve=pe instanceof Error?pe.message:String(pe);return l(ve),ve},[]),Y=Z.useCallback(async pe=>{C(ve=>({...ve,local:!0}));try{const ve=await y.listLocalDirectory(pe);if(!k.current)return;P(ve),d(we=>({...we,local:ve.path})),M(we=>({...we,local:new Set})),S(we=>({...we,local:void 0}))}catch(ve){if(!k.current)return;S(we=>({...we,local:z(ve)}))}finally{k.current&&C(ve=>({...ve,local:!1}))}},[y,z]),ne=Z.useCallback(async pe=>{const ve=le.current;if(ve){C(we=>({...we,remote:!0}));try{const we=await y.sftpList(ve,pe);if(!k.current)return;f(we),d(ze=>({...ze,remote:we.path})),M(ze=>({...ze,remote:new Set})),S(ze=>({...ze,remote:void 0}))}catch(we){if(!k.current)return;S(ze=>({...ze,remote:z(we)}))}finally{k.current&&C(we=>({...we,remote:!1}))}}},[y,z]);Z.useEffect(()=>y.onSftpEvent?.(pe=>{if(!k.current)return;const ve=le.current;if(pe.type==="prompt"){if(ve&&pe.prompt.sessionId!==ve)return;le.current=pe.prompt.sessionId,x(pe.prompt),K("");return}ve&&pe.sessionId!==ve||(pe.type==="progress"&&R({name:pe.name,percent:pe.percent,detail:pe.detail}),pe.type==="status"&&l(pe.message),pe.type==="closed"&&(le.current=null,g(null),S(we=>({...we,remote:pe.message})),l(pe.message)))}),[y]),Z.useEffect(()=>{Y();const pe=Hp(r.cwd);let ve=!1;return(async()=>{try{const we=await y.sftpOpen(v,pe.absolute);if(ve||!k.current)return;le.current=we.id,g(we),x(null),l(`Connected to ${we.target}`),await ne(pe.homeRelative?yn(we.cwd,pe.homeRelative):void 0)}catch(we){if(ve||!k.current)return;x(null),C(ze=>({...ze,remote:!1})),S(ze=>({...ze,remote:z(we)}))}})(),()=>{ve=!0}},[]);const _e=Z.useCallback(pe=>pe==="local"?Y(L.current):ne($.current),[Y,ne]),Se=(pe,ve)=>pe==="local"?Y(ve):ne(ve),Q=Z.useMemo(()=>Y_(I?.entries??[],E.local),[I,E.local]),U=Z.useMemo(()=>Y_(o?.entries??[],E.remote,!0),[o,E.remote]),oe=T!==null,me=async pe=>{const ve=le.current;if(!ve||!I||!o)return;const we=pe==="upload"?Q:U;if(!we.length)return;R({name:we[0].name,percent:0,detail:"starting"});let ze=0;try{for(const Ie of we)l(`${pe==="upload"?"Uploading":"Downloading"} ${Ie.name}…`),pe==="upload"?await y.sftpUpload(ve,Kr(I.path,Ie.name),o.path):await y.sftpDownload(ve,yn(o.path,Ie.name),I.path,Ie.kind),ze+=1;l(`${pe==="upload"?"Uploaded":"Downloaded"} ${ze} ${ze===1?"file":"files"}.`)}catch(Ie){const Pe=z(Ie);l(`${Pe} (${ze} of ${we.length} transferred)`)}finally{k.current&&(R(null),await _e(pe==="upload"?"remote":"local"))}},Ce=async pe=>{if(pe.preventDefault(),!F)return;const ve=F.value.trim(),we=F.side;if(ve)try{we==="local"&&I?await y.createLocalDirectory(Kr(I.path,ve)):we==="remote"&&o&&le.current&&await y.sftpMkdir(le.current,yn(o.path,ve)),J(null),l(`Created ${ve}`),await _e(we)}catch(ze){z(ze)}},ye=async pe=>{if(pe.preventDefault(),!O)return;const ve=O.value.trim(),{side:we,entry:ze}=O;if(!ve||ve===ze.name){te(null);return}try{we==="local"&&I?await y.renameLocalEntry(Kr(I.path,ze.name),Kr(I.path,ve)):we==="remote"&&o&&le.current&&await y.sftpRename(le.current,yn(o.path,ze.name),yn(o.path,ve)),te(null),l(`Renamed to ${ve}`),await _e(we)}catch(Ie){z(Ie)}},Me=async()=>{if(!he)return;const{side:pe,entry:ve}=he;try{pe==="local"&&I?await y.removeLocalEntry(Kr(I.path,ve.name),ve.kind):pe==="remote"&&o&&le.current&&await y.sftpRemove(le.current,yn(o.path,ve.name),ve.kind),G(null),l(`Deleted ${ve.name}`),await _e(pe)}catch(we){z(we)}},Ue=async pe=>{pe.preventDefault();const ve=le.current;if(!ve||!D)return;const we=D.kind==="confirm"?"yes":B;x(null),K(""),l(D.kind==="confirm"?"Accepting host key…":"Authenticating…");try{await y.sftpAnswerPrompt(ve,we)}catch(ze){z(ze)}},Ve=async pe=>{const ve=le.current;if(x(null),K(""),l(pe==="confirm"?"Host key rejected.":"Cancelled. The transfer connection was closed."),!!ve)try{pe==="confirm"?await y.sftpAnswerPrompt(ve,"no"):await y.sftpClose(ve)}catch{}},it=(pe,ve)=>{if(!Xr(ve))return;const we=pe==="local"?I?.path:o?.path;we&&Se(pe,pe==="local"?Kr(we,ve.name):yn(we,ve.name))},De=pe=>{const ve=pe==="local"?E.local:E.remote,we=(pe==="local"?I?.entries:o?.entries)??[];return ve.size!==1?null:we.find(ze=>ve.has(ze.name))??null},ri=pe=>{const ve=pe==="local"?I:o,we=pe==="local"?E.local:E.remote,ze=pe==="local"?h.local:h.remote,Ie=pe==="local"?_.local:_.remote,Pe=De(pe),pt=pe==="remote"&&!p;return c.jsxs("section",{className:`sftp-pane sftp-pane-${pe}`,children:[c.jsxs("header",{className:"sftp-pane-head",children:[c.jsx("span",{className:"eyebrow",children:pe==="local"?"THIS COMPUTER":r.host.toUpperCase()}),c.jsxs("div",{className:"sftp-pane-tools",children:[c.jsx("button",{type:"button",title:"Parent folder","aria-label":`${pe} parent folder`,disabled:!ve||Ie,onClick:()=>ve&&void Se(pe,pe==="local"?Ug(ve.path):zg(ve.path)),children:c.jsx(Be,{name:"level-up"})}),c.jsx("button",{type:"button",title:"Refresh","aria-label":`Refresh ${pe}`,disabled:Ie||pt,onClick:()=>{_e(pe)},children:c.jsx(Be,{name:"refresh"})}),c.jsx("button",{type:"button",title:"New folder","aria-label":`New folder on ${pe}`,disabled:!ve||pt,onClick:()=>J({side:pe,value:""}),children:c.jsx(Be,{name:"folder-plus"})}),c.jsx("button",{type:"button",title:Pe?`Rename ${Pe.name}`:"Select one item to rename","aria-label":`Rename on ${pe}`,disabled:!Pe||pt,onClick:()=>Pe&&te({side:pe,entry:Pe,value:Pe.name}),children:c.jsx(Be,{name:"pencil"})}),c.jsx("button",{type:"button",className:"sftp-danger",title:Pe?`Delete ${Pe.name}`:"Select one item to delete","aria-label":`Delete on ${pe}`,disabled:!Pe||pt,onClick:()=>Pe&&G({side:pe,entry:Pe}),children:c.jsx(Be,{name:"trash"})})]})]}),c.jsx("form",{className:"sftp-path",onSubmit:Ye=>{Ye.preventDefault();const ut=(pe==="local"?w.local:w.remote).trim();ut&&Se(pe,ut)},children:c.jsx("input",{value:pe==="local"?w.local:w.remote,onChange:Ye=>{const ut=Ye.target.value;d(bt=>pe==="local"?{...bt,local:ut}:{...bt,remote:ut})},spellCheck:!1,"aria-label":`${pe} path`,placeholder:pe==="local"?"Local folder":"Remote folder",disabled:pt})}),c.jsx("div",{className:"sftp-list",role:"listbox","aria-label":`${pe} files`,"aria-busy":Ie,children:ze?c.jsxs("div",{className:"sftp-empty sftp-error",children:[c.jsx("b",{children:pe==="local"?"Cannot read this folder":"No remote listing"}),c.jsx("small",{children:ze})]}):Ie&&!ve?c.jsxs("div",{className:"sftp-empty",children:[c.jsx("b",{children:pe==="remote"&&!p?"Connecting…":"Loading…"}),c.jsx("small",{children:pe==="remote"?`Opening SFTP to ${r.host}`:"Reading the local folder"})]}):ve&&ve.entries.length?ve.entries.map(Ye=>c.jsxs("button",{type:"button",role:"option","aria-selected":we.has(Ye.name),className:`sftp-row ${we.has(Ye.name)?"selected":""} ${Ye.kind==="directory"?"is-directory":""}`,onClick:ut=>{const bt=ut.ctrlKey||ut.metaKey,ki=ae.current[pe],xt=ut.shiftKey&&ki?ki:void 0,Si=ve?.entries.map(Ke=>Ke.name);M(Ke=>pe==="local"?{...Ke,local:Z_(Ke.local,Ye.name,bt,xt,Si)}:{...Ke,remote:Z_(Ke.remote,Ye.name,bt,xt,Si)}),ut.shiftKey||(ae.current[pe]=Ye.name)},onDoubleClick:()=>it(pe,Ye),onKeyDown:ut=>{ut.key!=="Enter"||!Xr(Ye)||(ut.preventDefault(),it(pe,Ye))},title:Ye.linkTarget?`${Ye.name} → ${Ye.linkTarget}`:Ye.name,children:[c.jsx(Be,{name:Ye.kind==="directory"?"folder":Ye.kind==="symlink"?"link":"file"}),c.jsx("span",{className:"sftp-name",children:Ye.name}),c.jsx("span",{className:"sftp-size",children:Pg(Ye)}),c.jsx("span",{className:"sftp-modified",children:$g(Ye.modified)})]},Ye.name)):c.jsxs("div",{className:"sftp-empty",children:[c.jsx("b",{children:"Empty folder"}),c.jsx("small",{children:"Nothing here to transfer."})]})}),c.jsxs("footer",{className:"sftp-pane-foot",children:[pe==="local"?c.jsxs("button",{type:"button",className:"primary-button",disabled:!Q.length||!p||oe,onClick:()=>{me("upload")},title:Q.length?`Copy to ${r.host}`:"Select files to upload",children:[c.jsx(Be,{name:"arrow-up"})," ",X_("Upload",Q.length)]}):c.jsxs("button",{type:"button",className:"primary-button",disabled:!U.length||!p||oe,onClick:()=>{me("download")},title:U.length?"Copy to this computer":"Select files to download",children:[c.jsx(Be,{name:"arrow-down"})," ",X_("Download",U.length,"item")]}),c.jsx("span",{className:"sftp-count",children:ve?`${ve.entries.length} items`:""})]})]})};return c.jsx("div",{className:"sftp-layer",role:"presentation",...j,children:c.jsxs("section",{className:"sftp-panel",role:"dialog","aria-label":"Transfer files",children:[c.jsxs("div",{className:"sftp-head",children:[c.jsxs("div",{children:[c.jsx("span",{className:"eyebrow",children:"TRANSFER FILES"}),c.jsxs("h2",{children:[r.name," · ",r.host]})]}),c.jsx("button",{type:"button",className:"close-button",onClick:b,children:"Esc"})]}),c.jsxs("div",{className:"sftp-body",children:[ri("local"),ri("remote")]}),D&&c.jsxs("form",{className:"sftp-prompt",onSubmit:Ue,children:[c.jsx("span",{className:"eyebrow warning-text",children:D.kind==="confirm"?"HOST KEY":"AUTHENTICATION"}),c.jsx("pre",{children:D.text}),D.kind==="confirm"?c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>{Ve("confirm")},children:"Reject"}),c.jsx("button",{type:"submit",className:"primary-button",children:"Accept key"})]}):c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:[D.kind==="passphrase"?"Key passphrase":"Password",c.jsx("input",{autoFocus:!0,type:"password",value:B,onChange:pe=>K(pe.target.value),autoComplete:"off"})]}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>{Ve(D.kind)},children:"Cancel"}),c.jsx("button",{type:"submit",className:"primary-button",children:"Send"})]})]})]}),F&&c.jsxs("form",{className:"sftp-inline-form",onSubmit:Ce,children:[c.jsxs("label",{children:["New folder in ",F.side==="local"?I?.path:o?.path,c.jsx("input",{autoFocus:!0,value:F.value,onChange:pe=>J({...F,value:pe.target.value}),required:!0})]}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>J(null),children:"Cancel"}),c.jsx("button",{type:"submit",className:"primary-button",children:"Create"})]})]}),O&&c.jsxs("form",{className:"sftp-inline-form",onSubmit:ye,children:[c.jsxs("label",{children:["Rename ",O.entry.name,c.jsx("input",{autoFocus:!0,value:O.value,onChange:pe=>te({...O,value:pe.target.value}),required:!0})]}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>te(null),children:"Cancel"}),c.jsx("button",{type:"submit",className:"primary-button",children:"Rename"})]})]}),he&&c.jsxs("div",{className:"sftp-inline-form",children:[c.jsx("span",{className:"eyebrow warning-text",children:"CONFIRM DELETE"}),c.jsxs("p",{children:["Delete ",c.jsx("b",{children:he.entry.name})," from ",he.side==="local"?"this computer":r.host,"?",he.entry.kind==="directory"?" Only an empty folder can be deleted here.":""]}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",autoFocus:!0,onClick:()=>G(null),children:"Cancel"}),c.jsx("button",{type:"button",className:"primary-button sftp-danger-button",onClick:()=>{Me()},children:"Delete"})]})]}),c.jsxs("footer",{className:"sftp-foot",children:[T?c.jsxs("div",{className:"sftp-progress",role:"progressbar","aria-valuenow":T.percent,"aria-valuemin":0,"aria-valuemax":100,"aria-label":`Transferring ${T.name}`,children:[c.jsx("div",{className:"sftp-progress-fill",style:{width:`${T.percent}%`}}),c.jsxs("span",{children:[Ig(T.name)," · ",T.percent,"% · ",T.detail]})]}):c.jsx("span",{className:"sftp-notice",children:u}),c.jsx("span",{className:"sftp-hint",children:"Double-click a folder to open · Ctrl-click to select several · Esc closes"})]})]})})}const ip={q4:96,q8:41,fp16:76,fp32:152},sp={q4:142,q8:77,fp16:146,fp32:291},np={q4:299,q8:249,fp16:485,fp32:968},kh=[{id:"onnx-community/whisper-tiny.en",label:"Whisper tiny · English",family:"tiny",multilingual:!1,downloadMb:ip},{id:"onnx-community/whisper-base.en",label:"Whisper base · English",family:"base",multilingual:!1,downloadMb:sp},{id:"onnx-community/whisper-small.en",label:"Whisper small · English",family:"small",multilingual:!1,downloadMb:np},{id:"onnx-community/whisper-tiny",label:"Whisper tiny · multilingual",family:"tiny",multilingual:!0,downloadMb:ip},{id:"onnx-community/whisper-base",label:"Whisper base · multilingual",family:"base",multilingual:!0,downloadMb:sp},{id:"onnx-community/whisper-small",label:"Whisper small · multilingual",family:"small",multilingual:!0,downloadMb:np}],lS="onnx-community/whisper-tiny.en",rp=[{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"}],zp=[{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 ec(r){return kh.find(v=>v.id===r)}function oS(r){return ec(r)?.multilingual??!1}function cS(r,v){return ec(r)?.downloadMb[v]??null}function uS(r,v){const y=cS(r,v);return y===null?"Download size unknown":`≈${y} MB download, cached after first use`}const hS={bash:"bash",zsh:"zsh",fish:"fish",sh:"sh",powershell:"Windows PowerShell",pwsh:"PowerShell 7",cmd:"Command Prompt",wsl:"WSL"};function Up(r){return hS[r]??r}const Ip="zerog-settings",Pp="zerog-theme",Le={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:lS,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"}},vt={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}},ap={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'},dS=[{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 Ch(r){return ap[r]??ap.system}function fS(r){const v={};for(const{action:y}of Cn){const b=r[y];Mp(b)&&(v[y]=b)}return v}function Gn(r){return typeof r=="object"&&r!==null}function Di(r,v,y){return typeof r=="string"&&v.includes(r)?r:y}function Gr(r,v){return typeof r=="boolean"?r:v}function ps(r,v,y){return typeof r!="number"||!Number.isFinite(r)?y:Math.min(v.max,Math.max(v.min,r))}function dl(r,v,y=512){return typeof r!="string"?v:r.slice(0,y)}function _S(r,v,y=200){return typeof r!="string"?v:Array.from(r.slice(0,y),b=>{const j=b.codePointAt(0)??0;return j<32||j===127?" ":b}).join("")}function lp(r){return r.proceedPhrase.trim()||Le.ai.proceedPhrase}const op=["dark","light"],pS=["stack","split-v","split-h","grid"],$p=["bash","zsh","fish","sh","powershell","pwsh","cmd","wsl"],mS=["block","underline","bar"],vS=["system","jetbrains","cascadia","consolas","fira","menlo"],gS=["builtin","server"],SS=["wasm","webgpu"],bS=["q4","q8","fp16","fp32"],yS=["transcribe","translate"],CS=["type","review"];function Qn(r,v){const y=Gn(r)?r:{},b=Gn(y.appearance)?y.appearance:{},j=Gn(y.terminal)?y.terminal:{},I=Gn(y.sessions)?y.sessions:{},P=Gn(y.ai)?y.ai:{},o=Gn(y.speech)?y.speech:{},f=Gn(y.shortcuts)?y.shortcuts:{},p=Di(v,op,Le.appearance.theme),g=Di(o.engine,gS,Le.speech.engine),_=Di(o.model,kh.map(E=>E.id),Le.speech.model),C=g==="server"||ec(_)?.multilingual?Di(o.language,zp.map(E=>E.value),Le.speech.language):"auto";return{shortcuts:fS(f),appearance:{theme:Di(b.theme,op,p),font:Di(b.font,vS,Le.appearance.font),fontSize:Math.round(ps(b.fontSize,vt.fontSize,Le.appearance.fontSize)),lineHeight:ps(b.lineHeight,vt.lineHeight,Le.appearance.lineHeight),letterSpacing:ps(b.letterSpacing,vt.letterSpacing,Le.appearance.letterSpacing)},terminal:{scrollback:Math.round(ps(j.scrollback,vt.scrollback,Le.terminal.scrollback)),cursorStyle:Di(j.cursorStyle,mS,Le.terminal.cursorStyle),cursorBlink:Gr(j.cursorBlink,Le.terminal.cursorBlink),copyOnSelect:Gr(j.copyOnSelect,Le.terminal.copyOnSelect)},sessions:{defaultBackend:Di(I.defaultBackend,$p,Le.sessions.defaultBackend),defaultWslDistribution:dl(I.defaultWslDistribution,Le.sessions.defaultWslDistribution,64),defaultLayout:Di(I.defaultLayout,pS,Le.sessions.defaultLayout),startSidebarCollapsed:Gr(I.startSidebarCollapsed,Le.sessions.startSidebarCollapsed),sidebarWidth:Math.round(ps(I.sidebarWidth,vt.sidebarWidth,Le.sessions.sidebarWidth)),splitColumnRatio:ps(I.splitColumnRatio,vt.splitRatio,Le.sessions.splitColumnRatio),splitRowRatio:ps(I.splitRowRatio,vt.splitRatio,Le.sessions.splitRowRatio)},ai:{requireApproval:Gr(P.requireApproval,Le.ai.requireApproval),voiceInsert:Di(P.voiceInsert,CS,Le.ai.voiceInsert),proceedPhrase:_S(P.proceedPhrase,Le.ai.proceedPhrase),recordCommands:Gr(P.recordCommands,Le.ai.recordCommands),baseUrl:dl(P.baseUrl,Le.ai.baseUrl,512),model:dl(P.model,Le.ai.model,200),includeOutput:Gr(P.includeOutput,Le.ai.includeOutput),outputChars:Math.round(ps(P.outputChars,vt.outputChars,Le.ai.outputChars))},speech:{engine:g,model:_,precision:Di(o.precision,bS,Le.speech.precision),device:Di(o.device,SS,Le.speech.device),language:C,task:Di(o.task,yS,Le.speech.task),maxUtteranceSeconds:Math.round(ps(o.maxUtteranceSeconds,vt.maxUtteranceSeconds,Le.speech.maxUtteranceSeconds)),silenceThreshold:ps(o.silenceThreshold,vt.silenceThreshold,Le.speech.silenceThreshold),serverUrl:dl(o.serverUrl,Le.speech.serverUrl,512),serverModel:dl(o.serverModel,Le.speech.serverModel,128)}}}function wS(r){if(!r)return Qn(void 0);let v=null,y=null;try{v=r.getItem(Ip),y=r.getItem(Pp)}catch{return Qn(void 0)}if(!v)return Qn(void 0,y);try{return Qn(JSON.parse(v),y)}catch{return Qn(void 0,y)}}function cp(r,v){if(r)try{r.setItem(Ip,JSON.stringify(v)),r.setItem(Pp,v.appearance.theme)}catch{}}function up(r,v,y){return Qn({...r,[v]:{...r[v],...y}})}function qp(r,v){if(v.some(b=>b.backend===r))return r;const y=v[0]?.backend;return y&&$p.includes(y)?y:r}function xS(r){const v=r.engine==="builtin",y=ec(r.model)?.multilingual??!1;return{model:v,precision:v,device:v,language:v?y:!0,task:v&&y,server:!v}}function ES(r,v){return Qn({...r,[v]:Le[v]})}const AS=new Set(["127.0.0.1","localhost","::1","[::1]"]);function Fp(r){try{const v=new URL(r);return v.protocol!=="http:"&&v.protocol!=="https:"||!v.hostname?null:v}catch{return null}}function Wp(r){const v=Fp(r);return v===null?null:v.hostname.toLowerCase()}function Mh(r){return Wp(r)!==null}function tc(r){const v=Wp(r);return v===null?!1:AS.has(v)||v.endsWith(".localhost")}function RS(r){const v=Fp(r);return v===null?!1:v.protocol==="http:"&&!tc(r)}const TS=12e4,DS=300;function qo(r,v,y){for(let b=0;b<y.length;b+=1)r.setUint8(v+b,y.charCodeAt(b))}function kS(r,v=Vo){const b=r.length*2,j=new ArrayBuffer(44+b),I=new DataView(j);qo(I,0,"RIFF"),I.setUint32(4,36+b,!0),qo(I,8,"WAVE"),qo(I,12,"fmt "),I.setUint32(16,16,!0),I.setUint16(20,1,!0),I.setUint16(22,1,!0),I.setUint32(24,v,!0),I.setUint32(28,v*2,!0),I.setUint16(32,2,!0),I.setUint16(34,16,!0),qo(I,36,"data"),I.setUint32(40,b,!0);for(let P=0;P<r.length;P+=1){const o=Math.max(-1,Math.min(1,r[P]));I.setInt16(44+P*2,Math.round(o*32767),!0)}return j}function MS(r){if(typeof r=="string"){const b=r.trim();return b||null}if(typeof r!="object"||r===null)return null;const v=r;if(typeof v.text=="string"&&v.text.trim())return v.text.trim();const y=v.segments;if(Array.isArray(y)){const b=y.map(j=>typeof j=="object"&&j!==null?j.text:null).filter(j=>typeof j=="string").join(" ").trim();if(b)return b}if(typeof v.error=="string")throw new Error(v.error);return null}function LS(r){const v=kS(r.audio,r.sampleRate??Vo),y=new FormData;return y.set("file",new Blob([v],{type:"audio/wav"}),"utterance.wav"),y.set("model",r.model),y.set("response_format","json"),r.language&&r.language!=="auto"&&y.set("language",r.language),y}function OS(){return typeof AbortSignal<"u"&&typeof AbortSignal.timeout=="function"?AbortSignal.timeout(TS):void 0}async function BS(r,v=fetch){if(!Mh(r.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(!r.model.trim())throw new Error("Speech server model name is required");const y=r.apiKey?.trim(),b=await v(r.url,{method:"POST",headers:y?{Authorization:`Bearer ${y}`}:void 0,body:LS(r),signal:OS()}),j=await b.text();if(!b.ok){const o=j.slice(0,DS).trim(),f=!y&&(b.status===401||b.status===403)?" — this server wants an API key":"";throw new Error(`Speech server returned ${b.status}${o?`: ${o}`:""}${f}`)}let I=j;try{I=JSON.parse(j)}catch{}const P=MS(I);if(P===null)throw new Error("Speech server returned no transcript");return P}const Kp=[{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"}],jS=`# ZeroG shell integration — reports prompt and command marks (OSC 133).
|
|
21
|
+
__zerog_at_prompt=1
|
|
22
|
+
__zerog_preexec() {
|
|
23
|
+
[ -n "\${COMP_LINE-}" ] && return
|
|
24
|
+
[ -z "\${__zerog_at_prompt-}" ] && return
|
|
25
|
+
__zerog_at_prompt=
|
|
26
|
+
printf '\\033]133;C\\007'
|
|
27
|
+
}
|
|
28
|
+
__zerog_precmd() {
|
|
29
|
+
local status=$?
|
|
30
|
+
printf '\\033]133;D;%s\\007' "$status"
|
|
31
|
+
printf '\\033]7;file://%s%s\\007' "$HOSTNAME" "$PWD"
|
|
32
|
+
__zerog_at_prompt=1
|
|
33
|
+
printf '\\033]133;A\\007'
|
|
34
|
+
}
|
|
35
|
+
trap '__zerog_preexec' DEBUG
|
|
36
|
+
PROMPT_COMMAND="__zerog_precmd\${PROMPT_COMMAND:+;$PROMPT_COMMAND}"
|
|
37
|
+
PS1="\\[\\033]133;A\\007\\]$PS1\\[\\033]133;B\\007\\]"`,NS=`# ZeroG shell integration — reports prompt and command marks (OSC 133).
|
|
38
|
+
autoload -Uz add-zsh-hook
|
|
39
|
+
__zerog_preexec() { printf '\\033]133;C\\007' }
|
|
40
|
+
__zerog_precmd() {
|
|
41
|
+
printf '\\033]133;D;%s\\007' "$?"
|
|
42
|
+
printf '\\033]7;file://%s%s\\007' "$HOST" "$PWD"
|
|
43
|
+
}
|
|
44
|
+
add-zsh-hook preexec __zerog_preexec
|
|
45
|
+
add-zsh-hook precmd __zerog_precmd
|
|
46
|
+
PS1=$'%{\\033]133;A\\007%}'$PS1$'%{\\033]133;B\\007%}'`,HS=`# ZeroG shell integration — reports prompt and command marks (OSC 133).
|
|
47
|
+
# Add this at the end of config.fish, after your prompt is defined.
|
|
48
|
+
if not functions -q __zerog_inner_prompt
|
|
49
|
+
functions --copy fish_prompt __zerog_inner_prompt
|
|
50
|
+
end
|
|
51
|
+
function fish_prompt
|
|
52
|
+
printf '\\033]133;A\\007'
|
|
53
|
+
printf '\\033]7;file://%s%s\\007' (hostname) "$PWD"
|
|
54
|
+
__zerog_inner_prompt
|
|
55
|
+
printf '\\033]133;B\\007'
|
|
56
|
+
end
|
|
57
|
+
function __zerog_preexec --on-event fish_preexec
|
|
58
|
+
printf '\\033]133;C\\007'
|
|
59
|
+
end
|
|
60
|
+
function __zerog_postexec --on-event fish_postexec
|
|
61
|
+
printf '\\033]133;D;%s\\007' $status
|
|
62
|
+
end`,zS=`# ZeroG shell integration — reports prompt and command marks (OSC 133).
|
|
63
|
+
$global:__zerogPrompt = $function:prompt
|
|
64
|
+
function prompt {
|
|
65
|
+
$status = if ($?) { 0 } else { 1 }
|
|
66
|
+
[Console]::Write("\`e]133;D;$status\`a")
|
|
67
|
+
[Console]::Write("\`e]7;file://$env:COMPUTERNAME$($PWD.Path)\`a")
|
|
68
|
+
[Console]::Write("\`e]133;A\`a")
|
|
69
|
+
$text = & $global:__zerogPrompt
|
|
70
|
+
[Console]::Write("\`e]133;B\`a")
|
|
71
|
+
return $text
|
|
72
|
+
}
|
|
73
|
+
try {
|
|
74
|
+
Set-PSReadLineKeyHandler -Chord Enter -ScriptBlock {
|
|
75
|
+
[Console]::Write("\`e]133;C\`a")
|
|
76
|
+
[Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine()
|
|
77
|
+
}
|
|
78
|
+
} catch {
|
|
79
|
+
# PSReadLine is absent, so the command text cannot be marked. The prompt
|
|
80
|
+
# marks and the exit status still report.
|
|
81
|
+
}`,US={bash:jS,zsh:NS,fish:HS,powershell:zS};function IS(r){return US[r]}function PS(r){return Kp.find(v=>v.id===r)?.file??""}const mh=[{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 $S({action:r,description:v,chord:y,moved:b,taken:j,onSet:I,onReset:P}){const[o,f]=Jn.useState(!1),[p,g]=Jn.useState(null);return Jn.useEffect(()=>{if(!o)return;const _=C=>{if(C.preventDefault(),C.stopPropagation(),C.key==="Escape"){f(!1),g(null);return}if(["Control","Shift","Alt","Meta","OS"].includes(C.key))return;const E=kp({key:C.key,code:C.code,ctrlKey:C.ctrlKey,metaKey:C.metaKey,shiftKey:C.shiftKey,altKey:C.altKey}),M=E?Op(E,r,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(!E||M){g(M);return}I(E),g(null),f(!1)};return window.addEventListener("keydown",_,!0),()=>window.removeEventListener("keydown",_,!0)},[o,r,j,I]),c.jsxs("div",{className:p?"shortcut-row invalid":"shortcut-row",children:[c.jsx("span",{className:"shortcut-what",children:v}),c.jsx("button",{type:"button",className:o?"shortcut-chord capturing":"shortcut-chord",onClick:()=>{g(null),f(_=>!_)},"aria-label":o?`Press a new shortcut for ${v}`:`Change the shortcut for ${v}`,children:o?c.jsx("span",{className:"shortcut-prompt",children:"press a chord · Esc"}):c.jsx("kbd",{children:y})}),c.jsx("button",{type:"button",className:"shortcut-reset",onClick:()=>{g(null),f(!1),P()},disabled:!b,title:b?"Back to the shortcut this shipped with":"This is the shortcut it shipped with",children:"Reset"}),p?c.jsx("small",{className:"shortcut-problem",children:p}):null]})}function ms({label:r,hint:v,children:y}){return c.jsxs("label",{className:"settings-field",children:[c.jsx("span",{className:"settings-field-label",children:r}),y,v?c.jsx("small",{children:v}):null]})}function qS(r){const v="OpenAI-compatible: POST to {base}/chat/completions. Ollama, LM Studio, llama.cpp, vLLM and OpenRouter all serve this.";return Mh(r)?tc(r)?`On this machine, so nothing leaves it. ${v}`:`Off this machine. ${v}`:`Any http:// or https:// address ending in /v1. ${v}`}function FS(r){const v="OpenAI-compatible: POST multipart audio to /v1/audio/transcriptions.";return Mh(r)?tc(r)?`On this machine. ${v}`:`Off this machine — recorded audio is sent to this host. ${v}`:`Any http:// or https:// address. ${v}`}function hp({label:r="Server API key",state:v,url:y,onSave:b,onClear:j}){const[I,P]=Z.useState(""),o=v.status==="saving",f=I.trim(),p=v.encryptionAvailable?RS(y)?"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 c.jsxs(ms,{label:r,hint:p,children:[c.jsxs("div",{className:"settings-key-row",children:[c.jsx("input",{type:"password",value:I,placeholder:v.stored||v.sessionOnly?"•••••••• (a key is set)":"Leave empty if the server needs none",autoComplete:"off",spellCheck:!1,onChange:g=>P(g.target.value),onKeyDown:g=>{g.key!=="Enter"||!f||o||(g.preventDefault(),b(f),P(""))}}),c.jsx("button",{type:"button",disabled:!f||o,onClick:()=>{b(f),P("")},children:o?"Saving…":"Save"}),v.stored||v.sessionOnly?c.jsx("button",{type:"button",disabled:o,onClick:j,children:"Clear"}):null]}),v.error?c.jsx("small",{className:"settings-key-error",children:v.error}):null,!v.error&&v.notice?c.jsx("small",{className:"settings-key-notice",children:v.notice}):null]})}function WS({enabled:r,state:v,bindings:y,onToggle:b,onCopySnippet:j,onClear:I}){const[P,o]=Z.useState("bash"),f=IS(P),p=gi("history-palette",y);return c.jsxs(c.Fragment,{children:[c.jsx(Yr,{label:"Remember commands for the history palette",hint:r?`Commands you run are stored on this machine, with their directory and exit status, so ${p} 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:r,onChange:b}),r?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"settings-note",children:v.panesOpen===0?"No panes open, so nothing is reporting yet.":v.panesReporting===0?`None of your ${v.panesOpen} open pane${v.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.`:`${v.panesReporting} of ${v.panesOpen} open pane${v.panesOpen===1?"":"s"} reporting prompt marks. ${v.entries} command${v.entries===1?"":"s"} remembered.`}),c.jsx(ms,{label:"Shell integration",hint:`Paste this into ${PS(P)} 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:c.jsxs("div",{className:"settings-key-row",children:[c.jsx("select",{value:P,onChange:g=>o(g.target.value),children:Kp.map(g=>c.jsx("option",{value:g.id,children:g.label},g.id))}),c.jsx("button",{type:"button",onClick:()=>j(f),children:"Copy snippet"})]})}),c.jsx("pre",{className:"settings-snippet",children:f}),c.jsxs("div",{className:"settings-test",children:[c.jsx("button",{type:"button",onClick:I,children:"Forget all remembered commands"}),c.jsx("small",{className:"settings-hint",children:"Removes the stored history and the file it lives in."})]})]}):null]})}function KS({state:r,onRun:v}){const y=r.status==="testing";return c.jsxs("div",{className:"settings-test",children:[c.jsx("button",{type:"button",className:"primary-button",disabled:y,onClick:v,children:y?"Testing…":"Test connection"}),r.message?c.jsx("small",{className:r.ok?"settings-key-notice":"settings-key-error",children:r.message}):null]})}function es({label:r,hint:v,value:y,options:b,onChange:j}){return c.jsx(ms,{label:r,hint:v,children:c.jsx("select",{value:y,onChange:I=>j(I.target.value),children:b.map(I=>c.jsx("option",{value:I.value,children:I.label},I.value))})})}function Vn({label:r,hint:v,value:y,min:b,max:j,step:I,format:P,onChange:o}){return c.jsx(ms,{label:r,hint:v,children:c.jsxs("span",{className:"settings-range",children:[c.jsx("input",{type:"range",min:b,max:j,step:I,value:y,onChange:f=>o(Number(f.target.value)),"aria-label":r}),c.jsx("output",{children:P(y)})]})})}function Yr({label:r,hint:v,checked:y,disabled:b=!1,onChange:j}){return c.jsxs("label",{className:`settings-toggle ${b?"settings-toggle-fixed":""}`,children:[c.jsx("input",{type:"checkbox",checked:y,disabled:b,onChange:I=>j(I.target.checked)}),c.jsxs("span",{children:[c.jsx("b",{children:r}),v?c.jsx("small",{children:v}):null]})]})}function GS({value:r,onChange:v}){const y=[{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 c.jsx("div",{className:"settings-engines",role:"radiogroup","aria-label":"Speech engine",children:y.map(b=>c.jsxs("button",{type:"button",role:"radio","aria-checked":r===b.id,className:`settings-engine ${r===b.id?"active":""}`,onClick:()=>v(b.id),children:[c.jsx("b",{children:b.title}),c.jsx("small",{children:b.detail})]},b.id))})}function VS({state:r,onRun:v}){const y=r.status!=="idle",b=r.status==="recording"?"Stop and transcribe":r.status==="transcribing"?"Transcribing…":"Test recognition";return c.jsxs("div",{className:"settings-test",children:[c.jsxs("div",{className:"settings-test-head",children:[c.jsxs("div",{children:[c.jsx("b",{children:"Try it"}),c.jsx("small",{children:"Records a phrase and transcribes it here, without typing into a terminal."})]}),c.jsx("button",{type:"button",className:r.status==="recording"?"settings-test-button recording":"settings-test-button",onClick:v,disabled:r.status==="transcribing",children:b})]}),r.message?c.jsx("p",{className:"settings-test-status",children:r.message}):null,r.error?c.jsx("p",{className:"settings-test-error",children:r.error}):null,r.transcript!==null&&r.transcript!==void 0?c.jsx("output",{className:"settings-test-transcript",children:r.transcript||"(nothing transcribed)"}):null,!y&&(r.elapsedMs!=null||r.level!=null)?c.jsxs("p",{className:"settings-test-metrics",children:[r.elapsedMs!=null?`${(r.elapsedMs/1e3).toFixed(1)}s`:null,r.elapsedMs!=null&&r.level!=null?" · ":null,r.level!=null?`level ${r.level.toFixed(4)} RMS`:null]}):null]})}function YS({settings:r,onChange:v,onReset:y,onClose:b,backdrop:j,backends:I,wslDistributions:P,speechTest:o,onSpeechTest:f,speechKey:p,onSpeechKeySave:g,onSpeechKeyClear:_,commandHistory:C,onCopySnippet:E,onClearCommandHistory:M,aiKey:w,onAiKeySave:d,onAiKeyClear:u,aiModels:l,onAiModelsRefresh:h,aiTest:S,onAiTest:T}){const[R,D]=Z.useState("appearance"),x=Z.useMemo(()=>Dh(r.shortcuts),[r.shortcuts]),B=Z.useMemo(()=>Object.fromEntries(Object.entries(x.chords).map(([O,te])=>[te,O])),[x]),K=mh.find(O=>O.id===R)??mh[0],F=xS(r.speech),J=I.length?I.map(O=>({value:O.backend,label:O.label})):[{value:r.sessions.defaultBackend,label:r.sessions.defaultBackend}];return c.jsx("div",{className:"modal-layer settings-layer",role:"presentation",...j,children:c.jsxs("section",{className:"settings-card",role:"dialog","aria-modal":"true","aria-label":"Settings",children:[c.jsxs("div",{className:"modal-head",children:[c.jsxs("div",{children:[c.jsx("span",{className:"eyebrow",children:"SETTINGS"}),c.jsx("h2",{children:K.label})]}),c.jsx("button",{type:"button",className:"close-button",onClick:b,children:"Esc"})]}),c.jsxs("div",{className:"settings-body",children:[c.jsx("nav",{className:"settings-nav","aria-label":"Settings pages",children:mh.map(O=>c.jsxs("button",{type:"button",className:`settings-nav-item ${O.id===R?"active":""}`,"aria-current":O.id===R,onClick:()=>D(O.id),children:[c.jsx("b",{children:O.label}),c.jsx("small",{children:O.hint})]},O.id))}),c.jsxs("div",{className:"settings-page",children:[c.jsx("p",{className:"settings-blurb",children:K.blurb}),R==="shortcuts"&&c.jsxs(c.Fragment,{children:[x.rejected.length?c.jsxs("p",{className:"settings-warning",children:[x.rejected.map(O=>O.reason).join(" ")," The default is in use instead."]}):null,c.jsx("div",{className:"shortcut-list",children:Cn.map(O=>c.jsx($S,{action:O.action,description:O.description,chord:gi(O.action,x),moved:kg(O.action,x),taken:B,onSet:te=>v("shortcuts",{[O.action]:te}),onReset:()=>v("shortcuts",{[O.action]:void 0})},O.action))}),c.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",Th.map((O,te)=>c.jsxs(Jn.Fragment,{children:[te?" and ":" ",c.jsx("kbd",{children:O.chord})]},O.chord)),"."]}),c.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."})]}),R==="appearance"&&c.jsxs(c.Fragment,{children:[c.jsx(es,{label:"Theme",value:r.appearance.theme,options:[{value:"dark",label:"Dark"},{value:"light",label:"Light"}],onChange:O=>v("appearance",{theme:O})}),c.jsx(es,{label:"Terminal font",hint:"Falls back to another monospace face when the font is not installed.",value:r.appearance.font,options:dS,onChange:O=>v("appearance",{font:O})}),c.jsx(Vn,{label:"Font size",value:r.appearance.fontSize,min:vt.fontSize.min,max:vt.fontSize.max,step:1,format:O=>`${O} px`,onChange:O=>v("appearance",{fontSize:O})}),c.jsx(Vn,{label:"Line height",value:r.appearance.lineHeight,min:vt.lineHeight.min,max:vt.lineHeight.max,step:.05,format:O=>O.toFixed(2),onChange:O=>v("appearance",{lineHeight:O})}),c.jsx(Vn,{label:"Letter spacing",value:r.appearance.letterSpacing,min:vt.letterSpacing.min,max:vt.letterSpacing.max,step:.1,format:O=>`${O.toFixed(1)} px`,onChange:O=>v("appearance",{letterSpacing:O})}),c.jsxs("div",{className:"settings-preview",style:{fontFamily:Ch(r.appearance.font),fontSize:`${r.appearance.fontSize}px`,lineHeight:r.appearance.lineHeight,letterSpacing:`${r.appearance.letterSpacing}px`},children:[c.jsx("span",{children:"user@host:~$ git status --short"}),c.jsx("span",{children:" M src/renderer/settings.ts"})]})]}),R==="terminal"&&c.jsxs(c.Fragment,{children:[c.jsx(Vn,{label:"Scrollback",hint:"Lines kept per pane. Larger scrollback costs memory in every open pane.",value:r.terminal.scrollback,min:vt.scrollback.min,max:5e4,step:200,format:O=>`${O.toLocaleString()} lines`,onChange:O=>v("terminal",{scrollback:O})}),c.jsx(es,{label:"Cursor",value:r.terminal.cursorStyle,options:[{value:"block",label:"Block"},{value:"underline",label:"Underline"},{value:"bar",label:"Bar"}],onChange:O=>v("terminal",{cursorStyle:O})}),c.jsx(Yr,{label:"Blink the cursor",checked:r.terminal.cursorBlink,onChange:O=>v("terminal",{cursorBlink:O})}),c.jsx(Yr,{label:"Copy on selection",hint:"Selecting text with the mouse puts it on the clipboard. Ctrl+Shift+C copies regardless.",checked:r.terminal.copyOnSelect,onChange:O=>v("terminal",{copyOnSelect:O})})]}),R==="sessions"&&c.jsxs(c.Fragment,{children:[c.jsx(es,{label:"Default shell",hint:"Pre-selected when opening a new local terminal.",value:qp(r.sessions.defaultBackend,I),options:J,onChange:O=>v("sessions",{defaultBackend:O})}),c.jsxs(ms,{label:"Default WSL distribution",hint:"Used when the default shell is WSL.",children:[c.jsx("input",{list:"settings-wsl-distributions",value:r.sessions.defaultWslDistribution,placeholder:"Ubuntu",onChange:O=>v("sessions",{defaultWslDistribution:O.target.value})}),c.jsx("datalist",{id:"settings-wsl-distributions",children:P.map(O=>c.jsx("option",{value:O},O))})]}),c.jsx(es,{label:"Layout at startup",value:r.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:O=>v("sessions",{defaultLayout:O})}),c.jsx(Yr,{label:"Start with the sidebar collapsed",checked:r.sessions.startSidebarCollapsed,onChange:O=>v("sessions",{startSidebarCollapsed:O})})]}),R==="ai"&&c.jsxs(c.Fragment,{children:[c.jsx(ms,{label:"Endpoint",hint:qS(r.ai.baseUrl),children:c.jsx("input",{value:r.ai.baseUrl,placeholder:Le.ai.baseUrl,spellCheck:!1,onChange:O=>v("ai",{baseUrl:O.target.value})})}),c.jsx(ms,{label:"Model",hint:"Any model the endpoint serves. Refresh lists what it reports having.",children:c.jsxs("div",{className:"settings-key-row",children:[c.jsx("input",{value:r.ai.model,list:"ai-models",placeholder:"qwen2.5-coder",spellCheck:!1,onChange:O=>v("ai",{model:O.target.value})}),c.jsx("datalist",{id:"ai-models",children:l.map(O=>c.jsx("option",{value:O},O))}),c.jsx("button",{type:"button",onClick:h,children:"Refresh"})]})}),c.jsx(hp,{label:"Endpoint API key",state:w,url:r.ai.baseUrl,onSave:d,onClear:u}),c.jsx(KS,{state:S,onRun:T}),c.jsx(Yr,{label:"Send recent terminal output",hint:r.ai.includeOutput?tc(r.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:r.ai.includeOutput,onChange:O=>v("ai",{includeOutput:O})}),r.ai.includeOutput?c.jsx(Vn,{label:"How much output",hint:"The tail of the pane, on whole lines. Enough for a stack trace is usually enough.",value:r.ai.outputChars,min:vt.outputChars.min,max:vt.outputChars.max,step:200,format:O=>`${O} characters`,onChange:O=>v("ai",{outputChars:O})}):null,c.jsx(Yr,{label:"Ask before running an AI suggestion",hint:r.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:r.ai.includeOutput||r.ai.requireApproval,disabled:r.ai.includeOutput,onChange:O=>v("ai",{requireApproval:O})}),c.jsx(es,{label:"Voice transcripts",hint:"Neither option presses Enter for you.",value:r.ai.voiceInsert,options:[{value:"type",label:"Type into the terminal"},{value:"review",label:"Show for review first"}],onChange:O=>v("ai",{voiceInsert:O})}),c.jsx(ms,{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:c.jsx("input",{value:r.ai.proceedPhrase,placeholder:Le.ai.proceedPhrase,onChange:O=>v("ai",{proceedPhrase:O.target.value})})}),c.jsx(WS,{enabled:r.ai.recordCommands,state:C,bindings:x,onToggle:O=>v("ai",{recordCommands:O}),onCopySnippet:E,onClear:M})]}),R==="speech"&&c.jsxs(c.Fragment,{children:[c.jsx(GS,{value:r.speech.engine,onChange:O=>v("speech",{engine:O})}),F.model?c.jsx(es,{label:"Model",hint:uS(r.speech.model,r.speech.precision),value:r.speech.model,options:kh.map(O=>({value:O.id,label:O.label})),onChange:O=>v("speech",{model:O})}):null,F.precision?c.jsx(es,{label:"Precision",hint:rp.find(O=>O.value===r.speech.precision)?.detail,value:r.speech.precision,options:rp.map(O=>({value:O.value,label:O.label})),onChange:O=>v("speech",{precision:O})}):null,F.device?c.jsx(es,{label:"Compute",hint:"WebGPU is faster where it works; the app falls back to WASM when it does not.",value:r.speech.device,options:[{value:"wasm",label:"CPU (WASM)"},{value:"webgpu",label:"GPU (WebGPU)"}],onChange:O=>v("speech",{device:O})}):null,F.language?c.jsx(es,{label:"Language",value:r.speech.language,options:zp,onChange:O=>v("speech",{language:O})}):null,F.task?c.jsx(es,{label:"Task",hint:"Translate produces English text from another language.",value:r.speech.task,options:[{value:"transcribe",label:"Transcribe"},{value:"translate",label:"Translate to English"}],onChange:O=>v("speech",{task:O})}):null,F.server?c.jsxs(c.Fragment,{children:[c.jsx(ms,{label:"Server URL",hint:FS(r.speech.serverUrl),children:c.jsx("input",{value:r.speech.serverUrl,placeholder:"http://127.0.0.1:8080/v1/audio/transcriptions",onChange:O=>v("speech",{serverUrl:O.target.value})})}),c.jsx(ms,{label:"Server model",hint:"The model name the server expects, e.g. Qwen3-ASR-0.6B.",children:c.jsx("input",{value:r.speech.serverModel,placeholder:"Qwen3-ASR-0.6B",onChange:O=>v("speech",{serverModel:O.target.value})})}),c.jsx(hp,{state:p,url:r.speech.serverUrl,onSave:g,onClear:_})]}):null,c.jsx(Vn,{label:"Maximum utterance",hint:"Recording stops itself at this length so a stuck microphone cannot queue forever.",value:r.speech.maxUtteranceSeconds,min:vt.maxUtteranceSeconds.min,max:vt.maxUtteranceSeconds.max,step:5,format:O=>`${O} s`,onChange:O=>v("speech",{maxUtteranceSeconds:O})}),c.jsx(Vn,{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:r.speech.silenceThreshold,min:vt.silenceThreshold.min,max:vt.silenceThreshold.max,step:5e-4,format:O=>O.toFixed(4),onChange:O=>v("speech",{silenceThreshold:O})}),c.jsx(VS,{state:o,onRun:f})]}),c.jsxs("div",{className:"settings-foot",children:[c.jsx("span",{className:"settings-hint",children:"Changes apply immediately and are remembered."}),c.jsxs("button",{type:"button",onClick:()=>y(R),children:["Reset ",K.label.toLowerCase()]})]})]})]})]})})}const Xn=[{kind:"local",label:"Local terminal",hint:"Shell on this machine"},{kind:"ssh",label:"SSH",hint:"Remote host"}];function dp(r){return r==="local"||r==="ssh"}const XS={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 vh(r){return XS[r]}function ZS(r,v){const y=Xn.findIndex(j=>j.kind===r);if(y===-1)return null;const b=Xn.length;switch(v){case"ArrowRight":case"ArrowDown":return Xn[(y+1)%b].kind;case"ArrowLeft":case"ArrowUp":return Xn[(y-1+b)%b].kind;case"Home":return Xn[0].kind;case"End":return Xn[b-1].kind;default:return null}}const Gp={"split-v":"Vertical split","split-h":"Horizontal split",grid:"Four-pane grid"},QS=[{layout:"split-v",icon:"split-v"},{layout:"split-h",icon:"split-h"},{layout:"grid",icon:"grid"}];function Vp(r){return r==="split-v"?["column"]:r==="split-h"?["row"]:r==="grid"?["column","row"]:[]}function Yp(r,v){return Vp(r).some(y=>{const b=y==="column"?v.columnRatio:v.rowRatio,j=y==="column"?Le.sessions.splitColumnRatio:Le.sessions.splitRowRatio;return Math.abs(b-j)>.005})}function JS(r){const v=Vp(r);return{...v.includes("column")?{splitColumnRatio:Le.sessions.splitColumnRatio}:{},...v.includes("row")?{splitRowRatio:Le.sessions.splitRowRatio}:{}}}function Xp(r){return r.maximized?{kind:"restore"}:r.layout==="stack"?{kind:"show",layout:r.lastSplit}:r.sessionCount>1?{kind:"maximize"}:{kind:"show",layout:"stack"}}function e0(r,v){return v.layout!==r||v.maximized?{kind:"show",layout:r}:Yp(r,v)?{kind:"reset-splits",ratios:JS(r)}:Xp(v)}function t0(r,v){return v.layout!==r||v.maximized?Gp[r]:Yp(r,v)?"Reset pane sizes":v.sessionCount>1?"Maximize focused pane":"Single pane"}function i0(r){return r.maximized||r.layout==="stack"?`Back to ${Gp[r.lastSplit].toLowerCase()}`:r.sessionCount>1?"Maximize focused pane":"Single pane"}function fp(r){return typeof r=="object"&&r!==null}class s0{constructor(v){this.options=v,this.worker=null,this.pending=new Map,this.nextId=1}async transcribe(v,y,b){if(y.engine==="server"){const I=this.options.now??(()=>Date.now()),P=I(),o=await this.options.resolveApiKey?.().catch(()=>null)??void 0;return{text:await BS({url:y.serverUrl,model:y.serverModel,language:y.language,audio:v,apiKey:o},this.options.fetchImpl),elapsedMs:I()-P,engine:"server"}}return{...await this.transcribeInWorker(v,y,b),engine:"builtin"}}transcribeInWorker(v,y,b){const j=this.ensureWorker(),I=this.nextId++;return new Promise((P,o)=>{this.pending.set(I,{resolve:P,reject:o,onProgress:b}),j.postMessage({type:"transcribe",id:I,audio:v,config:{model:y.model,precision:y.precision,device:y.device,language:y.language,task:y.task,multilingual:oS(y.model)}},[v.buffer])})}ensureWorker(){if(this.worker)return this.worker;const v=this.options.createWorker();return v.onmessage=y=>this.handleMessage(y.data),v.onerror=y=>{const b=fp(y)&&typeof y.message=="string"?y.message:"Speech worker failed";this.failAll(new Error(b)),this.worker=null},this.worker=v,v}handleMessage(v){if(!fp(v)||typeof v.id!="number")return;const y=this.pending.get(v.id);if(y){if(v.type==="loading"){y.onProgress?.({kind:"loading",progress:typeof v.progress=="number"?v.progress:null});return}if(v.type==="notice"){y.onProgress?.({kind:"notice",message:String(v.message)});return}if(v.type==="result"){this.pending.delete(v.id),y.resolve({text:typeof v.text=="string"?v.text:"",elapsedMs:typeof v.elapsedMs=="number"?v.elapsedMs:0});return}v.type==="error"&&(this.pending.delete(v.id),y.reject(new Error(typeof v.message=="string"?v.message:"Transcription failed")))}}failAll(v){for(const y of this.pending.values())y.reject(v);this.pending.clear()}dispose(){this.failAll(new Error("Speech client disposed")),this.worker?.terminate(),this.worker=null}}const n0=5;function r0(r,v,y=n0){return Math.abs(v-r)>=y}function a0(r,v){if(!r.length)return 0;for(let y=0;y<r.length;y+=1){const b=r[y];if(v<b.left+b.width/2)return y}return r.length-1}function _p(r,v,y){if(v===y||v<0||v>=r.length)return r;const b=Math.min(Math.max(y,0),r.length-1);if(b===v)return r;const j=[...r],[I]=j.splice(v,1);return j.splice(b,0,I),j}function gh(r,v){return v?r.findIndex(y=>y.id===v):-1}const l0=6;function o0(r,v,y,b=l0){return{x:pp(r.x,v.width,y.width,b),y:pp(r.y,v.height,y.height,b)}}function pp(r,v,y,b){return r+v+b<=y?Math.max(b,r):r-v-b>=0?r-v:Math.max(b,y-v-b)}function c0({at:r,items:v,label:y,onClose:b}){const j=Z.useRef(null),[I,P]=Z.useState(r);return Z.useLayoutEffect(()=>{const o=j.current?.getBoundingClientRect();o&&P(o0(r,{width:o.width,height:o.height},{width:window.innerWidth,height:window.innerHeight}))},[r,v.length]),Z.useEffect(()=>{const o=p=>{p.key==="Escape"&&(p.preventDefault(),p.stopPropagation(),b())},f=()=>b();return window.addEventListener("keydown",o,!0),window.addEventListener("pointerdown",f,!0),window.addEventListener("blur",f),window.addEventListener("wheel",f,{passive:!0}),()=>{window.removeEventListener("keydown",o,!0),window.removeEventListener("pointerdown",f,!0),window.removeEventListener("blur",f),window.removeEventListener("wheel",f)}},[b]),c.jsx("div",{className:"context-menu",role:"menu","aria-label":y,ref:j,style:{left:I.x,top:I.y},onPointerDown:o=>o.stopPropagation(),children:v.map(o=>c.jsxs("button",{type:"button",role:"menuitem",className:`context-menu-item ${o.danger?"danger":""}`.trim(),disabled:o.disabled||!o.onSelect,title:o.hint??"",onClick:()=>{b(),o.onSelect?.()},children:[o.icon?c.jsx(Be,{name:o.icon}):c.jsx("span",{className:"context-menu-gap"}),c.jsx("span",{children:o.label})]},o.label))})}function u0(r,v){let y=null,b=null,j=!1;return{handle(I){const P=I.charAt(0);if(j=!0,P==="A")return y=null,!0;if(P==="B")return y=r.cursor(),!0;if(P==="C"){if(!y)return!0;const o=r.read(y,r.cursor()).trim();return y=null,o&&(b={command:o,startedAt:r.now()}),!0}if(P==="D"){const o=b;if(b=null,!o)return!0;const f=h0(I);return v({command:o.command,...f===void 0?{}:{exitCode:f},durationMs:Math.max(0,r.now()-o.startedAt)}),!0}return!0},hasMarks(){return j},atPrompt(){return y!==null&&b===null},reset(){y=null,b=null}}}function h0(r){const v=r.split(";");if(v.length<2)return;const y=v[1].trim();if(!/^\d+$/.test(y))return;const b=Number(y);return b<=255?b:void 0}function d0(r,v,y){if(y.row<v.row||y.row===v.row&&y.col<=v.col)return"";const b=[];for(let j=v.row;j<=y.row;j+=1){const I=r(j)??"",P=j===v.row?v.col:0,o=j===y.row?y.col:I.length;b.push(I.slice(P,o))}return b.join("").replace(/\s+$/,"")}const mp="TOKEN|KEY|SECRET|PASSWORD|PASSWD|PASSPHRASE|CREDENTIAL|AUTH|APIKEY|ACCESS_KEY|PRIVATE",f0=[{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_]*(?:${mp})[A-Za-z0-9_]*\s*=\s*\S`,"i")},{reason:"secret-assignment",pattern:new RegExp(String.raw`(?:${mp})[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}],_0=24;function p0(r){return r.length<_0||/[/\\]/.test(r)||!/^[A-Za-z0-9+/=_-]+$/.test(r)||/^[0-9a-f]+$/i.test(r)?!1:/[a-z]/.test(r)&&/[A-Z]/.test(r)&&/[0-9]/.test(r)}function m0(r){const v=r.trim();if(!v)return null;for(const{reason:y,pattern:b}of f0)if(b.test(v))return y;for(const y of v.split(/[\s=:,'"`]+/))if(p0(y))return"high-entropy";return null}const v0=4320*60*1e3,Yn={cwd:50,host:12,recency:30,frequency:10,pick:25,failed:-20,match:40};function g0(r,v){if(!v)return[];const y=r.toLowerCase(),b=v.toLowerCase(),j=[];let I=0;for(const P of b){if(P===" ")continue;const o=y.indexOf(P,I);if(o<0)return null;j.push(o),I=o+1}return j}function S0(r,v){if(!v.length)return .5;const y=v[0],j=v[v.length-1]-y+1,I=v.length/j,P=1/(1+y),o=y===0||/\s/.test(r.charAt(y-1))?1:0;return .45*I+.35*P+.2*o}function b0(r,v){const y=v-Date.parse(r);return Number.isFinite(y)?y<=0?1:Math.pow(.5,y/v0):0}function y0(r,v,y){let b=Yn.match*S0(r.command,v);return y.cwd&&r.cwd===y.cwd&&(b+=Yn.cwd),y.host&&r.host===y.host&&(b+=Yn.host),b+=Yn.recency*b0(r.lastRun,y.now),b+=Yn.frequency*Math.log1p(r.runs),b+=Yn.pick*Math.log1p(r.picks),r.exitCode!==void 0&&r.exitCode!==0&&(b+=Yn.failed),b}function C0(r,v){const y=new Map;for(const j of r){const I=g0(j.command,v.query);if(I===null)continue;const P={entry:j,score:y0(j,I,v),matched:I},o=y.get(j.command);(!o||P.score>o.score)&&y.set(j.command,P)}const b=[...y.values()].sort((j,I)=>I.score!==j.score?I.score-j.score:I.entry.lastRun.localeCompare(j.entry.lastRun));return v.limit===void 0?b:b.slice(0,v.limit)}function Sh(r){return{phase:"asking",sessionId:r,prompt:""}}function w0(r,v,y){return!y.trim()||v||r.includeOutput?!1:!r.requireApproval}function vp(r){return!!(r.baseUrl.trim()&&r.model.trim())}function x0(r,v){const y=r.replace(/\s+$/,"");if(v<=0)return"";if(y.length<=v)return y;const b=y.slice(-v),j=b.indexOf(`
|
|
82
|
+
`);return j>=0&&j<b.length-1?b.slice(j+1):b}const E0=150,A0=3e3,gp=400;function Vr(r){return(r instanceof Error?r.message:String(r)).replace(/^Error invoking remote method '[^']*':\s*/,"").replace(/^(?:Error|TypeError):\s*/,"")}function Sp(r){return{id:r.sessionId,name:r.name,kind:r.kind,host:r.host,screenName:r.screenName,sshTarget:r.sshTarget,backend:r.backend}}const Re=()=>window.zerog;function bh(){try{return window.localStorage}catch{return null}}function Fo({session:r,active:v=!1,ghosted:y=!1,onClick:b}){const j=r.kind==="ssh"?`SSH · ${r.host}`:r.backend==="wsl"?`WSL${r.wslDistribution?` · ${r.wslDistribution}`:""} · ${r.cwd}`:r.backend&&r.backend!=="screen"?`${Up(r.backend)} · ${r.cwd}`:r.persistence==="screen"?`screen · ${r.cwd}`:`local · process only · ${r.cwd}`;return c.jsxs("button",{type:"button",className:`session-row ${v?"active":""} ${y?"session-ghosted":""}`,onClick:b,children:[c.jsx("span",{className:`status-dot ${r.status}`}),c.jsxs("span",{className:"session-copy",children:[c.jsx("b",{children:r.name}),c.jsx("small",{children:j})]}),c.jsx("span",{className:"session-state",children:y?"↗":r.status==="connected"?"●":"○"})]})}function R0({member:r,onClick:v}){const y=r.kind==="ssh"?`SSH · ${r.host??r.sshTarget??"saved host"}`:r.screenName?`screen · ${r.screenName}`:"local";return c.jsxs("button",{type:"button",className:"session-row session-ghosted",title:`Reconnect ${r.name}`,onClick:v,children:[c.jsx("span",{className:"status-dot"}),c.jsxs("span",{className:"session-copy",children:[c.jsx("b",{children:r.name}),c.jsxs("small",{children:[y," · not connected"]})]}),c.jsx("span",{className:"session-state",children:"↻"})]})}function T0({connection:r,onConfigure:v,onConnect:y}){const b=xp(v,y),j=r.hostName?`${r.user??""}${r.user?"@":""}${r.hostName}${r.port?`:${r.port}`:""}`:"Saved SSH connection";return c.jsxs("button",{type:"button",className:"session-row",title:`Double-click to connect ${r.alias} in a new pane`,onClick:b.onClick,onDoubleClick:b.onDoubleClick,children:[c.jsx("span",{className:"status-dot"}),c.jsxs("span",{className:"session-copy",children:[c.jsx("b",{children:r.alias}),c.jsx("small",{children:j})]}),c.jsx("span",{className:"session-state",children:"→"})]})}function D0(r,v=200){if(!r)return"";const y=r.buffer.active,b=y.length,j=Math.max(0,b-v),I=[];for(let P=j;P<b;P+=1)I.push(y.getLine(P)?.translateToString(!0)??"");return I.join(`
|
|
83
|
+
`)}const k0=120;function M0({sessionId:r,focused:v,dormant:y=!1,onStatus:b,appearance:j,terminalSettings:I,registerFocus:P,registerCapture:o,onCommand:f,registerRead:p}){const g=Z.useRef(null),_=Z.useRef(null),C=Z.useRef(b);C.current=b;const E=Z.useRef(j);E.current=j;const M=Z.useRef(I);M.current=I;const w=Z.useRef(null),d=Z.useRef(f);return d.current=f,Z.useEffect(()=>{if(!g.current)return;const u=g.current,l=new Ev.Terminal({cursorBlink:M.current.cursorBlink,cursorStyle:M.current.cursorStyle,fontFamily:Ch(E.current.font),fontSize:E.current.fontSize,lineHeight:E.current.lineHeight,letterSpacing:E.current.letterSpacing,scrollback:M.current.scrollback,allowProposedApi:!0,theme:bp(E.current.theme),linkHandler:{activate:(z,Y)=>{const ne=Re();ne?.openExternal&&(C.current(`Opening ${Y}`),ne.openExternal(Y).catch(_e=>{C.current(_e instanceof Error?_e.message:String(_e))}))},hover:(z,Y)=>C.current(`Link: ${Y}`),leave:()=>C.current("Ready")}}),h=new Rv.FitAddon;l.loadAddon(h),l.open(u),_.current=l;const S=Re();let T=!1,R=0,D=0,x=0,B=!1,K=0;const F=()=>{if(T||!u.isConnected||u.clientWidth<20||u.clientHeight<20)return!1;try{h.fit()}catch{return!1}return l.cols>0&&l.rows>0},J=()=>{!B||!S||!r||l.cols===D&&l.rows===x||(window.clearTimeout(K),K=window.setTimeout(()=>{T||!r||l.cols===D&&l.rows===x||(D=l.cols,x=l.rows,S.resize(r,D,x))},k0))},O=()=>{F()&&J()},te=()=>{cancelAnimationFrame(R),R=requestAnimationFrame(()=>{O(),R=requestAnimationFrame(O)})};if(w.current=te,!S)return te(),l.writeln("\x1B[90mZeroG Terminal\x1B[0m"),l.writeln("\x1B[31mPreload API unavailable. Rebuild the app.\x1B[0m"),C.current("Preload API unavailable"),()=>{T=!0,cancelAnimationFrame(R),_.current=null,l.dispose()};const he=S.onData((z,Y)=>{z===r&&l.write(Y)}),G=S.onStatus((z,Y)=>{z===r&&(C.current(Y),te())}),ae=l.onData(z=>{r&&S.write(r,z)}),le=Wv({terminal:l,clipboard:S,onError:z=>C.current(z),writeToPty:z=>{r&&S.write(r,z)},pasteEventTarget:u,isCopyOnSelectEnabled:()=>M.current.copyOnSelect}),L=u0({cursor:()=>({row:l.buffer.active.baseY+l.buffer.active.cursorY,col:l.buffer.active.cursorX}),read:(z,Y)=>d0(ne=>l.buffer.active.getLine(ne)?.translateToString(!0),z,Y),now:()=>Date.now()},z=>{r&&d.current?.(r,z)}),$=l.parser.registerOscHandler(133,z=>L.handle(z));r&&o?.(r,L);const k=new ResizeObserver(()=>te());if(k.observe(u),window.addEventListener("resize",te),document.fonts?.ready?.then(()=>{T||te()}).catch(()=>{}),te(),!r)l.writeln("\x1B[90mZeroG Terminal\x1B[0m"),l.writeln("\x1B[90mSelect a session or create a local/SSH connection.\x1B[0m");else{const z=F()?{cols:l.cols,rows:l.rows}:void 0;z&&(D=z.cols,x=z.rows),S.attachSession(r,z).then(Y=>{B=!0,Y.persistence==="process"?C.current(`${Y.host} · ${Y.name} · process only (install screen for persistence)`):C.current(`${Y.host} · ${Y.name}`),te()}).catch(Y=>{C.current(Y instanceof Error?Y.message:String(Y))})}return()=>{T=!0,cancelAnimationFrame(R),window.clearTimeout(K),le(),ae.dispose(),he(),G(),k.disconnect(),$.dispose(),r&&o?.(r,null),window.removeEventListener("resize",te),w.current=null,_.current=null,l.dispose()}},[r]),Z.useEffect(()=>{if(y)return;const u=_.current;if(!u)return;w.current?.();const l=requestAnimationFrame(()=>{u.rows>0&&u.refresh(0,u.rows-1)});return()=>cancelAnimationFrame(l)},[y]),Z.useEffect(()=>{const u=_.current;u&&(u.options.theme=bp(j.theme),u.options.fontFamily=Ch(j.font),u.options.fontSize=j.fontSize,u.options.lineHeight=j.lineHeight,u.options.letterSpacing=j.letterSpacing,u.options.scrollback=I.scrollback,u.options.cursorStyle=I.cursorStyle,u.options.cursorBlink=I.cursorBlink,w.current?.())},[j,I]),Z.useEffect(()=>{v&&_.current?.focus()},[v]),Z.useEffect(()=>{if(!(!r||!P))return P(r,()=>_.current?.focus()),()=>P(r,null)},[r,P]),Z.useEffect(()=>{if(!(!r||!p))return p(r,()=>D0(_.current)),()=>p(r,null)},[r,p]),c.jsx("div",{className:"terminal",ref:g,onMouseDownCapture:u=>u.preventDefault()})}function L0({open:r,ratio:v,browser:y,onRatio:b,children:j}){const I=Z.useRef(null),[P,o]=Z.useState(null),f=P??v,p=g=>Math.min(Ap,Math.max(Ep,Math.round(g)));return c.jsxs("div",{className:r?"pane-body pane-body-split":"pane-body",ref:I,style:r?{gridTemplateColumns:`${f}fr ${100-f}fr`}:void 0,children:[j,r?c.jsxs(c.Fragment,{children:[c.jsx(Go,{orientation:"vertical",className:"pane-resizer pane-browser-resizer",label:"Directory browser split",valuePercent:f,style:{left:`calc((100% - 1px) * ${f/100} + 0.5px)`},onDrag:g=>{const _=I.current?.getBoundingClientRect();!_||_.width<=0||o(p((g.clientX-_.left)/_.width*100))},onCommit:()=>{P!==null&&b(P),o(null)},onNudge:g=>b(p(f+g*2)),onReset:()=>b(Rp)}),y]}):null]})}function Go({orientation:r,className:v,label:y,valuePercent:b,style:j,onDrag:I,onCommit:P,onNudge:o,onReset:f}){const[p,g]=Z.useState(!1),_=r==="vertical"?"ArrowLeft":"ArrowUp",C=r==="vertical"?"ArrowRight":"ArrowDown";return c.jsx("div",{role:"separator","aria-orientation":r,"aria-label":y,"aria-valuenow":Math.round(b),"aria-valuemin":0,"aria-valuemax":100,tabIndex:0,className:`${v} ${p?"dragging":""}`.trim(),style:j,title:`${y} — drag, arrow keys, or double-click to reset`,onPointerDown:E=>{E.button===0&&(E.preventDefault(),E.currentTarget.setPointerCapture(E.pointerId),g(!0))},onPointerMove:E=>{E.currentTarget.hasPointerCapture(E.pointerId)&&I(E)},onPointerUp:E=>{E.currentTarget.hasPointerCapture(E.pointerId)&&(E.currentTarget.releasePointerCapture(E.pointerId),g(!1),P())},onPointerCancel:()=>g(!1),onDoubleClick:f,onKeyDown:E=>{E.key===_?(E.preventDefault(),o(-1)):E.key===C?(E.preventDefault(),o(1)):(E.key==="Enter"||E.key==="Home")&&(E.preventDefault(),f())}})}function O0({index:r,onCreate:v}){return c.jsxs("article",{className:"pane empty-pane",children:[c.jsxs("div",{className:"pane-title",children:[c.jsxs("span",{children:["PANE ",r]}),c.jsx("span",{className:"pane-dim",children:"EMPTY"})]}),c.jsxs("div",{className:"empty-pane-body",children:[c.jsx("span",{className:"empty-glyph",children:"+"}),c.jsx("strong",{children:"Split ready"}),c.jsx("small",{children:"Open another terminal here"}),c.jsx("button",{type:"button",onClick:v,children:"Choose session"})]})]})}function B0(){const[r,v]=Z.useState(()=>wS(bh())),y=r.appearance.theme,[b,j]=Z.useState([]),[I,P]=Z.useState(()=>[W_("Workspace",r.sessions.defaultLayout)]),[o,f]=Z.useState(()=>I[0]?.id??""),[p,g]=Z.useState("Ready"),[_,C]=Z.useState(!1),[E,M]=Z.useState(r.sessions.startSidebarCollapsed),[w,d]=Z.useState("terminals"),[u,l]=Z.useState("sessions"),[h,S]=Z.useState([]),[T,R]=Z.useState(!1),[D,x]=Z.useState(null),[B,K]=Z.useState(""),[F,J]=Z.useState("local"),[O,te]=Z.useState("loopback"),[he,G]=Z.useState(""),[ae,le]=Z.useState(""),[L,$]=Z.useState(""),[k,z]=Z.useState(!1),[Y,ne]=Z.useState(!1),[_e,Se]=Z.useState(!1),[Q,U]=Z.useState(!1),oe=Z.useMemo(()=>Dh(r.shortcuts),[r.shortcuts]),[me,Ce]=Z.useState(""),[ye,Me]=Z.useState(0),[Ue,Ve]=Z.useState([]),[it,De]=Z.useState(!0),[ri,pe]=Z.useState(null),[ve,we]=Z.useState(null),[ze,Ie]=Z.useState(!1),[Pe,pt]=Z.useState("Workspace"),[Ye,ut]=Z.useState(!1),[bt,ki]=Z.useState(""),[xt,Si]=Z.useState(!1),[Ke,gs]=Z.useState([]),[Gt,qi]=Z.useState("term"),[Vt,ic]=Z.useState(""),[fl,_l]=Z.useState(""),[tt,Dt]=Z.useState(null),[tr,ai]=Z.useState({status:"idle",stored:!1,encryptionAvailable:!0,sessionOnly:!1}),[ir,Ps]=Z.useState([]),[sc,Zr]=Z.useState({status:"idle"}),[li,Mi]=Z.useState({status:"idle",sessionId:null}),[ts,Qr]=Z.useState(null),Ss=Z.useRef(null),sr=Z.useRef(null),Fi=Z.useRef(null),bs=Z.useRef(void 0),[ys,Wi]=Z.useState(!1),[Jt,gt]=Z.useState(!1),[Bt,ei]=Z.useState({status:"idle"}),$s=Z.useRef(null),nr=Z.useRef(void 0),[nc,is]=Z.useState({status:"idle",stored:!1,encryptionAvailable:!0,sessionOnly:!1}),ss=Z.useRef(null),[qs,Cs]=Z.useState([]),[bi,Fs]=Z.useState(r.sessions.defaultBackend),[ws,yt]=Z.useState(r.sessions.defaultWslDistribution),[pl,rr]=Z.useState([]),[ns,Ki]=Z.useState([]),[Li,Jr]=Z.useState([]),[ea,ta]=Z.useState([]),[ia,wn]=Z.useState(!1),yi=Z.useRef(new Map),oi=Z.useCallback((m,N)=>{N?yi.current.set(m,N):yi.current.delete(m)},[]),xn=Z.useRef(new Map),rc=Z.useCallback((m,N)=>{N?xn.current.set(m,N):xn.current.delete(m)},[]),Ws=Z.useRef(new Map),ml=Z.useCallback((m,N)=>{N?Ws.current.set(m,N):Ws.current.delete(m)},[]),[ar,lr]=Z.useState({}),[Yt,sa]=Z.useState({}),En=Z.useRef(Xg(Re,(m,N)=>ra(q=>q[m]===N?q:{...q,[m]:N}))).current,na=En.listerFor,[rs,ra]=Z.useState({}),[vl,xs]=Z.useState(null),[or,gl]=Z.useState(null);Z.useEffect(()=>{Re()?.appVersion?.().then(m=>gl(Bp(m))).catch(()=>{})},[]),Z.useEffect(()=>Re()?.onSftpEvent?.(N=>{N.type==="prompt"?xs(N.prompt.text.trim().split(`
|
|
84
|
+
`).pop()??null):xs(null)}),[]);const aa=Z.useRef(new Set),cr=Z.useCallback(m=>{aa.current.has(m.id)||(aa.current.add(m.id),En.learnHome(m).then(N=>{N&&ra(q=>({...q,[m.id]:N}))}).catch(()=>{}))},[En]),Sl=Z.useRef(new Set),bl=Z.useCallback(m=>{if(Sl.current.has(m))return;Sl.current.add(m);const N=Re();N&&N.wslHome(m).then(q=>{q&&sa(V=>({...V,[m]:q}))}).catch(()=>{})},[]),Xt=Z.useCallback(m=>{m&&(ci(m),requestAnimationFrame(()=>yi.current.get(m)?.()))},[]),Gi=bn(()=>we(null)),la=bn(()=>{Re()?.cancelAiRequest?.(),Dt(null)}),oa=bn(()=>Ie(!1)),Ks=bn(()=>ne(!1)),Gs=bn(()=>Se(!1)),yl=bn(()=>Wi(!1)),ca=bn(()=>wi()),Cl=bn(()=>gt(!1)),Zt=Z.useCallback((m,N)=>{v(q=>{const V=up(q,m,N);return cp(bh(),V),V})},[]),Oi=Z.useCallback((m,N)=>{v(q=>up(q,m,N))},[]),ua=Z.useCallback(m=>{v(N=>{const q=ES(N,m);return cp(bh(),q),q})},[]);Z.useEffect(()=>{document.documentElement.dataset.theme=y},[y]);const Ze=Z.useMemo(()=>I.find(m=>m.id===o)??I[0]??null,[I,o]),Ht=Ze?.view??Qo(r.sessions.defaultLayout),St=Ht.layout,It=Ht.focusedSessionId,ha=Ht.maximizedSessionId??null,Xe=Z.useMemo(()=>Ht.activeSessionId?b.find(m=>m.id===Ht.activeSessionId)??null:null,[Ht.activeSessionId,b]),zt=Z.useCallback((m,N)=>{P(q=>K_(q,N??o,m))},[o]),Es=Z.useCallback(m=>zt({activeSessionId:m?.id}),[zt]),jt=Z.useCallback(m=>zt(N=>({layout:typeof m=="function"?m(N.layout):m})),[zt]),ci=Z.useCallback(m=>zt({focusedSessionId:m}),[zt]),Bi=Z.useCallback(m=>zt({maximizedSessionId:m}),[zt]),st=Z.useMemo(()=>{if(!Ze)return b;const m=new Set(Ze.sessionIds);return b.filter(N=>m.has(N.id))},[Ze,b]),wl=Ze?.pending??[],as=Z.useCallback(async()=>{const m=Re();if(De(!0),pe(null),!m){pe("Preload API unavailable"),g("Preload API unavailable"),De(!1);return}try{const N=await m.listSessions();j(N),g(N.length?`${N.length} session${N.length===1?"":"s"}`:"No sessions")}catch(N){const q=N instanceof Error?N.message:String(N);pe(q),g(q)}finally{De(!1)}},[]);Z.useEffect(()=>{as()},[as]),Z.useEffect(()=>{const m=Re();m&&m.listBackends?.().then(Cs).catch(()=>Cs([]))},[]),Z.useEffect(()=>{if(bi!=="wsl"){rr([]),yt("");return}const m=Re();m&&m.listWslDistributions?.().then(rr).catch(()=>rr([]))},[bi]),Z.useEffect(()=>{if(!Y){Ki([]);return}const m=Re();m&&m.listHistory?.().then(Ki).catch(()=>Ki([]))},[Y]),Z.useEffect(()=>{const m=Re(),N=vs((Xe?.kind==="ssh"?Xe.host:"")||(It?b.find(V=>V.id===It)?.host:"")||""),q=N?Li.filter(V=>vs(V.hostName??"")===N||V.alias===N):[];if(q.length===0){ta([]);return}m?.discoverRemoteScreens&&(wn(!0),Promise.allSettled(q.map(V=>m.discoverRemoteScreens(V))).then(V=>{const ge=[];V.forEach((be,Ee)=>{be.status==="fulfilled"&&Array.isArray(be.value)&&be.value.forEach(je=>{ge.push({session:je,connection:q[Ee]})})}),ta(ge)}).catch(()=>ta([])).finally(()=>wn(!1)))},[Li,Xe?.host,b,It]),Z.useEffect(()=>{const m=Re();m&&m.listKnownConnections?.().then(Jr).catch(()=>Jr([]))},[]),Z.useEffect(()=>{r.ai.recordCommands&&Re()?.listCommandHistory?.().then(Ve).catch(()=>{})},[r.ai.recordCommands]),Z.useEffect(()=>{const m=Re();m?.speechApiKeyStatus&&m.speechApiKeyStatus().then(N=>is(q=>({...q,stored:N.stored,encryptionAvailable:N.encryptionAvailable}))).catch(()=>{})},[]),Z.useEffect(()=>{const m=Re();m?.aiApiKeyStatus&&m.aiApiKeyStatus().then(N=>ai(q=>({...q,stored:N.stored,encryptionAvailable:N.encryptionAvailable}))).catch(()=>{})},[]),Z.useEffect(()=>{it||!xt||P(m=>tg(m,b))},[b,it,xt]),Z.useEffect(()=>{const m=Re();if(!m?.loadWorkspaces){Si(!0);return}let N=!1;return m.loadWorkspaces().then(q=>{if(N)return;const V=fg(q,r.sessions.defaultLayout);V.workspaces.length&&(P(V.workspaces),V.activeWorkspaceId&&f(V.activeWorkspaceId))}).catch(()=>{}).finally(()=>{N||Si(!0)}),()=>{N=!0}},[]),Z.useEffect(()=>{it||!xt||P(m=>ag(m,N=>{const q=ph(Sp(N),b,Li);return q.kind==="attach"?q.sessionId:void 0}))},[b,it,xt,Li]),Z.useEffect(()=>{const m=Re();if(m?.onForwardEvent)return m.onForwardEvent(N=>{if(N.type==="status"){S(q=>hl(q,N.forward));return}if(N.type==="prompt"){x({forwardId:N.forwardId,kind:N.prompt.kind,text:N.prompt.text});return}S(q=>q.map(V=>V.id===N.forwardId&&V.status!=="error"?{...V,status:"idle"}:V))})},[]),Z.useEffect(()=>{const m=Re();if(!m?.loadForwards){R(!0);return}let N=!1;return Promise.all([m.loadForwards(),m.listForwards?.()??[]]).then(([q,V])=>{if(N)return;const ge=rS(q);S(V.reduce((be,Ee)=>hl(be,Ee),ge))}).catch(()=>{}).finally(()=>{N||R(!0)}),()=>{N=!0}},[]),Z.useEffect(()=>{if(!T)return;const m=Re();if(!m?.saveForwards)return;const N=setTimeout(()=>{m.saveForwards(nS(h)).catch(()=>{})},gp);return()=>clearTimeout(N)},[h,T]),Z.useEffect(()=>{if(!xt||it)return;const m=Re();if(!m?.saveWorkspaces)return;const N=setTimeout(()=>{m.saveWorkspaces(hg(I,o,b)).catch(()=>{})},gp);return()=>clearTimeout(N)},[I,o,b,xt,it]),Z.useEffect(()=>{o&&gs(m=>m.includes(o)?m:[...m,o])},[o]),Z.useEffect(()=>{!Xe&&st.length&&Es(st[0])},[Xe,st,Es]),Z.useEffect(()=>Re()?.onLinkRefused?.(N=>g(N)),[]);const ur=Z.useRef(new Map);Z.useEffect(()=>{const m=Re();if(m)return m.onData((N,q)=>{const V=((ur.current.get(N)??"")+q).slice(-2048);ur.current.set(N,V);const ge=Vg(V);ge&&j(be=>{const Ee=be.find(je=>je.id===N);return!Ee||Ee.cwd===ge.path?be:be.map(je=>je.id===N?{...je,cwd:ge.path}:je)})})},[]),Z.useEffect(()=>{const m=N=>{if(N.key==="Escape"){if(ji.current){N.preventDefault(),ba();return}const V=Og({help:Q,transfer:Jt,settings:ys,voiceReview:!!ts,overview:ze,suggest:!!tt,modal:!!ve,palette:_e,history:Y});if(!V)return;N.preventDefault(),V==="help"&&U(!1),V==="transfer"&>(!1),V==="settings"&&Wi(!1),V==="voiceReview"&&wi(),V==="overview"&&Ie(!1),V==="suggest"&&(Re()?.cancelAiRequest?.(),Dt(null)),V==="modal"&&we(null),V==="palette"&&Se(!1),V==="history"&&ne(!1);return}const q=Mg({key:N.key,code:N.code,ctrlKey:N.ctrlKey,metaKey:N.metaKey,shiftKey:N.shiftKey,altKey:N.altKey,inTextField:N.target instanceof HTMLInputElement},oe);if(q){if(N.preventDefault(),q.action==="switch-workspace"){const V=I[q.position-1];V&&ya(V.id);return}q.action==="toggle-help"&&U(V=>!V),q.action==="toggle-overview"&&Ie(V=>!V),q.action==="new-workspace"&&(pt($o(I)),we("workspace")),q.action==="new-terminal"&&Ci("local"),q.action==="ask-ai"&&Al(),q.action==="toggle-layout"&&zt(V=>({maximizedSessionId:null,layout:V.layout==="stack"?V.lastSplit:"stack"})),q.action==="toggle-sidebar"&&M(V=>!V),q.action==="toggle-settings"&&Wi(V=>!V),q.action==="history-palette"&&vc()}};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[ze,tt,ve,_e,Y,ys,Jt,Q,ts,li.status,I,o,Ze,st,b]);const Vs=lp(r.ai),As=Ah(Xe),da=_g(Xe),hr=St==="stack"?1:St==="grid"?4:2,xl=Z.useMemo(()=>new Set([...Ke,o]),[Ke,o]),fa=Z.useMemo(()=>Zv(I.filter(m=>xl.has(m.id)),b,o),[I,b,o,xl]),Vi=Z.useMemo(()=>fa.filter(m=>m.workspaceId===o).map(m=>m.session),[fa,o]),ac=Math.max(hr,Vi.length),Pt=Vi.some(m=>m.id===ha)?ha:null,lc=Vi.find(m=>m.id===Xe?.id)?.id??Vi[0]?.id,oc=(m,N)=>St==="stack"?m.id===lc:N<hr;Z.useEffect(()=>{Jt&&!As&>(!1)},[Jt,As]),Z.useEffect(()=>{St==="stack"||Ht.lastSplit===St||zt({lastSplit:St})},[St,Ht.lastSplit,zt]);const Yi=async m=>{Es(m),ci(m.id);const N=Vi.findIndex(q=>q.id===m.id);Pt?Bi(m.id):N>=hr&&St!=="stack"&&jt("grid"),g(m.persistence==="process"?`${m.host} · ${m.name} · process only (install screen for persistence)`:`${m.host} · ${m.name}`),Ie(!1)},ls=(m,N=o)=>{P(q=>Qv(q,N,m.id))},cc=async m=>{m.preventDefault();const N=Pe.trim()||$o(I),q=W_(N,r.sessions.defaultLayout);P(V=>[...V,q]),f(q.id),Es(null),we(null),g(`Workspace “${N}” ready`)},uc=async m=>{m.preventDefault();const N=Re();if(N){if((Ze?fh(Ze):st.length)>=4){g("This workspace supports up to 4 sessions."),we(null);return}C(!0);try{const q=await N.createLocalSession({name:Gt,backend:bi,wslDistribution:bi==="wsl"?ws:void 0});j(V=>[...V.filter(ge=>ge.id!==q.id),q]),ls(q),ci(q.id),Bi(null),jt(_h(st.length+1)),we(null),await Yi(q)}catch(q){g(q instanceof Error?q.message:String(q))}finally{C(!1)}}},_a=async(m,N,q)=>{const V=Re();if(!V||_)return null;const ge=Ze?fh(Ze):st.length;if(!q?.replacingPane&&ge>=4)return g("This workspace supports up to 4 sessions."),we(null),null;C(!0);try{const be=await V.createSshSession({name:N||void 0,target:m});return j(Ee=>[...Ee.filter(je=>je.id!==be.id),be]),ls(be),ci(be.id),Bi(null),jt(_h(q?.replacingPane?Math.max(ge,1):ge+1)),we(null),await Yi(be),be}catch(be){return g(be instanceof Error?be.message:String(be)),null}finally{C(!1)}},hc=async m=>{m.preventDefault(),await _a(fl,Vt)},dr=async(m,N)=>{const q=Re();if(!q)return null;if(m.kind==="unavailable")return g(m.reason),null;if(m.kind==="attach"){const ge=b.find(be=>be.id===m.sessionId);return ge?(ls(ge),await Yi(ge),ge):null}if(m.kind==="attach-remote-screen")return _c(m.name,m.screenName,m.connection);const V=await _a(m.target,m.name,N);return!V||!m.screenCommand||(await q.attachSession(V.id),await fr(q,V.id),q.write(V.id,`${m.screenCommand}\r`)),V},dc=async m=>{const N=ph(Sp(m),b,Li);if(N.kind==="unavailable"){P(V=>V_(V,o,m.sessionId)),g(N.reason);return}g(`Reconnecting ${m.name}…`),await dr(N,{replacingPane:!0})&&P(V=>V_(V,o,m.sessionId))},fc=m=>{g(`Connecting to ${m.alias}…`),_a(m.hostName??m.alias,m.alias.slice(0,48))},_c=async(m,N,q)=>{try{const V=Re();if(!V)return null;g(`Attaching to ${m} on ${q.alias}…`);const be=(await V.buildRemoteScreenAttach?.(q,N))?.args,Ee=Array.isArray(be)?be.indexOf("--"):-1,je=Ee>0?be[Ee-1]:q.hostName??q.alias,Et={...await V.createSshSession({target:je,name:m}),screenName:N,persistence:"screen",backend:"screen"};j(At=>At.some(dt=>dt.id===Et.id)?At.map(dt=>dt.id===Et.id?Et:dt):[...At,Et]),ls(Et),await Yi(Et),await V.attachSession(Et.id);const Ni=be&&Ee>0?be.slice(Ee+1).join(" "):`screen -x ${N}`;return await fr(V,Et.id),V.write(Et.id,`${Ni}\r`),await as(),g(`Connected to ${m} on ${q.alias}`),Et}catch(V){return g(V instanceof Error?V.message:String(V)),null}},fr=(m,N)=>new Promise(q=>{let V=!1,ge="",be,Ee;const je=()=>{V||(V=!0,clearTimeout(be),clearTimeout(ht),Ee?.(),q())},ht=setTimeout(je,A0);Ee=m.onData((Et,Ni)=>{if(Et===N){if(ge=(ge+Ni).slice(-512),F_(ge)){je();return}clearTimeout(be),be=setTimeout(je,E0)}})}),pc=Z.useCallback((m,N)=>{if(!r.ai.recordCommands)return;const q=m0(N.command);if(q){g(`Command not remembered — it looks like it carries a credential (${q}).`);return}const V=Re();if(!V?.recordCommand)return;const ge=b.find(be=>be.id===m);V.recordCommand({command:N.command,...ge?.cwd?{cwd:ge.cwd}:{},...ge?.host?{host:ge.host}:{},...ge?.kind?{kind:ge.kind}:{},...N.exitCode===void 0?{}:{exitCode:N.exitCode}}).then(be=>{be&&Ve(Ee=>[...Ee.filter(je=>je.id!==be.id),be])}).catch(()=>{})},[r.ai.recordCommands,b]),mc=Z.useMemo(()=>{const m=[...xn.current.values()];return{entries:Ue.length,panesReporting:m.filter(N=>N.hasMarks()).length,panesOpen:m.length}},[Ue,ys,b]),vc=()=>{Ce(""),Me(0),Se(!0),Re()?.listCommandHistory?.().then(Ve).catch(()=>{})},_r=Z.useMemo(()=>{if(!_e)return[];const m=b.find(N=>N.id===(It??Xe?.id));return C0(Ue,{query:me,...m?.cwd?{cwd:m.cwd}:{},...m?.host?{host:m.host}:{},now:Date.now(),limit:40})},[_e,Ue,me,b,It,Xe?.id]),El=m=>{const N=It??Xe?.id;if(Se(!1),!N){g("No terminal selected for the command");return}Re()?.write(N,m.entry.command),Re()?.pickCommand?.(m.entry.id).catch(()=>{}),g(`On the prompt: ${m.entry.command}`),Xt(N)},gc=async()=>{await Re()?.clearCommandHistory?.().catch(()=>{}),Ve([]),g("Remembered commands forgotten.")},Al=()=>{if(!vp(r.ai)){Wi(!0),g("Set an AI endpoint and model in Settings first.");return}Dt(Sh(Xe?.id??It))},Sc=async m=>{const N=Re(),q=tt;if(!N?.requestAiCommand||!q)return;const V=q.sessionId,ge=V?b.find(je=>je.id===V):void 0,be=r.ai.includeOutput&&!!V,Ee=be&&V?x0(Ws.current.get(V)?.()??"",r.ai.outputChars):"";Dt({phase:"thinking",sessionId:V,prompt:m,usedOutput:be&&!!Ee});try{const je=await N.requestAiCommand({baseUrl:r.ai.baseUrl,model:r.ai.model},{prompt:m,...V?{sessionId:V}:{},context:{...ge?.backend?{shell:Up(ge.backend)}:{},...ge?.cwd?{cwd:ge.cwd}:{},...ge?.host?{host:ge.host}:{},...ge?.kind?{kind:ge.kind}:{},...Ee?{output:Ee}:{}}}),ht=be&&!!Ee;if(w0(r.ai,ht,je.command)&&V){N.write(V,`${je.command}\r`),Dt(null),g(`Ran suggestion: ${je.command}`);return}Dt({phase:"reviewing",sessionId:V,prompt:m,usedOutput:ht,suggestion:je})}catch(je){Dt({phase:"failed",sessionId:V,prompt:m,message:Vr(je)})}},bc=()=>{if(tt?.phase!=="reviewing")return;const{sessionId:m,suggestion:N}=tt;Dt(null),!(!m||!N.command)&&(Re()?.write(m,`${N.command}\r`),g(`Sent: ${N.command}`),Xt(m))},pa=async()=>{const m=Re();if(m?.listAiModels)try{Ps(await m.listAiModels(r.ai.baseUrl))}catch(N){Ps([]),g(Vr(N))}},An=async()=>{const m=Re();if(!m?.testAiEndpoint)return;Zr({status:"testing",message:null});const N=await m.testAiEndpoint({baseUrl:r.ai.baseUrl,model:r.ai.model});Zr({status:"idle",ok:N.ok,message:N.message})},Rl=Z.useMemo(()=>{const m=new Set;for(const N of b)N.kind==="ssh"&&N.host&&m.add(N.host);for(const N of Li)m.add(N.hostName??N.alias);return[...m]},[b,Li]),pr=()=>{K(m=>m||(Xe?.kind==="ssh"?Xe.host:Rl[0])||""),z(!1),we("forward")},ma=async m=>{const N=Re();if(!N?.openForward)return;const q=sS(m,h);if(q){g(q);return}l("ports"),S(V=>hl(V,{...m,status:"connecting"}));try{const V=await N.openForward(m);S(ge=>hl(ge,V)),g(`Sharing ${tp(V)}`)}catch(V){const ge=Vr(V);S(be=>hl(be,{...m,status:"error",message:ge})),g(ge)}},Tl=async m=>{m.preventDefault();const N=Number(he),q=Number(ae||he);if([N,q].some(ge=>!Number.isInteger(ge)||ge<1||ge>65535)){g("A port must be a whole number between 1 and 65535.");return}we(null),await ma({id:`forward:${crypto.randomUUID()}`,target:B.trim(),direction:F,bind:O,listenPort:N,destinationPort:q,...L.trim()?{destinationHost:L.trim()}:{}})},Dl=async m=>{const N=Re();S(q=>q.filter(V=>V.id!==m.id)),g(`Stopped sharing ${Zn(m)}`);try{await N?.closeForward?.(m.id)}catch{}},va=m=>Ze?.view.browsers?.[m],os=m=>!!va(m)?.open,yc=m=>va(m)?.ratio??Rp,kl=(m,N)=>{zt(q=>({browsers:{...q.browsers,[m]:{open:!1,...q.browsers?.[m],...N}}}))},Ml=m=>{const N=!os(m);kl(m,{open:N}),N||lr(q=>({...q,[m]:""}))},Ll=m=>ar[m.id]||Sg(m,Ol(m)),Ol=m=>m.kind==="ssh"?rs[m.id]:m.wslDistribution?Yt[m.wslDistribution]:void 0,Rn=(m,N)=>{const q=Re();if(!q)return;const V=pg(m);if(!V){g(`ZeroG does not know how ${m.name} quotes a path, so it will not type one.`);return}const ge=J_(m,N);if(!ge){g(`That directory is outside what ${m.name} can reach.`);return}if(!Tn(m)){g(`${m.name} is running something, so its directory was left alone.`);return}const be=wg(V,ge);if("refused"in be){g(be.refused);return}q.write(m.id,be.command+"\r"),lr(Ee=>({...Ee,[m.id]:N})),g(`${m.name}: ${be.command}`),Xt(m.id)},Tn=m=>{const N=xn.current.get(m.id);if(N?.hasMarks())return N.atPrompt();const q=Ws.current.get(m.id);if(!q)return!1;const V=q().trimEnd().split(`
|
|
85
|
+
`);return F_(V[V.length-1]??"")},ga=Z.useRef(new Map);Z.useEffect(()=>{const m=[];for(const N of b)ga.current.has(N.id)&&ga.current.get(N.id)!==N.cwd&&m.push(N.id),ga.current.set(N.id,N.cwd);m.length&&lr(N=>{const q={...N};let V=!1;for(const ge of m)q[ge]&&(delete q[ge],V=!0);return V?q:N})},[b]),Z.useEffect(()=>{for(const m of b){if(!os(m.id))continue;const N=!m.cwd||m.cwd.startsWith("~");if(m.kind==="ssh"){rs[m.id]||cr(m);continue}!m.wslDistribution||!N||Yt[m.wslDistribution]||bl(m.wslDistribution)}},[b,Ze?.view.browsers,Yt,rs,bl,cr]);const ji=Z.useRef(null),[Bl,mr]=Z.useState(null),[Dn,vr]=Z.useState(null),[jl,Sa]=Z.useState(null),kn=Z.useRef(!1),Cc=()=>[...document.querySelectorAll(".workspace-tab-slot")].map(m=>{const N=m.getBoundingClientRect();return{id:m.dataset.workspaceId??"",left:N.left,width:N.width}}),wc=(m,N)=>{N.button===0&&(N.target.closest(".workspace-tab-close")||(ji.current={id:m.id,pointerId:N.pointerId,startX:N.clientX,dragging:!1,original:I},N.currentTarget.setPointerCapture?.(N.pointerId)))},xc=m=>{const N=ji.current;if(!N||N.pointerId!==m.pointerId)return;if(!N.dragging){if(!r0(N.startX,m.clientX))return;N.dragging=!0,kn.current=!0,mr(N.id)}const q=Cc();if(q.findIndex(be=>be.id===N.id)<0)return;const ge=a0(q,m.clientX);P(be=>{const Ee=gh(be,N.id);return Ee<0?be:_p(be,Ee,ge)})},Ec=m=>{const N=ji.current;!N||N.pointerId!==m.pointerId||(m.currentTarget.releasePointerCapture?.(m.pointerId),ji.current=null,mr(null),N.dragging&&window.setTimeout(()=>{kn.current=!1},0))},ba=()=>{const m=ji.current;m&&(ji.current=null,mr(null),m.dragging&&P(m.original),kn.current=!1)},ti=m=>{const N=gh(I,m.id),q=I.length-1,V=ge=>P(be=>_p(be,gh(be,m.id),ge));return[{label:"Rename…",icon:"pencil",onSelect:()=>{Sa(m.id),pt(m.name),we("rename")}},{label:"Duplicate",icon:"copy",hint:"Copies the layout, and each SSH pane as one to reconnect",onSelect:()=>Mn(m)},{label:"Move left",icon:"chevron-left",disabled:N<=0,onSelect:()=>V(N-1)},{label:"Move right",icon:"chevron-right",disabled:N<0||N>=q,onSelect:()=>V(N+1)},{label:"Close workspace",icon:"x",danger:!0,disabled:I.length<2,hint:I.length<2?"The last workspace cannot be closed":"Its terminals keep running",onSelect:()=>Ca(m.id)}]},Mn=m=>{const N=$o(I),q=sg(I,m.id,b,N);if(!q.created)return;P(q.workspaces),f(q.created.id),Es(null);const V=[`Workspace “${N}” copies ${m.name}`];q.copied&&V.push(`${q.copied} SSH ${q.copied===1?"pane":"panes"} to reconnect`),q.skipped&&V.push(`${q.skipped} local ${q.skipped===1?"pane":"panes"} not copied`),g(V.join(" · "))},Nl=async m=>{m.preventDefault();const N=jl,q=Pe.trim();if(we(null),Sa(null),!N||!yh(q))return;const V=I.find(ge=>ge.id===N)?.name;q!==V&&(P(ge=>G_(ge,N,q)),g(`Workspace “${V}” is now “${q}”`))},gr=()=>{pt($o(I)),we("workspace")},ya=m=>{if(m===o)return;const N=I.find(q=>q.id===m);N&&(ut(!1),f(m),g(`Workspace “${N.name}”`))},Ca=m=>{const N=I.find(ge=>ge.id===m),q=rg(I,m,o);if(q.workspaces===I)return;ut(!1),P(q.workspaces),f(q.activeWorkspaceId);const V=q.releasedSessionIds.length;g(V?`Closed workspace “${N?.name}” · ${V} session${V===1?"":"s"} still running`:`Closed workspace “${N?.name}”`)},wa=()=>{Ze&&(ki(Ze.name),ut(!0))},Hl=()=>{if(ut(!1),!Ze)return;const m=bt.trim();!yh(m)||m===Ze.name||(P(N=>G_(N,Ze.id,m)),g(`Workspace renamed to “${m}”`))},Ci=(m,N)=>{qi(N0(Ze?.name??"term",st)),Fs(qp(r.sessions.defaultBackend,qs)),yt(r.sessions.defaultWslDistribution),N?.sshTarget!==void 0&&_l(N.sshTarget),we(m)},Ys=()=>Ci("local"),Ln=()=>h.length?c.jsx("div",{className:"session-list",children:eS(h).map(m=>c.jsxs(Jn.Fragment,{children:[c.jsx("div",{className:"session-group-label",children:m.host}),m.forwards.map(N=>c.jsxs("div",{className:`session-row forward-row ${N.status==="idle"?"session-ghosted":""}`,children:[c.jsx("span",{className:`status-dot ${tS(N)}`}),c.jsx("button",{type:"button",className:"forward-open",onClick:()=>N.status==="idle"||N.status==="error"?void ma(N):void 0,title:N.status==="idle"||N.status==="error"?`Reconnect ${Zn(N)}`:tp(N),children:c.jsxs("span",{className:"session-copy",children:[c.jsx("b",{children:Zn(N)}),c.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"}`:""]})]})}),iS(N)&&c.jsx("span",{className:"forward-badge",title:"Reachable from your network, not just this machine",children:"LAN"}),c.jsx("button",{type:"button",className:"forward-close",onClick:()=>{Dl(N)},title:`Stop sharing ${Zn(N)}`,"aria-label":`Stop sharing ${Zn(N)}`,children:"×"})]},N.id))]},m.host))}):c.jsx("div",{className:"session-list",children:c.jsxs("div",{className:"session-empty",children:[c.jsx("b",{children:"No shared ports"}),c.jsx("small",{children:"Share a port to reach a service on a remote host from this machine, or the other way round."}),c.jsx("button",{type:"button",onClick:pr,children:"Share a port"})]})}),xa=()=>{const m=vs((Xe?.kind==="ssh"?Xe.host:"")||(It?b.find(Ee=>Ee.id===It)?.host:"")||""),N=m?ea.filter(Ee=>vs(Ee.connection.hostName??"")===m||Ee.connection.alias===m).reduce((Ee,je)=>{const ht=je.connection.hostName||je.connection.alias;return(Ee[ht]=Ee[ht]||[]).push(je),Ee},{}):{},q=b.filter(Ee=>Ee.persistence==="screen"&&!st.some(je=>je.id===Ee.id)),V=Object.keys(N).length>0,ge=q.length>0;if(!V&&!ge)return c.jsxs("div",{className:"session-empty",children:[c.jsx("b",{children:"No screens"}),c.jsx("small",{children:m?"No remote screens found for this host.":"Open a remote session to discover screens, or start a local screen."})]});const be=[];if(V)for(const[Ee,je]of Object.entries(N)){const ht=je,Et=c.jsx("div",{className:"session-group-label",children:Ee},`${Ee}-label`),Ni=ht.map(({session:At})=>{const Zi=ht.find(dt=>dt.session.id===At.id)?.connection;return c.jsx(Fo,{session:At,ghosted:!0,onClick:async()=>{if(!Zi)return;g(`Attaching ${At.name}…`);const dt=Re();if(dt)try{const di=(await dt.buildRemoteScreenAttach?.(Zi,At.screenName??At.name))?.args,si=Array.isArray(di)?di.indexOf("--"):-1,Hi=si>0?di[si-1]:Zi.hostName??Zi.alias,zi={...await dt.createSshSession({target:Hi,name:At.name}),screenName:At.screenName??At.name,persistence:"screen",backend:"screen"};j(Bn=>Bn.some(jn=>jn.id===zi.id)?Bn.map(jn=>jn.id===zi.id?zi:jn):[...Bn,zi]),ls(zi),await Yi(zi),await dt.attachSession(zi.id);const Ma=di&&si>0?di.slice(si+1).join(" "):`screen -x ${At.screenName??At.name}`;await fr(dt,zi.id),dt.write(zi.id,`${Ma}\r`),await as(),g(`Connected to ${At.name}`)}catch($t){g($t instanceof Error?$t.message:String($t))}}},At.id)});be.push(Et,...Ni)}return ge&&!V&&(be.push(c.jsx("div",{className:"session-group-label",children:"local"},"local-label")),q.forEach(Ee=>{be.push(c.jsx(Fo,{session:Ee,ghosted:!0,onClick:()=>{ls(Ee),Yi(Ee),g(`Reconnecting to ${Ee.name}…`)}},Ee.id))})),c.jsx(c.Fragment,{children:be})},zl=St==="split-v"?"pane-grid split-v":St==="split-h"?"pane-grid split-h":St==="grid"?"pane-grid grid":"pane-grid",cs=!Pt&&(St==="split-v"||St==="grid"),Rs=!Pt&&(St==="split-h"||St==="grid"),Xi=r.sessions.splitColumnRatio,us=r.sessions.splitRowRatio,hs=Z.useRef(null),Ul=Pt?void 0:{...cs?{gridTemplateColumns:`${Xi}fr ${1-Xi}fr`}:{},...Rs?{gridTemplateRows:`${us}fr ${1-us}fr`}:{}},Ea=(m,N)=>{const q=hs.current?.getBoundingClientRect();if(!q)return;const V=m==="column"?(N.clientX-q.left)/q.width:(N.clientY-q.top)/q.height;Number.isFinite(V)&&Oi("sessions",m==="column"?{splitColumnRatio:V}:{splitRowRatio:V})},Aa=(m,N)=>{const V=(m==="column"?Xi:us)+N*.02;Zt("sessions",m==="column"?{splitColumnRatio:V}:{splitRowRatio:V})},Il=m=>{Zt("sessions",m==="column"?{splitColumnRatio:Le.sessions.splitColumnRatio}:{splitRowRatio:Le.sessions.splitRowRatio})},Sr={layout:St,maximized:!!Pt,columnRatio:Xi,rowRatio:us,sessionCount:st.length,lastSplit:Ht.lastSplit},Pl=Z.useRef(null),$l=m=>{const N=Pl.current?.getBoundingClientRect();N&&Oi("sessions",{sidebarWidth:Math.round(m.clientX-N.left)})},ql=m=>{zt(N=>({focusedSessionId:m,maximizedSessionId:N.maximizedSessionId===m?null:m}))},br=m=>{if(m.kind==="restore"){Bi(null);return}if(m.kind==="show"){Bi(null),jt(m.layout);return}if(m.kind==="reset-splits"){Zt("sessions",m.ratios);return}const N=It??Xe?.id??st[0]?.id;N&&Bi(N)},ui=m=>{if(!Pt||st.length<2)return;const q=(st.findIndex(ge=>ge.id===Pt)+m+st.length)%st.length,V=st[q];ci(V.id),Es(V),Bi(V.id)},On=()=>(sr.current??=new s0({createWorker:()=>new Worker(new URL(""+new URL("voice-worker-DoNT0zEM.js",import.meta.url).href,import.meta.url),{type:"module"}),resolveApiKey:async()=>ss.current??await window.zerog?.readSpeechApiKey()??null}),sr.current),hi=async m=>{const N=Re();if(N?.saveSpeechApiKey){is(q=>({...q,status:"saving",error:null,notice:null}));try{const q=await N.saveSpeechApiKey(m);ss.current=null,is({status:"idle",stored:q.stored,encryptionAvailable:q.encryptionAvailable,sessionOnly:!1,notice:q.stored?"Key saved, encrypted by this system.":"Key cleared."})}catch(q){ss.current=m,is(V=>({...V,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})),g(q instanceof Error?q.message:String(q))}}},Xs=async()=>{const m=Re();if(ss.current=null,!m?.clearSpeechApiKey){is(N=>({...N,stored:!1,sessionOnly:!1,notice:"Key cleared.",error:null}));return}try{const N=await m.clearSpeechApiKey();is(q=>({...q,status:"idle",stored:N.stored,sessionOnly:!1,notice:"Key cleared.",error:null}))}catch(N){is(q=>({...q,status:"idle",sessionOnly:!1,error:N instanceof Error?N.message:String(N)}))}},Ra=async m=>{const N=Re();if(N?.saveAiApiKey){ai(q=>({...q,status:"saving",error:null,notice:null}));try{const q=await N.saveAiApiKey(m);ai({status:"idle",stored:q.stored,encryptionAvailable:q.encryptionAvailable,sessionOnly:!1,notice:q.stored?"Key saved, encrypted by this system.":"Key cleared."})}catch(q){ai(V=>({...V,status:"idle",error:Vr(q)}))}}},yr=async()=>{const m=Re();if(m?.clearAiApiKey)try{const N=await m.clearAiApiKey();ai(q=>({...q,status:"idle",stored:N.stored,notice:"Key cleared.",error:null}))}catch(N){ai(q=>({...q,status:"idle",error:Vr(N)}))}},Cr=m=>{if(m.kind==="notice"){g(m.message);return}m.progress!==null&&g(`Loading speech model… ${Math.round(m.progress)}%`)},Ta=()=>{const m=Fi.current;window.clearTimeout(bs.current),Ss.current?.cancel(),Ss.current=null,Fi.current=null,Mi({status:"idle",sessionId:null}),Xt(m)},wi=()=>{const m=ts?.sessionId;Qr(null),Xt(m)},Da=async()=>{const m=Ss.current,N=Fi.current;if(!m||!N)return;window.clearTimeout(bs.current),Ss.current=null,Mi({status:"transcribing",sessionId:N}),g("Transcribing…");const q=await m.stop();if(!q||P_(q,r.speech.silenceThreshold)){Fi.current=null,Mi({status:"idle",sessionId:null}),g("Voice: no speech detected — lower the silence threshold in Settings if this is wrong"),Xt(N);return}try{const V=await On().transcribe(q,r.speech,Cr);if(Fi.current=null,Mi({status:"idle",sessionId:null}),!V.text){g("Voice: nothing transcribed"),Xt(N);return}if(r.ai.voiceInsert==="review"){Qr({sessionId:N,text:V.text}),g(`Voice: review "${V.text}"`);return}Re()?.write(N,V.text),g(`Voice: "${V.text}"`),Xt(N)}catch(V){Fi.current=null,Mi({status:"idle",sessionId:null}),g(`Voice error: ${V instanceof Error?V.message:String(V)}`),Xt(N)}},wr=async m=>{if(li.status==="listening"&&li.sessionId===m.id){await Da();return}if(li.status!=="idle")return;if(Bt.status!=="idle"){g("The speech test in Settings is using the microphone");return}const N=new $_;try{await N.start()}catch(q){g(`Microphone unavailable: ${q instanceof Error?q.message:String(q)}`);return}Ss.current=N,Fi.current=m.id,Mi({status:"listening",sessionId:m.id}),Xt(m.id),window.clearTimeout(bs.current),bs.current=window.setTimeout(()=>{Da()},r.speech.maxUtteranceSeconds*1e3),g(`Listening on ${m.name}… click the mic again to transcribe, Esc to discard`)},Zs=m=>{const N=Re();if(!N)return;const q=lp(r.ai);N.write(m.id,`${q}\r`),g(`Sent "${q}" to ${m.name}`),Xt(m.id)},Fl=async()=>{const m=$s.current;if(!m)return;window.clearTimeout(nr.current),$s.current=null,ei({status:"transcribing",message:"Transcribing…",transcript:null,error:null});const N=await m.stop();if(!N){ei({status:"idle",error:"Nothing was recorded."});return}const q=Cp(N),V=P_(N,r.speech.silenceThreshold);try{const ge=await On().transcribe(N,r.speech,be=>{ei(Ee=>({...Ee,message:be.kind==="notice"?be.message:be.progress!==null?`Loading speech model… ${Math.round(be.progress)}%`:"Loading speech model…"}))});ei({status:"idle",transcript:ge.text,elapsedMs:ge.elapsedMs,level:q,message:V?"Below the silence threshold — a real recording at this level would have been discarded.":ge.engine==="server"?"Transcribed by the server.":"Transcribed by the built-in engine.",error:null})}catch(ge){ei({status:"idle",level:q,error:ge instanceof Error?ge.message:String(ge)})}},ii=async()=>{if(Bt.status==="recording"){await Fl();return}if(Bt.status==="transcribing")return;if(li.status!=="idle"){ei({status:"idle",error:"A terminal pane is recording — stop that first."});return}const m=new $_;try{await m.start()}catch(N){ei({status:"idle",error:`Microphone unavailable: ${N instanceof Error?N.message:String(N)}`});return}$s.current=m,ei({status:"recording",message:"Listening… say a command, then stop.",transcript:null,error:null}),window.clearTimeout(nr.current),nr.current=window.setTimeout(()=>{Fl()},r.speech.maxUtteranceSeconds*1e3)};Z.useEffect(()=>()=>{window.clearTimeout(bs.current),window.clearTimeout(nr.current),Ss.current?.cancel(),$s.current?.cancel(),sr.current?.dispose()},[]);const ka=async m=>{li.sessionId===m.id&&Ta(),En.forget(m.id);const N=st.filter(V=>V.id!==m.id);P(V=>{const ge=Jv(V,m.id);return K_(ge,o,be=>({activeSessionId:be.activeSessionId??N[0]?.id,focusedSessionId:be.focusedSessionId??N[0]?.id,layout:_h(N.length)}))});const q=Re();if(q)try{await q.closeSession(m.id)}catch(V){g(V instanceof Error?V.message:String(V));return}g(m.persistence==="screen"?`Closed ${m.name} · screen session survives`:m.kind==="ssh"?`Closed ${m.name} · SSH connection ended`:`Closed ${m.name} · process ended`),as()};return c.jsxs("main",{className:`app-shell ${E?"drawer-collapsed":""}`,children:[c.jsxs("header",{className:"window-bar",children:[c.jsxs("div",{className:"window-brand",title:jp(or),children:[c.jsx("span",{className:"brand-mark",children:"ZG"}),c.jsx("span",{className:"brand-name",children:"ZeroG"}),or&&c.jsx("span",{className:"brand-version",children:or})]}),c.jsx("div",{className:"workspace-tabs",children:I.map((m,N)=>{const q=I.length>1,V=ng(m,b);return c.jsxs("span",{className:`workspace-tab-slot ${q?"closable":""} ${Bl===m.id?"dragging":""}`,"data-workspace-id":m.id,children:[c.jsxs("button",{type:"button",className:`workspace-tab ${m.id===Ze?.id?"active":""}`,title:`Switch to ${m.name}${N<9?` (Ctrl+Shift+${N+1})`:""} · drag to reorder`,onPointerDown:ge=>wc(m,ge),onContextMenu:ge=>{ge.preventDefault(),ba(),vr({id:m.id,at:{x:ge.clientX,y:ge.clientY}})},onPointerMove:xc,onPointerUp:Ec,onPointerCancel:ba,onClick:()=>{kn.current||ya(m.id)},children:[c.jsx("span",{className:`status-dot ${V==="empty"?"":V}`}),m.name,c.jsx("span",{className:"tab-meta",children:fh(m)})]}),q&&c.jsx("button",{type:"button",className:"workspace-tab-close",title:`Close ${m.name} · its terminals keep running`,"aria-label":`Close workspace ${m.name}`,onClick:()=>Ca(m.id),children:"×"})]},m.id)})}),c.jsxs("div",{className:"window-actions",children:[c.jsxs("button",{type:"button",className:"bar-button",onClick:()=>Ie(m=>!m),title:`Session overview (${gi("toggle-overview",oe)})`,children:[c.jsx(Be,{name:"grid"}),c.jsx("span",{children:"Overview"})]}),c.jsxs("button",{type:"button",className:"bar-button",onClick:gr,title:`New workspace (${gi("new-workspace",oe)})`,children:[c.jsx(Be,{name:"plus"}),c.jsx("span",{children:"Workspace"})]}),c.jsxs("button",{type:"button",className:"bar-button",onClick:Al,title:vp(r.ai)?`Ask for a command (${gi("ask-ai",oe)})`:"Set an AI endpoint in Settings first",children:[c.jsx(Be,{name:"spark"}),c.jsx("span",{children:"Suggest"})]}),c.jsx("button",{type:"button",className:"bar-button theme-button",onClick:()=>Zt("appearance",{theme:y==="dark"?"light":"dark"}),title:`Switch to ${y==="dark"?"light":"dark"} theme`,"aria-label":`Switch to ${y==="dark"?"light":"dark"} theme`,"aria-pressed":y==="light",children:c.jsx(Be,{name:y==="dark"?"sun":"moon"})}),c.jsx("button",{type:"button",className:Q?"bar-button active":"bar-button",onClick:()=>U(m=>!m),title:`Features and keyboard shortcuts (${gi("toggle-help",oe)})`,"aria-label":"Help","aria-pressed":Q,children:c.jsx(Be,{name:"help"})})]})]}),c.jsxs("div",{className:"body-shell",children:[c.jsxs("nav",{className:"rail","aria-label":"Workspace navigation",children:[c.jsx("button",{type:"button",className:"rail-button",title:`${E?"Show":"Hide"} sessions sidebar (${gi("toggle-sidebar",oe)})`,onClick:()=>M(m=>!m),children:c.jsx(Be,{name:E?"panel-left-open":"panel-left"})}),c.jsx("button",{type:"button",className:`rail-button ${!E&&u==="sessions"?"active":""}`,title:"Sessions",onClick:()=>{l("sessions"),M(!1)},children:c.jsx(Be,{name:"sessions"})}),c.jsx("button",{type:"button",className:"rail-button",onClick:()=>Ie(!0),title:"Overview",children:c.jsx(Be,{name:"grid"})}),c.jsx("button",{type:"button",className:`rail-button ${!E&&u==="ports"?"active":""}`,title:"Shared ports","aria-label":"Shared ports",onClick:()=>{l("ports"),M(!1)},children:c.jsx(Be,{name:"ports"})}),c.jsx("span",{className:"rail-spacer"}),c.jsx("button",{type:"button",className:"rail-button",onClick:pr,title:"Share a port over SSH","aria-label":"Share a port",children:c.jsx(Be,{name:"port-plus"})}),c.jsx("button",{type:"button",className:"rail-button",onClick:Ys,title:`New local terminal (${gi("new-terminal",oe)})`,"aria-label":"New local terminal",children:c.jsx(Be,{name:"terminal"})}),c.jsx("button",{type:"button",className:"rail-button",onClick:()=>Ci("ssh"),title:"Connect SSH",children:c.jsx(Be,{name:"ssh"})}),c.jsx("button",{type:"button",className:`rail-button ${ys?"active":""}`,title:`Settings (${gi("toggle-settings",oe)})`,"aria-label":"Settings","aria-expanded":ys,onClick:()=>Wi(m=>!m),children:c.jsx(Be,{name:"settings"})})]}),!E&&c.jsxs("aside",{className:"session-drawer",ref:Pl,style:{width:r.sessions.sidebarWidth},children:[c.jsxs("div",{className:"drawer-head",children:[c.jsxs("div",{className:"drawer-head-name",children:[c.jsx("span",{className:"eyebrow",children:u==="ports"?"SHARED PORTS":"WORKSPACE"}),u==="ports"?c.jsx("h1",{children:"Ports"}):Ye&&Ze?c.jsx("input",{className:"workspace-rename",autoFocus:!0,"aria-label":"Workspace name",value:bt,pattern:Ko,onChange:m=>ki(m.target.value),onBlur:Hl,onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),m.stopPropagation(),Hl()),m.key==="Escape"&&(m.preventDefault(),m.stopPropagation(),ut(!1))}}):c.jsx("h1",{onDoubleClick:wa,title:Ze?"Double-click to rename this workspace":void 0,children:Ze?.name??"Sessions"})]}),c.jsxs("div",{className:"drawer-head-actions",children:[c.jsx("button",{type:"button",className:"square-button",onClick:()=>M(!0),title:"Hide sessions sidebar",children:c.jsx(Be,{name:"panel-left"})}),c.jsx("button",{type:"button",className:"square-button history-button",onClick:()=>ne(m=>!m),title:"Session history","aria-label":"Open session history","aria-expanded":Y,children:c.jsx(Be,{name:"history"})}),c.jsx("button",{type:"button",className:"square-button",onClick:gr,title:`New workspace (${gi("new-workspace",oe)})`,"aria-label":"New workspace",children:c.jsx(Be,{name:"plus"})})]})]}),u==="ports"?Ln():c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"drawer-tools",role:"tablist","aria-label":"Session inventory",children:["terminals","screens","connections"].map(m=>{const N={terminals:"Terminals",screens:"Screens",connections:"Connections"},q=m==="terminals"?st.length:m==="screens"?b.filter(V=>(V.persistence==="screen"||V.screenName)&&!st.some(ge=>ge.id===V.id)).length+ea.length:b.filter(V=>V.kind==="ssh").length;return c.jsxs("button",{type:"button",role:"tab","aria-selected":w===m,className:`drawer-tool ${w===m?"active":""}`,onClick:()=>d(m),children:[N[m]," ",c.jsx("span",{children:q})]},m)})}),c.jsx("div",{className:"session-list",role:"tabpanel",children:it?c.jsxs("div",{className:"session-empty",children:[c.jsx("b",{children:"Loading sessions…"}),c.jsx("small",{children:"Checking available terminals and durable sessions."})]}):ri?c.jsxs("div",{className:"session-empty session-error",children:[c.jsx("b",{children:"Session inventory unavailable"}),c.jsx("small",{children:ri}),c.jsx("button",{type:"button",onClick:()=>{as()},children:"Retry"})]}):w==="terminals"?st.length||wl.length?c.jsxs(c.Fragment,{children:[st.map(m=>c.jsx(Fo,{session:m,active:Xe?.id===m.id,onClick:()=>{Yi(m)}},m.id)),wl.map(m=>c.jsx(R0,{member:m,onClick:()=>{dc(m)}},m.sessionId))]}):c.jsxs("div",{className:"session-empty",children:[c.jsx("b",{children:"No terminals yet"}),c.jsx("small",{children:"Add a local terminal or SSH connection to this workspace."})]}):w==="screens"?xa():w==="connections"?Li.length?Li.map(m=>c.jsx(T0,{connection:m,onConfigure:()=>Ci("ssh",{sshTarget:m.hostName??m.alias}),onConnect:()=>fc(m)},m.alias)):c.jsxs("div",{className:"session-empty",children:[c.jsx("b",{children:"No saved connections"}),c.jsx("small",{children:"Add Host entries to ~/.ssh/config to populate connections."})]}):b.filter(m=>m.kind==="ssh"&&m.scope==="remote"&&m.source==="discovered").length?b.filter(m=>m.kind==="ssh"&&m.scope==="remote"&&m.source==="discovered").map(m=>c.jsx(Fo,{session:m,ghosted:!0,onClick:async()=>{g(`Attaching remote screen ${m.name}…`);const N=Re();if(N)try{const V=(await N.buildRemoteScreenAttach?.({alias:m.host,hostName:m.host},m.screenName??m.name))?.args?.find(be=>be.includes("@")||!be.startsWith("-"))??m.host,ge=await N.createSshSession({target:V,name:m.name});j(be=>be.map(Ee=>Ee.id===m.id?ge:Ee)),ls(ge),await Yi(ge)}catch(q){g(q instanceof Error?q.message:String(q))}}},m.id)):c.jsxs("div",{className:"session-empty",children:[c.jsx("b",{children:"No remote screens"}),c.jsx("small",{children:"Remote screen sessions will appear here after discovery."})]})})]}),c.jsxs("div",{className:"drawer-bottom",children:[c.jsxs("button",{type:"button",className:"drawer-action",onClick:pr,children:[c.jsx(Be,{name:"port-plus"})," Share port"]}),c.jsxs("button",{type:"button",className:"drawer-action",onClick:Ys,children:[c.jsx(Be,{name:"plus"})," Local terminal ",c.jsx("kbd",{children:"⌘⇧T"})]}),c.jsxs("button",{type:"button",className:"drawer-action",onClick:()=>Ci("ssh"),children:[c.jsx(Be,{name:"ssh"})," Connect SSH"]}),c.jsxs("div",{className:"drawer-status",children:[c.jsx("span",{className:"status-dot connected"}),p]})]})]}),!E&&c.jsx(Go,{orientation:"vertical",className:"sidebar-resizer",label:"Sidebar width",valuePercent:r.sessions.sidebarWidth/vt.sidebarWidth.max*100,onDrag:$l,onCommit:()=>Zt("sessions",{sidebarWidth:r.sessions.sidebarWidth}),onNudge:m=>Zt("sessions",{sidebarWidth:r.sessions.sidebarWidth+m*16}),onReset:()=>Zt("sessions",{sidebarWidth:Le.sessions.sidebarWidth})}),c.jsxs("section",{className:"workspace",children:[c.jsxs("div",{className:"workspace-head",children:[c.jsxs("div",{className:"location",children:[E&&c.jsx("button",{type:"button",className:"inline-restore",onClick:()=>M(!1),title:"Show sessions sidebar",children:c.jsx(Be,{name:"panel-left-open"})}),c.jsx("span",{className:"connection-dot"}),c.jsx("span",{children:Xe?.host??"local"}),c.jsx("span",{className:"slash",children:"/"}),c.jsx("span",{children:Xe?.cwd??"~"}),c.jsx("span",{className:"slash",children:"/"}),c.jsx("span",{className:"muted-text",children:Xe?.name??Ze?.name??"no session"})]}),c.jsxs("div",{className:"head-controls",children:[c.jsxs("div",{className:"layout-controls",children:[c.jsx("span",{className:"control-label",children:"SFTP"}),c.jsx("button",{type:"button",className:Jt?"layout-button active":"layout-button",onClick:()=>gt(m=>!m),disabled:!da.available||!Re()?.sftpOpen,title:da.reason,"aria-label":"Transfer files over SFTP",children:c.jsx(Be,{name:"transfer"})})]}),c.jsxs("div",{className:"layout-controls",children:[c.jsx("span",{className:"control-label",children:"LAYOUT"}),c.jsx("button",{type:"button",className:St==="stack"||Pt?"layout-button active":"layout-button",onClick:()=>br(Xp(Sr)),title:`${i0(Sr)} (${gi("toggle-layout",oe)})`,children:c.jsx(Be,{name:"stack"})}),QS.map(({layout:m,icon:N})=>c.jsx("button",{type:"button",className:St===m&&!Pt?"layout-button active":"layout-button",onClick:()=>br(e0(m,Sr)),title:t0(m,Sr),children:c.jsx(Be,{name:N})},m))]})]})]}),c.jsxs("div",{className:`${zl} ${Pt?"maximized-pane-grid":""}`,ref:hs,style:Ul,children:[cs&&c.jsx(Go,{orientation:"vertical",className:"pane-resizer pane-resizer-column",label:"Pane column split",valuePercent:Xi*100,style:{left:`calc((100% - 1px) * ${Xi} + 0.5px)`},onDrag:m=>Ea("column",m),onCommit:()=>Zt("sessions",{splitColumnRatio:Xi}),onNudge:m=>Aa("column",m),onReset:()=>Il("column")}),Rs&&c.jsx(Go,{orientation:"horizontal",className:"pane-resizer pane-resizer-row",label:"Pane row split",valuePercent:us*100,style:{top:`calc((100% - 1px) * ${us} + 0.5px)`},onDrag:m=>Ea("row",m),onCommit:()=>Zt("sessions",{splitRowRatio:us}),onNudge:m=>Aa("row",m),onReset:()=>Il("row")}),fa.map(({session:m,index:N,dormant:q})=>{const V=li.sessionId===m.id&&li.status!=="idle"?li.status:null,ge=gg(m),be=!!ge&&os(m.id),Ee=be?Ll(m):null;return c.jsxs("article",{className:`pane terminal-pane ${q?"dormant-pane":""} ${!q&&It===m.id?"focused":""} ${!q&&Pt===m.id?"maximized-pane":""} ${q||oc(m,N)?"":"overflow-pane"}`,onMouseDown:()=>ci(m.id),children:[c.jsxs("div",{className:"pane-title",children:[c.jsxs("span",{children:[c.jsx("span",{className:"pane-live"})," ",m.name]}),c.jsxs("span",{className:"pane-actions",children:[Pt&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"pane-nav",onClick:()=>ui(-1),title:"Previous session",children:c.jsx(Be,{name:"chevron-left"})}),c.jsx("button",{type:"button",className:"pane-nav",onClick:()=>ui(1),title:"Next session",children:c.jsx(Be,{name:"chevron-right"})})]}),_?"connecting…":V?`${V}…`:m.kind==="ssh"?"ssh":"bash",c.jsx("button",{type:"button",className:be?"pane-browse active":"pane-browse",onClick:()=>Ml(m.id),disabled:!ge,title:ge?be?"Hide the directory browser":"Browse directories":"ZeroG cannot tell what kind of paths this pane uses","aria-label":`${be?"Hide":"Show"} the directory browser for ${m.name}`,"aria-pressed":be,children:c.jsx(Be,{name:"folder"})}),c.jsx("button",{type:"button",className:"pane-proceed",onClick:()=>Zs(m),title:`Send "${Vs}" and press Enter`,"aria-label":`Send "${Vs}" to ${m.name}`,children:c.jsx(Be,{name:"check"})}),c.jsx("button",{type:"button",className:V?`pane-mic ${V}`:"pane-mic",onClick:()=>{wr(m)},disabled:li.status!=="idle"&&!V,title:V==="listening"?"Stop and transcribe":V==="transcribing"?"Transcribing…":"Voice input","aria-label":V==="listening"?`Stop recording ${m.name}`:`Voice input for ${m.name}`,children:c.jsx(Be,{name:"mic"})}),c.jsx("button",{type:"button",className:"pane-maximize",onClick:()=>ql(m.id),title:Pt?"Restore pane":"Maximize pane",children:c.jsx(Be,{name:Pt?"restore":"maximize"})}),c.jsx("button",{type:"button",className:"pane-close",onClick:()=>{ka(m)},title:"Close pane","aria-label":`Close ${m.name}`,children:c.jsx(Be,{name:"x"})})]})]}),c.jsx(L0,{open:be,ratio:yc(m.id),onRatio:je=>kl(m.id,{ratio:je}),browser:ge?c.jsx(Eg,{session:m,path:Ee,unanchored:m.kind==="ssh",pathKind:ge,shellPath:Ee?J_(m,Ee):null,list:na(m),question:m.kind==="ssh"?vl:null,onOpen:je=>Rn(m,je),onBrowse:je=>lr(ht=>({...ht,[m.id]:je})),onClose:()=>Ml(m.id)}):null,children:c.jsx(M0,{sessionId:m.id,focused:!q&&It===m.id,dormant:q,onStatus:g,appearance:r.appearance,terminalSettings:r.terminal,registerFocus:oi,registerCapture:rc,onCommand:pc,registerRead:ml})})]},m.id)}),Array.from({length:Math.max(0,ac-Vi.length)},(m,N)=>c.jsx(O0,{index:Vi.length+N+1,onCreate:Ys},`placeholder-${N}`))]}),c.jsxs("footer",{className:"status-bar",children:[c.jsx("span",{children:"ZeroG"}),c.jsx("span",{className:"status-separator"}),c.jsx("span",{children:Ze?.name??"Workspace"}),c.jsx("span",{className:"status-separator"}),c.jsx("span",{children:Pt?"maximized pane":St==="stack"?"1 pane":`${hr} panes`}),c.jsx("span",{className:"status-separator"}),c.jsx("span",{children:"Esc closes overlays · ⌘⇧B sidebar"}),c.jsx("span",{className:"status-spacer"}),c.jsx("span",{children:Xe?`${Xe.kind==="ssh"?"SSH":Xe.persistence==="process"?"PROCESS":"SCREEN"} · ${Xe.persistence==="process"?"non-persistent":"persistent"}`:"no connection"})]})]})]}),Dn&&(()=>{const m=I.find(N=>N.id===Dn.id);return m?c.jsx(c0,{at:Dn.at,label:`${m.name} options`,items:ti(m),onClose:()=>vr(null)}):null})(),Q&&c.jsx(Hg,{version:or,bindings:oe,onClose:()=>U(!1)}),ze&&c.jsx("div",{className:"overview-layer",role:"presentation",...oa,children:c.jsxs("section",{className:"overview",children:[c.jsxs("div",{className:"overview-head",children:[c.jsxs("div",{children:[c.jsx("span",{className:"eyebrow",children:"WORKSPACE OVERVIEW"}),c.jsx("h2",{children:Ze?.name??"Choose a session"})]}),c.jsx("button",{type:"button",className:"close-button",onClick:()=>Ie(!1),children:"Esc"})]}),c.jsx("div",{className:"thumbnail-grid",children:st.length?st.map(m=>c.jsxs("button",{type:"button",className:`thumbnail ${Xe?.id===m.id?"active":""}`,onClick:()=>{Yi(m)},children:[c.jsxs("div",{className:"thumbnail-preview",children:[c.jsx("span",{className:"thumbnail-line cyan"}),c.jsx("span",{className:"thumbnail-line short"}),c.jsx("span",{className:"thumbnail-line green"}),c.jsx("span",{className:"thumbnail-cursor"})]}),c.jsxs("div",{className:"thumbnail-label",children:[c.jsx("b",{children:m.name}),c.jsxs("small",{children:[m.kind==="ssh"?m.host:"local screen"," · ",m.status]})]})]},m.id)):c.jsxs("div",{className:"overview-empty",children:[c.jsx("span",{children:"▦"}),c.jsx("b",{children:"No terminals in this workspace"}),c.jsx("small",{children:"Create a local terminal or connect over SSH."})]})}),c.jsxs("div",{className:"overview-foot",children:[c.jsx("button",{type:"button",onClick:()=>{Ie(!1),Ys()},children:"+ Local terminal"}),c.jsx("button",{type:"button",onClick:()=>{Ie(!1),Ci("ssh")},children:"Connect SSH"}),c.jsx("button",{type:"button",onClick:()=>{Ie(!1),gr()},children:"+ Workspace"}),c.jsx("span",{className:"overview-hint",children:"Press Esc to close"})]})]})}),_e&&c.jsx("div",{className:"palette-layer",role:"presentation",...Gs,children:c.jsxs("div",{className:"palette",role:"dialog","aria-label":"Command history",children:[c.jsx("input",{autoFocus:!0,className:"palette-query",value:me,placeholder:"Search commands you have run","aria-label":"Search commands you have run",onChange:m=>{Ce(m.target.value),Me(0)},onKeyDown:m=>{if(m.key==="ArrowDown")m.preventDefault(),Me(N=>Math.min(N+1,Math.max(0,_r.length-1)));else if(m.key==="ArrowUp")m.preventDefault(),Me(N=>Math.max(0,N-1));else if(m.key==="Enter"){m.preventDefault();const N=_r[ye];N&&El(N)}}}),r.ai.recordCommands?Ue.length?_r.length?c.jsx("div",{className:"palette-list",children:_r.map((m,N)=>c.jsxs("button",{type:"button",className:`palette-row ${N===ye?"active":""}`,onMouseEnter:()=>Me(N),onClick:()=>El(m),children:[c.jsx("span",{className:"palette-command",children:j0(m.entry.command,m.matched)}),c.jsxs("span",{className:"palette-meta",children:[m.entry.exitCode!==void 0&&m.entry.exitCode!==0?c.jsx("span",{className:"palette-failed",title:`Exited ${m.entry.exitCode}`,children:"failed"}):null,m.entry.cwd?c.jsx("span",{className:"palette-cwd",children:m.entry.cwd}):null]})]},m.entry.id))}):c.jsxs("div",{className:"palette-empty",children:[c.jsx("b",{children:"No match"}),c.jsxs("small",{children:[Ue.length," commands remembered, none matching that."]})]}):c.jsxs("div",{className:"palette-empty",children:[c.jsx("b",{children:"Nothing remembered yet"}),c.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."}),c.jsx("button",{type:"button",onClick:()=>{Se(!1),Wi(!0)},children:"Open settings"})]}):c.jsxs("div",{className:"palette-empty",children:[c.jsx("b",{children:"Commands are not being remembered"}),c.jsx("small",{children:"Turn on “Remember commands” in Settings under AI & voice. Nothing about what you type is stored until you do."}),c.jsx("button",{type:"button",onClick:()=>{Se(!1),Wi(!0)},children:"Open settings"})]}),c.jsx("small",{className:"palette-note",children:"Enter puts the command on the prompt without running it. ↑↓ to choose, Esc to close."})]})}),Y&&c.jsx("div",{className:"history-layer",role:"presentation",...Ks,children:c.jsxs("div",{className:"history-popover",role:"dialog","aria-label":"Session history",children:[c.jsxs("div",{className:"history-head",children:[c.jsx("b",{children:"History"}),c.jsx("button",{type:"button",onClick:()=>ne(!1),"aria-label":"Close history",children:"×"})]}),ns.length?ns.slice().sort((m,N)=>N.timestamp.localeCompare(m.timestamp)).map(m=>c.jsxs("button",{type:"button",className:"history-item",onClick:async()=>{ne(!1);const N=ph(m.session,b,Li);d(m.session.screenName||m.session.backend==="screen"?"screens":"terminals");const q=await dr(N);q&&g(`Reconnected ${q.name}`)},children:[c.jsxs("span",{className:"history-main",children:[c.jsx("span",{className:"history-kind",children:m.event.toUpperCase()}),c.jsxs("span",{className:"history-text",children:[c.jsx("b",{children:m.session.name}),c.jsxs("small",{children:[m.session.host," · ",m.available?"available":"unavailable"]})]})]}),c.jsx("button",{type:"button",className:"history-remove","aria-label":"Remove history entry",onClick:N=>{N.stopPropagation(),Re()?.removeHistory(m.id).then(()=>Ki(q=>q.filter(V=>V.id!==m.id))).catch(()=>{})},children:"×"})]},m.id)):c.jsx("p",{className:"history-empty",children:"No history entries yet."}),c.jsx("small",{className:"history-note",children:"Persisted session lifecycle from the main process."})]})}),ve&&c.jsx("div",{className:"modal-layer",role:"presentation",...Gi,children:c.jsxs("form",{className:"modal-card",onSubmit:ve==="workspace"?cc:ve==="rename"?Nl:ve==="forward"?Tl:ve==="local"?uc:hc,children:[c.jsxs("div",{className:"modal-head",children:[c.jsxs("div",{children:[c.jsx("span",{className:"eyebrow",children:vh(ve).eyebrow}),c.jsx("h2",{children:vh(ve).title})]}),c.jsx("button",{type:"button",className:"close-button",onClick:()=>we(null),children:"Esc"})]}),dp(ve)&&c.jsx("div",{className:"dialog-tabs",role:"tablist","aria-label":"Session type",children:Xn.map(m=>c.jsxs("button",{type:"button",id:`session-tab-${m.kind}`,role:"tab","aria-selected":ve===m.kind,"aria-controls":"session-dialog-panel",tabIndex:ve===m.kind?0:-1,disabled:_,className:`dialog-tab ${ve===m.kind?"active":""}`,onClick:()=>we(m.kind),onKeyDown:N=>{const q=ZS(m.kind,N.key);q&&(N.preventDefault(),we(q),document.getElementById(`session-tab-${q}`)?.focus())},children:[c.jsx("b",{children:m.label}),c.jsx("small",{children:m.hint})]},m.kind))}),ve==="rename"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{children:"Rename this workspace. Its panes, layout and shortcuts position are unaffected."}),c.jsxs("label",{children:["Workspace name",c.jsx("input",{autoFocus:!0,value:Pe,pattern:Ko,onChange:m=>pt(m.target.value)})]})]}),ve==="workspace"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{children:"Create a separate workspace for a project or host group. Terminals stay scoped to the active workspace."}),c.jsxs("label",{children:["Workspace name",c.jsx("input",{autoFocus:!0,value:Pe,onChange:m=>pt(m.target.value),pattern:Ko,required:!0})]})]}),ve==="forward"&&c.jsxs(c.Fragment,{children:[c.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."}),c.jsxs("label",{children:["SSH host",c.jsx("input",{autoFocus:!0,list:"forward-hosts",value:B,onChange:m=>K(m.target.value),placeholder:"user@server",required:!0}),c.jsx("datalist",{id:"forward-hosts",children:Rl.map(m=>c.jsx("option",{value:m},m))})]}),c.jsxs("label",{children:["Port",c.jsx("input",{value:he,onChange:m=>G(m.target.value),inputMode:"numeric",pattern:"[0-9]{1,5}",placeholder:"3000",required:!0})]}),c.jsx("button",{type:"button",className:"dialog-disclosure",onClick:()=>z(m=>!m),"aria-expanded":k,children:k?"Fewer options":"More options"}),k&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["Direction",c.jsxs("select",{value:F,onChange:m=>J(m.target.value),children:[c.jsx("option",{value:"local",children:"Remote port, reachable here"}),c.jsx("option",{value:"remote",children:"Port here, reachable on the remote"})]})]}),c.jsxs("label",{children:["Forward to ",c.jsx("span",{className:"muted-text",children:"optional"}),c.jsx("input",{value:L,onChange:m=>$(m.target.value),placeholder:"localhost"})]}),c.jsxs("label",{children:["Port on that side ",c.jsx("span",{className:"muted-text",children:"defaults to the same"}),c.jsx("input",{value:ae,onChange:m=>le(m.target.value),inputMode:"numeric",pattern:"[0-9]{1,5}",placeholder:he||"3000"})]}),c.jsxs("label",{className:"dialog-check",children:[c.jsx("input",{type:"checkbox",checked:O==="all",onChange:m=>te(m.target.checked?"all":"loopback")}),"Share on my network, not just this machine"]}),O==="all"&&c.jsxs("p",{className:"dialog-warning",children:["Anything on the network this machine is attached to will be able to reach",F==="local"?" the remote service":" the service running here","."]})]})]}),dp(ve)&&c.jsxs("div",{id:"session-dialog-panel",role:"tabpanel","aria-labelledby":`session-tab-${ve}`,children:[ve==="local"&&c.jsxs(c.Fragment,{children:[c.jsxs("p",{children:["Start a local session inside “",Ze?.name??"this workspace","”."]}),c.jsxs("label",{children:["Terminal name",c.jsx("input",{autoFocus:!0,value:Gt,onChange:m=>qi(m.target.value),pattern:"[A-Za-z0-9](?:[A-Za-z0-9_.]|-){0,48}",required:!0})]}),c.jsxs("label",{children:["Shell backend",c.jsx("select",{value:bi,onChange:m=>{const N=m.target.value;Fs(N)},children:qs.length?qs.map(m=>c.jsx("option",{value:m.backend,children:m.label},m.backend)):c.jsx("option",{value:"bash",children:"bash"})})]}),bi==="wsl"&&c.jsxs("label",{children:["WSL distribution",c.jsx("input",{value:ws,onChange:m=>yt(m.target.value),placeholder:"Ubuntu"})]})]}),ve==="ssh"&&c.jsxs(c.Fragment,{children:[c.jsxs("p",{children:["Connect a remote host into “",Ze?.name??"this workspace","”."]}),c.jsxs("label",{children:["SSH target",c.jsx("input",{autoFocus:!0,value:fl,onChange:m=>_l(m.target.value),placeholder:"user@server:22",required:!0})]}),c.jsxs("label",{children:["Session label ",c.jsx("span",{className:"muted-text",children:"optional"}),c.jsx("input",{value:Vt,onChange:m=>ic(m.target.value),placeholder:"server"})]})]})]}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>we(null),children:"Cancel"}),c.jsx("button",{className:"primary-button",disabled:_,type:"submit",children:_?"Working…":vh(ve).submit})]})]})}),Jt&&Xe&&As&&Re()&&c.jsx(aS,{session:Xe,target:As,api:Re(),onClose:()=>gt(!1),backdrop:Cl},Xe.id),ys&&c.jsx(YS,{settings:r,onChange:Zt,onReset:ua,onClose:()=>Wi(!1),backdrop:yl,backends:qs,wslDistributions:pl,speechTest:Bt,onSpeechTest:()=>{ii()},speechKey:nc,onSpeechKeySave:m=>{hi(m)},onSpeechKeyClear:()=>{Xs()},commandHistory:mc,onCopySnippet:m=>{Re()?.copyText?.(m).then(()=>g("Shell integration snippet copied.")).catch(()=>{})},onClearCommandHistory:()=>{gc()},aiKey:tr,onAiKeySave:m=>{Ra(m)},onAiKeyClear:()=>{yr()},aiModels:ir,onAiModelsRefresh:()=>{pa()},aiTest:sc,onAiTest:()=>{An()}}),ts&&c.jsx("div",{className:"modal-layer",role:"presentation",...ca,children:c.jsxs("div",{className:"modal-card approval-card",children:[c.jsxs("div",{className:"modal-head",children:[c.jsxs("div",{children:[c.jsx("span",{className:"eyebrow",children:"VOICE"}),c.jsx("h2",{children:"Insert transcript?"})]}),c.jsx("button",{type:"button",className:"close-button",onClick:()=>wi(),children:"Esc"})]}),c.jsx("p",{children:"Review mode is on, so nothing has been typed yet. Inserting does not press Enter."}),c.jsx("code",{children:ts.text}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>wi(),children:"Discard"}),c.jsx("button",{type:"button",className:"primary-button",onClick:()=>{Re()?.write(ts.sessionId,ts.text),g(`Voice: "${ts.text}"`),wi()},children:"Insert"})]})]})}),D&&c.jsx("div",{className:"modal-layer",role:"presentation",children:c.jsxs("form",{className:"modal-card approval-card",onSubmit:m=>{m.preventDefault();const N=new FormData(m.currentTarget).get("answer"),q=Re();x(null),q?.answerForwardPrompt?.(D.forwardId,String(N??"")).catch(V=>{g(Vr(V))})},children:[c.jsx("div",{className:"modal-head",children:c.jsxs("div",{children:[c.jsx("span",{className:"eyebrow",children:"SHARED PORT"}),c.jsx("h2",{children:D.kind==="confirm"?"Accept this host key?":"The host is asking"})]})}),c.jsx("code",{children:D.text}),c.jsxs("label",{children:[D.kind==="confirm"?"Type yes, no, or the fingerprint":"Answer",c.jsx("input",{autoFocus:!0,name:"answer",type:D.kind==="confirm"?"text":"password",autoComplete:"off"})]}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>{const m=D.forwardId;x(null),Re()?.closeForward?.(m).catch(()=>{}),S(N=>N.map(q=>q.id===m?{...q,status:"idle"}:q))},children:"Cancel"}),c.jsx("button",{className:"primary-button",type:"submit",children:"Send"})]})]})}),tt&&c.jsx("div",{className:"modal-layer",role:"presentation",...la,children:c.jsxs("div",{className:"modal-card approval-card",children:[c.jsxs("div",{className:"modal-head",children:[c.jsxs("div",{children:[c.jsx("span",{className:tt.phase==="reviewing"?"eyebrow warning-text":"eyebrow",children:tt.phase==="reviewing"?"APPROVAL REQUIRED":"AI SUGGESTION"}),c.jsx("h2",{children:tt.phase==="asking"?"What would you like to do?":tt.phase==="thinking"?"Asking the model…":tt.phase==="failed"?"No suggestion":"Run this command?"})]}),c.jsx("button",{type:"button",className:"close-button",onClick:()=>{Re()?.cancelAiRequest?.(),Dt(null)},children:"Esc"})]}),tt.phase==="asking"&&c.jsxs("form",{onSubmit:m=>{m.preventDefault();const N=String(new FormData(m.currentTarget).get("prompt")??"").trim();N&&Sc(N)},children:[c.jsxs("p",{children:[r.ai.model," at ",r.ai.baseUrl,"."," ",r.ai.includeOutput?"The last of this pane’s output is sent with your request.":"Only the shell, directory and host are sent."]}),c.jsxs("label",{children:["Request",c.jsx("input",{autoFocus:!0,name:"prompt",placeholder:"fix that error",autoComplete:"off"})]}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>Dt(null),children:"Cancel"}),c.jsx("button",{className:"primary-button",type:"submit",children:"Ask"})]})]}),tt.phase==="thinking"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{children:tt.prompt}),c.jsx("p",{className:"muted-text",children:tt.usedOutput?"Sent with recent output from this pane.":"Sent without terminal output."}),c.jsx("div",{className:"modal-actions",children:c.jsx("button",{type:"button",onClick:()=>{Re()?.cancelAiRequest?.(),Dt(null)},children:"Cancel"})})]}),tt.phase==="reviewing"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{children:tt.suggestion.explanation}),tt.suggestion.command?c.jsx("code",{children:tt.suggestion.command}):null,tt.usedOutput?c.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,c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>Dt(null),children:"Cancel"}),tt.suggestion.command?c.jsx("button",{type:"button",className:"primary-button",onClick:bc,children:"Run"}):c.jsx("button",{type:"button",onClick:()=>Dt(Sh(tt.sessionId)),children:"Ask again"})]})]}),tt.phase==="failed"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{children:tt.message}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>Dt(null),children:"Close"}),c.jsx("button",{type:"button",className:"primary-button",onClick:()=>Dt(Sh(tt.sessionId)),children:"Try again"})]})]})]})})]})}function j0(r,v){if(!v.length)return r;const y=new Set(v),b=[];let j="",I=y.has(0);for(let P=0;P<r.length;P+=1){const o=y.has(P);o!==I&&j&&(b.push(I?c.jsx("b",{children:j},P):j),j=""),I=o,j+=r.charAt(P)}return j&&b.push(I?c.jsx("b",{children:j},"tail"):j),b}function bp(r){return r==="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 N0(r,v){const y=r.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,24)||"term",b=new Set(v.map(I=>I.name.toLowerCase()));if(!b.has(y))return y;let j=2;for(;b.has(`${y}-${j}`);)j+=1;return`${y}-${j}`}wv.createRoot(document.getElementById("root")).render(c.jsx(B0,{}));
|