zerogterm 0.9.1-alpha.1 → 0.9.4-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -7
- package/dist/main/main/agent-hook-server.js +166 -0
- package/dist/main/main/editable.js +31 -0
- package/dist/main/main/host-label-store.js +110 -0
- package/dist/main/main/local-fs.js +57 -6
- package/dist/main/main/main.js +67 -1
- package/dist/main/main/pane-link.js +335 -0
- package/dist/main/main/preload.cjs +17 -0
- package/dist/main/main/remote-file.js +97 -0
- package/dist/main/main/sftp-service.js +12 -0
- package/dist/main/main/workspace-store.js +7 -0
- package/dist/main/shared/editing.js +11 -0
- package/dist/main/shared/files.js +11 -0
- package/dist/renderer/assets/index-B-yoOhye.css +1 -0
- package/dist/renderer/assets/index-CbW026Ci.js +149 -0
- package/dist/renderer/assets/{ort-wasm-simd-threaded.asyncify-DMmc6YqF.wasm → ort-wasm-simd-threaded.asyncify-CxOG5pUO.wasm} +0 -0
- package/dist/renderer/assets/voice-worker-DvImI8sL.js +40 -0
- package/dist/renderer/index.html +2 -2
- package/package.json +26 -2
- package/dist/renderer/assets/index-CknqVqkF.js +0 -142
- package/dist/renderer/assets/index-axEdZFb8.css +0 -1
- package/dist/renderer/assets/voice-worker-DoNT0zEM.js +0 -37
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
(function(){const C=document.createElement("link").relList;if(C&&C.supports&&C.supports("modulepreload"))return;for(const O of document.querySelectorAll('link[rel="modulepreload"]'))M(O);new MutationObserver(O=>{for(const K of O)if(K.type==="childList")for(const P of K.addedNodes)P.tagName==="LINK"&&P.rel==="modulepreload"&&M(P)}).observe(document,{childList:!0,subtree:!0});function E(O){const K={};return O.integrity&&(K.integrity=O.integrity),O.referrerPolicy&&(K.referrerPolicy=O.referrerPolicy),O.crossOrigin==="use-credentials"?K.credentials="include":O.crossOrigin==="anonymous"?K.credentials="omit":K.credentials="same-origin",K}function M(O){if(O.ep)return;O.ep=!0;const K=E(O);fetch(O.href,K)}})();function Ig(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var yu={exports:{}},Fo={};var G_;function Pg(){if(G_)return Fo;G_=1;var r=Symbol.for("react.transitional.element"),C=Symbol.for("react.fragment");function E(M,O,K){var P=null;if(K!==void 0&&(P=""+K),O.key!==void 0&&(P=""+O.key),"key"in O){K={};for(var n in O)n!=="key"&&(K[n]=O[n])}else K=O;return O=K.ref,{$$typeof:r,type:M,key:P,ref:O!==void 0?O:null,props:K}}return Fo.Fragment=C,Fo.jsx=E,Fo.jsxs=E,Fo}var K_;function $g(){return K_||(K_=1,yu.exports=Pg()),yu.exports}var c=$g(),Cu={exports:{}},Fe={};var V_;function Fg(){if(V_)return Fe;V_=1;var r=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),K=Symbol.for("react.consumer"),P=Symbol.for("react.context"),n=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),o=Symbol.for("react.activity"),b=Symbol.iterator;function x(j){return j===null||typeof j!="object"?null:(j=b&&j[b]||j["@@iterator"],typeof j=="function"?j:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,a={};function u(j,F,ie){this.props=j,this.context=F,this.refs=a,this.updater=ie||A}u.prototype.isReactComponent={},u.prototype.setState=function(j,F){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,F,"setState")},u.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function f(){}f.prototype=u.prototype;function h(j,F,ie){this.props=j,this.context=F,this.refs=a,this.updater=ie||A}var S=h.prototype=new f;S.constructor=h,p(S,u.prototype),S.isPureReactComponent=!0;var T=Array.isArray;function w(){}var L={H:null,A:null,T:null,S:null},y=Object.prototype.hasOwnProperty;function R(j,F,ie){var te=ie.ref;return{$$typeof:r,type:j,key:F,ref:te!==void 0?te:null,props:ie}}function k(j,F){return R(j.type,F,j.props)}function U(j){return typeof j=="object"&&j!==null&&j.$$typeof===r}function H(j){var F={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(ie){return F[ie]})}var z=/\/+/g;function Y(j,F){return typeof j=="object"&&j!==null&&j.key!=null?H(""+j.key):F.toString(36)}function re(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(w,w):(j.status="pending",j.then(function(F){j.status==="pending"&&(j.status="fulfilled",j.value=F)},function(F){j.status==="pending"&&(j.status="rejected",j.reason=F)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function V(j,F,ie,te,de){var ge=typeof j;(ge==="undefined"||ge==="boolean")&&(j=null);var J=!1;if(j===null)J=!0;else switch(ge){case"bigint":case"string":case"number":J=!0;break;case"object":switch(j.$$typeof){case r:case C:J=!0;break;case v:return J=j._init,V(J(j._payload),F,ie,te,de)}}if(J)return de=de(j),J=te===""?"."+Y(j,0):te,T(de)?(ie="",J!=null&&(ie=J.replace(z,"$&/")+"/"),V(de,F,ie,"",function(_e){return _e})):de!=null&&(U(de)&&(de=k(de,ie+(de.key==null||j&&j.key===de.key?"":(""+de.key).replace(z,"$&/")+"/")+J)),F.push(de)),1;J=0;var q=te===""?".":te+":";if(T(j))for(var ne=0;ne<j.length;ne++)te=j[ne],ge=q+Y(te,ne),J+=V(te,F,ie,ge,de);else if(ne=x(j),typeof ne=="function")for(j=ne.call(j),ne=0;!(te=j.next()).done;)te=te.value,ge=q+Y(te,ne++),J+=V(te,F,ie,ge,de);else if(ge==="object"){if(typeof j.then=="function")return V(re(j),F,ie,te,de);throw F=String(j),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return J}function X(j,F,ie){if(j==null)return j;var te=[],de=0;return V(j,te,"","",function(ge){return F.call(ie,ge,de++)}),te}function I(j){if(j._status===-1){var F=j._result;F=F(),F.then(function(ie){(j._status===0||j._status===-1)&&(j._status=1,j._result=ie)},function(ie){(j._status===0||j._status===-1)&&(j._status=2,j._result=ie)}),j._status===-1&&(j._status=0,j._result=F)}if(j._status===1)return j._result.default;throw j._result}var N=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},W={map:X,forEach:function(j,F,ie){X(j,function(){F.apply(this,arguments)},ie)},count:function(j){var F=0;return X(j,function(){F++}),F},toArray:function(j){return X(j,function(F){return F})||[]},only:function(j){if(!U(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return Fe.Activity=o,Fe.Children=W,Fe.Component=u,Fe.Fragment=E,Fe.Profiler=O,Fe.PureComponent=h,Fe.StrictMode=M,Fe.Suspense=d,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(j){return L.H.useMemoCache(j)}},Fe.cache=function(j){return function(){return j.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(j,F,ie){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var te=p({},j.props),de=j.key;if(F!=null)for(ge in F.key!==void 0&&(de=""+F.key),F)!y.call(F,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&F.ref===void 0||(te[ge]=F[ge]);var ge=arguments.length-2;if(ge===1)te.children=ie;else if(1<ge){for(var J=Array(ge),q=0;q<ge;q++)J[q]=arguments[q+2];te.children=J}return R(j.type,de,te)},Fe.createContext=function(j){return j={$$typeof:P,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:K,_context:j},j},Fe.createElement=function(j,F,ie){var te,de={},ge=null;if(F!=null)for(te in F.key!==void 0&&(ge=""+F.key),F)y.call(F,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(de[te]=F[te]);var J=arguments.length-2;if(J===1)de.children=ie;else if(1<J){for(var q=Array(J),ne=0;ne<J;ne++)q[ne]=arguments[ne+2];de.children=q}if(j&&j.defaultProps)for(te in J=j.defaultProps,J)de[te]===void 0&&(de[te]=J[te]);return R(j,ge,de)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(j){return{$$typeof:n,render:j}},Fe.isValidElement=U,Fe.lazy=function(j){return{$$typeof:v,_payload:{_status:-1,_result:j},_init:I}},Fe.memo=function(j,F){return{$$typeof:m,type:j,compare:F===void 0?null:F}},Fe.startTransition=function(j){var F=L.T,ie={};L.T=ie;try{var te=j(),de=L.S;de!==null&&de(ie,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(w,N)}catch(ge){N(ge)}finally{F!==null&&ie.types!==null&&(F.types=ie.types),L.T=F}},Fe.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},Fe.use=function(j){return L.H.use(j)},Fe.useActionState=function(j,F,ie){return L.H.useActionState(j,F,ie)},Fe.useCallback=function(j,F){return L.H.useCallback(j,F)},Fe.useContext=function(j){return L.H.useContext(j)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(j,F){return L.H.useDeferredValue(j,F)},Fe.useEffect=function(j,F){return L.H.useEffect(j,F)},Fe.useEffectEvent=function(j){return L.H.useEffectEvent(j)},Fe.useId=function(){return L.H.useId()},Fe.useImperativeHandle=function(j,F,ie){return L.H.useImperativeHandle(j,F,ie)},Fe.useInsertionEffect=function(j,F){return L.H.useInsertionEffect(j,F)},Fe.useLayoutEffect=function(j,F){return L.H.useLayoutEffect(j,F)},Fe.useMemo=function(j,F){return L.H.useMemo(j,F)},Fe.useOptimistic=function(j,F){return L.H.useOptimistic(j,F)},Fe.useReducer=function(j,F,ie){return L.H.useReducer(j,F,ie)},Fe.useRef=function(j){return L.H.useRef(j)},Fe.useState=function(j){return L.H.useState(j)},Fe.useSyncExternalStore=function(j,F,ie){return L.H.useSyncExternalStore(j,F,ie)},Fe.useTransition=function(){return L.H.useTransition()},Fe.version="19.2.8",Fe}var Y_;function qu(){return Y_||(Y_=1,Cu.exports=Fg()),Cu.exports}var Z=qu();const Tn=Ig(Z);var wu={exports:{}},Wo={},xu={exports:{}},Eu={};var X_;function Wg(){return X_||(X_=1,(function(r){function C(V,X){var I=V.length;V.push(X);e:for(;0<I;){var N=I-1>>>1,W=V[N];if(0<O(W,X))V[N]=X,V[I]=W,I=N;else break e}}function E(V){return V.length===0?null:V[0]}function M(V){if(V.length===0)return null;var X=V[0],I=V.pop();if(I!==X){V[0]=I;e:for(var N=0,W=V.length,j=W>>>1;N<j;){var F=2*(N+1)-1,ie=V[F],te=F+1,de=V[te];if(0>O(ie,I))te<W&&0>O(de,ie)?(V[N]=de,V[te]=I,N=te):(V[N]=ie,V[F]=I,N=F);else if(te<W&&0>O(de,I))V[N]=de,V[te]=I,N=te;else break e}}return X}function O(V,X){var I=V.sortIndex-X.sortIndex;return I!==0?I:V.id-X.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var K=performance;r.unstable_now=function(){return K.now()}}else{var P=Date,n=P.now();r.unstable_now=function(){return P.now()-n}}var d=[],m=[],v=1,o=null,b=3,x=!1,A=!1,p=!1,a=!1,u=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;function S(V){for(var X=E(m);X!==null;){if(X.callback===null)M(m);else if(X.startTime<=V)M(m),X.sortIndex=X.expirationTime,C(d,X);else break;X=E(m)}}function T(V){if(p=!1,S(V),!A)if(E(d)!==null)A=!0,w||(w=!0,H());else{var X=E(m);X!==null&&re(T,X.startTime-V)}}var w=!1,L=-1,y=5,R=-1;function k(){return a?!0:!(r.unstable_now()-R<y)}function U(){if(a=!1,w){var V=r.unstable_now();R=V;var X=!0;try{e:{A=!1,p&&(p=!1,f(L),L=-1),x=!0;var I=b;try{t:{for(S(V),o=E(d);o!==null&&!(o.expirationTime>V&&k());){var N=o.callback;if(typeof N=="function"){o.callback=null,b=o.priorityLevel;var W=N(o.expirationTime<=V);if(V=r.unstable_now(),typeof W=="function"){o.callback=W,S(V),X=!0;break t}o===E(d)&&M(d),S(V)}else M(d);o=E(d)}if(o!==null)X=!0;else{var j=E(m);j!==null&&re(T,j.startTime-V),X=!1}}break e}finally{o=null,b=I,x=!1}X=void 0}}finally{X?H():w=!1}}}var H;if(typeof h=="function")H=function(){h(U)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,Y=z.port2;z.port1.onmessage=U,H=function(){Y.postMessage(null)}}else H=function(){u(U,0)};function re(V,X){L=u(function(){V(r.unstable_now())},X)}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(V){V.callback=null},r.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):y=0<V?Math.floor(1e3/V):5},r.unstable_getCurrentPriorityLevel=function(){return b},r.unstable_next=function(V){switch(b){case 1:case 2:case 3:var X=3;break;default:X=b}var I=b;b=X;try{return V()}finally{b=I}},r.unstable_requestPaint=function(){a=!0},r.unstable_runWithPriority=function(V,X){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var I=b;b=V;try{return X()}finally{b=I}},r.unstable_scheduleCallback=function(V,X,I){var N=r.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?N+I:N):I=N,V){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=I+W,V={id:v++,callback:X,priorityLevel:V,startTime:I,expirationTime:W,sortIndex:-1},I>N?(V.sortIndex=I,C(m,V),E(d)===null&&V===E(m)&&(p?(f(L),L=-1):p=!0,re(T,I-N))):(V.sortIndex=W,C(d,V),A||x||(A=!0,w||(w=!0,H()))),V},r.unstable_shouldYield=k,r.unstable_wrapCallback=function(V){var X=b;return function(){var I=b;b=X;try{return V.apply(this,arguments)}finally{b=I}}}})(Eu)),Eu}var Z_;function qg(){return Z_||(Z_=1,xu.exports=Wg()),xu.exports}var Au={exports:{}},ti={};var Q_;function Gg(){if(Q_)return ti;Q_=1;var r=qu();function C(d){var m="https://react.dev/errors/"+d;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)m+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+d+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function E(){}var M={d:{f:E,r:function(){throw Error(C(522))},D:E,C:E,L:E,m:E,X:E,S:E,M:E},p:0,findDOMNode:null},O=Symbol.for("react.portal");function K(d,m,v){var o=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:O,key:o==null?null:""+o,children:d,containerInfo:m,implementation:v}}var P=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function n(d,m){if(d==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return ti.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,ti.createPortal=function(d,m){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(C(299));return K(d,m,null,v)},ti.flushSync=function(d){var m=P.T,v=M.p;try{if(P.T=null,M.p=2,d)return d()}finally{P.T=m,M.p=v,M.d.f()}},ti.preconnect=function(d,m){typeof d=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,M.d.C(d,m))},ti.prefetchDNS=function(d){typeof d=="string"&&M.d.D(d)},ti.preinit=function(d,m){if(typeof d=="string"&&m&&typeof m.as=="string"){var v=m.as,o=n(v,m.crossOrigin),b=typeof m.integrity=="string"?m.integrity:void 0,x=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;v==="style"?M.d.S(d,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:o,integrity:b,fetchPriority:x}):v==="script"&&M.d.X(d,{crossOrigin:o,integrity:b,fetchPriority:x,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},ti.preinitModule=function(d,m){if(typeof d=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var v=n(m.as,m.crossOrigin);M.d.M(d,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&M.d.M(d)},ti.preload=function(d,m){if(typeof d=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var v=m.as,o=n(v,m.crossOrigin);M.d.L(d,v,{crossOrigin:o,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},ti.preloadModule=function(d,m){if(typeof d=="string")if(m){var v=n(m.as,m.crossOrigin);M.d.m(d,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else M.d.m(d)},ti.requestFormReset=function(d){M.d.r(d)},ti.unstable_batchedUpdates=function(d,m){return d(m)},ti.useFormState=function(d,m,v){return P.H.useFormState(d,m,v)},ti.useFormStatus=function(){return P.H.useHostTransitionStatus()},ti.version="19.2.8",ti}var J_;function qp(){if(J_)return Au.exports;J_=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(C){console.error(C)}}return r(),Au.exports=Gg(),Au.exports}var ep;function Kg(){if(ep)return Wo;ep=1;var r=qg(),C=qu(),E=qp();function M(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function O(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function K(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 n(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(K(e)!==e)throw Error(M(188))}function m(e){var t=e.alternate;if(!t){if(t=K(e),t===null)throw Error(M(188));return t!==e?null:e}for(var i=e,s=t;;){var l=i.return;if(l===null)break;var _=l.alternate;if(_===null){if(s=l.return,s!==null){i=s;continue}break}if(l.child===_.child){for(_=l.child;_;){if(_===i)return d(l),e;if(_===s)return d(l),t;_=_.sibling}throw Error(M(188))}if(i.return!==s.return)i=l,s=_;else{for(var D=!1,$=l.child;$;){if($===i){D=!0,i=l,s=_;break}if($===s){D=!0,s=l,i=_;break}$=$.sibling}if(!D){for($=_.child;$;){if($===i){D=!0,i=_,s=l;break}if($===s){D=!0,s=_,i=l;break}$=$.sibling}if(!D)throw Error(M(189))}}if(i.alternate!==s)throw Error(M(190))}if(i.tag!==3)throw Error(M(188));return i.stateNode.current===i?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var o=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),h=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),k=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function H(e){return e===null||typeof e!="object"?null:(e=U&&e[U]||e["@@iterator"],typeof e=="function"?e:null)}var z=Symbol.for("react.client.reference");function Y(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===z?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case p:return"Fragment";case u:return"Profiler";case a:return"StrictMode";case T:return"Suspense";case w:return"SuspenseList";case R:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case A:return"Portal";case h:return e.displayName||"Context";case f: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 L:return t=e.displayName||null,t!==null?t:Y(e.type)||"Memo";case y:t=e._payload,e=e._init;try{return Y(e(t))}catch{}}return null}var re=Array.isArray,V=C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=E.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},N=[],W=-1;function j(e){return{current:e}}function F(e){0>W||(e.current=N[W],N[W]=null,W--)}function ie(e,t){W++,N[W]=e.current,e.current=t}var te=j(null),de=j(null),ge=j(null),J=j(null);function q(e,t){switch(ie(ge,t),ie(de,e),ie(te,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?p_(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=p_(t),e=m_(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}F(te),ie(te,e)}function ne(){F(te),F(de),F(ge)}function _e(e){e.memoizedState!==null&&ie(J,e);var t=te.current,i=m_(t,e.type);t!==i&&(ie(de,e),ie(te,i))}function we(e){de.current===e&&(F(te),F(de)),J.current===e&&(F(J),Uo._currentValue=I)}var xe,Ne;function Ae(e){if(xe===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);xe=t&&t[1]||"",Ne=-1<i.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+xe+e+Ne}var We=!1;function et(e,t){if(!e||We)return"";We=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(fe){var ce=fe}Reflect.construct(e,[],be)}else{try{be.call()}catch(fe){ce=fe}e.call(be.prototype)}}else{try{throw Error()}catch(fe){ce=fe}(be=e())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(fe){if(fe&&ce&&typeof fe.stack=="string")return[fe.stack,ce.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=s.DetermineComponentFrameRoot(),D=_[0],$=_[1];if(D&&$){var ee=D.split(`
|
|
4
|
+
`),le=$.split(`
|
|
5
|
+
`);for(l=s=0;s<ee.length&&!ee[s].includes("DetermineComponentFrameRoot");)s++;for(;l<le.length&&!le[l].includes("DetermineComponentFrameRoot");)l++;if(s===ee.length||l===le.length)for(s=ee.length-1,l=le.length-1;1<=s&&0<=l&&ee[s]!==le[l];)l--;for(;1<=s&&0<=l;s--,l--)if(ee[s]!==le[l]){if(s!==1||l!==1)do if(s--,l--,0>l||ee[s]!==le[l]){var pe=`
|
|
6
|
+
`+ee[s].replace(" at new "," at ");return e.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",e.displayName)),pe}while(1<=s&&0<=l);break}}}finally{We=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?Ae(i):""}function Te(e,t){switch(e.tag){case 26:case 27:case 5:return Ae(e.type);case 16:return Ae("Lazy");case 13:return e.child!==t&&t!==null?Ae("Suspense Fallback"):Ae("Suspense");case 19:return Ae("SuspenseList");case 0:case 15:return et(e.type,!1);case 11:return et(e.type.render,!1);case 1:return et(e.type,!0);case 31:return Ae("Activity");default:return""}}function Lt(e){try{var t="",i=null;do t+=Te(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
|
|
7
|
+
Error generating stack: `+s.message+`
|
|
8
|
+
`+s.stack}}var qt=Object.prototype.hasOwnProperty,$e=r.unstable_scheduleCallback,Pe=r.unstable_cancelCallback,he=r.unstable_shouldYield,ue=r.unstable_requestPaint,Se=r.unstable_now,De=r.unstable_getCurrentPriorityLevel,je=r.unstable_ImmediatePriority,at=r.unstable_UserBlockingPriority,ut=r.unstable_NormalPriority,Tt=r.unstable_LowPriority,Oe=r.unstable_IdlePriority,Ue=r.log,ze=r.unstable_setDisableYieldValue,wt=null,bt=null;function Pt(e){if(typeof Ue=="function"&&ze(e),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(wt,e)}catch{}}var mt=Math.clz32?Math.clz32:Yr,dt=Math.log,Mt=Math.LN2;function Yr(e){return e>>>=0,e===0?32:31-(dt(e)/Mt|0)|0}var $t=256,Fi=262144,xi=4194304;function Zi(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 ds(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var l=0,_=e.suspendedLanes,D=e.pingedLanes;e=e.warmLanes;var $=s&134217727;return $!==0?(s=$&~_,s!==0?l=Zi(s):(D&=$,D!==0?l=Zi(D):i||(i=$&~e,i!==0&&(l=Zi(i))))):($=s&~_,$!==0?l=Zi($):D!==0?l=Zi(D):i||(i=s&~e,i!==0&&(l=Zi(i)))),l===0?0:t!==0&&t!==l&&(t&_)===0&&(_=l&-l,i=t&-t,_>=i||_===32&&(i&4194048)!==0)?t:l}function nr(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Yo(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 Rs(){var e=xi;return xi<<=1,(xi&62914560)===0&&(xi=4194304),e}function Dn(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function ar(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Nc(e,t,i,s,l,_){var D=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var $=e.entanglements,ee=e.expirationTimes,le=e.hiddenUpdates;for(i=D&~i;0<i;){var pe=31-mt(i),be=1<<pe;$[pe]=0,ee[pe]=-1;var ce=le[pe];if(ce!==null)for(le[pe]=null,pe=0;pe<ce.length;pe++){var fe=ce[pe];fe!==null&&(fe.lane&=-536870913)}i&=~be}s!==0&&ka(e,s,0),_!==0&&l===0&&e.tag!==0&&(e.suspendedLanes|=_&~(D&~t))}function ka(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-mt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function Oa(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-mt(i),l=1<<s;l&t|e[s]&t&&(e[s]|=t),i&=~l}}function kn(e,t){var i=t&-t;return i=(i&42)!==0?1:Xr(i),(i&(e.suspendedLanes|t))!==0?0:i}function Xr(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 or(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ba(){var e=X.p;return e!==0?e:(e=window.event,e===void 0?32:U_(e.type))}function On(e,t){var i=X.p;try{return X.p=e,t()}finally{X.p=i}}var Wi=Math.random().toString(36).slice(2),Nt="__reactFiber$"+Wi,Ke="__reactProps$"+Wi,Dt="__reactContainer$"+Wi,ja="__reactEvents$"+Wi,lr="__reactListeners$"+Wi,Hc="__reactHandles$"+Wi,Na="__reactResources$"+Wi,Zr="__reactMarker$"+Wi;function Bn(e){delete e[Nt],delete e[Ke],delete e[ja],delete e[lr],delete e[Hc]}function Vt(e){var t=e[Nt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Dt]||i[Nt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=w_(e);e!==null;){if(i=e[Nt])return i;e=w_(e)}return t}e=i,i=e.parentNode}return null}function Ei(e){if(e=e[Nt]||e[Dt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ci(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(M(33))}function Ls(e){var t=e[Na];return t||(t=e[Na]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function St(e){e[Zr]=!0}var jn=new Set,fs={};function Ai(e,t){Ri(e,t),Ri(e+"Capture",t)}function Ri(e,t){for(fs[e]=t,e=0;e<t.length;e++)jn.add(t[e])}var _s=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]*$"),Ts={},cr={};function Nn(e){return qt.call(cr,e)?!0:qt.call(Ts,e)?!1:_s.test(e)?cr[e]=!0:(Ts[e]=!0,!1)}function Li(e,t,i){if(Nn(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 Ms(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 hi(e,t,i,s){if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+s)}}function ui(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ps(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Hn(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 l=s.get,_=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(D){i=""+D,_.call(this,D)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(D){i=""+D},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function hr(e){if(!e._valueTracker){var t=ps(e)?"checked":"value";e._valueTracker=Hn(e,t,""+e[t])}}function Ha(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=ps(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}function Qi(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 Xo=/[\n"\\]/g;function si(e){return e.replace(Xo,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Qr(e,t,i,s,l,_,D,$){e.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?e.type=D:e.removeAttribute("type"),t!=null?D==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ui(t)):e.value!==""+ui(t)&&(e.value=""+ui(t)):D!=="submit"&&D!=="reset"||e.removeAttribute("value"),t!=null?Jr(e,D,ui(t)):i!=null?Jr(e,D,ui(i)):s!=null&&e.removeAttribute("value"),l==null&&_!=null&&(e.defaultChecked=!!_),l!=null&&(e.checked=l&&typeof l!="function"&&typeof l!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?e.name=""+ui($):e.removeAttribute("name")}function Zo(e,t,i,s,l,_,D,$){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.type=_),t!=null||i!=null){if(!(_!=="submit"&&_!=="reset"||t!=null)){hr(e);return}i=i!=null?""+ui(i):"",t=t!=null?""+ui(t):i,$||t===e.value||(e.value=t),e.defaultValue=t}s=s??l,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=$?e.checked:!!s,e.defaultChecked=!!s,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(e.name=D),hr(e)}function Jr(e,t,i){t==="number"&&Qi(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Ds(e,t,i,s){if(e=e.options,t){t={};for(var l=0;l<i.length;l++)t["$"+i[l]]=!0;for(i=0;i<e.length;i++)l=t.hasOwnProperty("$"+e[i].value),e[i].selected!==l&&(e[i].selected=l),l&&s&&(e[i].defaultSelected=!0)}else{for(i=""+ui(i),t=null,l=0;l<e.length;l++){if(e[l].value===i){e[l].selected=!0,s&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function en(e,t,i){if(t!=null&&(t=""+ui(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+ui(i):""}function Ti(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(M(92));if(re(s)){if(1<s.length)throw Error(M(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=ui(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),hr(e)}function ks(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var Qo=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 zn(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||Qo.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function zc(e,t,i){if(t!=null&&typeof t!="object")throw Error(M(62));if(e=e.style,i!=null){for(var s in i)!i.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var l in t)s=t[l],t.hasOwnProperty(l)&&i[l]!==s&&zn(e,l,s)}else for(var _ in t)t.hasOwnProperty(_)&&zn(e,_,t[_])}function Un(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 za=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"]]),Uc=/^[\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 Os(e){return Uc.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ji(){}var ur=null;function Ua(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var dr=null,es=null;function In(e){var t=Ei(e);if(t&&(e=t.stateNode)){var i=e[Ke]||null;e:switch(e=t.stateNode,t.type){case"input":if(Qr(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="'+si(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var l=s[Ke]||null;if(!l)throw Error(M(90));Qr(s,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&Ha(s)}break e;case"textarea":en(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Ds(e,!!i.multiple,t,!1)}}}var Ia=!1;function fr(e,t,i){if(Ia)return e(t,i);Ia=!0;try{var s=e(t);return s}finally{if(Ia=!1,(dr!==null||es!==null)&&(Jl(),dr&&(t=dr,e=es,es=dr=null,In(t),e)))for(t=0;t<e.length;t++)In(e[t])}}function _r(e,t){var i=e.stateNode;if(i===null)return null;var s=i[Ke]||null;if(s===null)return null;i=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(M(231,t,typeof i));return i}var Mi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Pn=!1;if(Mi)try{var pr={};Object.defineProperty(pr,"passive",{get:function(){Pn=!0}}),window.addEventListener("test",pr,pr),window.removeEventListener("test",pr,pr)}catch{Pn=!1}var ts=null,mr=null,$n=null;function Pa(){if($n)return $n;var e,t=mr,i=t.length,s,l="value"in ts?ts.value:ts.textContent,_=l.length;for(e=0;e<i&&t[e]===l[e];e++);var D=i-e;for(s=1;s<=D&&t[i-s]===l[_-s];s++);return $n=l.slice(e,1<s?1-s:void 0)}function tn(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 sn(){return!0}function $a(){return!1}function st(e){function t(i,s,l,_,D){this._reactName=i,this._targetInst=l,this.type=s,this.nativeEvent=_,this.target=D,this.currentTarget=null;for(var $ in e)e.hasOwnProperty($)&&(i=e[$],this[$]=i?i(_):_[$]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?sn:$a,this.isPropagationStopped=$a,this}return o(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=sn)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=sn)},persist:function(){},isPersistent:sn}),t}var Bs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fn=st(Bs),rn=o({},Bs,{view:0,detail:0}),Ic=st(rn),Fa,Wa,nn,Wn=o({},rn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gn,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!==nn&&(nn&&e.type==="mousemove"?(Fa=e.screenX-nn.screenX,Wa=e.screenY-nn.screenY):Wa=Fa=0,nn=e),Fa)},movementY:function(e){return"movementY"in e?e.movementY:Wa}}),Di=st(Wn),Jo=o({},Wn,{dataTransfer:0}),Pc=st(Jo),lt=o({},rn,{relatedTarget:0}),di=st(lt),At=o({},Bs,{animationName:0,elapsedTime:0,pseudoElement:0}),fi=st(At),el=o({},Bs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),rt=st(el),Qt=o({},Bs,{data:0}),ms=st(Qt),qn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gr={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"},js={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function yt(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=js[e])?!!t[e]:!1}function Gn(){return yt}var vr=o({},rn,{key:function(e){if(e.key){var t=qn[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=tn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?gr[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gn,charCode:function(e){return e.type==="keypress"?tn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?tn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),tl=st(vr),il=o({},Wn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Kn=st(il),$c=o({},rn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gn}),Vn=st($c),sl=o({},Bs,{propertyName:0,elapsedTime:0,pseudoElement:0}),qa=st(sl),rl=o({},Wn,{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}),Ga=st(rl),is=o({},Bs,{newState:0,oldState:0}),Fc=st(is),Gt=[9,13,27,32],Ka=Mi&&"CompositionEvent"in window,an=null;Mi&&"documentMode"in document&&(an=document.documentMode);var Wc=Mi&&"TextEvent"in window&&!an,nl=Mi&&(!Ka||an&&8<an&&11>=an),al=" ",ol=!1;function Va(e,t){switch(e){case"keyup":return Gt.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ll(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var br=!1;function qc(e,t){switch(e){case"compositionend":return ll(t);case"keypress":return t.which!==32?null:(ol=!0,al);case"textInput":return e=t.data,e===al&&ol?null:e;default:return null}}function Ya(e,t){if(br)return e==="compositionend"||!Ka&&Va(e,t)?(e=Pa(),$n=mr=ts=null,br=!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 nl&&t.locale!=="ko"?null:t.data;default:return null}}var gs={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 Xa(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!gs[e.type]:t==="textarea"}function Za(e,t,i,s){dr?es?es.push(s):es=[s]:dr=s,t=ac(t,"onChange"),0<t.length&&(i=new Fn("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var ri=null,ki=null;function Gc(e){c_(e,0)}function Yn(e){var t=ci(e);if(Ha(t))return e}function Xn(e,t){if(e==="change")return t}var cl=!1;if(Mi){var Qa;if(Mi){var Zn="oninput"in document;if(!Zn){var hl=document.createElement("div");hl.setAttribute("oninput","return;"),Zn=typeof hl.oninput=="function"}Qa=Zn}else Qa=!1;cl=Qa&&(!document.documentMode||9<document.documentMode)}function ul(){ri&&(ri.detachEvent("onpropertychange",dl),ki=ri=null)}function dl(e){if(e.propertyName==="value"&&Yn(ki)){var t=[];Za(t,ki,e,Ua(e)),fr(Gc,t)}}function Ja(e,t,i){e==="focusin"?(ul(),ri=t,ki=i,ri.attachEvent("onpropertychange",dl)):e==="focusout"&&ul()}function Kc(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Yn(ki)}function Vc(e,t){if(e==="click")return Yn(t)}function Yc(e,t){if(e==="input"||e==="change")return Yn(t)}function Qn(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Jt=typeof Object.is=="function"?Object.is:Qn;function on(e,t){if(Jt(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 l=i[s];if(!qt.call(t,l)||!Jt(e[l],t[l]))return!1}return!0}function eo(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fl(e,t){var i=eo(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=eo(i)}}function _l(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_l(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function pl(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Qi(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=Qi(e.document)}return t}function to(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 ml=Mi&&"documentMode"in document&&11>=document.documentMode,vs=null,Jn=null,ln=null,io=!1;function so(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;io||vs==null||vs!==Qi(s)||(s=vs,"selectionStart"in s&&to(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&&on(ln,s)||(ln=s,s=ac(Jn,"onSelect"),0<s.length&&(t=new Fn("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=vs)))}function ss(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Sr={animationend:ss("Animation","AnimationEnd"),animationiteration:ss("Animation","AnimationIteration"),animationstart:ss("Animation","AnimationStart"),transitionrun:ss("Transition","TransitionRun"),transitionstart:ss("Transition","TransitionStart"),transitioncancel:ss("Transition","TransitionCancel"),transitionend:ss("Transition","TransitionEnd")},ea={},ro={};Mi&&(ro=document.createElement("div").style,"AnimationEvent"in window||(delete Sr.animationend.animation,delete Sr.animationiteration.animation,delete Sr.animationstart.animation),"TransitionEvent"in window||delete Sr.transitionend.transition);function bs(e){if(ea[e])return ea[e];if(!Sr[e])return e;var t=Sr[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in ro)return ea[e]=t[i];return e}var gl=bs("animationend"),vl=bs("animationiteration"),bl=bs("animationstart"),no=bs("transitionrun"),Ns=bs("transitionstart"),Xc=bs("transitioncancel"),ta=bs("transitionend"),ia=new Map,sa="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(" ");sa.push("scrollEnd");function Oi(e,t){ia.set(e,t),Ai(t,[e])}var cn=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)},Yt=[],yr=0,ao=0;function ra(){for(var e=yr,t=ao=yr=0;t<e;){var i=Yt[t];Yt[t++]=null;var s=Yt[t];Yt[t++]=null;var l=Yt[t];Yt[t++]=null;var _=Yt[t];if(Yt[t++]=null,s!==null&&l!==null){var D=s.pending;D===null?l.next=l:(l.next=D.next,D.next=l),s.pending=l}_!==0&&Sl(i,l,_)}}function na(e,t,i,s){Yt[yr++]=e,Yt[yr++]=t,Yt[yr++]=i,Yt[yr++]=s,ao|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function hn(e,t,i,s){return na(e,t,i,s),aa(e)}function Hs(e,t){return na(e,null,null,t),aa(e)}function Sl(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var l=!1,_=e.return;_!==null;)_.childLanes|=i,s=_.alternate,s!==null&&(s.childLanes|=i),_.tag===22&&(e=_.stateNode,e===null||e._visibility&1||(l=!0)),e=_,_=_.return;return e.tag===3?(_=e.stateNode,l&&t!==null&&(l=31-mt(i),e=_.hiddenUpdates,s=e[l],s===null?e[l]=[t]:s.push(t),t.lane=i|536870912),_):null}function aa(e){if(50<ko)throw ko=0,qh=null,Error(M(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ss={};function yl(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 ei(e,t,i,s){return new yl(e,t,i,s)}function oo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function qi(e,t){var i=e.alternate;return i===null?(i=ei(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 zs(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 Us(e,t,i,s,l,_){var D=0;if(s=e,typeof e=="function")oo(e)&&(D=1);else if(typeof e=="string")D=Lg(e,i,te.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case R:return e=ei(31,i,t,l),e.elementType=R,e.lanes=_,e;case p:return Is(i.children,l,_,t);case a:D=8,l|=24;break;case u:return e=ei(12,i,t,l|2),e.elementType=u,e.lanes=_,e;case T:return e=ei(13,i,t,l),e.elementType=T,e.lanes=_,e;case w:return e=ei(19,i,t,l),e.elementType=w,e.lanes=_,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case h:D=10;break e;case f:D=9;break e;case S:D=11;break e;case L:D=14;break e;case y:D=16,s=null;break e}D=29,i=Error(M(130,e===null?"null":typeof e,"")),s=null}return t=ei(D,i,t,l),t.elementType=e,t.type=s,t.lanes=_,t}function Is(e,t,i,s){return e=ei(7,e,s,t),e.lanes=i,e}function lo(e,t,i){return e=ei(6,e,null,t),e.lanes=i,e}function Cl(e){var t=ei(18,null,null,0);return t.stateNode=e,t}function oa(e,t,i){return t=ei(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var co=new WeakMap;function Ht(e,t){if(typeof e=="object"&&e!==null){var i=co.get(e);return i!==void 0?i:(t={value:e,source:t,stack:Lt(t)},co.set(e,t),t)}return{value:e,source:t,stack:Lt(t)}}var _i=[],Ps=0,la=null,Cr=0,ni=[],ai=0,Bi=null,ji=1,Gi="";function rs(e,t){_i[Ps++]=Cr,_i[Ps++]=la,la=e,Cr=t}function ho(e,t,i){ni[ai++]=ji,ni[ai++]=Gi,ni[ai++]=Bi,Bi=e;var s=ji;e=Gi;var l=32-mt(s)-1;s&=~(1<<l),i+=1;var _=32-mt(t)+l;if(30<_){var D=l-l%5;_=(s&(1<<D)-1).toString(32),s>>=D,l-=D,ji=1<<32-mt(t)+l|i<<l|s,Gi=_+e}else ji=1<<_|i<<l|s,Gi=e}function ca(e){e.return!==null&&(rs(e,1),ho(e,1,0))}function ha(e){for(;e===la;)la=_i[--Ps],_i[Ps]=null,Cr=_i[--Ps],_i[Ps]=null;for(;e===Bi;)Bi=ni[--ai],ni[ai]=null,Gi=ni[--ai],ni[ai]=null,ji=ni[--ai],ni[ai]=null}function wl(e,t){ni[ai++]=ji,ni[ai++]=Gi,ni[ai++]=Bi,ji=t.id,Gi=t.overflow,Bi=e}var Ft=null,gt=null,Ve=!1,ys=null,pi=!1,$s=Error(M(519));function ns(e){var t=Error(M(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw xr(Ht(t,e)),$s}function xl(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[Nt]=e,t[Ke]=s,i){case"dialog":Xe("cancel",t),Xe("close",t);break;case"iframe":case"object":case"embed":Xe("load",t);break;case"video":case"audio":for(i=0;i<Bo.length;i++)Xe(Bo[i],t);break;case"source":Xe("error",t);break;case"img":case"image":case"link":Xe("error",t),Xe("load",t);break;case"details":Xe("toggle",t);break;case"input":Xe("invalid",t),Zo(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Xe("invalid",t);break;case"textarea":Xe("invalid",t),Ti(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||f_(t.textContent,i)?(s.popover!=null&&(Xe("beforetoggle",t),Xe("toggle",t)),s.onScroll!=null&&Xe("scroll",t),s.onScrollEnd!=null&&Xe("scrollend",t),s.onClick!=null&&(t.onclick=Ji),t=!0):t=!1,t||ns(e,!0)}function El(e){for(Ft=e.return;Ft;)switch(Ft.tag){case 5:case 31:case 13:pi=!1;return;case 27:case 3:pi=!0;return;default:Ft=Ft.return}}function wr(e){if(e!==Ft)return!1;if(!Ve)return El(e),Ve=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||au(e.type,e.memoizedProps)),i=!i),i&>&&ns(e),El(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(M(317));gt=C_(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(M(317));gt=C_(e)}else t===27?(t=gt,zr(e.type)?(e=uu,uu=null,gt=e):gt=t):gt=Ft?Yi(e.stateNode.nextSibling):null;return!0}function Fs(){gt=Ft=null,Ve=!1}function un(){var e=ys;return e!==null&&(yi===null?yi=e:yi.push.apply(yi,e),ys=null),e}function xr(e){ys===null?ys=[e]:ys.push(e)}var uo=j(null),Ws=null,as=null;function Cs(e,t,i){ie(uo,t._currentValue),t._currentValue=i}function os(e){e._currentValue=uo.current,F(uo)}function fo(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 _o(e,t,i,s){var l=e.child;for(l!==null&&(l.return=e);l!==null;){var _=l.dependencies;if(_!==null){var D=l.child;_=_.firstContext;e:for(;_!==null;){var $=_;_=l;for(var ee=0;ee<t.length;ee++)if($.context===t[ee]){_.lanes|=i,$=_.alternate,$!==null&&($.lanes|=i),fo(_.return,i,e),s||(D=null);break e}_=$.next}}else if(l.tag===18){if(D=l.return,D===null)throw Error(M(341));D.lanes|=i,_=D.alternate,_!==null&&(_.lanes|=i),fo(D,i,e),D=null}else D=l.child;if(D!==null)D.return=l;else for(D=l;D!==null;){if(D===e){D=null;break}if(l=D.sibling,l!==null){l.return=D.return,D=l;break}D=D.return}l=D}}function qs(e,t,i,s){e=null;for(var l=t,_=!1;l!==null;){if(!_){if((l.flags&524288)!==0)_=!0;else if((l.flags&262144)!==0)break}if(l.tag===10){var D=l.alternate;if(D===null)throw Error(M(387));if(D=D.memoizedProps,D!==null){var $=l.type;Jt(l.pendingProps.value,D.value)||(e!==null?e.push($):e=[$])}}else if(l===J.current){if(D=l.alternate,D===null)throw Error(M(387));D.memoizedState.memoizedState!==l.memoizedState.memoizedState&&(e!==null?e.push(Uo):e=[Uo])}l=l.return}e!==null&&_o(t,e,i,s),t.flags|=262144}function ua(e){for(e=e.firstContext;e!==null;){if(!Jt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Gs(e){Ws=e,as=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function g(e){return G(Ws,e)}function B(e,t){return Ws===null&&Gs(e),G(e,t)}function G(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},as===null){if(e===null)throw Error(M(308));as=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else as=as.next=t;return i}var Q=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()})}},me=r.unstable_scheduleCallback,ye=r.unstable_NormalPriority,Ce={$$typeof:h,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Re(){return{controller:new Q,data:new Map,refCount:0}}function Ze(e){e.refCount--,e.refCount===0&&me(ye,function(){e.controller.abort()})}var ot=null,mi=0,Rt=0,Ki=null;function oi(e,t){if(ot===null){var i=ot=[];mi=0,Rt=Zh(),Ki={status:"pending",value:void 0,then:function(s){i.push(s)}}}return mi++,t.then(dn,dn),t}function dn(){if(--mi===0&&ot!==null){Ki!==null&&(Ki.status="fulfilled");var e=ot;ot=null,Rt=0,Ki=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function fn(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(l){i.push(l)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var l=0;l<i.length;l++)(0,i[l])(t)},function(l){for(s.status="rejected",s.reason=l,l=0;l<i.length;l++)(0,i[l])(void 0)}),s}var _n=V.S;V.S=function(e,t){Hf=Se(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&oi(e,t),_n!==null&&_n(e,t)};var Ks=j(null);function Al(){var e=Ks.current;return e!==null?e:vt.pooledCache}function gi(e,t){t===null?ie(Ks,Ks.current):ie(Ks,t.pool)}function Rl(){var e=Al();return e===null?null:{parent:Ce._currentValue,pool:e}}var ws=Error(M(460)),Er=Error(M(474)),Ll=Error(M(542)),Tl={then:function(){}};function td(e){return e=e.status,e==="fulfilled"||e==="rejected"}function id(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Ji,Ji),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,rd(e),e;default:if(typeof t.status=="string")t.then(Ji,Ji);else{if(e=vt,e!==null&&100<e.shellSuspendCounter)throw Error(M(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var l=t;l.status="fulfilled",l.value=s}},function(s){if(t.status==="pending"){var l=t;l.status="rejected",l.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,rd(e),e}throw mn=t,ws}}function pn(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(mn=i,ws):i}}var mn=null;function sd(){if(mn===null)throw Error(M(459));var e=mn;return mn=null,e}function rd(e){if(e===ws||e===Ll)throw Error(M(483))}var da=null,po=0;function Ml(e){var t=po;return po+=1,da===null&&(da=[]),id(da,e,t)}function mo(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Dl(e,t){throw t.$$typeof===b?Error(M(525)):(e=Object.prototype.toString.call(t),Error(M(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function nd(e){function t(ae,se){if(e){var oe=ae.deletions;oe===null?(ae.deletions=[se],ae.flags|=16):oe.push(se)}}function i(ae,se){if(!e)return null;for(;se!==null;)t(ae,se),se=se.sibling;return null}function s(ae){for(var se=new Map;ae!==null;)ae.key!==null?se.set(ae.key,ae):se.set(ae.index,ae),ae=ae.sibling;return se}function l(ae,se){return ae=qi(ae,se),ae.index=0,ae.sibling=null,ae}function _(ae,se,oe){return ae.index=oe,e?(oe=ae.alternate,oe!==null?(oe=oe.index,oe<se?(ae.flags|=67108866,se):oe):(ae.flags|=67108866,se)):(ae.flags|=1048576,se)}function D(ae){return e&&ae.alternate===null&&(ae.flags|=67108866),ae}function $(ae,se,oe,ve){return se===null||se.tag!==6?(se=lo(oe,ae.mode,ve),se.return=ae,se):(se=l(se,oe),se.return=ae,se)}function ee(ae,se,oe,ve){var Be=oe.type;return Be===p?pe(ae,se,oe.props.children,ve,oe.key):se!==null&&(se.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===y&&pn(Be)===se.type)?(se=l(se,oe.props),mo(se,oe),se.return=ae,se):(se=Us(oe.type,oe.key,oe.props,null,ae.mode,ve),mo(se,oe),se.return=ae,se)}function le(ae,se,oe,ve){return se===null||se.tag!==4||se.stateNode.containerInfo!==oe.containerInfo||se.stateNode.implementation!==oe.implementation?(se=oa(oe,ae.mode,ve),se.return=ae,se):(se=l(se,oe.children||[]),se.return=ae,se)}function pe(ae,se,oe,ve,Be){return se===null||se.tag!==7?(se=Is(oe,ae.mode,ve,Be),se.return=ae,se):(se=l(se,oe),se.return=ae,se)}function be(ae,se,oe){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return se=lo(""+se,ae.mode,oe),se.return=ae,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case x:return oe=Us(se.type,se.key,se.props,null,ae.mode,oe),mo(oe,se),oe.return=ae,oe;case A:return se=oa(se,ae.mode,oe),se.return=ae,se;case y:return se=pn(se),be(ae,se,oe)}if(re(se)||H(se))return se=Is(se,ae.mode,oe,null),se.return=ae,se;if(typeof se.then=="function")return be(ae,Ml(se),oe);if(se.$$typeof===h)return be(ae,B(ae,se),oe);Dl(ae,se)}return null}function ce(ae,se,oe,ve){var Be=se!==null?se.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Be!==null?null:$(ae,se,""+oe,ve);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case x:return oe.key===Be?ee(ae,se,oe,ve):null;case A:return oe.key===Be?le(ae,se,oe,ve):null;case y:return oe=pn(oe),ce(ae,se,oe,ve)}if(re(oe)||H(oe))return Be!==null?null:pe(ae,se,oe,ve,null);if(typeof oe.then=="function")return ce(ae,se,Ml(oe),ve);if(oe.$$typeof===h)return ce(ae,se,B(ae,oe),ve);Dl(ae,oe)}return null}function fe(ae,se,oe,ve,Be){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return ae=ae.get(oe)||null,$(se,ae,""+ve,Be);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case x:return ae=ae.get(ve.key===null?oe:ve.key)||null,ee(se,ae,ve,Be);case A:return ae=ae.get(ve.key===null?oe:ve.key)||null,le(se,ae,ve,Be);case y:return ve=pn(ve),fe(ae,se,oe,ve,Be)}if(re(ve)||H(ve))return ae=ae.get(oe)||null,pe(se,ae,ve,Be,null);if(typeof ve.then=="function")return fe(ae,se,oe,Ml(ve),Be);if(ve.$$typeof===h)return fe(ae,se,oe,B(se,ve),Be);Dl(se,ve)}return null}function Le(ae,se,oe,ve){for(var Be=null,tt=null,Me=se,Ge=se=0,Je=null;Me!==null&&Ge<oe.length;Ge++){Me.index>Ge?(Je=Me,Me=null):Je=Me.sibling;var it=ce(ae,Me,oe[Ge],ve);if(it===null){Me===null&&(Me=Je);break}e&&Me&&it.alternate===null&&t(ae,Me),se=_(it,se,Ge),tt===null?Be=it:tt.sibling=it,tt=it,Me=Je}if(Ge===oe.length)return i(ae,Me),Ve&&rs(ae,Ge),Be;if(Me===null){for(;Ge<oe.length;Ge++)Me=be(ae,oe[Ge],ve),Me!==null&&(se=_(Me,se,Ge),tt===null?Be=Me:tt.sibling=Me,tt=Me);return Ve&&rs(ae,Ge),Be}for(Me=s(Me);Ge<oe.length;Ge++)Je=fe(Me,ae,Ge,oe[Ge],ve),Je!==null&&(e&&Je.alternate!==null&&Me.delete(Je.key===null?Ge:Je.key),se=_(Je,se,Ge),tt===null?Be=Je:tt.sibling=Je,tt=Je);return e&&Me.forEach(function(Fr){return t(ae,Fr)}),Ve&&rs(ae,Ge),Be}function He(ae,se,oe,ve){if(oe==null)throw Error(M(151));for(var Be=null,tt=null,Me=se,Ge=se=0,Je=null,it=oe.next();Me!==null&&!it.done;Ge++,it=oe.next()){Me.index>Ge?(Je=Me,Me=null):Je=Me.sibling;var Fr=ce(ae,Me,it.value,ve);if(Fr===null){Me===null&&(Me=Je);break}e&&Me&&Fr.alternate===null&&t(ae,Me),se=_(Fr,se,Ge),tt===null?Be=Fr:tt.sibling=Fr,tt=Fr,Me=Je}if(it.done)return i(ae,Me),Ve&&rs(ae,Ge),Be;if(Me===null){for(;!it.done;Ge++,it=oe.next())it=be(ae,it.value,ve),it!==null&&(se=_(it,se,Ge),tt===null?Be=it:tt.sibling=it,tt=it);return Ve&&rs(ae,Ge),Be}for(Me=s(Me);!it.done;Ge++,it=oe.next())it=fe(Me,ae,Ge,it.value,ve),it!==null&&(e&&it.alternate!==null&&Me.delete(it.key===null?Ge:it.key),se=_(it,se,Ge),tt===null?Be=it:tt.sibling=it,tt=it);return e&&Me.forEach(function(Ug){return t(ae,Ug)}),Ve&&rs(ae,Ge),Be}function pt(ae,se,oe,ve){if(typeof oe=="object"&&oe!==null&&oe.type===p&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case x:e:{for(var Be=oe.key;se!==null;){if(se.key===Be){if(Be=oe.type,Be===p){if(se.tag===7){i(ae,se.sibling),ve=l(se,oe.props.children),ve.return=ae,ae=ve;break e}}else if(se.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===y&&pn(Be)===se.type){i(ae,se.sibling),ve=l(se,oe.props),mo(ve,oe),ve.return=ae,ae=ve;break e}i(ae,se);break}else t(ae,se);se=se.sibling}oe.type===p?(ve=Is(oe.props.children,ae.mode,ve,oe.key),ve.return=ae,ae=ve):(ve=Us(oe.type,oe.key,oe.props,null,ae.mode,ve),mo(ve,oe),ve.return=ae,ae=ve)}return D(ae);case A:e:{for(Be=oe.key;se!==null;){if(se.key===Be)if(se.tag===4&&se.stateNode.containerInfo===oe.containerInfo&&se.stateNode.implementation===oe.implementation){i(ae,se.sibling),ve=l(se,oe.children||[]),ve.return=ae,ae=ve;break e}else{i(ae,se);break}else t(ae,se);se=se.sibling}ve=oa(oe,ae.mode,ve),ve.return=ae,ae=ve}return D(ae);case y:return oe=pn(oe),pt(ae,se,oe,ve)}if(re(oe))return Le(ae,se,oe,ve);if(H(oe)){if(Be=H(oe),typeof Be!="function")throw Error(M(150));return oe=Be.call(oe),He(ae,se,oe,ve)}if(typeof oe.then=="function")return pt(ae,se,Ml(oe),ve);if(oe.$$typeof===h)return pt(ae,se,B(ae,oe),ve);Dl(ae,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,se!==null&&se.tag===6?(i(ae,se.sibling),ve=l(se,oe),ve.return=ae,ae=ve):(i(ae,se),ve=lo(oe,ae.mode,ve),ve.return=ae,ae=ve),D(ae)):i(ae,se)}return function(ae,se,oe,ve){try{po=0;var Be=pt(ae,se,oe,ve);return da=null,Be}catch(Me){if(Me===ws||Me===Ll)throw Me;var tt=ei(29,Me,null,ae.mode);return tt.lanes=ve,tt.return=ae,tt}}}var gn=nd(!0),ad=nd(!1),Ar=!1;function Zc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Rr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Lr(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(nt&2)!==0){var l=s.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),s.pending=t,t=aa(e),Sl(e,null,i),t}return na(e,s,t,i),aa(e)}function go(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,Oa(e,i)}}function Jc(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var l=null,_=null;if(i=i.firstBaseUpdate,i!==null){do{var D={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};_===null?l=_=D:_=_.next=D,i=i.next}while(i!==null);_===null?l=_=t:_=_.next=t}else l=_=t;i={baseState:s.baseState,firstBaseUpdate:l,lastBaseUpdate:_,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 eh=!1;function vo(){if(eh){var e=Ki;if(e!==null)throw e}}function bo(e,t,i,s){eh=!1;var l=e.updateQueue;Ar=!1;var _=l.firstBaseUpdate,D=l.lastBaseUpdate,$=l.shared.pending;if($!==null){l.shared.pending=null;var ee=$,le=ee.next;ee.next=null,D===null?_=le:D.next=le,D=ee;var pe=e.alternate;pe!==null&&(pe=pe.updateQueue,$=pe.lastBaseUpdate,$!==D&&($===null?pe.firstBaseUpdate=le:$.next=le,pe.lastBaseUpdate=ee))}if(_!==null){var be=l.baseState;D=0,pe=le=ee=null,$=_;do{var ce=$.lane&-536870913,fe=ce!==$.lane;if(fe?(Qe&ce)===ce:(s&ce)===ce){ce!==0&&ce===Rt&&(eh=!0),pe!==null&&(pe=pe.next={lane:0,tag:$.tag,payload:$.payload,callback:null,next:null});e:{var Le=e,He=$;ce=t;var pt=i;switch(He.tag){case 1:if(Le=He.payload,typeof Le=="function"){be=Le.call(pt,be,ce);break e}be=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=He.payload,ce=typeof Le=="function"?Le.call(pt,be,ce):Le,ce==null)break e;be=o({},be,ce);break e;case 2:Ar=!0}}ce=$.callback,ce!==null&&(e.flags|=64,fe&&(e.flags|=8192),fe=l.callbacks,fe===null?l.callbacks=[ce]:fe.push(ce))}else fe={lane:ce,tag:$.tag,payload:$.payload,callback:$.callback,next:null},pe===null?(le=pe=fe,ee=be):pe=pe.next=fe,D|=ce;if($=$.next,$===null){if($=l.shared.pending,$===null)break;fe=$,$=fe.next,fe.next=null,l.lastBaseUpdate=fe,l.shared.pending=null}}while(!0);pe===null&&(ee=be),l.baseState=ee,l.firstBaseUpdate=le,l.lastBaseUpdate=pe,_===null&&(l.shared.lanes=0),Or|=D,e.lanes=D,e.memoizedState=be}}function od(e,t){if(typeof e!="function")throw Error(M(191,e));e.call(t)}function ld(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)od(i[e],t)}var fa=j(null),kl=j(0);function cd(e,t){e=ir,ie(kl,e),ie(fa,t),ir=e|t.baseLanes}function th(){ie(kl,ir),ie(fa,fa.current)}function ih(){ir=kl.current,F(fa),F(kl)}var Ni=j(null),Vi=null;function Tr(e){var t=e.alternate;ie(Bt,Bt.current&1),ie(Ni,e),Vi===null&&(t===null||fa.current!==null||t.memoizedState!==null)&&(Vi=e)}function sh(e){ie(Bt,Bt.current),ie(Ni,e),Vi===null&&(Vi=e)}function hd(e){e.tag===22?(ie(Bt,Bt.current),ie(Ni,e),Vi===null&&(Vi=e)):Mr()}function Mr(){ie(Bt,Bt.current),ie(Ni,Ni.current)}function Hi(e){F(Ni),Vi===e&&(Vi=null),F(Bt)}var Bt=j(0);function Ol(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||cu(i)||hu(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 Vs=0,qe=null,ft=null,zt=null,Bl=!1,_a=!1,vn=!1,jl=0,So=0,pa=null,Tm=0;function kt(){throw Error(M(321))}function rh(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Jt(e[i],t[i]))return!1;return!0}function nh(e,t,i,s,l,_){return Vs=_,qe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,V.H=e===null||e.memoizedState===null?Kd:Sh,vn=!1,_=i(s,l),vn=!1,_a&&(_=dd(t,i,s,l)),ud(e),_}function ud(e){V.H=wo;var t=ft!==null&&ft.next!==null;if(Vs=0,zt=ft=qe=null,Bl=!1,So=0,pa=null,t)throw Error(M(300));e===null||Ut||(e=e.dependencies,e!==null&&ua(e)&&(Ut=!0))}function dd(e,t,i,s){qe=e;var l=0;do{if(_a&&(pa=null),So=0,_a=!1,25<=l)throw Error(M(301));if(l+=1,zt=ft=null,e.updateQueue!=null){var _=e.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}V.H=Vd,_=t(i,s)}while(_a);return _}function Mm(){var e=V.H,t=e.useState()[0];return t=typeof t.then=="function"?yo(t):t,e=e.useState()[0],(ft!==null?ft.memoizedState:null)!==e&&(qe.flags|=1024),t}function ah(){var e=jl!==0;return jl=0,e}function oh(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function lh(e){if(Bl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Bl=!1}Vs=0,zt=ft=qe=null,_a=!1,So=jl=0,pa=null}function li(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zt===null?qe.memoizedState=zt=e:zt=zt.next=e,zt}function jt(){if(ft===null){var e=qe.alternate;e=e!==null?e.memoizedState:null}else e=ft.next;var t=zt===null?qe.memoizedState:zt.next;if(t!==null)zt=t,ft=e;else{if(e===null)throw qe.alternate===null?Error(M(467)):Error(M(310));ft=e,e={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},zt===null?qe.memoizedState=zt=e:zt=zt.next=e}return zt}function Nl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yo(e){var t=So;return So+=1,pa===null&&(pa=[]),e=id(pa,e,t),t=qe,(zt===null?t.memoizedState:zt.next)===null&&(t=t.alternate,V.H=t===null||t.memoizedState===null?Kd:Sh),e}function Hl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return yo(e);if(e.$$typeof===h)return g(e)}throw Error(M(438,String(e)))}function ch(e){var t=null,i=qe.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=qe.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(l){return l.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=Nl(),qe.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),s=0;s<e;s++)i[s]=k;return t.index++,i}function Ys(e,t){return typeof t=="function"?t(e):t}function zl(e){var t=jt();return hh(t,ft,e)}function hh(e,t,i){var s=e.queue;if(s===null)throw Error(M(311));s.lastRenderedReducer=i;var l=e.baseQueue,_=s.pending;if(_!==null){if(l!==null){var D=l.next;l.next=_.next,_.next=D}t.baseQueue=l=_,s.pending=null}if(_=e.baseState,l===null)e.memoizedState=_;else{t=l.next;var $=D=null,ee=null,le=t,pe=!1;do{var be=le.lane&-536870913;if(be!==le.lane?(Qe&be)===be:(Vs&be)===be){var ce=le.revertLane;if(ce===0)ee!==null&&(ee=ee.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),be===Rt&&(pe=!0);else if((Vs&ce)===ce){le=le.next,ce===Rt&&(pe=!0);continue}else be={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},ee===null?($=ee=be,D=_):ee=ee.next=be,qe.lanes|=ce,Or|=ce;be=le.action,vn&&i(_,be),_=le.hasEagerState?le.eagerState:i(_,be)}else ce={lane:be,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},ee===null?($=ee=ce,D=_):ee=ee.next=ce,qe.lanes|=be,Or|=be;le=le.next}while(le!==null&&le!==t);if(ee===null?D=_:ee.next=$,!Jt(_,e.memoizedState)&&(Ut=!0,pe&&(i=Ki,i!==null)))throw i;e.memoizedState=_,e.baseState=D,e.baseQueue=ee,s.lastRenderedState=_}return l===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function uh(e){var t=jt(),i=t.queue;if(i===null)throw Error(M(311));i.lastRenderedReducer=e;var s=i.dispatch,l=i.pending,_=t.memoizedState;if(l!==null){i.pending=null;var D=l=l.next;do _=e(_,D.action),D=D.next;while(D!==l);Jt(_,t.memoizedState)||(Ut=!0),t.memoizedState=_,t.baseQueue===null&&(t.baseState=_),i.lastRenderedState=_}return[_,s]}function fd(e,t,i){var s=qe,l=jt(),_=Ve;if(_){if(i===void 0)throw Error(M(407));i=i()}else i=t();var D=!Jt((ft||l).memoizedState,i);if(D&&(l.memoizedState=i,Ut=!0),l=l.queue,_h(md.bind(null,s,l,e),[e]),l.getSnapshot!==t||D||zt!==null&&zt.memoizedState.tag&1){if(s.flags|=2048,ma(9,{destroy:void 0},pd.bind(null,s,l,i,t),null),vt===null)throw Error(M(349));_||(Vs&127)!==0||_d(s,t,i)}return i}function _d(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=qe.updateQueue,t===null?(t=Nl(),qe.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function pd(e,t,i,s){t.value=i,t.getSnapshot=s,gd(t)&&vd(e)}function md(e,t,i){return i(function(){gd(t)&&vd(e)})}function gd(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Jt(e,i)}catch{return!0}}function vd(e){var t=Hs(e,2);t!==null&&Ci(t,e,2)}function dh(e){var t=li();if(typeof e=="function"){var i=e;if(e=i(),vn){Pt(!0);try{i()}finally{Pt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ys,lastRenderedState:e},t}function bd(e,t,i,s){return e.baseState=i,hh(e,ft,typeof s=="function"?s:Ys)}function Dm(e,t,i,s,l){if(Pl(e))throw Error(M(485));if(e=t.action,e!==null){var _={payload:l,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){_.listeners.push(D)}};V.T!==null?i(!0):_.isTransition=!1,s(_),i=t.pending,i===null?(_.next=t.pending=_,Sd(t,_)):(_.next=i.next,t.pending=i.next=_)}}function Sd(e,t){var i=t.action,s=t.payload,l=e.state;if(t.isTransition){var _=V.T,D={};V.T=D;try{var $=i(l,s),ee=V.S;ee!==null&&ee(D,$),yd(e,t,$)}catch(le){fh(e,t,le)}finally{_!==null&&D.types!==null&&(_.types=D.types),V.T=_}}else try{_=i(l,s),yd(e,t,_)}catch(le){fh(e,t,le)}}function yd(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){Cd(e,t,s)},function(s){return fh(e,t,s)}):Cd(e,t,i)}function Cd(e,t,i){t.status="fulfilled",t.value=i,wd(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 fh(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,wd(t),t=t.next;while(t!==s)}e.action=null}function wd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function xd(e,t){return t}function Ed(e,t){if(Ve){var i=vt.formState;if(i!==null){e:{var s=qe;if(Ve){if(gt){t:{for(var l=gt,_=pi;l.nodeType!==8;){if(!_){l=null;break t}if(l=Yi(l.nextSibling),l===null){l=null;break t}}_=l.data,l=_==="F!"||_==="F"?l:null}if(l){gt=Yi(l.nextSibling),s=l.data==="F!";break e}}ns(s)}s=!1}s&&(t=i[0])}}return i=li(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xd,lastRenderedState:t},i.queue=s,i=Wd.bind(null,qe,s),s.dispatch=i,s=dh(!1),_=bh.bind(null,qe,!1,s.queue),s=li(),l={state:t,dispatch:null,action:e,pending:null},s.queue=l,i=Dm.bind(null,qe,l,_,i),l.dispatch=i,s.memoizedState=e,[t,i,!1]}function Ad(e){var t=jt();return Rd(t,ft,e)}function Rd(e,t,i){if(t=hh(e,t,xd)[0],e=zl(Ys)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=yo(t)}catch(D){throw D===ws?Ll:D}else s=t;t=jt();var l=t.queue,_=l.dispatch;return i!==t.memoizedState&&(qe.flags|=2048,ma(9,{destroy:void 0},km.bind(null,l,i),null)),[s,_,e]}function km(e,t){e.action=t}function Ld(e){var t=jt(),i=ft;if(i!==null)return Rd(t,i,e);jt(),t=t.memoizedState,i=jt();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function ma(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=qe.updateQueue,t===null&&(t=Nl(),qe.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(s=i.next,i.next=e,e.next=s,t.lastEffect=e),e}function Td(){return jt().memoizedState}function Ul(e,t,i,s){var l=li();qe.flags|=e,l.memoizedState=ma(1|t,{destroy:void 0},i,s===void 0?null:s)}function Il(e,t,i,s){var l=jt();s=s===void 0?null:s;var _=l.memoizedState.inst;ft!==null&&s!==null&&rh(s,ft.memoizedState.deps)?l.memoizedState=ma(t,_,i,s):(qe.flags|=e,l.memoizedState=ma(1|t,_,i,s))}function Md(e,t){Ul(8390656,8,e,t)}function _h(e,t){Il(2048,8,e,t)}function Om(e){qe.flags|=4;var t=qe.updateQueue;if(t===null)t=Nl(),qe.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Dd(e){var t=jt().memoizedState;return Om({ref:t,nextImpl:e}),function(){if((nt&2)!==0)throw Error(M(440));return t.impl.apply(void 0,arguments)}}function kd(e,t){return Il(4,2,e,t)}function Od(e,t){return Il(4,4,e,t)}function Bd(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 jd(e,t,i){i=i!=null?i.concat([e]):null,Il(4,4,Bd.bind(null,t,e),i)}function ph(){}function Nd(e,t){var i=jt();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&rh(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function Hd(e,t){var i=jt();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&rh(t,s[1]))return s[0];if(s=e(),vn){Pt(!0);try{e()}finally{Pt(!1)}}return i.memoizedState=[s,t],s}function mh(e,t,i){return i===void 0||(Vs&1073741824)!==0&&(Qe&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=Uf(),qe.lanes|=e,Or|=e,i)}function zd(e,t,i,s){return Jt(i,t)?i:fa.current!==null?(e=mh(e,i,s),Jt(e,t)||(Ut=!0),e):(Vs&42)===0||(Vs&1073741824)!==0&&(Qe&261930)===0?(Ut=!0,e.memoizedState=i):(e=Uf(),qe.lanes|=e,Or|=e,t)}function Ud(e,t,i,s,l){var _=X.p;X.p=_!==0&&8>_?_:8;var D=V.T,$={};V.T=$,bh(e,!1,t,i);try{var ee=l(),le=V.S;if(le!==null&&le($,ee),ee!==null&&typeof ee=="object"&&typeof ee.then=="function"){var pe=fn(ee,s);Co(e,t,pe,Ii(e))}else Co(e,t,s,Ii(e))}catch(be){Co(e,t,{then:function(){},status:"rejected",reason:be},Ii())}finally{X.p=_,D!==null&&$.types!==null&&(D.types=$.types),V.T=D}}function Bm(){}function gh(e,t,i,s){if(e.tag!==5)throw Error(M(476));var l=Id(e).queue;Ud(e,l,t,I,i===null?Bm:function(){return Pd(e),i(s)})}function Id(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ys,lastRenderedState:I},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ys,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Pd(e){var t=Id(e);t.next===null&&(t=e.alternate.memoizedState),Co(e,t.next.queue,{},Ii())}function vh(){return g(Uo)}function $d(){return jt().memoizedState}function Fd(){return jt().memoizedState}function jm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Ii();e=Rr(i);var s=Lr(t,e,i);s!==null&&(Ci(s,t,i),go(s,t,i)),t={cache:Re()},e.payload=t;return}t=t.return}}function Nm(e,t,i){var s=Ii();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Pl(e)?qd(t,i):(i=hn(e,t,i,s),i!==null&&(Ci(i,e,s),Gd(i,t,s)))}function Wd(e,t,i){var s=Ii();Co(e,t,i,s)}function Co(e,t,i,s){var l={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Pl(e))qd(t,l);else{var _=e.alternate;if(e.lanes===0&&(_===null||_.lanes===0)&&(_=t.lastRenderedReducer,_!==null))try{var D=t.lastRenderedState,$=_(D,i);if(l.hasEagerState=!0,l.eagerState=$,Jt($,D))return na(e,t,l,0),vt===null&&ra(),!1}catch{}if(i=hn(e,t,l,s),i!==null)return Ci(i,e,s),Gd(i,t,s),!0}return!1}function bh(e,t,i,s){if(s={lane:2,revertLane:Zh(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Pl(e)){if(t)throw Error(M(479))}else t=hn(e,i,s,2),t!==null&&Ci(t,e,2)}function Pl(e){var t=e.alternate;return e===qe||t!==null&&t===qe}function qd(e,t){_a=Bl=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Gd(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,Oa(e,i)}}var wo={readContext:g,use:Hl,useCallback:kt,useContext:kt,useEffect:kt,useImperativeHandle:kt,useLayoutEffect:kt,useInsertionEffect:kt,useMemo:kt,useReducer:kt,useRef:kt,useState:kt,useDebugValue:kt,useDeferredValue:kt,useTransition:kt,useSyncExternalStore:kt,useId:kt,useHostTransitionStatus:kt,useFormState:kt,useActionState:kt,useOptimistic:kt,useMemoCache:kt,useCacheRefresh:kt};wo.useEffectEvent=kt;var Kd={readContext:g,use:Hl,useCallback:function(e,t){return li().memoizedState=[e,t===void 0?null:t],e},useContext:g,useEffect:Md,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,Ul(4194308,4,Bd.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Ul(4194308,4,e,t)},useInsertionEffect:function(e,t){Ul(4,2,e,t)},useMemo:function(e,t){var i=li();t=t===void 0?null:t;var s=e();if(vn){Pt(!0);try{e()}finally{Pt(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=li();if(i!==void 0){var l=i(t);if(vn){Pt(!0);try{i(t)}finally{Pt(!1)}}}else l=t;return s.memoizedState=s.baseState=l,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:l},s.queue=e,e=e.dispatch=Nm.bind(null,qe,e),[s.memoizedState,e]},useRef:function(e){var t=li();return e={current:e},t.memoizedState=e},useState:function(e){e=dh(e);var t=e.queue,i=Wd.bind(null,qe,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:ph,useDeferredValue:function(e,t){var i=li();return mh(i,e,t)},useTransition:function(){var e=dh(!1);return e=Ud.bind(null,qe,e.queue,!0,!1),li().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=qe,l=li();if(Ve){if(i===void 0)throw Error(M(407));i=i()}else{if(i=t(),vt===null)throw Error(M(349));(Qe&127)!==0||_d(s,t,i)}l.memoizedState=i;var _={value:i,getSnapshot:t};return l.queue=_,Md(md.bind(null,s,_,e),[e]),s.flags|=2048,ma(9,{destroy:void 0},pd.bind(null,s,_,i,t),null),i},useId:function(){var e=li(),t=vt.identifierPrefix;if(Ve){var i=Gi,s=ji;i=(s&~(1<<32-mt(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=jl++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=Tm++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:vh,useFormState:Ed,useActionState:Ed,useOptimistic:function(e){var t=li();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=bh.bind(null,qe,!0,i),i.dispatch=t,[e,t]},useMemoCache:ch,useCacheRefresh:function(){return li().memoizedState=jm.bind(null,qe)},useEffectEvent:function(e){var t=li(),i={impl:e};return t.memoizedState=i,function(){if((nt&2)!==0)throw Error(M(440));return i.impl.apply(void 0,arguments)}}},Sh={readContext:g,use:Hl,useCallback:Nd,useContext:g,useEffect:_h,useImperativeHandle:jd,useInsertionEffect:kd,useLayoutEffect:Od,useMemo:Hd,useReducer:zl,useRef:Td,useState:function(){return zl(Ys)},useDebugValue:ph,useDeferredValue:function(e,t){var i=jt();return zd(i,ft.memoizedState,e,t)},useTransition:function(){var e=zl(Ys)[0],t=jt().memoizedState;return[typeof e=="boolean"?e:yo(e),t]},useSyncExternalStore:fd,useId:$d,useHostTransitionStatus:vh,useFormState:Ad,useActionState:Ad,useOptimistic:function(e,t){var i=jt();return bd(i,ft,e,t)},useMemoCache:ch,useCacheRefresh:Fd};Sh.useEffectEvent=Dd;var Vd={readContext:g,use:Hl,useCallback:Nd,useContext:g,useEffect:_h,useImperativeHandle:jd,useInsertionEffect:kd,useLayoutEffect:Od,useMemo:Hd,useReducer:uh,useRef:Td,useState:function(){return uh(Ys)},useDebugValue:ph,useDeferredValue:function(e,t){var i=jt();return ft===null?mh(i,e,t):zd(i,ft.memoizedState,e,t)},useTransition:function(){var e=uh(Ys)[0],t=jt().memoizedState;return[typeof e=="boolean"?e:yo(e),t]},useSyncExternalStore:fd,useId:$d,useHostTransitionStatus:vh,useFormState:Ld,useActionState:Ld,useOptimistic:function(e,t){var i=jt();return ft!==null?bd(i,ft,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:ch,useCacheRefresh:Fd};Vd.useEffectEvent=Dd;function yh(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:o({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Ch={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=Ii(),l=Rr(s);l.payload=t,i!=null&&(l.callback=i),t=Lr(e,l,s),t!==null&&(Ci(t,e,s),go(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=Ii(),l=Rr(s);l.tag=1,l.payload=t,i!=null&&(l.callback=i),t=Lr(e,l,s),t!==null&&(Ci(t,e,s),go(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Ii(),s=Rr(i);s.tag=2,t!=null&&(s.callback=t),t=Lr(e,s,i),t!==null&&(Ci(t,e,i),go(t,e,i))}};function Yd(e,t,i,s,l,_,D){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,_,D):t.prototype&&t.prototype.isPureReactComponent?!on(i,s)||!on(l,_):!0}function Xd(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&&Ch.enqueueReplaceState(t,t.state,null)}function bn(e,t){var i=t;if("ref"in t){i={};for(var s in t)s!=="ref"&&(i[s]=t[s])}if(e=e.defaultProps){i===t&&(i=o({},i));for(var l in e)i[l]===void 0&&(i[l]=e[l])}return i}function Zd(e){cn(e)}function Qd(e){console.error(e)}function Jd(e){cn(e)}function $l(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function ef(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(l){setTimeout(function(){throw l})}}function wh(e,t,i){return i=Rr(i),i.tag=3,i.payload={element:null},i.callback=function(){$l(e,t)},i}function tf(e){return e=Rr(e),e.tag=3,e}function sf(e,t,i,s){var l=i.type.getDerivedStateFromError;if(typeof l=="function"){var _=s.value;e.payload=function(){return l(_)},e.callback=function(){ef(t,i,s)}}var D=i.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(e.callback=function(){ef(t,i,s),typeof l!="function"&&(Br===null?Br=new Set([this]):Br.add(this));var $=s.stack;this.componentDidCatch(s.value,{componentStack:$!==null?$:""})})}function Hm(e,t,i,s,l){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&qs(t,i,l,!0),i=Ni.current,i!==null){switch(i.tag){case 31:case 13:return Vi===null?ec():i.alternate===null&&Ot===0&&(Ot=3),i.flags&=-257,i.flags|=65536,i.lanes=l,s===Tl?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),Vh(e,s,l)),!1;case 22:return i.flags|=65536,s===Tl?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)),Vh(e,s,l)),!1}throw Error(M(435,i.tag))}return Vh(e,s,l),ec(),!1}if(Ve)return t=Ni.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=l,s!==$s&&(e=Error(M(422),{cause:s}),xr(Ht(e,i)))):(s!==$s&&(t=Error(M(423),{cause:s}),xr(Ht(t,i))),e=e.current.alternate,e.flags|=65536,l&=-l,e.lanes|=l,s=Ht(s,i),l=wh(e.stateNode,s,l),Jc(e,l),Ot!==4&&(Ot=2)),!1;var _=Error(M(520),{cause:s});if(_=Ht(_,i),Do===null?Do=[_]:Do.push(_),Ot!==4&&(Ot=2),t===null)return!0;s=Ht(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=l&-l,i.lanes|=e,e=wh(i.stateNode,s,e),Jc(i,e),!1;case 1:if(t=i.type,_=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Br===null||!Br.has(_))))return i.flags|=65536,l&=-l,i.lanes|=l,l=tf(l),sf(l,e,i,s),Jc(i,l),!1}i=i.return}while(i!==null);return!1}var xh=Error(M(461)),Ut=!1;function Xt(e,t,i,s){t.child=e===null?ad(t,null,i,s):gn(t,e.child,i,s)}function rf(e,t,i,s,l){i=i.render;var _=t.ref;if("ref"in s){var D={};for(var $ in s)$!=="ref"&&(D[$]=s[$])}else D=s;return Gs(t),s=nh(e,t,i,D,_,l),$=ah(),e!==null&&!Ut?(oh(e,t,l),Xs(e,t,l)):(Ve&&$&&ca(t),t.flags|=1,Xt(e,t,s,l),t.child)}function nf(e,t,i,s,l){if(e===null){var _=i.type;return typeof _=="function"&&!oo(_)&&_.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=_,af(e,t,_,s,l)):(e=Us(i.type,null,s,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(_=e.child,!kh(e,l)){var D=_.memoizedProps;if(i=i.compare,i=i!==null?i:on,i(D,s)&&e.ref===t.ref)return Xs(e,t,l)}return t.flags|=1,e=qi(_,s),e.ref=t.ref,e.return=t,t.child=e}function af(e,t,i,s,l){if(e!==null){var _=e.memoizedProps;if(on(_,s)&&e.ref===t.ref)if(Ut=!1,t.pendingProps=s=_,kh(e,l))(e.flags&131072)!==0&&(Ut=!0);else return t.lanes=e.lanes,Xs(e,t,l)}return Eh(e,t,i,s,l)}function of(e,t,i,s){var l=s.children,_=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(_=_!==null?_.baseLanes|i:i,e!==null){for(s=t.child=e.child,l=0;s!==null;)l=l|s.lanes|s.childLanes,s=s.sibling;s=l&~_}else s=0,t.child=null;return lf(e,t,_,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&gi(t,_!==null?_.cachePool:null),_!==null?cd(t,_):th(),hd(t);else return s=t.lanes=536870912,lf(e,t,_!==null?_.baseLanes|i:i,i,s)}else _!==null?(gi(t,_.cachePool),cd(t,_),Mr(),t.memoizedState=null):(e!==null&&gi(t,null),th(),Mr());return Xt(e,t,l,i),t.child}function xo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function lf(e,t,i,s,l){var _=Al();return _=_===null?null:{parent:Ce._currentValue,pool:_},t.memoizedState={baseLanes:i,cachePool:_},e!==null&&gi(t,null),th(),hd(t),e!==null&&qs(e,t,s,!0),t.childLanes=l,null}function Fl(e,t){return t=ql({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function cf(e,t,i){return gn(t,e.child,null,i),e=Fl(t,t.pendingProps),e.flags|=2,Hi(t),t.memoizedState=null,e}function zm(e,t,i){var s=t.pendingProps,l=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ve){if(s.mode==="hidden")return e=Fl(t,s),t.lanes=536870912,xo(null,e);if(sh(t),(e=gt)?(e=y_(e,pi),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Bi!==null?{id:ji,overflow:Gi}:null,retryLane:536870912,hydrationErrors:null},i=Cl(e),i.return=t,t.child=i,Ft=t,gt=null)):e=null,e===null)throw ns(t);return t.lanes=536870912,null}return Fl(t,s)}var _=e.memoizedState;if(_!==null){var D=_.dehydrated;if(sh(t),l)if(t.flags&256)t.flags&=-257,t=cf(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(M(558));else if(Ut||qs(e,t,i,!1),l=(i&e.childLanes)!==0,Ut||l){if(s=vt,s!==null&&(D=kn(s,i),D!==0&&D!==_.retryLane))throw _.retryLane=D,Hs(e,D),Ci(s,e,D),xh;ec(),t=cf(e,t,i)}else e=_.treeContext,gt=Yi(D.nextSibling),Ft=t,Ve=!0,ys=null,pi=!1,e!==null&&wl(t,e),t=Fl(t,s),t.flags|=4096;return t}return e=qi(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Wl(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(M(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Eh(e,t,i,s,l){return Gs(t),i=nh(e,t,i,s,void 0,l),s=ah(),e!==null&&!Ut?(oh(e,t,l),Xs(e,t,l)):(Ve&&s&&ca(t),t.flags|=1,Xt(e,t,i,l),t.child)}function hf(e,t,i,s,l,_){return Gs(t),t.updateQueue=null,i=dd(t,s,i,l),ud(e),s=ah(),e!==null&&!Ut?(oh(e,t,_),Xs(e,t,_)):(Ve&&s&&ca(t),t.flags|=1,Xt(e,t,i,_),t.child)}function uf(e,t,i,s,l){if(Gs(t),t.stateNode===null){var _=Ss,D=i.contextType;typeof D=="object"&&D!==null&&(_=g(D)),_=new i(s,_),t.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=Ch,t.stateNode=_,_._reactInternals=t,_=t.stateNode,_.props=s,_.state=t.memoizedState,_.refs={},Zc(t),D=i.contextType,_.context=typeof D=="object"&&D!==null?g(D):Ss,_.state=t.memoizedState,D=i.getDerivedStateFromProps,typeof D=="function"&&(yh(t,i,D,s),_.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(D=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),D!==_.state&&Ch.enqueueReplaceState(_,_.state,null),bo(t,s,_,l),vo(),_.state=t.memoizedState),typeof _.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){_=t.stateNode;var $=t.memoizedProps,ee=bn(i,$);_.props=ee;var le=_.context,pe=i.contextType;D=Ss,typeof pe=="object"&&pe!==null&&(D=g(pe));var be=i.getDerivedStateFromProps;pe=typeof be=="function"||typeof _.getSnapshotBeforeUpdate=="function",$=t.pendingProps!==$,pe||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||($||le!==D)&&Xd(t,_,s,D),Ar=!1;var ce=t.memoizedState;_.state=ce,bo(t,s,_,l),vo(),le=t.memoizedState,$||ce!==le||Ar?(typeof be=="function"&&(yh(t,i,be,s),le=t.memoizedState),(ee=Ar||Yd(t,i,ee,s,ce,le,D))?(pe||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(t.flags|=4194308)):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=le),_.props=s,_.state=le,_.context=D,s=ee):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{_=t.stateNode,Qc(e,t),D=t.memoizedProps,pe=bn(i,D),_.props=pe,be=t.pendingProps,ce=_.context,le=i.contextType,ee=Ss,typeof le=="object"&&le!==null&&(ee=g(le)),$=i.getDerivedStateFromProps,(le=typeof $=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(D!==be||ce!==ee)&&Xd(t,_,s,ee),Ar=!1,ce=t.memoizedState,_.state=ce,bo(t,s,_,l),vo();var fe=t.memoizedState;D!==be||ce!==fe||Ar||e!==null&&e.dependencies!==null&&ua(e.dependencies)?(typeof $=="function"&&(yh(t,i,$,s),fe=t.memoizedState),(pe=Ar||Yd(t,i,pe,s,ce,fe,ee)||e!==null&&e.dependencies!==null&&ua(e.dependencies))?(le||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(s,fe,ee),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(s,fe,ee)),typeof _.componentDidUpdate=="function"&&(t.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof _.componentDidUpdate!="function"||D===e.memoizedProps&&ce===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&ce===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=fe),_.props=s,_.state=fe,_.context=ee,s=pe):(typeof _.componentDidUpdate!="function"||D===e.memoizedProps&&ce===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&ce===e.memoizedState||(t.flags|=1024),s=!1)}return _=s,Wl(e,t),s=(t.flags&128)!==0,_||s?(_=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:_.render(),t.flags|=1,e!==null&&s?(t.child=gn(t,e.child,null,l),t.child=gn(t,null,i,l)):Xt(e,t,i,l),t.memoizedState=_.state,e=t.child):e=Xs(e,t,l),e}function df(e,t,i,s){return Fs(),t.flags|=256,Xt(e,t,i,s),t.child}var Ah={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Rh(e){return{baseLanes:e,cachePool:Rl()}}function Lh(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Ui),e}function ff(e,t,i){var s=t.pendingProps,l=!1,_=(t.flags&128)!==0,D;if((D=_)||(D=e!==null&&e.memoizedState===null?!1:(Bt.current&2)!==0),D&&(l=!0,t.flags&=-129),D=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ve){if(l?Tr(t):Mr(),(e=gt)?(e=y_(e,pi),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Bi!==null?{id:ji,overflow:Gi}:null,retryLane:536870912,hydrationErrors:null},i=Cl(e),i.return=t,t.child=i,Ft=t,gt=null)):e=null,e===null)throw ns(t);return hu(e)?t.lanes=32:t.lanes=536870912,null}var $=s.children;return s=s.fallback,l?(Mr(),l=t.mode,$=ql({mode:"hidden",children:$},l),s=Is(s,l,i,null),$.return=t,s.return=t,$.sibling=s,t.child=$,s=t.child,s.memoizedState=Rh(i),s.childLanes=Lh(e,D,i),t.memoizedState=Ah,xo(null,s)):(Tr(t),Th(t,$))}var ee=e.memoizedState;if(ee!==null&&($=ee.dehydrated,$!==null)){if(_)t.flags&256?(Tr(t),t.flags&=-257,t=Mh(e,t,i)):t.memoizedState!==null?(Mr(),t.child=e.child,t.flags|=128,t=null):(Mr(),$=s.fallback,l=t.mode,s=ql({mode:"visible",children:s.children},l),$=Is($,l,i,null),$.flags|=2,s.return=t,$.return=t,s.sibling=$,t.child=s,gn(t,e.child,null,i),s=t.child,s.memoizedState=Rh(i),s.childLanes=Lh(e,D,i),t.memoizedState=Ah,t=xo(null,s));else if(Tr(t),hu($)){if(D=$.nextSibling&&$.nextSibling.dataset,D)var le=D.dgst;D=le,s=Error(M(419)),s.stack="",s.digest=D,xr({value:s,source:null,stack:null}),t=Mh(e,t,i)}else if(Ut||qs(e,t,i,!1),D=(i&e.childLanes)!==0,Ut||D){if(D=vt,D!==null&&(s=kn(D,i),s!==0&&s!==ee.retryLane))throw ee.retryLane=s,Hs(e,s),Ci(D,e,s),xh;cu($)||ec(),t=Mh(e,t,i)}else cu($)?(t.flags|=192,t.child=e.child,t=null):(e=ee.treeContext,gt=Yi($.nextSibling),Ft=t,Ve=!0,ys=null,pi=!1,e!==null&&wl(t,e),t=Th(t,s.children),t.flags|=4096);return t}return l?(Mr(),$=s.fallback,l=t.mode,ee=e.child,le=ee.sibling,s=qi(ee,{mode:"hidden",children:s.children}),s.subtreeFlags=ee.subtreeFlags&65011712,le!==null?$=qi(le,$):($=Is($,l,i,null),$.flags|=2),$.return=t,s.return=t,s.sibling=$,t.child=s,xo(null,s),s=t.child,$=e.child.memoizedState,$===null?$=Rh(i):(l=$.cachePool,l!==null?(ee=Ce._currentValue,l=l.parent!==ee?{parent:ee,pool:ee}:l):l=Rl(),$={baseLanes:$.baseLanes|i,cachePool:l}),s.memoizedState=$,s.childLanes=Lh(e,D,i),t.memoizedState=Ah,xo(e.child,s)):(Tr(t),i=e.child,e=i.sibling,i=qi(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(D=t.deletions,D===null?(t.deletions=[e],t.flags|=16):D.push(e)),t.child=i,t.memoizedState=null,i)}function Th(e,t){return t=ql({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ql(e,t){return e=ei(22,e,null,t),e.lanes=0,e}function Mh(e,t,i){return gn(t,e.child,null,i),e=Th(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function _f(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),fo(e.return,t,i)}function Dh(e,t,i,s,l,_){var D=e.memoizedState;D===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:l,treeForkCount:_}:(D.isBackwards=t,D.rendering=null,D.renderingStartTime=0,D.last=s,D.tail=i,D.tailMode=l,D.treeForkCount=_)}function pf(e,t,i){var s=t.pendingProps,l=s.revealOrder,_=s.tail;s=s.children;var D=Bt.current,$=(D&2)!==0;if($?(D=D&1|2,t.flags|=128):D&=1,ie(Bt,D),Xt(e,t,s,i),s=Ve?Cr:0,!$&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&_f(e,i,t);else if(e.tag===19)_f(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(l){case"forwards":for(i=t.child,l=null;i!==null;)e=i.alternate,e!==null&&Ol(e)===null&&(l=i),i=i.sibling;i=l,i===null?(l=t.child,t.child=null):(l=i.sibling,i.sibling=null),Dh(t,!1,l,i,_,s);break;case"backwards":case"unstable_legacy-backwards":for(i=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&Ol(e)===null){t.child=l;break}e=l.sibling,l.sibling=i,i=l,l=e}Dh(t,!0,i,null,_,s);break;case"together":Dh(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Xs(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),Or|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(qs(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(M(153));if(t.child!==null){for(e=t.child,i=qi(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=qi(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function kh(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ua(e)))}function Um(e,t,i){switch(t.tag){case 3:q(t,t.stateNode.containerInfo),Cs(t,Ce,e.memoizedState.cache),Fs();break;case 27:case 5:_e(t);break;case 4:q(t,t.stateNode.containerInfo);break;case 10:Cs(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,sh(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Tr(t),t.flags|=128,null):(i&t.child.childLanes)!==0?ff(e,t,i):(Tr(t),e=Xs(e,t,i),e!==null?e.sibling:null);Tr(t);break;case 19:var l=(e.flags&128)!==0;if(s=(i&t.childLanes)!==0,s||(qs(e,t,i,!1),s=(i&t.childLanes)!==0),l){if(s)return pf(e,t,i);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),ie(Bt,Bt.current),s)break;return null;case 22:return t.lanes=0,of(e,t,i,t.pendingProps);case 24:Cs(t,Ce,e.memoizedState.cache)}return Xs(e,t,i)}function mf(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ut=!0;else{if(!kh(e,i)&&(t.flags&128)===0)return Ut=!1,Um(e,t,i);Ut=(e.flags&131072)!==0}else Ut=!1,Ve&&(t.flags&1048576)!==0&&ho(t,Cr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=pn(t.elementType),t.type=e,typeof e=="function")oo(e)?(s=bn(e,s),t.tag=1,t=uf(null,t,e,s,i)):(t.tag=0,t=Eh(null,t,e,s,i));else{if(e!=null){var l=e.$$typeof;if(l===S){t.tag=11,t=rf(null,t,e,s,i);break e}else if(l===L){t.tag=14,t=nf(null,t,e,s,i);break e}}throw t=Y(e)||e,Error(M(306,t,""))}}return t;case 0:return Eh(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,l=bn(s,t.pendingProps),uf(e,t,s,l,i);case 3:e:{if(q(t,t.stateNode.containerInfo),e===null)throw Error(M(387));s=t.pendingProps;var _=t.memoizedState;l=_.element,Qc(e,t),bo(t,s,null,i);var D=t.memoizedState;if(s=D.cache,Cs(t,Ce,s),s!==_.cache&&_o(t,[Ce],i,!0),vo(),s=D.element,_.isDehydrated)if(_={element:s,isDehydrated:!1,cache:D.cache},t.updateQueue.baseState=_,t.memoizedState=_,t.flags&256){t=df(e,t,s,i);break e}else if(s!==l){l=Ht(Error(M(424)),t),xr(l),t=df(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,gt=Yi(e.firstChild),Ft=t,Ve=!0,ys=null,pi=!0,i=ad(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Fs(),s===l){t=Xs(e,t,i);break e}Xt(e,t,s,i)}t=t.child}return t;case 26:return Wl(e,t),e===null?(i=R_(t.type,null,t.pendingProps,null))?t.memoizedState=i:Ve||(i=t.type,e=t.pendingProps,s=oc(ge.current).createElement(i),s[Nt]=t,s[Ke]=e,Zt(s,i,e),St(s),t.stateNode=s):t.memoizedState=R_(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return _e(t),e===null&&Ve&&(s=t.stateNode=x_(t.type,t.pendingProps,ge.current),Ft=t,pi=!0,l=gt,zr(t.type)?(uu=l,gt=Yi(s.firstChild)):gt=l),Xt(e,t,t.pendingProps.children,i),Wl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ve&&((l=s=gt)&&(s=pg(s,t.type,t.pendingProps,pi),s!==null?(t.stateNode=s,Ft=t,gt=Yi(s.firstChild),pi=!1,l=!0):l=!1),l||ns(t)),_e(t),l=t.type,_=t.pendingProps,D=e!==null?e.memoizedProps:null,s=_.children,au(l,_)?s=null:D!==null&&au(l,D)&&(t.flags|=32),t.memoizedState!==null&&(l=nh(e,t,Mm,null,null,i),Uo._currentValue=l),Wl(e,t),Xt(e,t,s,i),t.child;case 6:return e===null&&Ve&&((e=i=gt)&&(i=mg(i,t.pendingProps,pi),i!==null?(t.stateNode=i,Ft=t,gt=null,e=!0):e=!1),e||ns(t)),null;case 13:return ff(e,t,i);case 4:return q(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=gn(t,null,s,i):Xt(e,t,s,i),t.child;case 11:return rf(e,t,t.type,t.pendingProps,i);case 7:return Xt(e,t,t.pendingProps,i),t.child;case 8:return Xt(e,t,t.pendingProps.children,i),t.child;case 12:return Xt(e,t,t.pendingProps.children,i),t.child;case 10:return s=t.pendingProps,Cs(t,t.type,s.value),Xt(e,t,s.children,i),t.child;case 9:return l=t.type._context,s=t.pendingProps.children,Gs(t),l=g(l),s=s(l),t.flags|=1,Xt(e,t,s,i),t.child;case 14:return nf(e,t,t.type,t.pendingProps,i);case 15:return af(e,t,t.type,t.pendingProps,i);case 19:return pf(e,t,i);case 31:return zm(e,t,i);case 22:return of(e,t,i,t.pendingProps);case 24:return Gs(t),s=g(Ce),e===null?(l=Al(),l===null&&(l=vt,_=Re(),l.pooledCache=_,_.refCount++,_!==null&&(l.pooledCacheLanes|=i),l=_),t.memoizedState={parent:s,cache:l},Zc(t),Cs(t,Ce,l)):((e.lanes&i)!==0&&(Qc(e,t),bo(t,null,null,i),vo()),l=e.memoizedState,_=t.memoizedState,l.parent!==s?(l={parent:s,cache:s},t.memoizedState=l,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=l),Cs(t,Ce,s)):(s=_.cache,Cs(t,Ce,s),s!==l.cache&&_o(t,[Ce],i,!0))),Xt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(M(156,t.tag))}function Zs(e){e.flags|=4}function Oh(e,t,i,s,l){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(l&335544128)===l)if(e.stateNode.complete)e.flags|=8192;else if(Ff())e.flags|=8192;else throw mn=Tl,Er}else e.flags&=-16777217}function gf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!k_(t))if(Ff())e.flags|=8192;else throw mn=Tl,Er}function Gl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Rs():536870912,e.lanes|=t,Sa|=t)}function Eo(e,t){if(!Ve)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 Ct(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var l=e.child;l!==null;)i|=l.lanes|l.childLanes,s|=l.subtreeFlags&65011712,s|=l.flags&65011712,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)i|=l.lanes|l.childLanes,s|=l.subtreeFlags,s|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function Im(e,t,i){var s=t.pendingProps;switch(ha(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ct(t),null;case 1:return Ct(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),os(Ce),ne(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(wr(t)?Zs(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,un())),Ct(t),null;case 26:var l=t.type,_=t.memoizedState;return e===null?(Zs(t),_!==null?(Ct(t),gf(t,_)):(Ct(t),Oh(t,l,null,s,i))):_?_!==e.memoizedState?(Zs(t),Ct(t),gf(t,_)):(Ct(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Zs(t),Ct(t),Oh(t,l,e,s,i)),null;case 27:if(we(t),i=ge.current,l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Zs(t);else{if(!s){if(t.stateNode===null)throw Error(M(166));return Ct(t),null}e=te.current,wr(t)?xl(t):(e=x_(l,s,i),t.stateNode=e,Zs(t))}return Ct(t),null;case 5:if(we(t),l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Zs(t);else{if(!s){if(t.stateNode===null)throw Error(M(166));return Ct(t),null}if(_=te.current,wr(t))xl(t);else{var D=oc(ge.current);switch(_){case 1:_=D.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:_=D.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":_=D.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":_=D.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":_=D.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof s.is=="string"?D.createElement("select",{is:s.is}):D.createElement("select"),s.multiple?_.multiple=!0:s.size&&(_.size=s.size);break;default:_=typeof s.is=="string"?D.createElement(l,{is:s.is}):D.createElement(l)}}_[Nt]=t,_[Ke]=s;e:for(D=t.child;D!==null;){if(D.tag===5||D.tag===6)_.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===t)break e;for(;D.sibling===null;){if(D.return===null||D.return===t)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}t.stateNode=_;e:switch(Zt(_,l,s),l){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Zs(t)}}return Ct(t),Oh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Zs(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(M(166));if(e=ge.current,wr(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,l=Ft,l!==null)switch(l.tag){case 27:case 5:s=l.memoizedProps}e[Nt]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||f_(e.nodeValue,i)),e||ns(t,!0)}else e=oc(e).createTextNode(s),e[Nt]=t,t.stateNode=e}return Ct(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=wr(t),i!==null){if(e===null){if(!s)throw Error(M(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(M(557));e[Nt]=t}else Fs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ct(t),e=!1}else i=un(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(Hi(t),t):(Hi(t),null);if((t.flags&128)!==0)throw Error(M(558))}return Ct(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=wr(t),s!==null&&s.dehydrated!==null){if(e===null){if(!l)throw Error(M(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(M(317));l[Nt]=t}else Fs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ct(t),l=!1}else l=un(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)return t.flags&256?(Hi(t),t):(Hi(t),null)}return Hi(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,l=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(l=s.alternate.memoizedState.cachePool.pool),_=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(_=s.memoizedState.cachePool.pool),_!==l&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Gl(t,t.updateQueue),Ct(t),null);case 4:return ne(),e===null&&tu(t.stateNode.containerInfo),Ct(t),null;case 10:return os(t.type),Ct(t),null;case 19:if(F(Bt),s=t.memoizedState,s===null)return Ct(t),null;if(l=(t.flags&128)!==0,_=s.rendering,_===null)if(l)Eo(s,!1);else{if(Ot!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(_=Ol(e),_!==null){for(t.flags|=128,Eo(s,!1),e=_.updateQueue,t.updateQueue=e,Gl(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)zs(i,e),i=i.sibling;return ie(Bt,Bt.current&1|2),Ve&&rs(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Se()>Zl&&(t.flags|=128,l=!0,Eo(s,!1),t.lanes=4194304)}else{if(!l)if(e=Ol(_),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,Gl(t,e),Eo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!_.alternate&&!Ve)return Ct(t),null}else 2*Se()-s.renderingStartTime>Zl&&i!==536870912&&(t.flags|=128,l=!0,Eo(s,!1),t.lanes=4194304);s.isBackwards?(_.sibling=t.child,t.child=_):(e=s.last,e!==null?e.sibling=_:t.child=_,s.last=_)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Se(),e.sibling=null,i=Bt.current,ie(Bt,l?i&1|2:i&1),Ve&&rs(t,s.treeForkCount),e):(Ct(t),null);case 22:case 23:return Hi(t),ih(),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&&(Ct(t),t.subtreeFlags&6&&(t.flags|=8192)):Ct(t),i=t.updateQueue,i!==null&&Gl(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==i&&(t.flags|=2048),e!==null&&F(Ks),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),os(Ce),Ct(t),null;case 25:return null;case 30:return null}throw Error(M(156,t.tag))}function Pm(e,t){switch(ha(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return os(Ce),ne(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return we(t),null;case 31:if(t.memoizedState!==null){if(Hi(t),t.alternate===null)throw Error(M(340));Fs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Hi(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(M(340));Fs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return F(Bt),null;case 4:return ne(),null;case 10:return os(t.type),null;case 22:case 23:return Hi(t),ih(),e!==null&&F(Ks),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return os(Ce),null;case 25:return null;default:return null}}function vf(e,t){switch(ha(t),t.tag){case 3:os(Ce),ne();break;case 26:case 27:case 5:we(t);break;case 4:ne();break;case 31:t.memoizedState!==null&&Hi(t);break;case 13:Hi(t);break;case 19:F(Bt);break;case 10:os(t.type);break;case 22:case 23:Hi(t),ih(),e!==null&&F(Ks);break;case 24:os(Ce)}}function Ao(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var l=s.next;i=l;do{if((i.tag&e)===e){s=void 0;var _=i.create,D=i.inst;s=_(),D.destroy=s}i=i.next}while(i!==l)}}catch($){ht(t,t.return,$)}}function Dr(e,t,i){try{var s=t.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var _=l.next;s=_;do{if((s.tag&e)===e){var D=s.inst,$=D.destroy;if($!==void 0){D.destroy=void 0,l=t;var ee=i,le=$;try{le()}catch(pe){ht(l,ee,pe)}}}s=s.next}while(s!==_)}}catch(pe){ht(t,t.return,pe)}}function bf(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{ld(t,i)}catch(s){ht(e,e.return,s)}}}function Sf(e,t,i){i.props=bn(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){ht(e,t,s)}}function Ro(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(l){ht(e,t,l)}}function xs(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(l){ht(e,t,l)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(l){ht(e,t,l)}else i.current=null}function yf(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(l){ht(e,e.return,l)}}function Bh(e,t,i){try{var s=e.stateNode;cg(s,e.type,i,t),s[Ke]=t}catch(l){ht(e,e.return,l)}}function Cf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&zr(e.type)||e.tag===4}function jh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Cf(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&&zr(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 Nh(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=Ji));else if(s!==4&&(s===27&&zr(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Nh(e,t,i),e=e.sibling;e!==null;)Nh(e,t,i),e=e.sibling}function Kl(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&&zr(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Kl(e,t,i),e=e.sibling;e!==null;)Kl(e,t,i),e=e.sibling}function wf(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,l=t.attributes;l.length;)t.removeAttributeNode(l[0]);Zt(t,s,i),t[Nt]=e,t[Ke]=i}catch(_){ht(e,e.return,_)}}var Qs=!1,It=!1,Hh=!1,xf=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function $m(e,t){if(e=e.containerInfo,ru=_c,e=pl(e),to(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 l=s.anchorOffset,_=s.focusNode;s=s.focusOffset;try{i.nodeType,_.nodeType}catch{i=null;break e}var D=0,$=-1,ee=-1,le=0,pe=0,be=e,ce=null;t:for(;;){for(var fe;be!==i||l!==0&&be.nodeType!==3||($=D+l),be!==_||s!==0&&be.nodeType!==3||(ee=D+s),be.nodeType===3&&(D+=be.nodeValue.length),(fe=be.firstChild)!==null;)ce=be,be=fe;for(;;){if(be===e)break t;if(ce===i&&++le===l&&($=D),ce===_&&++pe===s&&(ee=D),(fe=be.nextSibling)!==null)break;be=ce,ce=be.parentNode}be=fe}i=$===-1||ee===-1?null:{start:$,end:ee}}else i=null}i=i||{start:0,end:0}}else i=null;for(nu={focusedElem:e,selectionRange:i},_c=!1,Kt=t;Kt!==null;)if(t=Kt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Kt=e;else for(;Kt!==null;){switch(t=Kt,_=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++)l=e[i],l.ref.impl=l.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&_!==null){e=void 0,i=t,l=_.memoizedProps,_=_.memoizedState,s=i.stateNode;try{var Le=bn(i.type,l);e=s.getSnapshotBeforeUpdate(Le,_),s.__reactInternalSnapshotBeforeUpdate=e}catch(He){ht(i,i.return,He)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)lu(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":lu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(M(163))}if(e=t.sibling,e!==null){e.return=t.return,Kt=e;break}Kt=t.return}}function Ef(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:er(e,i),s&4&&Ao(5,i);break;case 1:if(er(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(D){ht(i,i.return,D)}else{var l=bn(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(l,t,e.__reactInternalSnapshotBeforeUpdate)}catch(D){ht(i,i.return,D)}}s&64&&bf(i),s&512&&Ro(i,i.return);break;case 3:if(er(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{ld(e,t)}catch(D){ht(i,i.return,D)}}break;case 27:t===null&&s&4&&wf(i);case 26:case 5:er(e,i),t===null&&s&4&&yf(i),s&512&&Ro(i,i.return);break;case 12:er(e,i);break;case 31:er(e,i),s&4&&Lf(e,i);break;case 13:er(e,i),s&4&&Tf(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=Zm.bind(null,i),gg(e,i))));break;case 22:if(s=i.memoizedState!==null||Qs,!s){t=t!==null&&t.memoizedState!==null||It,l=Qs;var _=It;Qs=s,(It=t)&&!_?tr(e,i,(i.subtreeFlags&8772)!==0):er(e,i),Qs=l,It=_}break;case 30:break;default:er(e,i)}}function Af(e){var t=e.alternate;t!==null&&(e.alternate=null,Af(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Bn(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 xt=null,vi=!1;function Js(e,t,i){for(i=i.child;i!==null;)Rf(e,t,i),i=i.sibling}function Rf(e,t,i){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(wt,i)}catch{}switch(i.tag){case 26:It||xs(i,t),Js(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:It||xs(i,t);var s=xt,l=vi;zr(i.type)&&(xt=i.stateNode,vi=!1),Js(e,t,i),No(i.stateNode),xt=s,vi=l;break;case 5:It||xs(i,t);case 6:if(s=xt,l=vi,xt=null,Js(e,t,i),xt=s,vi=l,xt!==null)if(vi)try{(xt.nodeType===9?xt.body:xt.nodeName==="HTML"?xt.ownerDocument.body:xt).removeChild(i.stateNode)}catch(_){ht(i,t,_)}else try{xt.removeChild(i.stateNode)}catch(_){ht(i,t,_)}break;case 18:xt!==null&&(vi?(e=xt,b_(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),La(e)):b_(xt,i.stateNode));break;case 4:s=xt,l=vi,xt=i.stateNode.containerInfo,vi=!0,Js(e,t,i),xt=s,vi=l;break;case 0:case 11:case 14:case 15:Dr(2,i,t),It||Dr(4,i,t),Js(e,t,i);break;case 1:It||(xs(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:It=(s=It)||i.memoizedState!==null,Js(e,t,i),It=s;break;default:Js(e,t,i)}}function Lf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{La(e)}catch(i){ht(t,t.return,i)}}}function Tf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{La(e)}catch(i){ht(t,t.return,i)}}function Fm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new xf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new xf),t;default:throw Error(M(435,e.tag))}}function Vl(e,t){var i=Fm(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var l=Qm.bind(null,e,s);s.then(l,l)}})}function bi(e,t){var i=t.deletions;if(i!==null)for(var s=0;s<i.length;s++){var l=i[s],_=e,D=t,$=D;e:for(;$!==null;){switch($.tag){case 27:if(zr($.type)){xt=$.stateNode,vi=!1;break e}break;case 5:xt=$.stateNode,vi=!1;break e;case 3:case 4:xt=$.stateNode.containerInfo,vi=!0;break e}$=$.return}if(xt===null)throw Error(M(160));Rf(_,D,l),xt=null,vi=!1,_=l.alternate,_!==null&&(_.return=null),l.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Mf(t,e),t=t.sibling}var ls=null;function Mf(e,t){var i=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:bi(t,e),Si(e),s&4&&(Dr(3,e,e.return),Ao(3,e),Dr(5,e,e.return));break;case 1:bi(t,e),Si(e),s&512&&(It||i===null||xs(i,i.return)),s&64&&Qs&&(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 l=ls;if(bi(t,e),Si(e),s&512&&(It||i===null||xs(i,i.return)),s&4){var _=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,l=l.ownerDocument||l;t:switch(s){case"title":_=l.getElementsByTagName("title")[0],(!_||_[Zr]||_[Nt]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=l.createElement(s),l.head.insertBefore(_,l.querySelector("head > title"))),Zt(_,s,i),_[Nt]=e,St(_),s=_;break e;case"link":var D=M_("link","href",l).get(s+(i.href||""));if(D){for(var $=0;$<D.length;$++)if(_=D[$],_.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&_.getAttribute("rel")===(i.rel==null?null:i.rel)&&_.getAttribute("title")===(i.title==null?null:i.title)&&_.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){D.splice($,1);break t}}_=l.createElement(s),Zt(_,s,i),l.head.appendChild(_);break;case"meta":if(D=M_("meta","content",l).get(s+(i.content||""))){for($=0;$<D.length;$++)if(_=D[$],_.getAttribute("content")===(i.content==null?null:""+i.content)&&_.getAttribute("name")===(i.name==null?null:i.name)&&_.getAttribute("property")===(i.property==null?null:i.property)&&_.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&_.getAttribute("charset")===(i.charSet==null?null:i.charSet)){D.splice($,1);break t}}_=l.createElement(s),Zt(_,s,i),l.head.appendChild(_);break;default:throw Error(M(468,s))}_[Nt]=e,St(_),s=_}e.stateNode=s}else D_(l,e.type,e.stateNode);else e.stateNode=T_(l,s,e.memoizedProps);else _!==s?(_===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):_.count--,s===null?D_(l,e.type,e.stateNode):T_(l,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Bh(e,e.memoizedProps,i.memoizedProps)}break;case 27:bi(t,e),Si(e),s&512&&(It||i===null||xs(i,i.return)),i!==null&&s&4&&Bh(e,e.memoizedProps,i.memoizedProps);break;case 5:if(bi(t,e),Si(e),s&512&&(It||i===null||xs(i,i.return)),e.flags&32){l=e.stateNode;try{ks(l,"")}catch(Le){ht(e,e.return,Le)}}s&4&&e.stateNode!=null&&(l=e.memoizedProps,Bh(e,l,i!==null?i.memoizedProps:l)),s&1024&&(Hh=!0);break;case 6:if(bi(t,e),Si(e),s&4){if(e.stateNode===null)throw Error(M(162));s=e.memoizedProps,i=e.stateNode;try{i.nodeValue=s}catch(Le){ht(e,e.return,Le)}}break;case 3:if(hc=null,l=ls,ls=lc(t.containerInfo),bi(t,e),ls=l,Si(e),s&4&&i!==null&&i.memoizedState.isDehydrated)try{La(t.containerInfo)}catch(Le){ht(e,e.return,Le)}Hh&&(Hh=!1,Df(e));break;case 4:s=ls,ls=lc(e.stateNode.containerInfo),bi(t,e),Si(e),ls=s;break;case 12:bi(t,e),Si(e);break;case 31:bi(t,e),Si(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Vl(e,s)));break;case 13:bi(t,e),Si(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Xl=Se()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Vl(e,s)));break;case 22:l=e.memoizedState!==null;var ee=i!==null&&i.memoizedState!==null,le=Qs,pe=It;if(Qs=le||l,It=pe||ee,bi(t,e),It=pe,Qs=le,Si(e),s&8192)e:for(t=e.stateNode,t._visibility=l?t._visibility&-2:t._visibility|1,l&&(i===null||ee||Qs||It||Sn(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){ee=i=t;try{if(_=ee.stateNode,l)D=_.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{$=ee.stateNode;var be=ee.memoizedProps.style,ce=be!=null&&be.hasOwnProperty("display")?be.display:null;$.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(Le){ht(ee,ee.return,Le)}}}else if(t.tag===6){if(i===null){ee=t;try{ee.stateNode.nodeValue=l?"":ee.memoizedProps}catch(Le){ht(ee,ee.return,Le)}}}else if(t.tag===18){if(i===null){ee=t;try{var fe=ee.stateNode;l?S_(fe,!0):S_(ee.stateNode,!1)}catch(Le){ht(ee,ee.return,Le)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(i=s.retryQueue,i!==null&&(s.retryQueue=null,Vl(e,i))));break;case 19:bi(t,e),Si(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Vl(e,s)));break;case 30:break;case 21:break;default:bi(t,e),Si(e)}}function Si(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(Cf(s)){i=s;break}s=s.return}if(i==null)throw Error(M(160));switch(i.tag){case 27:var l=i.stateNode,_=jh(e);Kl(e,_,l);break;case 5:var D=i.stateNode;i.flags&32&&(ks(D,""),i.flags&=-33);var $=jh(e);Kl(e,$,D);break;case 3:case 4:var ee=i.stateNode.containerInfo,le=jh(e);Nh(e,le,ee);break;default:throw Error(M(161))}}catch(pe){ht(e,e.return,pe)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Df(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Df(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function er(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Ef(e,t.alternate,t),t=t.sibling}function Sn(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Dr(4,t,t.return),Sn(t);break;case 1:xs(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&Sf(t,t.return,i),Sn(t);break;case 27:No(t.stateNode);case 26:case 5:xs(t,t.return),Sn(t);break;case 22:t.memoizedState===null&&Sn(t);break;case 30:Sn(t);break;default:Sn(t)}e=e.sibling}}function tr(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,l=e,_=t,D=_.flags;switch(_.tag){case 0:case 11:case 15:tr(l,_,i),Ao(4,_);break;case 1:if(tr(l,_,i),s=_,l=s.stateNode,typeof l.componentDidMount=="function")try{l.componentDidMount()}catch(le){ht(s,s.return,le)}if(s=_,l=s.updateQueue,l!==null){var $=s.stateNode;try{var ee=l.shared.hiddenCallbacks;if(ee!==null)for(l.shared.hiddenCallbacks=null,l=0;l<ee.length;l++)od(ee[l],$)}catch(le){ht(s,s.return,le)}}i&&D&64&&bf(_),Ro(_,_.return);break;case 27:wf(_);case 26:case 5:tr(l,_,i),i&&s===null&&D&4&&yf(_),Ro(_,_.return);break;case 12:tr(l,_,i);break;case 31:tr(l,_,i),i&&D&4&&Lf(l,_);break;case 13:tr(l,_,i),i&&D&4&&Tf(l,_);break;case 22:_.memoizedState===null&&tr(l,_,i),Ro(_,_.return);break;case 30:break;default:tr(l,_,i)}t=t.sibling}}function zh(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&&Ze(i))}function Uh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ze(e))}function cs(e,t,i,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)kf(e,t,i,s),t=t.sibling}function kf(e,t,i,s){var l=t.flags;switch(t.tag){case 0:case 11:case 15:cs(e,t,i,s),l&2048&&Ao(9,t);break;case 1:cs(e,t,i,s);break;case 3:cs(e,t,i,s),l&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ze(e)));break;case 12:if(l&2048){cs(e,t,i,s),e=t.stateNode;try{var _=t.memoizedProps,D=_.id,$=_.onPostCommit;typeof $=="function"&&$(D,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(ee){ht(t,t.return,ee)}}else cs(e,t,i,s);break;case 31:cs(e,t,i,s);break;case 13:cs(e,t,i,s);break;case 23:break;case 22:_=t.stateNode,D=t.alternate,t.memoizedState!==null?_._visibility&2?cs(e,t,i,s):Lo(e,t):_._visibility&2?cs(e,t,i,s):(_._visibility|=2,ga(e,t,i,s,(t.subtreeFlags&10256)!==0||!1)),l&2048&&zh(D,t);break;case 24:cs(e,t,i,s),l&2048&&Uh(t.alternate,t);break;default:cs(e,t,i,s)}}function ga(e,t,i,s,l){for(l=l&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var _=e,D=t,$=i,ee=s,le=D.flags;switch(D.tag){case 0:case 11:case 15:ga(_,D,$,ee,l),Ao(8,D);break;case 23:break;case 22:var pe=D.stateNode;D.memoizedState!==null?pe._visibility&2?ga(_,D,$,ee,l):Lo(_,D):(pe._visibility|=2,ga(_,D,$,ee,l)),l&&le&2048&&zh(D.alternate,D);break;case 24:ga(_,D,$,ee,l),l&&le&2048&&Uh(D.alternate,D);break;default:ga(_,D,$,ee,l)}t=t.sibling}}function Lo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,l=s.flags;switch(s.tag){case 22:Lo(i,s),l&2048&&zh(s.alternate,s);break;case 24:Lo(i,s),l&2048&&Uh(s.alternate,s);break;default:Lo(i,s)}t=t.sibling}}var To=8192;function va(e,t,i){if(e.subtreeFlags&To)for(e=e.child;e!==null;)Of(e,t,i),e=e.sibling}function Of(e,t,i){switch(e.tag){case 26:va(e,t,i),e.flags&To&&e.memoizedState!==null&&Tg(i,ls,e.memoizedState,e.memoizedProps);break;case 5:va(e,t,i);break;case 3:case 4:var s=ls;ls=lc(e.stateNode.containerInfo),va(e,t,i),ls=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=To,To=16777216,va(e,t,i),To=s):va(e,t,i));break;default:va(e,t,i)}}function Bf(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 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];Kt=s,Nf(s,e)}Bf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)jf(e),e=e.sibling}function jf(e){switch(e.tag){case 0:case 11:case 15:Mo(e),e.flags&2048&&Dr(9,e,e.return);break;case 3:Mo(e);break;case 12:Mo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Yl(e)):Mo(e);break;default:Mo(e)}}function Yl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];Kt=s,Nf(s,e)}Bf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Dr(8,t,t.return),Yl(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Yl(t));break;default:Yl(t)}e=e.sibling}}function Nf(e,t){for(;Kt!==null;){var i=Kt;switch(i.tag){case 0:case 11:case 15:Dr(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var s=i.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Ze(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,Kt=s;else e:for(i=e;Kt!==null;){s=Kt;var l=s.sibling,_=s.return;if(Af(s),s===i){Kt=null;break e}if(l!==null){l.return=_,Kt=l;break e}Kt=_}}}var Wm={getCacheForType:function(e){var t=g(Ce),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return g(Ce).controller.signal}},qm=typeof WeakMap=="function"?WeakMap:Map,nt=0,vt=null,Ye=null,Qe=0,ct=0,zi=null,kr=!1,ba=!1,Ih=!1,ir=0,Ot=0,Or=0,yn=0,Ph=0,Ui=0,Sa=0,Do=null,yi=null,$h=!1,Xl=0,Hf=0,Zl=1/0,Ql=null,Br=null,Wt=0,jr=null,ya=null,sr=0,Fh=0,Wh=null,zf=null,ko=0,qh=null;function Ii(){return(nt&2)!==0&&Qe!==0?Qe&-Qe:V.T!==null?Zh():Ba()}function Uf(){if(Ui===0)if((Qe&536870912)===0||Ve){var e=Fi;Fi<<=1,(Fi&3932160)===0&&(Fi=262144),Ui=e}else Ui=536870912;return e=Ni.current,e!==null&&(e.flags|=32),Ui}function Ci(e,t,i){(e===vt&&(ct===2||ct===9)||e.cancelPendingCommit!==null)&&(Ca(e,0),Nr(e,Qe,Ui,!1)),ar(e,i),((nt&2)===0||e!==vt)&&(e===vt&&((nt&2)===0&&(yn|=i),Ot===4&&Nr(e,Qe,Ui,!1)),Es(e))}function If(e,t,i){if((nt&6)!==0)throw Error(M(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||nr(e,t),l=s?Vm(e,t):Kh(e,t,!0),_=s;do{if(l===0){ba&&!s&&Nr(e,t,0,!1);break}else{if(i=e.current.alternate,_&&!Gm(i)){l=Kh(e,t,!1),_=!1;continue}if(l===2){if(_=t,e.errorRecoveryDisabledLanes&_)var D=0;else D=e.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){t=D;e:{var $=e;l=Do;var ee=$.current.memoizedState.isDehydrated;if(ee&&(Ca($,D).flags|=256),D=Kh($,D,!1),D!==2){if(Ih&&!ee){$.errorRecoveryDisabledLanes|=_,yn|=_,l=4;break e}_=yi,yi=l,_!==null&&(yi===null?yi=_:yi.push.apply(yi,_))}l=D}if(_=!1,l!==2)continue}}if(l===1){Ca(e,0),Nr(e,t,0,!0);break}e:{switch(s=e,_=l,_){case 0:case 1:throw Error(M(345));case 4:if((t&4194048)!==t)break;case 6:Nr(s,t,Ui,!kr);break e;case 2:yi=null;break;case 3:case 5:break;default:throw Error(M(329))}if((t&62914560)===t&&(l=Xl+300-Se(),10<l)){if(Nr(s,t,Ui,!kr),ds(s,0,!0)!==0)break e;sr=t,s.timeoutHandle=g_(Pf.bind(null,s,i,yi,Ql,$h,t,Ui,yn,Sa,kr,_,"Throttled",-0,0),l);break e}Pf(s,i,yi,Ql,$h,t,Ui,yn,Sa,kr,_,null,-0,0)}}break}while(!0);Es(e)}function Pf(e,t,i,s,l,_,D,$,ee,le,pe,be,ce,fe){if(e.timeoutHandle=-1,be=t.subtreeFlags,be&8192||(be&16785408)===16785408){be={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ji},Of(t,_,be);var Le=(_&62914560)===_?Xl-Se():(_&4194048)===_?Hf-Se():0;if(Le=Mg(be,Le),Le!==null){sr=_,e.cancelPendingCommit=Le(Yf.bind(null,e,t,_,i,s,l,D,$,ee,pe,be,null,ce,fe)),Nr(e,_,D,!le);return}}Yf(e,t,_,i,s,l,D,$,ee)}function Gm(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 l=i[s],_=l.getSnapshot;l=l.value;try{if(!Jt(_(),l))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 Nr(e,t,i,s){t&=~Ph,t&=~yn,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var l=t;0<l;){var _=31-mt(l),D=1<<_;s[_]=-1,l&=~D}i!==0&&ka(e,i,t)}function Jl(){return(nt&6)===0?(Oo(0),!1):!0}function Gh(){if(Ye!==null){if(ct===0)var e=Ye.return;else e=Ye,as=Ws=null,lh(e),da=null,po=0,e=Ye;for(;e!==null;)vf(e.alternate,e),e=e.return;Ye=null}}function Ca(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,dg(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),sr=0,Gh(),vt=e,Ye=i=qi(e.current,null),Qe=t,ct=0,zi=null,kr=!1,ba=nr(e,t),Ih=!1,Sa=Ui=Ph=yn=Or=Ot=0,yi=Do=null,$h=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var l=31-mt(s),_=1<<l;t|=e[l],s&=~_}return ir=t,ra(),i}function $f(e,t){qe=null,V.H=wo,t===ws||t===Ll?(t=sd(),ct=3):t===Er?(t=sd(),ct=4):ct=t===xh?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,zi=t,Ye===null&&(Ot=1,$l(e,Ht(t,e.current)))}function Ff(){var e=Ni.current;return e===null?!0:(Qe&4194048)===Qe?Vi===null:(Qe&62914560)===Qe||(Qe&536870912)!==0?e===Vi:!1}function Wf(){var e=V.H;return V.H=wo,e===null?wo:e}function qf(){var e=V.A;return V.A=Wm,e}function ec(){Ot=4,kr||(Qe&4194048)!==Qe&&Ni.current!==null||(ba=!0),(Or&134217727)===0&&(yn&134217727)===0||vt===null||Nr(vt,Qe,Ui,!1)}function Kh(e,t,i){var s=nt;nt|=2;var l=Wf(),_=qf();(vt!==e||Qe!==t)&&(Ql=null,Ca(e,t)),t=!1;var D=Ot;e:do try{if(ct!==0&&Ye!==null){var $=Ye,ee=zi;switch(ct){case 8:Gh(),D=6;break e;case 3:case 2:case 9:case 6:Ni.current===null&&(t=!0);var le=ct;if(ct=0,zi=null,wa(e,$,ee,le),i&&ba){D=0;break e}break;default:le=ct,ct=0,zi=null,wa(e,$,ee,le)}}Km(),D=Ot;break}catch(pe){$f(e,pe)}while(!0);return t&&e.shellSuspendCounter++,as=Ws=null,nt=s,V.H=l,V.A=_,Ye===null&&(vt=null,Qe=0,ra()),D}function Km(){for(;Ye!==null;)Gf(Ye)}function Vm(e,t){var i=nt;nt|=2;var s=Wf(),l=qf();vt!==e||Qe!==t?(Ql=null,Zl=Se()+500,Ca(e,t)):ba=nr(e,t);e:do try{if(ct!==0&&Ye!==null){t=Ye;var _=zi;t:switch(ct){case 1:ct=0,zi=null,wa(e,t,_,1);break;case 2:case 9:if(td(_)){ct=0,zi=null,Kf(t);break}t=function(){ct!==2&&ct!==9||vt!==e||(ct=7),Es(e)},_.then(t,t);break e;case 3:ct=7;break e;case 4:ct=5;break e;case 7:td(_)?(ct=0,zi=null,Kf(t)):(ct=0,zi=null,wa(e,t,_,7));break;case 5:var D=null;switch(Ye.tag){case 26:D=Ye.memoizedState;case 5:case 27:var $=Ye;if(D?k_(D):$.stateNode.complete){ct=0,zi=null;var ee=$.sibling;if(ee!==null)Ye=ee;else{var le=$.return;le!==null?(Ye=le,tc(le)):Ye=null}break t}}ct=0,zi=null,wa(e,t,_,5);break;case 6:ct=0,zi=null,wa(e,t,_,6);break;case 8:Gh(),Ot=6;break e;default:throw Error(M(462))}}Ym();break}catch(pe){$f(e,pe)}while(!0);return as=Ws=null,V.H=s,V.A=l,nt=i,Ye!==null?0:(vt=null,Qe=0,ra(),Ot)}function Ym(){for(;Ye!==null&&!he();)Gf(Ye)}function Gf(e){var t=mf(e.alternate,e,ir);e.memoizedProps=e.pendingProps,t===null?tc(e):Ye=t}function Kf(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=hf(i,t,t.pendingProps,t.type,void 0,Qe);break;case 11:t=hf(i,t,t.pendingProps,t.type.render,t.ref,Qe);break;case 5:lh(t);default:vf(i,t),t=Ye=zs(t,ir),t=mf(i,t,ir)}e.memoizedProps=e.pendingProps,t===null?tc(e):Ye=t}function wa(e,t,i,s){as=Ws=null,lh(t),da=null,po=0;var l=t.return;try{if(Hm(e,l,t,i,Qe)){Ot=1,$l(e,Ht(i,e.current)),Ye=null;return}}catch(_){if(l!==null)throw Ye=l,_;Ot=1,$l(e,Ht(i,e.current)),Ye=null;return}t.flags&32768?(Ve||s===1?e=!0:ba||(Qe&536870912)!==0?e=!1:(kr=e=!0,(s===2||s===9||s===3||s===6)&&(s=Ni.current,s!==null&&s.tag===13&&(s.flags|=16384))),Vf(t,e)):tc(t)}function tc(e){var t=e;do{if((t.flags&32768)!==0){Vf(t,kr);return}e=t.return;var i=Im(t.alternate,t,ir);if(i!==null){Ye=i;return}if(t=t.sibling,t!==null){Ye=t;return}Ye=t=e}while(t!==null);Ot===0&&(Ot=5)}function Vf(e,t){do{var i=Pm(e.alternate,e);if(i!==null){i.flags&=32767,Ye=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Ye=e;return}Ye=e=i}while(e!==null);Ot=6,Ye=null}function Yf(e,t,i,s,l,_,D,$,ee){e.cancelPendingCommit=null;do ic();while(Wt!==0);if((nt&6)!==0)throw Error(M(327));if(t!==null){if(t===e.current)throw Error(M(177));if(_=t.lanes|t.childLanes,_|=ao,Nc(e,i,_,D,$,ee),e===vt&&(Ye=vt=null,Qe=0),ya=t,jr=e,sr=i,Fh=_,Wh=l,zf=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Jm(ut,function(){return e_(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=V.T,V.T=null,l=X.p,X.p=2,D=nt,nt|=4;try{$m(e,t,i)}finally{nt=D,X.p=l,V.T=s}}Wt=1,Xf(),Zf(),Qf()}}function Xf(){if(Wt===1){Wt=0;var e=jr,t=ya,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=V.T,V.T=null;var s=X.p;X.p=2;var l=nt;nt|=4;try{Mf(t,e);var _=nu,D=pl(e.containerInfo),$=_.focusedElem,ee=_.selectionRange;if(D!==$&&$&&$.ownerDocument&&_l($.ownerDocument.documentElement,$)){if(ee!==null&&to($)){var le=ee.start,pe=ee.end;if(pe===void 0&&(pe=le),"selectionStart"in $)$.selectionStart=le,$.selectionEnd=Math.min(pe,$.value.length);else{var be=$.ownerDocument||document,ce=be&&be.defaultView||window;if(ce.getSelection){var fe=ce.getSelection(),Le=$.textContent.length,He=Math.min(ee.start,Le),pt=ee.end===void 0?He:Math.min(ee.end,Le);!fe.extend&&He>pt&&(D=pt,pt=He,He=D);var ae=fl($,He),se=fl($,pt);if(ae&&se&&(fe.rangeCount!==1||fe.anchorNode!==ae.node||fe.anchorOffset!==ae.offset||fe.focusNode!==se.node||fe.focusOffset!==se.offset)){var oe=be.createRange();oe.setStart(ae.node,ae.offset),fe.removeAllRanges(),He>pt?(fe.addRange(oe),fe.extend(se.node,se.offset)):(oe.setEnd(se.node,se.offset),fe.addRange(oe))}}}}for(be=[],fe=$;fe=fe.parentNode;)fe.nodeType===1&&be.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof $.focus=="function"&&$.focus(),$=0;$<be.length;$++){var ve=be[$];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}_c=!!ru,nu=ru=null}finally{nt=l,X.p=s,V.T=i}}e.current=t,Wt=2}}function Zf(){if(Wt===2){Wt=0;var e=jr,t=ya,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=V.T,V.T=null;var s=X.p;X.p=2;var l=nt;nt|=4;try{Ef(e,t.alternate,t)}finally{nt=l,X.p=s,V.T=i}}Wt=3}}function Qf(){if(Wt===4||Wt===3){Wt=0,ue();var e=jr,t=ya,i=sr,s=zf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Wt=5:(Wt=0,ya=jr=null,Jf(e,e.pendingLanes));var l=e.pendingLanes;if(l===0&&(Br=null),or(i),t=t.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(wt,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=V.T,l=X.p,X.p=2,V.T=null;try{for(var _=e.onRecoverableError,D=0;D<s.length;D++){var $=s[D];_($.value,{componentStack:$.stack})}}finally{V.T=t,X.p=l}}(sr&3)!==0&&ic(),Es(e),l=e.pendingLanes,(i&261930)!==0&&(l&42)!==0?e===qh?ko++:(ko=0,qh=e):ko=0,Oo(0)}}function Jf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ze(t)))}function ic(){return Xf(),Zf(),Qf(),e_()}function e_(){if(Wt!==5)return!1;var e=jr,t=Fh;Fh=0;var i=or(sr),s=V.T,l=X.p;try{X.p=32>i?32:i,V.T=null,i=Wh,Wh=null;var _=jr,D=sr;if(Wt=0,ya=jr=null,sr=0,(nt&6)!==0)throw Error(M(331));var $=nt;if(nt|=4,jf(_.current),kf(_,_.current,D,i),nt=$,Oo(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(wt,_)}catch{}return!0}finally{X.p=l,V.T=s,Jf(e,t)}}function t_(e,t,i){t=Ht(i,t),t=wh(e.stateNode,t,2),e=Lr(e,t,2),e!==null&&(ar(e,2),Es(e))}function ht(e,t,i){if(e.tag===3)t_(e,e,i);else for(;t!==null;){if(t.tag===3){t_(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Br===null||!Br.has(s))){e=Ht(i,e),i=tf(2),s=Lr(t,i,2),s!==null&&(sf(i,s,t,e),ar(s,2),Es(s));break}}t=t.return}}function Vh(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new qm;var l=new Set;s.set(t,l)}else l=s.get(t),l===void 0&&(l=new Set,s.set(t,l));l.has(i)||(Ih=!0,l.add(i),e=Xm.bind(null,e,t,i),t.then(e,e))}function Xm(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,vt===e&&(Qe&i)===i&&(Ot===4||Ot===3&&(Qe&62914560)===Qe&&300>Se()-Xl?(nt&2)===0&&Ca(e,0):Ph|=i,Sa===Qe&&(Sa=0)),Es(e)}function i_(e,t){t===0&&(t=Rs()),e=Hs(e,t),e!==null&&(ar(e,t),Es(e))}function Zm(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),i_(e,i)}function Qm(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,l=e.memoizedState;l!==null&&(i=l.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(M(314))}s!==null&&s.delete(t),i_(e,i)}function Jm(e,t){return $e(e,t)}var sc=null,xa=null,Yh=!1,rc=!1,Xh=!1,Hr=0;function Es(e){e!==xa&&e.next===null&&(xa===null?sc=xa=e:xa=xa.next=e),rc=!0,Yh||(Yh=!0,tg())}function Oo(e,t){if(!Xh&&rc){Xh=!0;do for(var i=!1,s=sc;s!==null;){if(e!==0){var l=s.pendingLanes;if(l===0)var _=0;else{var D=s.suspendedLanes,$=s.pingedLanes;_=(1<<31-mt(42|e)+1)-1,_&=l&~(D&~$),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(i=!0,a_(s,_))}else _=Qe,_=ds(s,s===vt?_:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(_&3)===0||nr(s,_)||(i=!0,a_(s,_));s=s.next}while(i);Xh=!1}}function eg(){s_()}function s_(){rc=Yh=!1;var e=0;Hr!==0&&ug()&&(e=Hr);for(var t=Se(),i=null,s=sc;s!==null;){var l=s.next,_=r_(s,t);_===0?(s.next=null,i===null?sc=l:i.next=l,l===null&&(xa=i)):(i=s,(e!==0||(_&3)!==0)&&(rc=!0)),s=l}Wt!==0&&Wt!==5||Oo(e),Hr!==0&&(Hr=0)}function r_(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,l=e.expirationTimes,_=e.pendingLanes&-62914561;0<_;){var D=31-mt(_),$=1<<D,ee=l[D];ee===-1?(($&i)===0||($&s)!==0)&&(l[D]=Yo($,t)):ee<=t&&(e.expiredLanes|=$),_&=~$}if(t=vt,i=Qe,i=ds(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(ct===2||ct===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Pe(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||nr(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&Pe(s),or(i)){case 2:case 8:i=at;break;case 32:i=ut;break;case 268435456:i=Oe;break;default:i=ut}return s=n_.bind(null,e),i=$e(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&Pe(s),e.callbackPriority=2,e.callbackNode=null,2}function n_(e,t){if(Wt!==0&&Wt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(ic()&&e.callbackNode!==i)return null;var s=Qe;return s=ds(e,e===vt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(If(e,s,t),r_(e,Se()),e.callbackNode!=null&&e.callbackNode===i?n_.bind(null,e):null)}function a_(e,t){if(ic())return null;If(e,t,!0)}function tg(){fg(function(){(nt&6)!==0?$e(je,eg):s_()})}function Zh(){if(Hr===0){var e=Rt;e===0&&(e=$t,$t<<=1,($t&261888)===0&&($t=256)),Hr=e}return Hr}function o_(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Os(""+e)}function l_(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 ig(e,t,i,s,l){if(t==="submit"&&i&&i.stateNode===l){var _=o_((l[Ke]||null).action),D=s.submitter;D&&(t=(t=D[Ke]||null)?o_(t.formAction):D.getAttribute("formAction"),t!==null&&(_=t,D=null));var $=new Fn("action","action",null,s,l);e.push({event:$,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Hr!==0){var ee=D?l_(l,D):new FormData(l);gh(i,{pending:!0,data:ee,method:l.method,action:_},null,ee)}}else typeof _=="function"&&($.preventDefault(),ee=D?l_(l,D):new FormData(l),gh(i,{pending:!0,data:ee,method:l.method,action:_},_,ee))},currentTarget:l}]})}}for(var Qh=0;Qh<sa.length;Qh++){var Jh=sa[Qh],sg=Jh.toLowerCase(),rg=Jh[0].toUpperCase()+Jh.slice(1);Oi(sg,"on"+rg)}Oi(gl,"onAnimationEnd"),Oi(vl,"onAnimationIteration"),Oi(bl,"onAnimationStart"),Oi("dblclick","onDoubleClick"),Oi("focusin","onFocus"),Oi("focusout","onBlur"),Oi(no,"onTransitionRun"),Oi(Ns,"onTransitionStart"),Oi(Xc,"onTransitionCancel"),Oi(ta,"onTransitionEnd"),Ri("onMouseEnter",["mouseout","mouseover"]),Ri("onMouseLeave",["mouseout","mouseover"]),Ri("onPointerEnter",["pointerout","pointerover"]),Ri("onPointerLeave",["pointerout","pointerover"]),Ai("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ai("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ai("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ai("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ai("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ai("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bo="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(" "),ng=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Bo));function c_(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],l=s.event;s=s.listeners;e:{var _=void 0;if(t)for(var D=s.length-1;0<=D;D--){var $=s[D],ee=$.instance,le=$.currentTarget;if($=$.listener,ee!==_&&l.isPropagationStopped())break e;_=$,l.currentTarget=le;try{_(l)}catch(pe){cn(pe)}l.currentTarget=null,_=ee}else for(D=0;D<s.length;D++){if($=s[D],ee=$.instance,le=$.currentTarget,$=$.listener,ee!==_&&l.isPropagationStopped())break e;_=$,l.currentTarget=le;try{_(l)}catch(pe){cn(pe)}l.currentTarget=null,_=ee}}}}function Xe(e,t){var i=t[ja];i===void 0&&(i=t[ja]=new Set);var s=e+"__bubble";i.has(s)||(h_(t,e,2,!1),i.add(s))}function eu(e,t,i){var s=0;t&&(s|=4),h_(i,e,s,t)}var nc="_reactListening"+Math.random().toString(36).slice(2);function tu(e){if(!e[nc]){e[nc]=!0,jn.forEach(function(i){i!=="selectionchange"&&(ng.has(i)||eu(i,!1,e),eu(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[nc]||(t[nc]=!0,eu("selectionchange",!1,t))}}function h_(e,t,i,s){switch(U_(t)){case 2:var l=Og;break;case 8:l=Bg;break;default:l=mu}i=l.bind(null,t,i,e),l=void 0,!Pn||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),s?l!==void 0?e.addEventListener(t,i,{capture:!0,passive:l}):e.addEventListener(t,i,!0):l!==void 0?e.addEventListener(t,i,{passive:l}):e.addEventListener(t,i,!1)}function iu(e,t,i,s,l){var _=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var D=s.tag;if(D===3||D===4){var $=s.stateNode.containerInfo;if($===l)break;if(D===4)for(D=s.return;D!==null;){var ee=D.tag;if((ee===3||ee===4)&&D.stateNode.containerInfo===l)return;D=D.return}for(;$!==null;){if(D=Vt($),D===null)return;if(ee=D.tag,ee===5||ee===6||ee===26||ee===27){s=_=D;continue e}$=$.parentNode}}s=s.return}fr(function(){var le=_,pe=Ua(i),be=[];e:{var ce=ia.get(e);if(ce!==void 0){var fe=Fn,Le=e;switch(e){case"keypress":if(tn(i)===0)break e;case"keydown":case"keyup":fe=tl;break;case"focusin":Le="focus",fe=di;break;case"focusout":Le="blur",fe=di;break;case"beforeblur":case"afterblur":fe=di;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":fe=Di;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=Pc;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=Vn;break;case gl:case vl:case bl:fe=fi;break;case ta:fe=qa;break;case"scroll":case"scrollend":fe=Ic;break;case"wheel":fe=Ga;break;case"copy":case"cut":case"paste":fe=rt;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=Kn;break;case"toggle":case"beforetoggle":fe=Fc}var He=(t&4)!==0,pt=!He&&(e==="scroll"||e==="scrollend"),ae=He?ce!==null?ce+"Capture":null:ce;He=[];for(var se=le,oe;se!==null;){var ve=se;if(oe=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||oe===null||ae===null||(ve=_r(se,ae),ve!=null&&He.push(jo(se,ve,oe))),pt)break;se=se.return}0<He.length&&(ce=new fe(ce,Le,null,i,pe),be.push({event:ce,listeners:He}))}}if((t&7)===0){e:{if(ce=e==="mouseover"||e==="pointerover",fe=e==="mouseout"||e==="pointerout",ce&&i!==ur&&(Le=i.relatedTarget||i.fromElement)&&(Vt(Le)||Le[Dt]))break e;if((fe||ce)&&(ce=pe.window===pe?pe:(ce=pe.ownerDocument)?ce.defaultView||ce.parentWindow:window,fe?(Le=i.relatedTarget||i.toElement,fe=le,Le=Le?Vt(Le):null,Le!==null&&(pt=K(Le),He=Le.tag,Le!==pt||He!==5&&He!==27&&He!==6)&&(Le=null)):(fe=null,Le=le),fe!==Le)){if(He=Di,ve="onMouseLeave",ae="onMouseEnter",se="mouse",(e==="pointerout"||e==="pointerover")&&(He=Kn,ve="onPointerLeave",ae="onPointerEnter",se="pointer"),pt=fe==null?ce:ci(fe),oe=Le==null?ce:ci(Le),ce=new He(ve,se+"leave",fe,i,pe),ce.target=pt,ce.relatedTarget=oe,ve=null,Vt(pe)===le&&(He=new He(ae,se+"enter",Le,i,pe),He.target=oe,He.relatedTarget=pt,ve=He),pt=ve,fe&&Le)t:{for(He=ag,ae=fe,se=Le,oe=0,ve=ae;ve;ve=He(ve))oe++;ve=0;for(var Be=se;Be;Be=He(Be))ve++;for(;0<oe-ve;)ae=He(ae),oe--;for(;0<ve-oe;)se=He(se),ve--;for(;oe--;){if(ae===se||se!==null&&ae===se.alternate){He=ae;break t}ae=He(ae),se=He(se)}He=null}else He=null;fe!==null&&u_(be,ce,fe,He,!1),Le!==null&&pt!==null&&u_(be,pt,Le,He,!0)}}e:{if(ce=le?ci(le):window,fe=ce.nodeName&&ce.nodeName.toLowerCase(),fe==="select"||fe==="input"&&ce.type==="file")var tt=Xn;else if(Xa(ce))if(cl)tt=Yc;else{tt=Kc;var Me=Ja}else fe=ce.nodeName,!fe||fe.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?le&&Un(le.elementType)&&(tt=Xn):tt=Vc;if(tt&&(tt=tt(e,le))){Za(be,tt,i,pe);break e}Me&&Me(e,ce,le),e==="focusout"&&le&&ce.type==="number"&&le.memoizedProps.value!=null&&Jr(ce,"number",ce.value)}switch(Me=le?ci(le):window,e){case"focusin":(Xa(Me)||Me.contentEditable==="true")&&(vs=Me,Jn=le,ln=null);break;case"focusout":ln=Jn=vs=null;break;case"mousedown":io=!0;break;case"contextmenu":case"mouseup":case"dragend":io=!1,so(be,i,pe);break;case"selectionchange":if(ml)break;case"keydown":case"keyup":so(be,i,pe)}var Ge;if(Ka)e:{switch(e){case"compositionstart":var Je="onCompositionStart";break e;case"compositionend":Je="onCompositionEnd";break e;case"compositionupdate":Je="onCompositionUpdate";break e}Je=void 0}else br?Va(e,i)&&(Je="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Je="onCompositionStart");Je&&(nl&&i.locale!=="ko"&&(br||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&br&&(Ge=Pa()):(ts=pe,mr="value"in ts?ts.value:ts.textContent,br=!0)),Me=ac(le,Je),0<Me.length&&(Je=new ms(Je,e,null,i,pe),be.push({event:Je,listeners:Me}),Ge?Je.data=Ge:(Ge=ll(i),Ge!==null&&(Je.data=Ge)))),(Ge=Wc?qc(e,i):Ya(e,i))&&(Je=ac(le,"onBeforeInput"),0<Je.length&&(Me=new ms("onBeforeInput","beforeinput",null,i,pe),be.push({event:Me,listeners:Je}),Me.data=Ge)),ig(be,e,le,i,pe)}c_(be,t)})}function jo(e,t,i){return{instance:e,listener:t,currentTarget:i}}function ac(e,t){for(var i=t+"Capture",s=[];e!==null;){var l=e,_=l.stateNode;if(l=l.tag,l!==5&&l!==26&&l!==27||_===null||(l=_r(e,i),l!=null&&s.unshift(jo(e,l,_)),l=_r(e,t),l!=null&&s.push(jo(e,l,_))),e.tag===3)return s;e=e.return}return[]}function ag(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function u_(e,t,i,s,l){for(var _=t._reactName,D=[];i!==null&&i!==s;){var $=i,ee=$.alternate,le=$.stateNode;if($=$.tag,ee!==null&&ee===s)break;$!==5&&$!==26&&$!==27||le===null||(ee=le,l?(le=_r(i,_),le!=null&&D.unshift(jo(i,le,ee))):l||(le=_r(i,_),le!=null&&D.push(jo(i,le,ee)))),i=i.return}D.length!==0&&e.push({event:t,listeners:D})}var og=/\r\n?/g,lg=/\u0000|\uFFFD/g;function d_(e){return(typeof e=="string"?e:""+e).replace(og,`
|
|
9
|
+
`).replace(lg,"")}function f_(e,t){return t=d_(t),d_(e)===t}function _t(e,t,i,s,l,_){switch(i){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||ks(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&ks(e,""+s);break;case"className":Ms(e,"class",s);break;case"tabIndex":Ms(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Ms(e,i,s);break;case"style":zc(e,s,_);break;case"data":if(t!=="object"){Ms(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=Os(""+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 _=="function"&&(i==="formAction"?(t!=="input"&&_t(e,t,"name",l.name,l,null),_t(e,t,"formEncType",l.formEncType,l,null),_t(e,t,"formMethod",l.formMethod,l,null),_t(e,t,"formTarget",l.formTarget,l,null)):(_t(e,t,"encType",l.encType,l,null),_t(e,t,"method",l.method,l,null),_t(e,t,"target",l.target,l,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=Os(""+s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=Ji);break;case"onScroll":s!=null&&Xe("scroll",e);break;case"onScrollEnd":s!=null&&Xe("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(M(61));if(i=s.__html,i!=null){if(l.children!=null)throw Error(M(60));e.innerHTML=i}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}i=Os(""+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":Xe("beforetoggle",e),Xe("toggle",e),Li(e,"popover",s);break;case"xlinkActuate":hi(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":hi(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":hi(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":hi(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":hi(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":hi(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":hi(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":hi(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":hi(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Li(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=za.get(i)||i,Li(e,i,s))}}function su(e,t,i,s,l,_){switch(i){case"style":zc(e,s,_);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(M(61));if(i=s.__html,i!=null){if(l.children!=null)throw Error(M(60));e.innerHTML=i}}break;case"children":typeof s=="string"?ks(e,s):(typeof s=="number"||typeof s=="bigint")&&ks(e,""+s);break;case"onScroll":s!=null&&Xe("scroll",e);break;case"onScrollEnd":s!=null&&Xe("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Ji);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!fs.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(l=i.endsWith("Capture"),t=i.slice(2,l?i.length-7:void 0),_=e[Ke]||null,_=_!=null?_[i]:null,typeof _=="function"&&e.removeEventListener(t,_,l),typeof s=="function")){typeof _!="function"&&_!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,s,l);break e}i in e?e[i]=s:s===!0?e.setAttribute(i,""):Li(e,i,s)}}}function Zt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Xe("error",e),Xe("load",e);var s=!1,l=!1,_;for(_ in i)if(i.hasOwnProperty(_)){var D=i[_];if(D!=null)switch(_){case"src":s=!0;break;case"srcSet":l=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(M(137,t));default:_t(e,t,_,D,i,null)}}l&&_t(e,t,"srcSet",i.srcSet,i,null),s&&_t(e,t,"src",i.src,i,null);return;case"input":Xe("invalid",e);var $=_=D=l=null,ee=null,le=null;for(s in i)if(i.hasOwnProperty(s)){var pe=i[s];if(pe!=null)switch(s){case"name":l=pe;break;case"type":D=pe;break;case"checked":ee=pe;break;case"defaultChecked":le=pe;break;case"value":_=pe;break;case"defaultValue":$=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(M(137,t));break;default:_t(e,t,s,pe,i,null)}}Zo(e,_,$,ee,le,D,l,!1);return;case"select":Xe("invalid",e),s=D=_=null;for(l in i)if(i.hasOwnProperty(l)&&($=i[l],$!=null))switch(l){case"value":_=$;break;case"defaultValue":D=$;break;case"multiple":s=$;default:_t(e,t,l,$,i,null)}t=_,i=D,e.multiple=!!s,t!=null?Ds(e,!!s,t,!1):i!=null&&Ds(e,!!s,i,!0);return;case"textarea":Xe("invalid",e),_=l=s=null;for(D in i)if(i.hasOwnProperty(D)&&($=i[D],$!=null))switch(D){case"value":s=$;break;case"defaultValue":l=$;break;case"children":_=$;break;case"dangerouslySetInnerHTML":if($!=null)throw Error(M(91));break;default:_t(e,t,D,$,i,null)}Ti(e,s,l,_);return;case"option":for(ee in i)i.hasOwnProperty(ee)&&(s=i[ee],s!=null)&&(ee==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":_t(e,t,ee,s,i,null));return;case"dialog":Xe("beforetoggle",e),Xe("toggle",e),Xe("cancel",e),Xe("close",e);break;case"iframe":case"object":Xe("load",e);break;case"video":case"audio":for(s=0;s<Bo.length;s++)Xe(Bo[s],e);break;case"image":Xe("error",e),Xe("load",e);break;case"details":Xe("toggle",e);break;case"embed":case"source":case"link":Xe("error",e),Xe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(le in i)if(i.hasOwnProperty(le)&&(s=i[le],s!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(M(137,t));default:_t(e,t,le,s,i,null)}return;default:if(Un(t)){for(pe in i)i.hasOwnProperty(pe)&&(s=i[pe],s!==void 0&&su(e,t,pe,s,i,void 0));return}}for($ in i)i.hasOwnProperty($)&&(s=i[$],s!=null&&_t(e,t,$,s,i,null))}function cg(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 l=null,_=null,D=null,$=null,ee=null,le=null,pe=null;for(fe in i){var be=i[fe];if(i.hasOwnProperty(fe)&&be!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":ee=be;default:s.hasOwnProperty(fe)||_t(e,t,fe,null,s,be)}}for(var ce in s){var fe=s[ce];if(be=i[ce],s.hasOwnProperty(ce)&&(fe!=null||be!=null))switch(ce){case"type":_=fe;break;case"name":l=fe;break;case"checked":le=fe;break;case"defaultChecked":pe=fe;break;case"value":D=fe;break;case"defaultValue":$=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(M(137,t));break;default:fe!==be&&_t(e,t,ce,fe,s,be)}}Qr(e,D,$,ee,le,pe,_,l);return;case"select":fe=D=$=ce=null;for(_ in i)if(ee=i[_],i.hasOwnProperty(_)&&ee!=null)switch(_){case"value":break;case"multiple":fe=ee;default:s.hasOwnProperty(_)||_t(e,t,_,null,s,ee)}for(l in s)if(_=s[l],ee=i[l],s.hasOwnProperty(l)&&(_!=null||ee!=null))switch(l){case"value":ce=_;break;case"defaultValue":$=_;break;case"multiple":D=_;default:_!==ee&&_t(e,t,l,_,s,ee)}t=$,i=D,s=fe,ce!=null?Ds(e,!!i,ce,!1):!!s!=!!i&&(t!=null?Ds(e,!!i,t,!0):Ds(e,!!i,i?[]:"",!1));return;case"textarea":fe=ce=null;for($ in i)if(l=i[$],i.hasOwnProperty($)&&l!=null&&!s.hasOwnProperty($))switch($){case"value":break;case"children":break;default:_t(e,t,$,null,s,l)}for(D in s)if(l=s[D],_=i[D],s.hasOwnProperty(D)&&(l!=null||_!=null))switch(D){case"value":ce=l;break;case"defaultValue":fe=l;break;case"children":break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(M(91));break;default:l!==_&&_t(e,t,D,l,s,_)}en(e,ce,fe);return;case"option":for(var Le in i)ce=i[Le],i.hasOwnProperty(Le)&&ce!=null&&!s.hasOwnProperty(Le)&&(Le==="selected"?e.selected=!1:_t(e,t,Le,null,s,ce));for(ee in s)ce=s[ee],fe=i[ee],s.hasOwnProperty(ee)&&ce!==fe&&(ce!=null||fe!=null)&&(ee==="selected"?e.selected=ce&&typeof ce!="function"&&typeof ce!="symbol":_t(e,t,ee,ce,s,fe));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var He in i)ce=i[He],i.hasOwnProperty(He)&&ce!=null&&!s.hasOwnProperty(He)&&_t(e,t,He,null,s,ce);for(le in s)if(ce=s[le],fe=i[le],s.hasOwnProperty(le)&&ce!==fe&&(ce!=null||fe!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(M(137,t));break;default:_t(e,t,le,ce,s,fe)}return;default:if(Un(t)){for(var pt in i)ce=i[pt],i.hasOwnProperty(pt)&&ce!==void 0&&!s.hasOwnProperty(pt)&&su(e,t,pt,void 0,s,ce);for(pe in s)ce=s[pe],fe=i[pe],!s.hasOwnProperty(pe)||ce===fe||ce===void 0&&fe===void 0||su(e,t,pe,ce,s,fe);return}}for(var ae in i)ce=i[ae],i.hasOwnProperty(ae)&&ce!=null&&!s.hasOwnProperty(ae)&&_t(e,t,ae,null,s,ce);for(be in s)ce=s[be],fe=i[be],!s.hasOwnProperty(be)||ce===fe||ce==null&&fe==null||_t(e,t,be,ce,s,fe)}function __(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function hg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var l=i[s],_=l.transferSize,D=l.initiatorType,$=l.duration;if(_&&$&&__(D)){for(D=0,$=l.responseEnd,s+=1;s<i.length;s++){var ee=i[s],le=ee.startTime;if(le>$)break;var pe=ee.transferSize,be=ee.initiatorType;pe&&__(be)&&(ee=ee.responseEnd,D+=pe*(ee<$?1:($-le)/(ee-le)))}if(--s,t+=8*(_+D)/(l.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 ru=null,nu=null;function oc(e){return e.nodeType===9?e:e.ownerDocument}function p_(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 m_(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 au(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 ou=null;function ug(){var e=window.event;return e&&e.type==="popstate"?e===ou?!1:(ou=e,!0):(ou=null,!1)}var g_=typeof setTimeout=="function"?setTimeout:void 0,dg=typeof clearTimeout=="function"?clearTimeout:void 0,v_=typeof Promise=="function"?Promise:void 0,fg=typeof queueMicrotask=="function"?queueMicrotask:typeof v_<"u"?function(e){return v_.resolve(null).then(e).catch(_g)}:g_;function _g(e){setTimeout(function(){throw e})}function zr(e){return e==="head"}function b_(e,t){var i=t,s=0;do{var l=i.nextSibling;if(e.removeChild(i),l&&l.nodeType===8)if(i=l.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(l),La(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")No(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,No(i);for(var _=i.firstChild;_;){var D=_.nextSibling,$=_.nodeName;_[Zr]||$==="SCRIPT"||$==="STYLE"||$==="LINK"&&_.rel.toLowerCase()==="stylesheet"||i.removeChild(_),_=D}}else i==="body"&&No(e.ownerDocument.body);i=l}while(i);La(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 lu(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":lu(i),Bn(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function pg(e,t,i,s){for(;e.nodeType===1;){var l=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Zr])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(_=e.getAttribute("rel"),_==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(_!==l.rel||e.getAttribute("href")!==(l.href==null||l.href===""?null:l.href)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin)||e.getAttribute("title")!==(l.title==null?null:l.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(_=e.getAttribute("src"),(_!==(l.src==null?null:l.src)||e.getAttribute("type")!==(l.type==null?null:l.type)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin))&&_&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var _=l.name==null?null:""+l.name;if(l.type==="hidden"&&e.getAttribute("name")===_)return e}else return e;if(e=Yi(e.nextSibling),e===null)break}return null}function mg(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Yi(e.nextSibling),e===null))return null;return e}function y_(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Yi(e.nextSibling),e===null))return null;return e}function cu(e){return e.data==="$?"||e.data==="$~"}function hu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function gg(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 Yi(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 uu=null;function C_(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Yi(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function w_(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 x_(e,t,i){switch(t=oc(i),e){case"html":if(e=t.documentElement,!e)throw Error(M(452));return e;case"head":if(e=t.head,!e)throw Error(M(453));return e;case"body":if(e=t.body,!e)throw Error(M(454));return e;default:throw Error(M(451))}}function No(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Bn(e)}var Xi=new Map,E_=new Set;function lc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var rr=X.d;X.d={f:vg,r:bg,D:Sg,C:yg,L:Cg,m:wg,X:Eg,S:xg,M:Ag};function vg(){var e=rr.f(),t=Jl();return e||t}function bg(e){var t=Ei(e);t!==null&&t.tag===5&&t.type==="form"?Pd(t):rr.r(e)}var Ea=typeof document>"u"?null:document;function A_(e,t,i){var s=Ea;if(s&&typeof t=="string"&&t){var l=si(t);l='link[rel="'+e+'"][href="'+l+'"]',typeof i=="string"&&(l+='[crossorigin="'+i+'"]'),E_.has(l)||(E_.add(l),e={rel:e,crossOrigin:i,href:t},s.querySelector(l)===null&&(t=s.createElement("link"),Zt(t,"link",e),St(t),s.head.appendChild(t)))}}function Sg(e){rr.D(e),A_("dns-prefetch",e,null)}function yg(e,t){rr.C(e,t),A_("preconnect",e,t)}function Cg(e,t,i){rr.L(e,t,i);var s=Ea;if(s&&e&&t){var l='link[rel="preload"][as="'+si(t)+'"]';t==="image"&&i&&i.imageSrcSet?(l+='[imagesrcset="'+si(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(l+='[imagesizes="'+si(i.imageSizes)+'"]')):l+='[href="'+si(e)+'"]';var _=l;switch(t){case"style":_=Aa(e);break;case"script":_=Ra(e)}Xi.has(_)||(e=o({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Xi.set(_,e),s.querySelector(l)!==null||t==="style"&&s.querySelector(Ho(_))||t==="script"&&s.querySelector(zo(_))||(t=s.createElement("link"),Zt(t,"link",e),St(t),s.head.appendChild(t)))}}function wg(e,t){rr.m(e,t);var i=Ea;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",l='link[rel="modulepreload"][as="'+si(s)+'"][href="'+si(e)+'"]',_=l;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=Ra(e)}if(!Xi.has(_)&&(e=o({rel:"modulepreload",href:e},t),Xi.set(_,e),i.querySelector(l)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(zo(_)))return}s=i.createElement("link"),Zt(s,"link",e),St(s),i.head.appendChild(s)}}}function xg(e,t,i){rr.S(e,t,i);var s=Ea;if(s&&e){var l=Ls(s).hoistableStyles,_=Aa(e);t=t||"default";var D=l.get(_);if(!D){var $={loading:0,preload:null};if(D=s.querySelector(Ho(_)))$.loading=5;else{e=o({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Xi.get(_))&&du(e,i);var ee=D=s.createElement("link");St(ee),Zt(ee,"link",e),ee._p=new Promise(function(le,pe){ee.onload=le,ee.onerror=pe}),ee.addEventListener("load",function(){$.loading|=1}),ee.addEventListener("error",function(){$.loading|=2}),$.loading|=4,cc(D,t,s)}D={type:"stylesheet",instance:D,count:1,state:$},l.set(_,D)}}}function Eg(e,t){rr.X(e,t);var i=Ea;if(i&&e){var s=Ls(i).hoistableScripts,l=Ra(e),_=s.get(l);_||(_=i.querySelector(zo(l)),_||(e=o({src:e,async:!0},t),(t=Xi.get(l))&&fu(e,t),_=i.createElement("script"),St(_),Zt(_,"link",e),i.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},s.set(l,_))}}function Ag(e,t){rr.M(e,t);var i=Ea;if(i&&e){var s=Ls(i).hoistableScripts,l=Ra(e),_=s.get(l);_||(_=i.querySelector(zo(l)),_||(e=o({src:e,async:!0,type:"module"},t),(t=Xi.get(l))&&fu(e,t),_=i.createElement("script"),St(_),Zt(_,"link",e),i.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},s.set(l,_))}}function R_(e,t,i,s){var l=(l=ge.current)?lc(l):null;if(!l)throw Error(M(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Aa(i.href),i=Ls(l).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=Aa(i.href);var _=Ls(l).hoistableStyles,D=_.get(e);if(D||(l=l.ownerDocument||l,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(e,D),(_=l.querySelector(Ho(e)))&&!_._p&&(D.instance=_,D.state.loading=5),Xi.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},Xi.set(e,i),_||Rg(l,e,i,D.state))),t&&s===null)throw Error(M(528,""));return D}if(t&&s!==null)throw Error(M(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ra(i),i=Ls(l).hoistableScripts,s=i.get(t),s||(s={type:"script",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(M(444,e))}}function Aa(e){return'href="'+si(e)+'"'}function Ho(e){return'link[rel="stylesheet"]['+e+"]"}function L_(e){return o({},e,{"data-precedence":e.precedence,precedence:null})}function Rg(e,t,i,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),Zt(t,"link",i),St(t),e.head.appendChild(t))}function Ra(e){return'[src="'+si(e)+'"]'}function zo(e){return"script[async]"+e}function T_(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+si(i.href)+'"]');if(s)return t.instance=s,St(s),s;var l=o({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),St(s),Zt(s,"style",l),cc(s,i.precedence,e),t.instance=s;case"stylesheet":l=Aa(i.href);var _=e.querySelector(Ho(l));if(_)return t.state.loading|=4,t.instance=_,St(_),_;s=L_(i),(l=Xi.get(l))&&du(s,l),_=(e.ownerDocument||e).createElement("link"),St(_);var D=_;return D._p=new Promise(function($,ee){D.onload=$,D.onerror=ee}),Zt(_,"link",s),t.state.loading|=4,cc(_,i.precedence,e),t.instance=_;case"script":return _=Ra(i.src),(l=e.querySelector(zo(_)))?(t.instance=l,St(l),l):(s=i,(l=Xi.get(_))&&(s=o({},i),fu(s,l)),e=e.ownerDocument||e,l=e.createElement("script"),St(l),Zt(l,"link",s),e.head.appendChild(l),t.instance=l);case"void":return null;default:throw Error(M(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,cc(s,i.precedence,e));return t.instance}function cc(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=s.length?s[s.length-1]:null,_=l,D=0;D<s.length;D++){var $=s[D];if($.dataset.precedence===t)_=$;else if(_!==l)break}_?_.parentNode.insertBefore(e,_.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function du(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function fu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var hc=null;function M_(e,t,i){if(hc===null){var s=new Map,l=hc=new Map;l.set(i,s)}else l=hc,s=l.get(i),s||(s=new Map,l.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),l=0;l<i.length;l++){var _=i[l];if(!(_[Zr]||_[Nt]||e==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var D=_.getAttribute(t)||"";D=e+D;var $=s.get(D);$?$.push(_):s.set(D,[_])}}return s}function D_(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function Lg(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 k_(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Tg(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 l=Aa(s.href),_=t.querySelector(Ho(l));if(_){t=_._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=uc.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=_,St(_);return}_=t.ownerDocument||t,s=L_(s),(l=Xi.get(l))&&du(s,l),_=_.createElement("link"),St(_);var D=_;D._p=new Promise(function($,ee){D.onload=$,D.onerror=ee}),Zt(_,"link",s),i.instance=_}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=uc.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var _u=0;function Mg(e,t){return e.stylesheets&&e.count===0&&fc(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&fc(e,e.stylesheets),e.unsuspend){var _=e.unsuspend;e.unsuspend=null,_()}},6e4+t);0<e.imgBytes&&_u===0&&(_u=62500*hg());var l=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fc(e,e.stylesheets),e.unsuspend)){var _=e.unsuspend;e.unsuspend=null,_()}},(e.imgBytes>_u?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(l)}}:null}function uc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var dc=null;function fc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,dc=new Map,t.forEach(Dg,e),dc=null,uc.call(e))}function Dg(e,t){if(!(t.state.loading&4)){var i=dc.get(e);if(i)var s=i.get(null);else{i=new Map,dc.set(e,i);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<l.length;_++){var D=l[_];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(i.set(D.dataset.precedence,D),s=D)}s&&i.set(null,s)}l=t.instance,D=l.getAttribute("data-precedence"),_=i.get(D)||s,_===s&&i.set(null,l),i.set(D,l),this.count++,s=uc.bind(this),l.addEventListener("load",s),l.addEventListener("error",s),_?_.parentNode.insertBefore(l,_.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(l,e.firstChild)),t.state.loading|=4}}var Uo={$$typeof:h,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function kg(e,t,i,s,l,_,D,$,ee){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=Dn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dn(0),this.hiddenUpdates=Dn(null),this.identifierPrefix=s,this.onUncaughtError=l,this.onCaughtError=_,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ee,this.incompleteTransitions=new Map}function O_(e,t,i,s,l,_,D,$,ee,le,pe,be){return e=new kg(e,t,i,D,ee,le,pe,be,$),t=1,_===!0&&(t|=24),_=ei(3,null,null,t),e.current=_,_.stateNode=e,t=Re(),t.refCount++,e.pooledCache=t,t.refCount++,_.memoizedState={element:s,isDehydrated:i,cache:t},Zc(_),e}function B_(e){return e?(e=Ss,e):Ss}function j_(e,t,i,s,l,_){l=B_(l),s.context===null?s.context=l:s.pendingContext=l,s=Rr(t),s.payload={element:i},_=_===void 0?null:_,_!==null&&(s.callback=_),i=Lr(e,s,t),i!==null&&(Ci(i,e,t),go(i,e,t))}function N_(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function pu(e,t){N_(e,t),(e=e.alternate)&&N_(e,t)}function H_(e){if(e.tag===13||e.tag===31){var t=Hs(e,67108864);t!==null&&Ci(t,e,67108864),pu(e,67108864)}}function z_(e){if(e.tag===13||e.tag===31){var t=Ii();t=Xr(t);var i=Hs(e,t);i!==null&&Ci(i,e,t),pu(e,t)}}var _c=!0;function Og(e,t,i,s){var l=V.T;V.T=null;var _=X.p;try{X.p=2,mu(e,t,i,s)}finally{X.p=_,V.T=l}}function Bg(e,t,i,s){var l=V.T;V.T=null;var _=X.p;try{X.p=8,mu(e,t,i,s)}finally{X.p=_,V.T=l}}function mu(e,t,i,s){if(_c){var l=gu(s);if(l===null)iu(e,t,s,pc,i),I_(e,s);else if(Ng(l,e,t,i,s))s.stopPropagation();else if(I_(e,s),t&4&&-1<jg.indexOf(e)){for(;l!==null;){var _=Ei(l);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var D=Zi(_.pendingLanes);if(D!==0){var $=_;for($.pendingLanes|=2,$.entangledLanes|=2;D;){var ee=1<<31-mt(D);$.entanglements[1]|=ee,D&=~ee}Es(_),(nt&6)===0&&(Zl=Se()+500,Oo(0))}}break;case 31:case 13:$=Hs(_,2),$!==null&&Ci($,_,2),Jl(),pu(_,2)}if(_=gu(s),_===null&&iu(e,t,s,pc,i),_===l)break;l=_}l!==null&&s.stopPropagation()}else iu(e,t,s,null,i)}}function gu(e){return e=Ua(e),vu(e)}var pc=null;function vu(e){if(pc=null,e=Vt(e),e!==null){var t=K(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=n(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 pc=e,null}function U_(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(De()){case je:return 2;case at:return 8;case ut:case Tt:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var bu=!1,Ur=null,Ir=null,Pr=null,Io=new Map,Po=new Map,$r=[],jg="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 I_(e,t){switch(e){case"focusin":case"focusout":Ur=null;break;case"dragenter":case"dragleave":Ir=null;break;case"mouseover":case"mouseout":Pr=null;break;case"pointerover":case"pointerout":Io.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Po.delete(t.pointerId)}}function $o(e,t,i,s,l,_){return e===null||e.nativeEvent!==_?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:_,targetContainers:[l]},t!==null&&(t=Ei(t),t!==null&&H_(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function Ng(e,t,i,s,l){switch(t){case"focusin":return Ur=$o(Ur,e,t,i,s,l),!0;case"dragenter":return Ir=$o(Ir,e,t,i,s,l),!0;case"mouseover":return Pr=$o(Pr,e,t,i,s,l),!0;case"pointerover":var _=l.pointerId;return Io.set(_,$o(Io.get(_)||null,e,t,i,s,l)),!0;case"gotpointercapture":return _=l.pointerId,Po.set(_,$o(Po.get(_)||null,e,t,i,s,l)),!0}return!1}function P_(e){var t=Vt(e.target);if(t!==null){var i=K(t);if(i!==null){if(t=i.tag,t===13){if(t=P(i),t!==null){e.blockedOn=t,On(e.priority,function(){z_(i)});return}}else if(t===31){if(t=n(i),t!==null){e.blockedOn=t,On(e.priority,function(){z_(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 mc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=gu(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);ur=s,i.target.dispatchEvent(s),ur=null}else return t=Ei(i),t!==null&&H_(t),e.blockedOn=i,!1;t.shift()}return!0}function $_(e,t,i){mc(e)&&i.delete(t)}function Hg(){bu=!1,Ur!==null&&mc(Ur)&&(Ur=null),Ir!==null&&mc(Ir)&&(Ir=null),Pr!==null&&mc(Pr)&&(Pr=null),Io.forEach($_),Po.forEach($_)}function gc(e,t){e.blockedOn===t&&(e.blockedOn=null,bu||(bu=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Hg)))}var vc=null;function F_(e){vc!==e&&(vc=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){vc===e&&(vc=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],l=e[t+2];if(typeof s!="function"){if(vu(s||i)===null)continue;break}var _=Ei(i);_!==null&&(e.splice(t,3),t-=3,gh(_,{pending:!0,data:l,method:i.method,action:s},s,l))}}))}function La(e){function t(ee){return gc(ee,e)}Ur!==null&&gc(Ur,e),Ir!==null&&gc(Ir,e),Pr!==null&&gc(Pr,e),Io.forEach(t),Po.forEach(t);for(var i=0;i<$r.length;i++){var s=$r[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<$r.length&&(i=$r[0],i.blockedOn===null);)P_(i),i.blockedOn===null&&$r.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var l=i[s],_=i[s+1],D=l[Ke]||null;if(typeof _=="function")D||F_(i);else if(D){var $=null;if(_&&_.hasAttribute("formAction")){if(l=_,D=_[Ke]||null)$=D.formAction;else if(vu(l)!==null)continue}else $=D.action;typeof $=="function"?i[s+1]=$:(i.splice(s,3),s-=3),F_(i)}}}function W_(){function e(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(D){return l=D})},focusReset:"manual",scroll:"manual"})}function t(){l!==null&&(l(),l=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,l=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),l!==null&&(l(),l=null)}}}function Su(e){this._internalRoot=e}bc.prototype.render=Su.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(M(409));var i=t.current,s=Ii();j_(i,s,e,t,null,null)},bc.prototype.unmount=Su.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;j_(e.current,2,null,e,null,null),Jl(),t[Dt]=null}};function bc(e){this._internalRoot=e}bc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ba();e={blockedOn:null,target:e,priority:t};for(var i=0;i<$r.length&&t!==0&&t<$r[i].priority;i++);$r.splice(i,0,e),i===0&&P_(e)}};var q_=C.version;if(q_!=="19.2.8")throw Error(M(527,q_,"19.2.8"));X.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(M(188)):(e=Object.keys(e).join(","),Error(M(268,e)));return e=m(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var zg={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Sc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sc.isDisabled&&Sc.supportsFiber)try{wt=Sc.inject(zg),bt=Sc}catch{}}return Wo.createRoot=function(e,t){if(!O(e))throw Error(M(299));var i=!1,s="",l=Zd,_=Qd,D=Jd;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(l=t.onUncaughtError),t.onCaughtError!==void 0&&(_=t.onCaughtError),t.onRecoverableError!==void 0&&(D=t.onRecoverableError)),t=O_(e,1,!1,null,null,i,s,null,l,_,D,W_),e[Dt]=t.current,tu(e),new Su(t)},Wo.hydrateRoot=function(e,t,i){if(!O(e))throw Error(M(299));var s=!1,l="",_=Zd,D=Qd,$=Jd,ee=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(l=i.identifierPrefix),i.onUncaughtError!==void 0&&(_=i.onUncaughtError),i.onCaughtError!==void 0&&(D=i.onCaughtError),i.onRecoverableError!==void 0&&($=i.onRecoverableError),i.formState!==void 0&&(ee=i.formState)),t=O_(e,1,!0,t,i??null,s,l,ee,_,D,$,W_),t.context=B_(null),i=t.current,s=Ii(),s=Xr(s),l=Rr(s),l.callback=null,Lr(i,l,s),i=s,t.current.lanes=i,ar(t,i),Es(t),e[Dt]=t.current,tu(e),new bc(t)},Wo.version="19.2.8",Wo}var tp;function Vg(){if(tp)return wu.exports;tp=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(C){console.error(C)}}return r(),wu.exports=Kg(),wu.exports}var Yg=Vg(),Ru={exports:{}},ip;function Xg(){return ip||(ip=1,(function(r,C){(function(E,M){r.exports=M()})(globalThis,(()=>(()=>{var E={4567:function(P,n,d){var m=this&&this.__decorate||function(f,h,S,T){var w,L=arguments.length,y=L<3?h:T===null?T=Object.getOwnPropertyDescriptor(h,S):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(f,h,S,T);else for(var R=f.length-1;R>=0;R--)(w=f[R])&&(y=(L<3?w(y):L>3?w(h,S,y):w(h,S))||y);return L>3&&y&&Object.defineProperty(h,S,y),y},v=this&&this.__param||function(f,h){return function(S,T){h(S,T,f)}};Object.defineProperty(n,"__esModule",{value:!0}),n.AccessibilityManager=void 0;const o=d(9042),b=d(9924),x=d(844),A=d(4725),p=d(2585),a=d(3656);let u=n.AccessibilityManager=class extends x.Disposable{constructor(f,h,S,T){super(),this._terminal=f,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 w=0;w<this._terminal.rows;w++)this._rowElements[w]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[w]);if(this._topBoundaryFocusListener=w=>this._handleBoundaryFocus(w,0),this._bottomBoundaryFocusListener=w=>this._handleBoundaryFocus(w,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 b.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((w=>this._handleResize(w.rows)))),this.register(this._terminal.onRender((w=>this._refreshRows(w.start,w.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((w=>this._handleChar(w)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
10
|
+
`)))),this.register(this._terminal.onA11yTab((w=>this._handleTab(w)))),this.register(this._terminal.onKey((w=>this._handleKey(w.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,a.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,x.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(f){for(let h=0;h<f;h++)this._handleChar(" ")}_handleChar(f){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==f&&(this._charsToAnnounce+=f):this._charsToAnnounce+=f,f===`
|
|
11
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=o.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(f){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(f)||this._charsToConsume.push(f)}_refreshRows(f,h){this._liveRegionDebouncer.refresh(f,h,this._terminal.rows)}_renderRows(f,h){const S=this._terminal.buffer,T=S.lines.length.toString();for(let w=f;w<=h;w++){const L=S.lines.get(S.ydisp+w),y=[],R=L?.translateToString(!0,void 0,void 0,y)||"",k=(S.ydisp+w+1).toString(),U=this._rowElements[w];U&&(R.length===0?(U.innerText=" ",this._rowColumns.set(U,[0,1])):(U.textContent=R,this._rowColumns.set(U,y)),U.setAttribute("aria-posinset",k),U.setAttribute("aria-setsize",T))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(f,h){const S=f.target,T=this._rowElements[h===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(h===0?"1":`${this._terminal.buffer.lines.length}`)||f.relatedTarget!==T)return;let w,L;if(h===0?(w=S,L=this._rowElements.pop(),this._rowContainer.removeChild(L)):(w=this._rowElements.shift(),L=S,this._rowContainer.removeChild(w)),w.removeEventListener("focus",this._topBoundaryFocusListener),L.removeEventListener("focus",this._bottomBoundaryFocusListener),h===0){const y=this._createAccessibilityTreeNode();this._rowElements.unshift(y),this._rowContainer.insertAdjacentElement("afterbegin",y)}else{const y=this._createAccessibilityTreeNode();this._rowElements.push(y),this._rowContainer.appendChild(y)}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(),f.preventDefault(),f.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const f=document.getSelection();if(!f)return;if(f.isCollapsed)return void(this._rowContainer.contains(f.anchorNode)&&this._terminal.clearSelection());if(!f.anchorNode||!f.focusNode)return void console.error("anchorNode and/or focusNode are null");let h={node:f.anchorNode,offset:f.anchorOffset},S={node:f.focusNode,offset:f.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 w=({node:R,offset:k})=>{const U=R instanceof Text?R.parentNode:R;let H=parseInt(U?.getAttribute("aria-posinset"),10)-1;if(isNaN(H))return console.warn("row is invalid. Race condition?"),null;const z=this._rowColumns.get(U);if(!z)return console.warn("columns is null. Race condition?"),null;let Y=k<z.length?z[k]:z.slice(-1)[0]+1;return Y>=this._terminal.cols&&(++H,Y=0),{row:H,column:Y}},L=w(h),y=w(S);if(L&&y){if(L.row>y.row||L.row===y.row&&L.column>=y.column)throw new Error("invalid range");this._terminal.select(L.column,L.row,(y.row-L.row)*this._terminal.cols-L.column+y.column)}}_handleResize(f){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>f;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const f=this._coreBrowserService.mainDocument.createElement("div");return f.setAttribute("role","listitem"),f.tabIndex=-1,this._refreshRowDimensions(f),f}_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 f=0;f<this._terminal.rows;f++)this._refreshRowDimensions(this._rowElements[f])}}_refreshRowDimensions(f){f.style.height=`${this._renderService.dimensions.css.cell.height}px`}};n.AccessibilityManager=u=m([v(1,p.IInstantiationService),v(2,A.ICoreBrowserService),v(3,A.IRenderService)],u)},3614:(P,n)=>{function d(b){return b.replace(/\r?\n/g,"\r")}function m(b,x){return x?"\x1B[200~"+b+"\x1B[201~":b}function v(b,x,A,p){b=m(b=d(b),A.decPrivateModes.bracketedPasteMode&&p.rawOptions.ignoreBracketedPasteMode!==!0),A.triggerDataEvent(b,!0),x.value=""}function o(b,x,A){const p=A.getBoundingClientRect(),a=b.clientX-p.left-10,u=b.clientY-p.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${a}px`,x.style.top=`${u}px`,x.style.zIndex="1000",x.focus()}Object.defineProperty(n,"__esModule",{value:!0}),n.rightClickHandler=n.moveTextAreaUnderMouseCursor=n.paste=n.handlePasteEvent=n.copyHandler=n.bracketTextForPaste=n.prepareTextForTerminal=void 0,n.prepareTextForTerminal=d,n.bracketTextForPaste=m,n.copyHandler=function(b,x){b.clipboardData&&b.clipboardData.setData("text/plain",x.selectionText),b.preventDefault()},n.handlePasteEvent=function(b,x,A,p){b.stopPropagation(),b.clipboardData&&v(b.clipboardData.getData("text/plain"),x,A,p)},n.paste=v,n.moveTextAreaUnderMouseCursor=o,n.rightClickHandler=function(b,x,A,p,a){o(b,x,A),a&&p.rightClickSelect(b),x.value=p.selectionText,x.select()}},7239:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorContrastCache=void 0;const m=d(1505);n.ColorContrastCache=class{constructor(){this._color=new m.TwoKeyMap,this._css=new m.TwoKeyMap}setCss(v,o,b){this._css.set(v,o,b)}getCss(v,o){return this._css.get(v,o)}setColor(v,o,b){this._color.set(v,o,b)}getColor(v,o){return this._color.get(v,o)}clear(){this._color.clear(),this._css.clear()}}},3656:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(d,m,v,o){d.addEventListener(m,v,o);let b=!1;return{dispose:()=>{b||(b=!0,d.removeEventListener(m,v,o))}}}},3551:function(P,n,d){var m=this&&this.__decorate||function(u,f,h,S){var T,w=arguments.length,L=w<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,h):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(u,f,h,S);else for(var y=u.length-1;y>=0;y--)(T=u[y])&&(L=(w<3?T(L):w>3?T(f,h,L):T(f,h))||L);return w>3&&L&&Object.defineProperty(f,h,L),L},v=this&&this.__param||function(u,f){return function(h,S){f(h,S,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Linkifier=void 0;const o=d(3656),b=d(8460),x=d(844),A=d(2585),p=d(4725);let a=n.Linkifier=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(u,f,h,S,T){super(),this._element=u,this._mouseService=f,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 b.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new b.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,o.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,o.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,o.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,o.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(u){this._lastMouseEvent=u;const f=this._positionFromMouseEvent(u,this._element,this._mouseService);if(!f)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&&f.x===this._lastBufferCell.x&&f.y===this._lastBufferCell.y||(this._handleHover(f),this._lastBufferCell=f)}_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,f){this._activeProviderReplies&&f||(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())f?this._activeProviderReplies?.get(S)&&(h=this._checkLinkProviderResult(S,u,h)):T.provideLinks(u.y,(w=>{if(this._isMouseOut)return;const L=w?.map((y=>({link:y})));this._activeProviderReplies?.set(S,L),h=this._checkLinkProviderResult(S,u,h),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(u.y,this._activeProviderReplies)}))}_removeIntersectingLinks(u,f){const h=new Set;for(let S=0;S<f.size;S++){const T=f.get(S);if(T)for(let w=0;w<T.length;w++){const L=T[w],y=L.link.range.start.y<u?0:L.link.range.start.x,R=L.link.range.end.y>u?this._bufferService.cols:L.link.range.end.x;for(let k=y;k<=R;k++){if(h.has(k)){T.splice(w--,1);break}h.add(k)}}}}_checkLinkProviderResult(u,f,h){if(!this._activeProviderReplies)return h;const S=this._activeProviderReplies.get(u);let T=!1;for(let w=0;w<u;w++)this._activeProviderReplies.has(w)&&!this._activeProviderReplies.get(w)||(T=!0);if(!T&&S){const w=S.find((L=>this._linkAtPosition(L.link,f)));w&&(h=!0,this._handleNewLink(w))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!h)for(let w=0;w<this._activeProviderReplies.size;w++){const L=this._activeProviderReplies.get(w)?.find((y=>this._linkAtPosition(y.link,f)));if(L){h=!0,this._handleNewLink(L);break}}return h}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(u){if(!this._currentLink)return;const f=this._positionFromMouseEvent(u,this._element,this._mouseService);f&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,f)&&this._currentLink.link.activate(u,this._currentLink.link.text)}_clearCurrentLink(u,f){this._currentLink&&this._lastMouseEvent&&(!u||!f||this._currentLink.link.range.start.y>=u&&this._currentLink.link.range.end.y<=f)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,x.disposeArray)(this._linkCacheDisposables))}_handleNewLink(u){if(!this._lastMouseEvent)return;const f=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);f&&this._linkAtPosition(u.link,f)&&(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 w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._askForLink(w,!1)}}))))}_linkHover(u,f,h){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!0),this._currentLink.state.decorations.pointerCursor&&u.classList.add("xterm-cursor-pointer")),f.hover&&f.hover(h,f.text)}_fireUnderlineEvent(u,f){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);(f?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(T)}_linkLeave(u,f,h){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!1),this._currentLink.state.decorations.pointerCursor&&u.classList.remove("xterm-cursor-pointer")),f.leave&&f.leave(h,f.text)}_linkAtPosition(u,f){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=f.y*this._bufferService.cols+f.x;return h<=T&&T<=S}_positionFromMouseEvent(u,f,h){const S=h.getCoords(u,f,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(u,f,h,S,T){return{x1:u,y1:f,x2:h,y2:S,cols:this._bufferService.cols,fg:T}}};n.Linkifier=a=m([v(1,p.IMouseService),v(2,p.IRenderService),v(3,A.IBufferService),v(4,p.ILinkProviderService)],a)},9042:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tooMuchOutput=n.promptLabel=void 0,n.promptLabel="Terminal input",n.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(P,n,d){var m=this&&this.__decorate||function(p,a,u,f){var h,S=arguments.length,T=S<3?a:f===null?f=Object.getOwnPropertyDescriptor(a,u):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(p,a,u,f);else for(var w=p.length-1;w>=0;w--)(h=p[w])&&(T=(S<3?h(T):S>3?h(a,u,T):h(a,u))||T);return S>3&&T&&Object.defineProperty(a,u,T),T},v=this&&this.__param||function(p,a){return function(u,f){a(u,f,p)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkProvider=void 0;const o=d(511),b=d(2585);let x=n.OscLinkProvider=class{constructor(p,a,u){this._bufferService=p,this._optionsService=a,this._oscLinkService=u}provideLinks(p,a){const u=this._bufferService.buffer.lines.get(p-1);if(!u)return void a(void 0);const f=[],h=this._optionsService.rawOptions.linkHandler,S=new o.CellData,T=u.getTrimmedLength();let w=-1,L=-1,y=!1;for(let R=0;R<T;R++)if(L!==-1||u.hasContent(R)){if(u.loadCell(R,S),S.hasExtendedAttrs()&&S.extended.urlId){if(L===-1){L=R,w=S.extended.urlId;continue}y=S.extended.urlId!==w}else L!==-1&&(y=!0);if(y||L!==-1&&R===T-1){const k=this._oscLinkService.getLinkData(w)?.uri;if(k){const U={start:{x:L+1,y:p},end:{x:R+(y||R!==T-1?0:1),y:p}};let H=!1;if(!h?.allowNonHttpProtocols)try{const z=new URL(k);["http:","https:"].includes(z.protocol)||(H=!0)}catch{H=!0}H||f.push({text:k,range:U,activate:(z,Y)=>h?h.activate(z,Y,U):A(0,Y),hover:(z,Y)=>h?.hover?.(z,Y,U),leave:(z,Y)=>h?.leave?.(z,Y,U)})}y=!1,S.hasExtendedAttrs()&&S.extended.urlId?(L=R,w=S.extended.urlId):(L=-1,w=-1)}}a(f)}};function A(p,a){if(confirm(`Do you want to navigate to ${a}?
|
|
12
|
+
|
|
13
|
+
WARNING: This link could potentially be dangerous`)){const u=window.open();if(u){try{u.opener=null}catch{}u.location.href=a}else console.warn("Opening link blocked as opener could not be cleared")}}n.OscLinkProvider=x=m([v(0,b.IBufferService),v(1,b.IOptionsService),v(2,b.IOscLinkService)],x)},6193:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderDebouncer=void 0,n.RenderDebouncer=class{constructor(d,m){this._renderCallback=d,this._coreBrowserService=m,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(d){return this._refreshCallbacks.push(d),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(d,m,v){this._rowCount=v,d=d!==void 0?d:0,m=m!==void 0?m:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,d):d,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,m):m,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const d=Math.max(this._rowStart,0),m=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(d,m),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const d of this._refreshCallbacks)d(0);this._refreshCallbacks=[]}}},3236:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Terminal=void 0;const m=d(3614),v=d(3656),o=d(3551),b=d(9042),x=d(3730),A=d(1680),p=d(3107),a=d(5744),u=d(2950),f=d(1296),h=d(428),S=d(4269),T=d(5114),w=d(8934),L=d(3230),y=d(9312),R=d(4725),k=d(6731),U=d(8055),H=d(8969),z=d(8460),Y=d(844),re=d(6114),V=d(8437),X=d(2584),I=d(7399),N=d(5941),W=d(9074),j=d(2585),F=d(5435),ie=d(4567),te=d(779);class de extends H.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(J={}){super(J),this.browser=re,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Y.MutableDisposable),this._onCursorMove=this.register(new z.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new z.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new z.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new z.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new z.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new z.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new z.EventEmitter),this._onBlur=this.register(new z.EventEmitter),this._onA11yCharEmitter=this.register(new z.EventEmitter),this._onA11yTabEmitter=this.register(new z.EventEmitter),this._onWillOpen=this.register(new z.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(W.DecorationService),this._instantiationService.setService(j.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(te.LinkProviderService),this._instantiationService.setService(R.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((q,ne)=>this.refresh(q,ne)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((q=>this._reportWindowsOptions(q)))),this.register(this._inputHandler.onColor((q=>this._handleColorEvent(q)))),this.register((0,z.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,z.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,z.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,z.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((q=>this._afterResize(q.cols,q.rows)))),this.register((0,Y.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(J){if(this._themeService)for(const q of J){let ne,_e="";switch(q.index){case 256:ne="foreground",_e="10";break;case 257:ne="background",_e="11";break;case 258:ne="cursor",_e="12";break;default:ne="ansi",_e="4;"+q.index}switch(q.type){case 0:const we=U.color.toColorRGB(ne==="ansi"?this._themeService.colors.ansi[q.index]:this._themeService.colors[ne]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${_e};${(0,N.toRgbString)(we)}${X.C1_ESCAPED.ST}`);break;case 1:if(ne==="ansi")this._themeService.modifyColors((xe=>xe.ansi[q.index]=U.channels.toColor(...q.color)));else{const xe=ne;this._themeService.modifyColors((Ne=>Ne[xe]=U.channels.toColor(...q.color)))}break;case 2:this._themeService.restoreColor(q.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(J){J?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(ie.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(J){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const J=this.buffer.ybase+this.buffer.y,q=this.buffer.lines.get(J);if(!q)return;const ne=Math.min(this.buffer.x,this.cols-1),_e=this._renderService.dimensions.css.cell.height,we=q.getWidth(ne),xe=this._renderService.dimensions.css.cell.width*we,Ne=this.buffer.y*this._renderService.dimensions.css.cell.height,Ae=ne*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ae+"px",this.textarea.style.top=Ne+"px",this.textarea.style.width=xe+"px",this.textarea.style.height=_e+"px",this.textarea.style.lineHeight=_e+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,v.addDisposableDomListener)(this.element,"copy",(q=>{this.hasSelection()&&(0,m.copyHandler)(q,this._selectionService)})));const J=q=>(0,m.handlePasteEvent)(q,this.textarea,this.coreService,this.optionsService);this.register((0,v.addDisposableDomListener)(this.textarea,"paste",J)),this.register((0,v.addDisposableDomListener)(this.element,"paste",J)),re.isFirefox?this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(q=>{q.button===2&&(0,m.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,v.addDisposableDomListener)(this.element,"contextmenu",(q=>{(0,m.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),re.isLinux&&this.register((0,v.addDisposableDomListener)(this.element,"auxclick",(q=>{q.button===1&&(0,m.moveTextAreaUnderMouseCursor)(q,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,v.addDisposableDomListener)(this.textarea,"keyup",(J=>this._keyUp(J)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keydown",(J=>this._keyDown(J)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keypress",(J=>this._keyPress(J)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionupdate",(J=>this._compositionHelper.compositionupdate(J)))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,v.addDisposableDomListener)(this.textarea,"input",(J=>this._inputEvent(J)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(J){if(!J)throw new Error("Terminal requires a parent element.");if(J.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=J.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"),J.appendChild(this.element);const q=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),q.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,v.addDisposableDomListener)(this.screenElement,"mousemove",(ne=>this.updateCursorStyle(ne)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),q.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",b.promptLabel),re.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(T.CoreBrowserService,this.textarea,J.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(R.ICoreBrowserService,this._coreBrowserService),this.register((0,v.addDisposableDomListener)(this.textarea,"focus",(ne=>this._handleTextAreaFocus(ne)))),this.register((0,v.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(R.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(k.ThemeService),this._instantiationService.setService(R.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(R.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(L.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(R.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ne=>this._onRender.fire(ne)))),this.onResize((ne=>this._renderService.resize(ne.cols,ne.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(w.MouseService),this._instantiationService.setService(R.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(o.Linkifier,this.screenElement)),this.element.appendChild(q);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(A.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.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(y.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(R.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ne=>this._renderService.handleSelectionChanged(ne.start,ne.end,ne.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ne=>{this.textarea.value=ne,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ne=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,v.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(p.BufferDecorationRenderer,this.screenElement)),this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(ne=>this._selectionService.handleMouseDown(ne)))),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(ie.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ne=>this._handleScreenReaderModeOptionChange(ne)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(a.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ne=>{!this._overviewRulerRenderer&&ne&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(a.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const J=this,q=this.element;function ne(xe){const Ne=J._mouseService.getMouseReportCoords(xe,J.screenElement);if(!Ne)return!1;let Ae,We;switch(xe.overrideType||xe.type){case"mousemove":We=32,xe.buttons===void 0?(Ae=3,xe.button!==void 0&&(Ae=xe.button<3?xe.button:3)):Ae=1&xe.buttons?0:4&xe.buttons?1:2&xe.buttons?2:3;break;case"mouseup":We=0,Ae=xe.button<3?xe.button:3;break;case"mousedown":We=1,Ae=xe.button<3?xe.button:3;break;case"wheel":if(J._customWheelEventHandler&&J._customWheelEventHandler(xe)===!1||J.viewport.getLinesScrolled(xe)===0)return!1;We=xe.deltaY<0?0:1,Ae=4;break;default:return!1}return!(We===void 0||Ae===void 0||Ae>4)&&J.coreMouseService.triggerMouseEvent({col:Ne.col,row:Ne.row,x:Ne.x,y:Ne.y,button:Ae,action:We,ctrl:xe.ctrlKey,alt:xe.altKey,shift:xe.shiftKey})}const _e={mouseup:null,wheel:null,mousedrag:null,mousemove:null},we={mouseup:xe=>(ne(xe),xe.buttons||(this._document.removeEventListener("mouseup",_e.mouseup),_e.mousedrag&&this._document.removeEventListener("mousemove",_e.mousedrag)),this.cancel(xe)),wheel:xe=>(ne(xe),this.cancel(xe,!0)),mousedrag:xe=>{xe.buttons&&ne(xe)},mousemove:xe=>{xe.buttons||ne(xe)}};this.register(this.coreMouseService.onProtocolChange((xe=>{xe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(xe)),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&xe?_e.mousemove||(q.addEventListener("mousemove",we.mousemove),_e.mousemove=we.mousemove):(q.removeEventListener("mousemove",_e.mousemove),_e.mousemove=null),16&xe?_e.wheel||(q.addEventListener("wheel",we.wheel,{passive:!1}),_e.wheel=we.wheel):(q.removeEventListener("wheel",_e.wheel),_e.wheel=null),2&xe?_e.mouseup||(_e.mouseup=we.mouseup):(this._document.removeEventListener("mouseup",_e.mouseup),_e.mouseup=null),4&xe?_e.mousedrag||(_e.mousedrag=we.mousedrag):(this._document.removeEventListener("mousemove",_e.mousedrag),_e.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,v.addDisposableDomListener)(q,"mousedown",(xe=>{if(xe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(xe))return ne(xe),_e.mouseup&&this._document.addEventListener("mouseup",_e.mouseup),_e.mousedrag&&this._document.addEventListener("mousemove",_e.mousedrag),this.cancel(xe)}))),this.register((0,v.addDisposableDomListener)(q,"wheel",(xe=>{if(!_e.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(xe)===!1)return!1;if(!this.buffer.hasScrollback){const Ne=this.viewport.getLinesScrolled(xe);if(Ne===0)return;const Ae=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(xe.deltaY<0?"A":"B");let We="";for(let et=0;et<Math.abs(Ne);et++)We+=Ae;return this.coreService.triggerDataEvent(We,!0),this.cancel(xe,!0)}return this.viewport.handleWheel(xe)?this.cancel(xe):void 0}}),{passive:!1})),this.register((0,v.addDisposableDomListener)(q,"touchstart",(xe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(xe),this.cancel(xe)}),{passive:!0})),this.register((0,v.addDisposableDomListener)(q,"touchmove",(xe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(xe)?void 0:this.cancel(xe)}),{passive:!1}))}refresh(J,q){this._renderService?.refreshRows(J,q)}updateCursorStyle(J){this._selectionService?.shouldColumnSelect(J)?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(J,q,ne=0){ne===1?(super.scrollLines(J,q,ne),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(J)}paste(J){(0,m.paste)(J,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(J){this._customKeyEventHandler=J}attachCustomWheelEventHandler(J){this._customWheelEventHandler=J}registerLinkProvider(J){return this._linkProviderService.registerLinkProvider(J)}registerCharacterJoiner(J){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const q=this._characterJoinerService.register(J);return this.refresh(0,this.rows-1),q}deregisterCharacterJoiner(J){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(J)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(J){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+J)}registerDecoration(J){return this._decorationService.registerDecoration(J)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(J,q,ne){this._selectionService.setSelection(J,q,ne)}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(J,q){this._selectionService?.selectLines(J,q)}_keyDown(J){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1)return!1;const q=this.browser.isMac&&this.options.macOptionIsMeta&&J.altKey;if(!q&&!this._compositionHelper.keydown(J))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;q||J.key!=="Dead"&&J.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ne=(0,I.evaluateKeyboardEvent)(J,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(J),ne.type===3||ne.type===2){const _e=this.rows-1;return this.scrollLines(ne.type===2?-_e:_e),this.cancel(J,!0)}return ne.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,J)||(ne.cancel&&this.cancel(J,!0),!ne.key||!!(J.key&&!J.ctrlKey&&!J.altKey&&!J.metaKey&&J.key.length===1&&J.key.charCodeAt(0)>=65&&J.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ne.key!==X.C0.ETX&&ne.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ne.key,domEvent:J}),this._showCursor(),this.coreService.triggerDataEvent(ne.key,!0),!this.optionsService.rawOptions.screenReaderMode||J.altKey||J.ctrlKey?this.cancel(J,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(J,q){const ne=J.isMac&&!this.options.macOptionIsMeta&&q.altKey&&!q.ctrlKey&&!q.metaKey||J.isWindows&&q.altKey&&q.ctrlKey&&!q.metaKey||J.isWindows&&q.getModifierState("AltGraph");return q.type==="keypress"?ne:ne&&(!q.keyCode||q.keyCode>47)}_keyUp(J){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1||((function(q){return q.keyCode===16||q.keyCode===17||q.keyCode===18})(J)||this.focus(),this.updateCursorStyle(J),this._keyPressHandled=!1)}_keyPress(J){let q;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1)return!1;if(this.cancel(J),J.charCode)q=J.charCode;else if(J.which===null||J.which===void 0)q=J.keyCode;else{if(J.which===0||J.charCode===0)return!1;q=J.which}return!(!q||(J.altKey||J.ctrlKey||J.metaKey)&&!this._isThirdLevelShift(this.browser,J)||(q=String.fromCharCode(q),this._onKey.fire({key:q,domEvent:J}),this._showCursor(),this.coreService.triggerDataEvent(q,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(J){if(J.data&&J.inputType==="insertText"&&(!J.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const q=J.data;return this.coreService.triggerDataEvent(q,!0),this.cancel(J),!0}return!1}resize(J,q){J!==this.cols||q!==this.rows?super.resize(J,q):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(J,q){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 J=1;J<this.rows;J++)this.buffer.lines.push(this.buffer.getBlankLine(V.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 J=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=J,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(X.C0.ESC+"[I"):this.coreService.triggerDataEvent(X.C0.ESC+"[O")}_reportWindowsOptions(J){if(this._renderService)switch(J){case F.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const q=this._renderService.dimensions.css.canvas.width.toFixed(0),ne=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[4;${ne};${q}t`);break;case F.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const _e=this._renderService.dimensions.css.cell.width.toFixed(0),we=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[6;${we};${_e}t`)}}cancel(J,q){if(this.options.cancelEvents||q)return J.preventDefault(),J.stopPropagation(),!1}}n.Terminal=de},9924:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TimeBasedDebouncer=void 0,n.TimeBasedDebouncer=class{constructor(d,m=1e3){this._renderCallback=d,this._debounceThresholdMS=m,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(d,m,v){this._rowCount=v,d=d!==void 0?d:0,m=m!==void 0?m:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,d):d,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,m):m;const o=Date.now();if(o-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=o,this._innerRefresh();else if(!this._additionalRefreshRequested){const b=o-this._lastRefreshMs,x=this._debounceThresholdMS-b;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),x)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const d=Math.max(this._rowStart,0),m=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(d,m)}}},1680:function(P,n,d){var m=this&&this.__decorate||function(u,f,h,S){var T,w=arguments.length,L=w<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,h):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(u,f,h,S);else for(var y=u.length-1;y>=0;y--)(T=u[y])&&(L=(w<3?T(L):w>3?T(f,h,L):T(f,h))||L);return w>3&&L&&Object.defineProperty(f,h,L),L},v=this&&this.__param||function(u,f){return function(h,S){f(h,S,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Viewport=void 0;const o=d(3656),b=d(4725),x=d(8460),A=d(844),p=d(2585);let a=n.Viewport=class extends A.Disposable{constructor(u,f,h,S,T,w,L,y){super(),this._viewportElement=u,this._scrollArea=f,this._bufferService=h,this._optionsService=S,this._charSizeService=T,this._renderService=w,this._coreBrowserService=L,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,o.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((R=>this._activeBuffer=R.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((R=>this._renderDimensions=R))),this._handleThemeChange(y.colors),this.register(y.onChangeColors((R=>this._handleThemeChange(R)))),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 f=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==f&&(this._lastRecordedBufferHeight=f,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 f=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:f,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,f){const h=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(f<0&&this._viewportElement.scrollTop!==0||f>0&&h<this._lastRecordedBufferHeight)||(u.cancelable&&u.preventDefault(),!1)}handleWheel(u){const f=this._getPixelsScrolled(u);return f!==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+f:this._smoothScrollState.target+=f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=f,this._bubbleScroll(u,f))}scrollLines(u){if(u!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const f=u*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+f,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 f=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_LINE?f*=this._currentRowHeight:u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._currentRowHeight*this._bufferService.rows),f}getBufferElements(u,f){let h,S="";const T=[],w=f??this._bufferService.buffer.lines.length,L=this._bufferService.buffer.lines;for(let y=u;y<w;y++){const R=L.get(y);if(!R)continue;const k=L.get(y+1)?.isWrapped;if(S+=R.translateToString(!k),!k||y===L.length-1){const U=document.createElement("div");U.textContent=S,T.push(U),S.length>0&&(h=U),S=""}}return{bufferElements:T,cursorElement:h}}getLinesScrolled(u){if(u.deltaY===0||u.shiftKey)return 0;let f=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(f/=this._currentRowHeight+0,this._wheelPartialScroll+=f,f=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._bufferService.rows),f}_applyScrollModifier(u,f){const h=this._optionsService.rawOptions.fastScrollModifier;return h==="alt"&&f.altKey||h==="ctrl"&&f.ctrlKey||h==="shift"&&f.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 f=this._lastTouchY-u.touches[0].pageY;return this._lastTouchY=u.touches[0].pageY,f!==0&&(this._viewportElement.scrollTop+=f,this._bubbleScroll(u,f))}};n.Viewport=a=m([v(2,p.IBufferService),v(3,p.IOptionsService),v(4,b.ICharSizeService),v(5,b.IRenderService),v(6,b.ICoreBrowserService),v(7,b.IThemeService)],a)},3107:function(P,n,d){var m=this&&this.__decorate||function(p,a,u,f){var h,S=arguments.length,T=S<3?a:f===null?f=Object.getOwnPropertyDescriptor(a,u):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(p,a,u,f);else for(var w=p.length-1;w>=0;w--)(h=p[w])&&(T=(S<3?h(T):S>3?h(a,u,T):h(a,u))||T);return S>3&&T&&Object.defineProperty(a,u,T),T},v=this&&this.__param||function(p,a){return function(u,f){a(u,f,p)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferDecorationRenderer=void 0;const o=d(4725),b=d(844),x=d(2585);let A=n.BufferDecorationRenderer=class extends b.Disposable{constructor(p,a,u,f,h){super(),this._screenElement=p,this._bufferService=a,this._coreBrowserService=u,this._decorationService=f,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,b.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const p of this._decorationService.decorations)this._renderDecoration(p);this._dimensionsChanged=!1}_renderDecoration(p){this._refreshStyle(p),this._dimensionsChanged&&this._refreshXPosition(p)}_createElement(p){const a=this._coreBrowserService.mainDocument.createElement("div");a.classList.add("xterm-decoration"),a.classList.toggle("xterm-decoration-top-layer",p?.options?.layer==="top"),a.style.width=`${Math.round((p.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,a.style.height=(p.options.height||1)*this._renderService.dimensions.css.cell.height+"px",a.style.top=(p.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",a.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const u=p.options.x??0;return u&&u>this._bufferService.cols&&(a.style.display="none"),this._refreshXPosition(p,a),a}_refreshStyle(p){const a=p.marker.line-this._bufferService.buffers.active.ydisp;if(a<0||a>=this._bufferService.rows)p.element&&(p.element.style.display="none",p.onRenderEmitter.fire(p.element));else{let u=this._decorationElements.get(p);u||(u=this._createElement(p),p.element=u,this._decorationElements.set(p,u),this._container.appendChild(u),p.onDispose((()=>{this._decorationElements.delete(p),u.remove()}))),u.style.top=a*this._renderService.dimensions.css.cell.height+"px",u.style.display=this._altBufferIsActive?"none":"block",p.onRenderEmitter.fire(u)}}_refreshXPosition(p,a=p.element){if(!a)return;const u=p.options.x??0;(p.options.anchor||"left")==="right"?a.style.right=u?u*this._renderService.dimensions.css.cell.width+"px":"":a.style.left=u?u*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(p){this._decorationElements.get(p)?.remove(),this._decorationElements.delete(p),p.dispose()}};n.BufferDecorationRenderer=A=m([v(1,x.IBufferService),v(2,o.ICoreBrowserService),v(3,x.IDecorationService),v(4,o.IRenderService)],A)},5871:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorZoneStore=void 0,n.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(d){if(d.options.overviewRulerOptions){for(const m of this._zones)if(m.color===d.options.overviewRulerOptions.color&&m.position===d.options.overviewRulerOptions.position){if(this._lineIntersectsZone(m,d.marker.line))return;if(this._lineAdjacentToZone(m,d.marker.line,d.options.overviewRulerOptions.position))return void this._addLineToZone(m,d.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=d.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=d.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=d.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=d.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:d.options.overviewRulerOptions.color,position:d.options.overviewRulerOptions.position,startBufferLine:d.marker.line,endBufferLine:d.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(d){this._linePadding=d}_lineIntersectsZone(d,m){return m>=d.startBufferLine&&m<=d.endBufferLine}_lineAdjacentToZone(d,m,v){return m>=d.startBufferLine-this._linePadding[v||"full"]&&m<=d.endBufferLine+this._linePadding[v||"full"]}_addLineToZone(d,m){d.startBufferLine=Math.min(d.startBufferLine,m),d.endBufferLine=Math.max(d.endBufferLine,m)}}},5744:function(P,n,d){var m=this&&this.__decorate||function(h,S,T,w){var L,y=arguments.length,R=y<3?S:w===null?w=Object.getOwnPropertyDescriptor(S,T):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(h,S,T,w);else for(var k=h.length-1;k>=0;k--)(L=h[k])&&(R=(y<3?L(R):y>3?L(S,T,R):L(S,T))||R);return y>3&&R&&Object.defineProperty(S,T,R),R},v=this&&this.__param||function(h,S){return function(T,w){S(T,w,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OverviewRulerRenderer=void 0;const o=d(5871),b=d(4725),x=d(844),A=d(2585),p={full:0,left:0,center:0,right:0},a={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0};let f=n.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(h,S,T,w,L,y,R){super(),this._viewportElement=h,this._screenElement=S,this._bufferService=T,this._decorationService=w,this._renderService=L,this._optionsService=y,this._coreBrowserService=R,this._colorZoneStore=new o.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const k=this._canvas.getContext("2d");if(!k)throw new Error("Ctx cannot be null");this._ctx=k,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.toDisposable)((()=>{this._canvas?.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const h=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);a.full=this._canvas.width,a.left=h,a.center=S,a.right=h,this._refreshDrawHeightConstants(),u.full=0,u.left=0,u.center=a.left,u.right=a.left+a.center}_refreshDrawHeightConstants(){p.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);p.left=S,p.center=S,p.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const 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)-p[h.position||"full"]/2),a[h.position||"full"],Math.round((this._canvas.height-1)*((h.endBufferLine-h.startBufferLine)/this._bufferService.buffers.active.lines.length)+p[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})))}};n.OverviewRulerRenderer=f=m([v(2,A.IBufferService),v(3,A.IDecorationService),v(4,b.IRenderService),v(5,A.IOptionsService),v(6,b.ICoreBrowserService)],f)},2950:function(P,n,d){var m=this&&this.__decorate||function(p,a,u,f){var h,S=arguments.length,T=S<3?a:f===null?f=Object.getOwnPropertyDescriptor(a,u):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(p,a,u,f);else for(var w=p.length-1;w>=0;w--)(h=p[w])&&(T=(S<3?h(T):S>3?h(a,u,T):h(a,u))||T);return S>3&&T&&Object.defineProperty(a,u,T),T},v=this&&this.__param||function(p,a){return function(u,f){a(u,f,p)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CompositionHelper=void 0;const o=d(4725),b=d(2585),x=d(2584);let A=n.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(p,a,u,f,h,S){this._textarea=p,this._compositionView=a,this._bufferService=u,this._optionsService=f,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(p){this._compositionView.textContent=p.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(p){if(this._isComposing||this._isSendingComposition){if(p.keyCode===229||p.keyCode===16||p.keyCode===17||p.keyCode===18)return!1;this._finalizeComposition(!1)}return p.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(p){if(this._compositionView.classList.remove("active"),this._isComposing=!1,p){const a={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let u;this._isSendingComposition=!1,a.start+=this._dataAlreadySent.length,u=this._isComposing?this._textarea.value.substring(a.start,a.end):this._textarea.value.substring(a.start),u.length>0&&this._coreService.triggerDataEvent(u,!0)}}),0)}else{this._isSendingComposition=!1;const a=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(a,!0)}}_handleAnyTextareaChanges(){const p=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const a=this._textarea.value,u=a.replace(p,"");this._dataAlreadySent=u,a.length>p.length?this._coreService.triggerDataEvent(u,!0):a.length<p.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):a.length===p.length&&a!==p&&this._coreService.triggerDataEvent(a,!0)}}),0)}updateCompositionElements(p){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const a=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),u=this._renderService.dimensions.css.cell.height,f=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,h=a*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=h+"px",this._compositionView.style.top=f+"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=f+"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"}p||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};n.CompositionHelper=A=m([v(2,b.IBufferService),v(3,b.IOptionsService),v(4,b.ICoreService),v(5,o.IRenderService)],A)},9806:(P,n)=>{function d(m,v,o){const b=o.getBoundingClientRect(),x=m.getComputedStyle(o),A=parseInt(x.getPropertyValue("padding-left")),p=parseInt(x.getPropertyValue("padding-top"));return[v.clientX-b.left-A,v.clientY-b.top-p]}Object.defineProperty(n,"__esModule",{value:!0}),n.getCoords=n.getCoordsRelativeToElement=void 0,n.getCoordsRelativeToElement=d,n.getCoords=function(m,v,o,b,x,A,p,a,u){if(!A)return;const f=d(m,v,o);return f?(f[0]=Math.ceil((f[0]+(u?p/2:0))/p),f[1]=Math.ceil(f[1]/a),f[0]=Math.min(Math.max(f[0],1),b+(u?1:0)),f[1]=Math.min(Math.max(f[1],1),x),f):void 0}},9504:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.moveToCellSequence=void 0;const m=d(2584);function v(a,u,f,h){const S=a-o(a,f),T=u-o(u,f),w=Math.abs(S-T)-(function(L,y,R){let k=0;const U=L-o(L,R),H=y-o(y,R);for(let z=0;z<Math.abs(U-H);z++){const Y=b(L,y)==="A"?-1:1;R.buffer.lines.get(U+Y*z)?.isWrapped&&k++}return k})(a,u,f);return p(w,A(b(a,u),h))}function o(a,u){let f=0,h=u.buffer.lines.get(a),S=h?.isWrapped;for(;S&&a>=0&&a<u.rows;)f++,h=u.buffer.lines.get(--a),S=h?.isWrapped;return f}function b(a,u){return a>u?"A":"B"}function x(a,u,f,h,S,T){let w=a,L=u,y="";for(;w!==f||L!==h;)w+=S?1:-1,S&&w>T.cols-1?(y+=T.buffer.translateBufferLineToString(L,!1,a,w),w=0,a=0,L++):!S&&w<0&&(y+=T.buffer.translateBufferLineToString(L,!1,0,a+1),w=T.cols-1,a=w,L--);return y+T.buffer.translateBufferLineToString(L,!1,a,w)}function A(a,u){const f=u?"O":"[";return m.C0.ESC+f+a}function p(a,u){a=Math.floor(a);let f="";for(let h=0;h<a;h++)f+=u;return f}n.moveToCellSequence=function(a,u,f,h){const S=f.buffer.x,T=f.buffer.y;if(!f.buffer.hasScrollback)return(function(y,R,k,U,H,z){return v(R,U,H,z).length===0?"":p(x(y,R,y,R-o(R,H),!1,H).length,A("D",z))})(S,T,0,u,f,h)+v(T,u,f,h)+(function(y,R,k,U,H,z){let Y;Y=v(R,U,H,z).length>0?U-o(U,H):R;const re=U,V=(function(X,I,N,W,j,F){let ie;return ie=v(N,W,j,F).length>0?W-o(W,j):I,X<N&&ie<=W||X>=N&&ie<W?"C":"D"})(y,R,k,U,H,z);return p(x(y,Y,k,re,V==="C",H).length,A(V,z))})(S,T,a,u,f,h);let w;if(T===u)return w=S>a?"D":"C",p(Math.abs(S-a),A(w,h));w=T>u?"D":"C";const L=Math.abs(T-u);return p((function(y,R){return R.cols-y})(T>u?a:S,f)+(L-1)*f.cols+1+((T>u?S:a)-1),A(w,h))}},1296:function(P,n,d){var m=this&&this.__decorate||function(z,Y,re,V){var X,I=arguments.length,N=I<3?Y:V===null?V=Object.getOwnPropertyDescriptor(Y,re):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(z,Y,re,V);else for(var W=z.length-1;W>=0;W--)(X=z[W])&&(N=(I<3?X(N):I>3?X(Y,re,N):X(Y,re))||N);return I>3&&N&&Object.defineProperty(Y,re,N),N},v=this&&this.__param||function(z,Y){return function(re,V){Y(re,V,z)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRenderer=void 0;const o=d(3787),b=d(2550),x=d(2223),A=d(6171),p=d(6052),a=d(4725),u=d(8055),f=d(8460),h=d(844),S=d(2585),T="xterm-dom-renderer-owner-",w="xterm-rows",L="xterm-fg-",y="xterm-bg-",R="xterm-focus",k="xterm-selection";let U=1,H=n.DomRenderer=class extends h.Disposable{constructor(z,Y,re,V,X,I,N,W,j,F,ie,te,de){super(),this._terminal=z,this._document=Y,this._element=re,this._screenElement=V,this._viewportElement=X,this._helperContainer=I,this._linkifier2=N,this._charSizeService=j,this._optionsService=F,this._bufferService=ie,this._coreBrowserService=te,this._themeService=de,this._terminalClass=U++,this._rowElements=[],this._selectionRenderModel=(0,p.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new f.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(w),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,A.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ge=>this._injectCss(ge)))),this._injectCss(this._themeService.colors),this._rowFactory=W.createInstance(o.DomRendererRowFactory,document),this._element.classList.add(T+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ge=>this._handleLinkHover(ge)))),this.register(this._linkifier2.onHideLinkUnderline((ge=>this._handleLinkLeave(ge)))),this.register((0,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 b.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const z=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*z,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*z),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/z),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/z),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const re of this._rowElements)re.style.width=`${this.dimensions.css.canvas.width}px`,re.style.height=`${this.dimensions.css.cell.height}px`,re.style.lineHeight=`${this.dimensions.css.cell.height}px`,re.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const Y=`${this._terminalSelector} .${w} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Y,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(z){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let Y=`${this._terminalSelector} .${w} { color: ${z.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Y+=`${this._terminalSelector} .${w} .xterm-dim { color: ${u.color.multiplyOpacity(z.foreground,.5).css};}`,Y+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const re=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;Y+=`@keyframes ${re} { 50% { border-bottom-style: hidden; }}`,Y+=`@keyframes ${V} { 50% { box-shadow: none; }}`,Y+=`@keyframes ${X} { 0% { background-color: ${z.cursor.css}; color: ${z.cursorAccent.css}; } 50% { background-color: inherit; color: ${z.cursor.css}; }}`,Y+=`${this._terminalSelector} .${w}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${re} 1s step-end infinite;}${this._terminalSelector} .${w}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${w}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-block { background-color: ${z.cursor.css}; color: ${z.cursorAccent.css};}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${z.cursor.css} !important; color: ${z.cursorAccent.css} !important;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${z.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${z.cursor.css} inset;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${z.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,Y+=`${this._terminalSelector} .${k} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${k} div { position: absolute; background-color: ${z.selectionBackgroundOpaque.css};}${this._terminalSelector} .${k} div { position: absolute; background-color: ${z.selectionInactiveBackgroundOpaque.css};}`;for(const[I,N]of z.ansi.entries())Y+=`${this._terminalSelector} .${L}${I} { color: ${N.css}; }${this._terminalSelector} .${L}${I}.xterm-dim { color: ${u.color.multiplyOpacity(N,.5).css}; }${this._terminalSelector} .${y}${I} { background-color: ${N.css}; }`;Y+=`${this._terminalSelector} .${L}${x.INVERTED_DEFAULT_COLOR} { color: ${u.color.opaque(z.background).css}; }${this._terminalSelector} .${L}${x.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${u.color.multiplyOpacity(u.color.opaque(z.background),.5).css}; }${this._terminalSelector} .${y}${x.INVERTED_DEFAULT_COLOR} { background-color: ${z.foreground.css}; }`,this._themeStyleElement.textContent=Y}_setDefaultSpacing(){const z=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${z}px`,this._rowFactory.defaultSpacing=z}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(z,Y){for(let re=this._rowElements.length;re<=Y;re++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>Y;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(z,Y){this._refreshRowElements(z,Y),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(R),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(R),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(z,Y,re){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(z,Y,re),this.renderRows(0,this._bufferService.rows-1),!z||!Y)return;this._selectionRenderModel.update(this._terminal,z,Y,re);const V=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,I=this._selectionRenderModel.viewportCappedStartRow,N=this._selectionRenderModel.viewportCappedEndRow;if(I>=this._bufferService.rows||N<0)return;const W=this._document.createDocumentFragment();if(re){const j=z[0]>Y[0];W.appendChild(this._createSelectionElement(I,j?Y[0]:z[0],j?z[0]:Y[0],N-I+1))}else{const j=V===I?z[0]:0,F=I===X?Y[0]:this._bufferService.cols;W.appendChild(this._createSelectionElement(I,j,F));const ie=N-I-1;if(W.appendChild(this._createSelectionElement(I+1,0,this._bufferService.cols,ie)),I!==N){const te=X===N?Y[0]:this._bufferService.cols;W.appendChild(this._createSelectionElement(N,0,te))}}this._selectionContainer.appendChild(W)}_createSelectionElement(z,Y,re,V=1){const X=this._document.createElement("div"),I=Y*this.dimensions.css.cell.width;let N=this.dimensions.css.cell.width*(re-Y);return I+N>this.dimensions.css.canvas.width&&(N=this.dimensions.css.canvas.width-I),X.style.height=V*this.dimensions.css.cell.height+"px",X.style.top=z*this.dimensions.css.cell.height+"px",X.style.left=`${I}px`,X.style.width=`${N}px`,X}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const z of this._rowElements)z.replaceChildren()}renderRows(z,Y){const re=this._bufferService.buffer,V=re.ybase+re.y,X=Math.min(re.x,this._bufferService.cols-1),I=this._optionsService.rawOptions.cursorBlink,N=this._optionsService.rawOptions.cursorStyle,W=this._optionsService.rawOptions.cursorInactiveStyle;for(let j=z;j<=Y;j++){const F=j+re.ydisp,ie=this._rowElements[j],te=re.lines.get(F);if(!ie||!te)break;ie.replaceChildren(...this._rowFactory.createRow(te,F,F===V,N,W,X,I,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${T}${this._terminalClass}`}_handleLinkHover(z){this._setCellUnderline(z.x1,z.x2,z.y1,z.y2,z.cols,!0)}_handleLinkLeave(z){this._setCellUnderline(z.x1,z.x2,z.y1,z.y2,z.cols,!1)}_setCellUnderline(z,Y,re,V,X,I){re<0&&(z=0),V<0&&(Y=0);const N=this._bufferService.rows-1;re=Math.max(Math.min(re,N),0),V=Math.max(Math.min(V,N),0),X=Math.min(X,this._bufferService.cols);const W=this._bufferService.buffer,j=W.ybase+W.y,F=Math.min(W.x,X-1),ie=this._optionsService.rawOptions.cursorBlink,te=this._optionsService.rawOptions.cursorStyle,de=this._optionsService.rawOptions.cursorInactiveStyle;for(let ge=re;ge<=V;++ge){const J=ge+W.ydisp,q=this._rowElements[ge],ne=W.lines.get(J);if(!q||!ne)break;q.replaceChildren(...this._rowFactory.createRow(ne,J,J===j,te,de,F,ie,this.dimensions.css.cell.width,this._widthCache,I?ge===re?z:0:-1,I?(ge===V?Y:X)-1:-1))}}};n.DomRenderer=H=m([v(7,S.IInstantiationService),v(8,a.ICharSizeService),v(9,S.IOptionsService),v(10,S.IBufferService),v(11,a.ICoreBrowserService),v(12,a.IThemeService)],H)},3787:function(P,n,d){var m=this&&this.__decorate||function(w,L,y,R){var k,U=arguments.length,H=U<3?L:R===null?R=Object.getOwnPropertyDescriptor(L,y):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(w,L,y,R);else for(var z=w.length-1;z>=0;z--)(k=w[z])&&(H=(U<3?k(H):U>3?k(L,y,H):k(L,y))||H);return U>3&&H&&Object.defineProperty(L,y,H),H},v=this&&this.__param||function(w,L){return function(y,R){L(y,R,w)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRendererRowFactory=void 0;const o=d(2223),b=d(643),x=d(511),A=d(2585),p=d(8055),a=d(4725),u=d(4269),f=d(6171),h=d(3734);let S=n.DomRendererRowFactory=class{constructor(w,L,y,R,k,U,H){this._document=w,this._characterJoinerService=L,this._optionsService=y,this._coreBrowserService=R,this._coreService=k,this._decorationService=U,this._themeService=H,this._workCell=new x.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(w,L,y){this._selectionStart=w,this._selectionEnd=L,this._columnSelectMode=y}createRow(w,L,y,R,k,U,H,z,Y,re,V){const X=[],I=this._characterJoinerService.getJoinedCharacters(L),N=this._themeService.colors;let W,j=w.getNoBgTrimmedLength();y&&j<U+1&&(j=U+1);let F=0,ie="",te=0,de=0,ge=0,J=!1,q=0,ne=!1,_e=0;const we=[],xe=re!==-1&&V!==-1;for(let Ne=0;Ne<j;Ne++){w.loadCell(Ne,this._workCell);let Ae=this._workCell.getWidth();if(Ae===0)continue;let We=!1,et=Ne,Te=this._workCell;if(I.length>0&&Ne===I[0][0]){We=!0;const ze=I.shift();Te=new u.JoinedCellData(this._workCell,w.translateToString(!0,ze[0],ze[1]),ze[1]-ze[0]),et=ze[1]-1,Ae=Te.getWidth()}const Lt=this._isCellInSelection(Ne,L),qt=y&&Ne===U,$e=xe&&Ne>=re&&Ne<=V;let Pe=!1;this._decorationService.forEachDecorationAtCell(Ne,L,void 0,(ze=>{Pe=!0}));let he=Te.getChars()||b.WHITESPACE_CELL_CHAR;if(he===" "&&(Te.isUnderline()||Te.isOverline())&&(he=" "),_e=Ae*z-Y.get(he,Te.isBold(),Te.isItalic()),W){if(F&&(Lt&&ne||!Lt&&!ne&&Te.bg===te)&&(Lt&&ne&&N.selectionForeground||Te.fg===de)&&Te.extended.ext===ge&&$e===J&&_e===q&&!qt&&!We&&!Pe){Te.isInvisible()?ie+=b.WHITESPACE_CELL_CHAR:ie+=he,F++;continue}F&&(W.textContent=ie),W=this._document.createElement("span"),F=0,ie=""}else W=this._document.createElement("span");if(te=Te.bg,de=Te.fg,ge=Te.extended.ext,J=$e,q=_e,ne=Lt,We&&U>=Ne&&U<=et&&(U=Ne),!this._coreService.isCursorHidden&&qt&&this._coreService.isCursorInitialized){if(we.push("xterm-cursor"),this._coreBrowserService.isFocused)H&&we.push("xterm-cursor-blink"),we.push(R==="bar"?"xterm-cursor-bar":R==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(k)switch(k){case"outline":we.push("xterm-cursor-outline");break;case"block":we.push("xterm-cursor-block");break;case"bar":we.push("xterm-cursor-bar");break;case"underline":we.push("xterm-cursor-underline")}}if(Te.isBold()&&we.push("xterm-bold"),Te.isItalic()&&we.push("xterm-italic"),Te.isDim()&&we.push("xterm-dim"),ie=Te.isInvisible()?b.WHITESPACE_CELL_CHAR:Te.getChars()||b.WHITESPACE_CELL_CHAR,Te.isUnderline()&&(we.push(`xterm-underline-${Te.extended.underlineStyle}`),ie===" "&&(ie=" "),!Te.isUnderlineColorDefault()))if(Te.isUnderlineColorRGB())W.style.textDecorationColor=`rgb(${h.AttributeData.toColorRGB(Te.getUnderlineColor()).join(",")})`;else{let ze=Te.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Te.isBold()&&ze<8&&(ze+=8),W.style.textDecorationColor=N.ansi[ze].css}Te.isOverline()&&(we.push("xterm-overline"),ie===" "&&(ie=" ")),Te.isStrikethrough()&&we.push("xterm-strikethrough"),$e&&(W.style.textDecoration="underline");let ue=Te.getFgColor(),Se=Te.getFgColorMode(),De=Te.getBgColor(),je=Te.getBgColorMode();const at=!!Te.isInverse();if(at){const ze=ue;ue=De,De=ze;const wt=Se;Se=je,je=wt}let ut,Tt,Oe,Ue=!1;switch(this._decorationService.forEachDecorationAtCell(Ne,L,void 0,(ze=>{ze.options.layer!=="top"&&Ue||(ze.backgroundColorRGB&&(je=50331648,De=ze.backgroundColorRGB.rgba>>8&16777215,ut=ze.backgroundColorRGB),ze.foregroundColorRGB&&(Se=50331648,ue=ze.foregroundColorRGB.rgba>>8&16777215,Tt=ze.foregroundColorRGB),Ue=ze.options.layer==="top")})),!Ue&&Lt&&(ut=this._coreBrowserService.isFocused?N.selectionBackgroundOpaque:N.selectionInactiveBackgroundOpaque,De=ut.rgba>>8&16777215,je=50331648,Ue=!0,N.selectionForeground&&(Se=50331648,ue=N.selectionForeground.rgba>>8&16777215,Tt=N.selectionForeground)),Ue&&we.push("xterm-decoration-top"),je){case 16777216:case 33554432:Oe=N.ansi[De],we.push(`xterm-bg-${De}`);break;case 50331648:Oe=p.channels.toColor(De>>16,De>>8&255,255&De),this._addStyle(W,`background-color:#${T((De>>>0).toString(16),"0",6)}`);break;default:at?(Oe=N.foreground,we.push(`xterm-bg-${o.INVERTED_DEFAULT_COLOR}`)):Oe=N.background}switch(ut||Te.isDim()&&(ut=p.color.multiplyOpacity(Oe,.5)),Se){case 16777216:case 33554432:Te.isBold()&&ue<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ue+=8),this._applyMinimumContrast(W,Oe,N.ansi[ue],Te,ut,void 0)||we.push(`xterm-fg-${ue}`);break;case 50331648:const ze=p.channels.toColor(ue>>16&255,ue>>8&255,255&ue);this._applyMinimumContrast(W,Oe,ze,Te,ut,Tt)||this._addStyle(W,`color:#${T(ue.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(W,Oe,N.foreground,Te,ut,Tt)||at&&we.push(`xterm-fg-${o.INVERTED_DEFAULT_COLOR}`)}we.length&&(W.className=we.join(" "),we.length=0),qt||We||Pe?W.textContent=ie:F++,_e!==this.defaultSpacing&&(W.style.letterSpacing=`${_e}px`),X.push(W),Ne=et}return W&&F&&(W.textContent=ie),X}_applyMinimumContrast(w,L,y,R,k,U){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.treatGlyphAsBackgroundColor)(R.getCode()))return!1;const H=this._getContrastCache(R);let z;if(k||U||(z=H.getColor(L.rgba,y.rgba)),z===void 0){const Y=this._optionsService.rawOptions.minimumContrastRatio/(R.isDim()?2:1);z=p.color.ensureContrastRatio(k||L,U||y,Y),H.setColor((k||L).rgba,(U||y).rgba,z??null)}return!!z&&(this._addStyle(w,`color:${z.css}`),!0)}_getContrastCache(w){return w.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(w,L){w.setAttribute("style",`${w.getAttribute("style")||""}${L};`)}_isCellInSelection(w,L){const y=this._selectionStart,R=this._selectionEnd;return!(!y||!R)&&(this._columnSelectMode?y[0]<=R[0]?w>=y[0]&&L>=y[1]&&w<R[0]&&L<=R[1]:w<y[0]&&L>=y[1]&&w>=R[0]&&L<=R[1]:L>y[1]&&L<R[1]||y[1]===R[1]&&L===y[1]&&w>=y[0]&&w<R[0]||y[1]<R[1]&&L===R[1]&&w<R[0]||y[1]<R[1]&&L===y[1]&&w>=y[0])}};function T(w,L,y){for(;w.length<y;)w=L+w;return w}n.DomRendererRowFactory=S=m([v(1,a.ICharacterJoinerService),v(2,A.IOptionsService),v(3,a.ICoreBrowserService),v(4,A.ICoreService),v(5,A.IDecorationService),v(6,a.IThemeService)],S)},2550:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WidthCache=void 0,n.WidthCache=class{constructor(d,m){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=d.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const v=d.createElement("span");v.classList.add("xterm-char-measure-element");const o=d.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontWeight="bold";const b=d.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontStyle="italic";const x=d.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontWeight="bold",x.style.fontStyle="italic",this._measureElements=[v,o,b,x],this._container.appendChild(v),this._container.appendChild(o),this._container.appendChild(b),this._container.appendChild(x),m.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(d,m,v,o){d===this._font&&m===this._fontSize&&v===this._weight&&o===this._weightBold||(this._font=d,this._fontSize=m,this._weight=v,this._weightBold=o,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${v}`,this._measureElements[1].style.fontWeight=`${o}`,this._measureElements[2].style.fontWeight=`${v}`,this._measureElements[3].style.fontWeight=`${o}`,this.clear())}get(d,m,v){let o=0;if(!m&&!v&&d.length===1&&(o=d.charCodeAt(0))<256){if(this._flat[o]!==-9999)return this._flat[o];const A=this._measure(d,0);return A>0&&(this._flat[o]=A),A}let b=d;m&&(b+="B"),v&&(b+="I");let x=this._holey.get(b);if(x===void 0){let A=0;m&&(A|=1),v&&(A|=2),x=this._measure(d,A),x>0&&this._holey.set(b,x)}return x}_measure(d,m){const v=this._measureElements[m];return v.textContent=d.repeat(32),v.offsetWidth/32}}},2223:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const m=d(6114);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=m.isFirefox||m.isLegacyEdge?"bottom":"ideographic"},6171:(P,n)=>{function d(v){return 57508<=v&&v<=57558}function m(v){return v>=128512&&v<=128591||v>=127744&&v<=128511||v>=128640&&v<=128767||v>=9728&&v<=9983||v>=9984&&v<=10175||v>=65024&&v<=65039||v>=129280&&v<=129535||v>=127462&&v<=127487}Object.defineProperty(n,"__esModule",{value:!0}),n.computeNextVariantOffset=n.createRenderDimensions=n.treatGlyphAsBackgroundColor=n.allowRescaling=n.isEmoji=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(v){if(!v)throw new Error("value must not be falsy");return v},n.isPowerlineGlyph=d,n.isRestrictedPowerlineGlyph=function(v){return 57520<=v&&v<=57527},n.isEmoji=m,n.allowRescaling=function(v,o,b,x){return o===1&&b>Math.ceil(1.5*x)&&v!==void 0&&v>255&&!m(v)&&!d(v)&&!(function(A){return 57344<=A&&A<=63743})(v)},n.treatGlyphAsBackgroundColor=function(v){return d(v)||(function(o){return 9472<=o&&o<=9631})(v)},n.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}}}},n.computeNextVariantOffset=function(v,o,b=0){return(v-(2*Math.round(o)-b))%(2*Math.round(o))}},6052:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createSelectionRenderModel=void 0;class d{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(v,o,b,x=!1){if(this.selectionStart=o,this.selectionEnd=b,!o||!b||o[0]===b[0]&&o[1]===b[1])return void this.clear();const A=v.buffers.active.ydisp,p=o[1]-A,a=b[1]-A,u=Math.max(p,0),f=Math.min(a,v.rows-1);u>=v.rows||f<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=p,this.viewportEndRow=a,this.viewportCappedStartRow=u,this.viewportCappedEndRow=f,this.startCol=o[0],this.endCol=b[0])}isCellSelected(v,o,b){return!!this.hasSelection&&(b-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?o>=this.startCol&&b>=this.viewportCappedStartRow&&o<this.endCol&&b<=this.viewportCappedEndRow:o<this.startCol&&b>=this.viewportCappedStartRow&&o>=this.endCol&&b<=this.viewportCappedEndRow:b>this.viewportStartRow&&b<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&b===this.viewportStartRow&&o>=this.startCol&&o<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportEndRow&&o<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportStartRow&&o>=this.startCol)}}n.createSelectionRenderModel=function(){return new d}},456:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionModel=void 0,n.SelectionModel=class{constructor(d){this._bufferService=d,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const d=this.selectionStart[0]+this.selectionStartLength;return d>this._bufferService.cols?d%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)-1]:[d%this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)]:[d,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const d=this.selectionStart[0]+this.selectionStartLength;return d>this._bufferService.cols?[d%this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)]:[Math.max(d,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const d=this.selectionStart,m=this.selectionEnd;return!(!d||!m)&&(d[1]>m[1]||d[1]===m[1]&&d[0]>m[0])}handleTrim(d){return this.selectionStart&&(this.selectionStart[1]-=d),this.selectionEnd&&(this.selectionEnd[1]-=d),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(P,n,d){var m=this&&this.__decorate||function(f,h,S,T){var w,L=arguments.length,y=L<3?h:T===null?T=Object.getOwnPropertyDescriptor(h,S):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(f,h,S,T);else for(var R=f.length-1;R>=0;R--)(w=f[R])&&(y=(L<3?w(y):L>3?w(h,S,y):w(h,S))||y);return L>3&&y&&Object.defineProperty(h,S,y),y},v=this&&this.__param||function(f,h){return function(S,T){h(S,T,f)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharSizeService=void 0;const o=d(2585),b=d(8460),x=d(844);let A=n.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(f,h,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new b.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new u(this._optionsService))}catch{this._measureStrategy=this.register(new a(f,h,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const f=this._measureStrategy.measure();f.width===this.width&&f.height===this.height||(this.width=f.width,this.height=f.height,this._onCharSizeChange.fire())}};n.CharSizeService=A=m([v(2,o.IOptionsService)],A);class p extends x.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 a extends p{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 p{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,n,d){var m=this&&this.__decorate||function(u,f,h,S){var T,w=arguments.length,L=w<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,h):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(u,f,h,S);else for(var y=u.length-1;y>=0;y--)(T=u[y])&&(L=(w<3?T(L):w>3?T(f,h,L):T(f,h))||L);return w>3&&L&&Object.defineProperty(f,h,L),L},v=this&&this.__param||function(u,f){return function(h,S){f(h,S,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const o=d(3734),b=d(643),x=d(511),A=d(2585);class p extends o.AttributeData{constructor(f,h,S){super(),this.content=0,this.combinedData="",this.fg=f.fg,this.bg=f.bg,this.combinedData=h,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(f){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=p;let a=n.CharacterJoinerService=class Gp{constructor(f){this._bufferService=f,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.CellData}register(f){const h={id:this._nextCharacterJoinerId++,handler:f};return this._characterJoiners.push(h),h.id}deregister(f){for(let h=0;h<this._characterJoiners.length;h++)if(this._characterJoiners[h].id===f)return this._characterJoiners.splice(h,1),!0;return!1}getJoinedCharacters(f){if(this._characterJoiners.length===0)return[];const h=this._bufferService.buffer.lines.get(f);if(!h||h.length===0)return[];const S=[],T=h.translateToString(!0);let w=0,L=0,y=0,R=h.getFg(0),k=h.getBg(0);for(let U=0;U<h.getTrimmedLength();U++)if(h.loadCell(U,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==R||this._workCell.bg!==k){if(U-w>1){const H=this._getJoinedRanges(T,y,L,h,w);for(let z=0;z<H.length;z++)S.push(H[z])}w=U,y=L,R=this._workCell.fg,k=this._workCell.bg}L+=this._workCell.getChars().length||b.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-w>1){const U=this._getJoinedRanges(T,y,L,h,w);for(let H=0;H<U.length;H++)S.push(U[H])}return S}_getJoinedRanges(f,h,S,T,w){const L=f.substring(h,S);let y=[];try{y=this._characterJoiners[0].handler(L)}catch(R){console.error(R)}for(let R=1;R<this._characterJoiners.length;R++)try{const k=this._characterJoiners[R].handler(L);for(let U=0;U<k.length;U++)Gp._mergeRanges(y,k[U])}catch(k){console.error(k)}return this._stringRangesToCellRanges(y,T,w),y}_stringRangesToCellRanges(f,h,S){let T=0,w=!1,L=0,y=f[T];if(y){for(let R=S;R<this._bufferService.cols;R++){const k=h.getWidth(R),U=h.getString(R).length||b.WHITESPACE_CELL_CHAR.length;if(k!==0){if(!w&&y[0]<=L&&(y[0]=R,w=!0),y[1]<=L){if(y[1]=R,y=f[++T],!y)break;y[0]<=L?(y[0]=R,w=!0):w=!1}L+=U}}y&&(y[1]=this._bufferService.cols)}}static _mergeRanges(f,h){let S=!1;for(let T=0;T<f.length;T++){const w=f[T];if(S){if(h[1]<=w[0])return f[T-1][1]=h[1],f;if(h[1]<=w[1])return f[T-1][1]=Math.max(h[1],w[1]),f.splice(T,1),f;f.splice(T,1),T--}else{if(h[1]<=w[0])return f.splice(T,0,h),f;if(h[1]<=w[1])return w[0]=Math.min(h[0],w[0]),f;h[0]<w[1]&&(w[0]=Math.min(h[0],w[0]),S=!0)}}return S?f[f.length-1][1]=h[1]:f.push(h),f}};n.CharacterJoinerService=a=m([v(0,A.IBufferService)],a)},5114:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreBrowserService=void 0;const m=d(844),v=d(8460),o=d(3656);class b extends m.Disposable{constructor(p,a,u){super(),this._textarea=p,this._window=a,this.mainDocument=u,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new x(this._window),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new v.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((f=>this._screenDprMonitor.setWindow(f)))),this.register((0,v.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(p){this._window!==p&&(this._window=p,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}n.CoreBrowserService=b;class x extends m.Disposable{constructor(p){super(),this._parentWindow=p,this._windowResizeListener=this.register(new m.MutableDisposable),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,m.toDisposable)((()=>this.clearListener())))}setWindow(p){this._parentWindow=p,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,o.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkProviderService=void 0;const m=d(844);class v extends m.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,m.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(b){return this.linkProviders.push(b),{dispose:()=>{const x=this.linkProviders.indexOf(b);x!==-1&&this.linkProviders.splice(x,1)}}}}n.LinkProviderService=v},8934:function(P,n,d){var m=this&&this.__decorate||function(A,p,a,u){var f,h=arguments.length,S=h<3?p:u===null?u=Object.getOwnPropertyDescriptor(p,a):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(A,p,a,u);else for(var T=A.length-1;T>=0;T--)(f=A[T])&&(S=(h<3?f(S):h>3?f(p,a,S):f(p,a))||S);return h>3&&S&&Object.defineProperty(p,a,S),S},v=this&&this.__param||function(A,p){return function(a,u){p(a,u,A)}};Object.defineProperty(n,"__esModule",{value:!0}),n.MouseService=void 0;const o=d(4725),b=d(9806);let x=n.MouseService=class{constructor(A,p){this._renderService=A,this._charSizeService=p}getCoords(A,p,a,u,f){return(0,b.getCoords)(window,A,p,a,u,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,f)}getMouseReportCoords(A,p){const a=(0,b.getCoordsRelativeToElement)(window,A,p);if(this._charSizeService.hasValidSize)return a[0]=Math.min(Math.max(a[0],0),this._renderService.dimensions.css.canvas.width-1),a[1]=Math.min(Math.max(a[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(a[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(a[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(a[0]),y:Math.floor(a[1])}}};n.MouseService=x=m([v(0,o.IRenderService),v(1,o.ICharSizeService)],x)},3230:function(P,n,d){var m=this&&this.__decorate||function(f,h,S,T){var w,L=arguments.length,y=L<3?h:T===null?T=Object.getOwnPropertyDescriptor(h,S):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(f,h,S,T);else for(var R=f.length-1;R>=0;R--)(w=f[R])&&(y=(L<3?w(y):L>3?w(h,S,y):w(h,S))||y);return L>3&&y&&Object.defineProperty(h,S,y),y},v=this&&this.__param||function(f,h){return function(S,T){h(S,T,f)}};Object.defineProperty(n,"__esModule",{value:!0}),n.RenderService=void 0;const o=d(6193),b=d(4725),x=d(8460),A=d(844),p=d(7226),a=d(2585);let u=n.RenderService=class extends A.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(f,h,S,T,w,L,y,R){super(),this._rowCount=f,this._charSizeService=T,this._renderer=this.register(new A.MutableDisposable),this._pausedResizeTask=new p.DebouncedIdleTask,this._observerDisposable=this.register(new A.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new o.RenderDebouncer(((k,U)=>this._renderRows(k,U)),y),this.register(this._renderDebouncer),this.register(y.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(L.onResize((()=>this._fullRefresh()))),this.register(L.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(S.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(w.onDecorationRegistered((()=>this._fullRefresh()))),this.register(w.onDecorationRemoved((()=>this._fullRefresh()))),this.register(S.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(L.cols,L.rows),this._fullRefresh()}))),this.register(S.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(L.buffer.y,L.buffer.y,!0)))),this.register(R.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(y.window,h),this.register(y.onWindowChange((k=>this._registerIntersectionObserver(k,h))))}_registerIntersectionObserver(f,h){if("IntersectionObserver"in f){const S=new f.IntersectionObserver((T=>this._handleIntersectionChange(T[T.length-1])),{threshold:0});S.observe(h),this._observerDisposable.value=(0,A.toDisposable)((()=>S.disconnect()))}}_handleIntersectionChange(f){this._isPaused=f.isIntersecting===void 0?f.intersectionRatio===0:!f.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(f,h,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(f,h,this._rowCount))}_renderRows(f,h){this._renderer.value&&(f=Math.min(f,this._rowCount-1),h=Math.min(h,this._rowCount-1),this._renderer.value.renderRows(f,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:f,end:h}),this._onRender.fire({start:f,end:h}),this._isNextRenderRedrawOnly=!0)}resize(f,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(f){this._renderer.value=f,this._renderer.value&&(this._renderer.value.onRequestRedraw((h=>this.refreshRows(h.start,h.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(f){return this._renderDebouncer.addRefreshCallback(f)}_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(f,h){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(f,h))):this._renderer.value.handleResize(f,h),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(f,h,S){this._selectionState.start=f,this._selectionState.end=h,this._selectionState.columnSelectMode=S,this._renderer.value?.handleSelectionChanged(f,h,S)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};n.RenderService=u=m([v(2,a.IOptionsService),v(3,b.ICharSizeService),v(4,a.IDecorationService),v(5,a.IBufferService),v(6,b.ICoreBrowserService),v(7,b.IThemeService)],u)},9312:function(P,n,d){var m=this&&this.__decorate||function(y,R,k,U){var H,z=arguments.length,Y=z<3?R:U===null?U=Object.getOwnPropertyDescriptor(R,k):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(y,R,k,U);else for(var re=y.length-1;re>=0;re--)(H=y[re])&&(Y=(z<3?H(Y):z>3?H(R,k,Y):H(R,k))||Y);return z>3&&Y&&Object.defineProperty(R,k,Y),Y},v=this&&this.__param||function(y,R){return function(k,U){R(k,U,y)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionService=void 0;const o=d(9806),b=d(9504),x=d(456),A=d(4725),p=d(8460),a=d(844),u=d(6114),f=d(4841),h=d(511),S=d(2585),T=" ",w=new RegExp(T,"g");let L=n.SelectionService=class extends a.Disposable{constructor(y,R,k,U,H,z,Y,re,V){super(),this._element=y,this._screenElement=R,this._linkifier=k,this._bufferService=U,this._coreService=H,this._mouseService=z,this._optionsService=Y,this._renderService=re,this._coreBrowserService=V,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 p.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new p.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new p.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new p.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new x.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,a.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 y=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!(!y||!R||y[0]===R[0]&&y[1]===R[1])}get selectionText(){const y=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;if(!y||!R)return"";const k=this._bufferService.buffer,U=[];if(this._activeSelectionMode===3){if(y[0]===R[0])return"";const H=y[0]<R[0]?y[0]:R[0],z=y[0]<R[0]?R[0]:y[0];for(let Y=y[1];Y<=R[1];Y++){const re=k.translateBufferLineToString(Y,!0,H,z);U.push(re)}}else{const H=y[1]===R[1]?R[0]:void 0;U.push(k.translateBufferLineToString(y[1],!0,y[0],H));for(let z=y[1]+1;z<=R[1]-1;z++){const Y=k.lines.get(z),re=k.translateBufferLineToString(z,!0);Y?.isWrapped?U[U.length-1]+=re:U.push(re)}if(y[1]!==R[1]){const z=k.lines.get(R[1]),Y=k.translateBufferLineToString(R[1],!0,0,R[0]);z&&z.isWrapped?U[U.length-1]+=Y:U.push(Y)}}return U.map((H=>H.replace(w," "))).join(u.isWindows?`\r
|
|
14
|
+
`:`
|
|
15
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(y){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),u.isLinux&&y&&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(y){const R=this._getMouseBufferCoords(y),k=this._model.finalSelectionStart,U=this._model.finalSelectionEnd;return!!(k&&U&&R)&&this._areCoordsInSelection(R,k,U)}isCellInSelection(y,R){const k=this._model.finalSelectionStart,U=this._model.finalSelectionEnd;return!(!k||!U)&&this._areCoordsInSelection([y,R],k,U)}_areCoordsInSelection(y,R,k){return y[1]>R[1]&&y[1]<k[1]||R[1]===k[1]&&y[1]===R[1]&&y[0]>=R[0]&&y[0]<k[0]||R[1]<k[1]&&y[1]===k[1]&&y[0]<k[0]||R[1]<k[1]&&y[1]===R[1]&&y[0]>=R[0]}_selectWordAtCursor(y,R){const k=this._linkifier.currentLink?.link?.range;if(k)return this._model.selectionStart=[k.start.x-1,k.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(k,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const U=this._getMouseBufferCoords(y);return!!U&&(this._selectWordAt(U,R),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(y,R){this._model.clearSelection(),y=Math.max(y,0),R=Math.min(R,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,y],this._model.selectionEnd=[this._bufferService.cols,R],this.refresh(),this._onSelectionChange.fire()}_handleTrim(y){this._model.handleTrim(y)&&this.refresh()}_getMouseBufferCoords(y){const R=this._mouseService.getCoords(y,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(R)return R[0]--,R[1]--,R[1]+=this._bufferService.buffer.ydisp,R}_getMouseEventScrollAmount(y){let R=(0,o.getCoordsRelativeToElement)(this._coreBrowserService.window,y,this._screenElement)[1];const k=this._renderService.dimensions.css.canvas.height;return R>=0&&R<=k?0:(R>k&&(R-=k),R=Math.min(Math.max(R,-50),50),R/=50,R/Math.abs(R)+Math.round(14*R))}shouldForceSelection(y){return u.isMac?y.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:y.shiftKey}handleMouseDown(y){if(this._mouseDownTimeStamp=y.timeStamp,(y.button!==2||!this.hasSelection)&&y.button===0){if(!this._enabled){if(!this.shouldForceSelection(y))return;y.stopPropagation()}y.preventDefault(),this._dragScrollAmount=0,this._enabled&&y.shiftKey?this._handleIncrementalClick(y):y.detail===1?this._handleSingleClick(y):y.detail===2?this._handleDoubleClick(y):y.detail===3&&this._handleTripleClick(y),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(y){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(y))}_handleSingleClick(y){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(y)?3:0,this._model.selectionStart=this._getMouseBufferCoords(y),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const R=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);R&&R.length!==this._model.selectionStart[0]&&R.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(y){this._selectWordAtCursor(y,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(y){const R=this._getMouseBufferCoords(y);R&&(this._activeSelectionMode=2,this._selectLineAt(R[1]))}shouldColumnSelect(y){return y.altKey&&!(u.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(y){if(y.stopImmediatePropagation(),!this._model.selectionStart)return;const R=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(y),!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(y),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const k=this._bufferService.buffer;if(this._model.selectionEnd[1]<k.lines.length){const U=k.lines.get(this._model.selectionEnd[1]);U&&U.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}R&&R[0]===this._model.selectionEnd[0]&&R[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const y=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(y.ydisp+this._bufferService.rows,y.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=y.ydisp),this.refresh()}}_handleMouseUp(y){const R=y.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&R<500&&y.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const k=this._mouseService.getCoords(y,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(k&&k[0]!==void 0&&k[1]!==void 0){const U=(0,b.moveToCellSequence)(k[0]-1,k[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(U,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const y=this._model.finalSelectionStart,R=this._model.finalSelectionEnd,k=!(!y||!R||y[0]===R[0]&&y[1]===R[1]);k?y&&R&&(this._oldSelectionStart&&this._oldSelectionEnd&&y[0]===this._oldSelectionStart[0]&&y[1]===this._oldSelectionStart[1]&&R[0]===this._oldSelectionEnd[0]&&R[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(y,R,k)):this._oldHasSelection&&this._fireOnSelectionChange(y,R,k)}_fireOnSelectionChange(y,R,k){this._oldSelectionStart=y,this._oldSelectionEnd=R,this._oldHasSelection=k,this._onSelectionChange.fire()}_handleBufferActivate(y){this.clearSelection(),this._trimListener.dispose(),this._trimListener=y.activeBuffer.lines.onTrim((R=>this._handleTrim(R)))}_convertViewportColToCharacterIndex(y,R){let k=R;for(let U=0;R>=U;U++){const H=y.loadCell(U,this._workCell).getChars().length;this._workCell.getWidth()===0?k--:H>1&&R!==U&&(k+=H-1)}return k}setSelection(y,R,k){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[y,R],this._model.selectionStartLength=k,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(y){this._isClickInSelection(y)||(this._selectWordAtCursor(y,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(y,R,k=!0,U=!0){if(y[0]>=this._bufferService.cols)return;const H=this._bufferService.buffer,z=H.lines.get(y[1]);if(!z)return;const Y=H.translateBufferLineToString(y[1],!1);let re=this._convertViewportColToCharacterIndex(z,y[0]),V=re;const X=y[0]-re;let I=0,N=0,W=0,j=0;if(Y.charAt(re)===" "){for(;re>0&&Y.charAt(re-1)===" ";)re--;for(;V<Y.length&&Y.charAt(V+1)===" ";)V++}else{let te=y[0],de=y[0];z.getWidth(te)===0&&(I++,te--),z.getWidth(de)===2&&(N++,de++);const ge=z.getString(de).length;for(ge>1&&(j+=ge-1,V+=ge-1);te>0&&re>0&&!this._isCharWordSeparator(z.loadCell(te-1,this._workCell));){z.loadCell(te-1,this._workCell);const J=this._workCell.getChars().length;this._workCell.getWidth()===0?(I++,te--):J>1&&(W+=J-1,re-=J-1),re--,te--}for(;de<z.length&&V+1<Y.length&&!this._isCharWordSeparator(z.loadCell(de+1,this._workCell));){z.loadCell(de+1,this._workCell);const J=this._workCell.getChars().length;this._workCell.getWidth()===2?(N++,de++):J>1&&(j+=J-1,V+=J-1),V++,de++}}V++;let F=re+X-I+W,ie=Math.min(this._bufferService.cols,V-re+I+N-W-j);if(R||Y.slice(re,V).trim()!==""){if(k&&F===0&&z.getCodePoint(0)!==32){const te=H.lines.get(y[1]-1);if(te&&z.isWrapped&&te.getCodePoint(this._bufferService.cols-1)!==32){const de=this._getWordAt([this._bufferService.cols-1,y[1]-1],!1,!0,!1);if(de){const ge=this._bufferService.cols-de.start;F-=ge,ie+=ge}}}if(U&&F+ie===this._bufferService.cols&&z.getCodePoint(this._bufferService.cols-1)!==32){const te=H.lines.get(y[1]+1);if(te?.isWrapped&&te.getCodePoint(0)!==32){const de=this._getWordAt([0,y[1]+1],!1,!1,!0);de&&(ie+=de.length)}}return{start:F,length:ie}}}_selectWordAt(y,R){const k=this._getWordAt(y,R);if(k){for(;k.start<0;)k.start+=this._bufferService.cols,y[1]--;this._model.selectionStart=[k.start,y[1]],this._model.selectionStartLength=k.length}}_selectToWordAt(y){const R=this._getWordAt(y,!0);if(R){let k=y[1];for(;R.start<0;)R.start+=this._bufferService.cols,k--;if(!this._model.areSelectionValuesReversed())for(;R.start+R.length>this._bufferService.cols;)R.length-=this._bufferService.cols,k++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?R.start:R.start+R.length,k]}}_isCharWordSeparator(y){return y.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(y.getChars())>=0}_selectLineAt(y){const R=this._bufferService.buffer.getWrappedRangeForLine(y),k={start:{x:0,y:R.first},end:{x:this._bufferService.cols-1,y:R.last}};this._model.selectionStart=[0,R.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(k,this._bufferService.cols)}};n.SelectionService=L=m([v(3,S.IBufferService),v(4,S.ICoreService),v(5,A.IMouseService),v(6,S.IOptionsService),v(7,A.IRenderService),v(8,A.ICoreBrowserService)],L)},4725:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ILinkProviderService=n.IThemeService=n.ICharacterJoinerService=n.ISelectionService=n.IRenderService=n.IMouseService=n.ICoreBrowserService=n.ICharSizeService=void 0;const m=d(8343);n.ICharSizeService=(0,m.createDecorator)("CharSizeService"),n.ICoreBrowserService=(0,m.createDecorator)("CoreBrowserService"),n.IMouseService=(0,m.createDecorator)("MouseService"),n.IRenderService=(0,m.createDecorator)("RenderService"),n.ISelectionService=(0,m.createDecorator)("SelectionService"),n.ICharacterJoinerService=(0,m.createDecorator)("CharacterJoinerService"),n.IThemeService=(0,m.createDecorator)("ThemeService"),n.ILinkProviderService=(0,m.createDecorator)("LinkProviderService")},6731:function(P,n,d){var m=this&&this.__decorate||function(L,y,R,k){var U,H=arguments.length,z=H<3?y:k===null?k=Object.getOwnPropertyDescriptor(y,R):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(L,y,R,k);else for(var Y=L.length-1;Y>=0;Y--)(U=L[Y])&&(z=(H<3?U(z):H>3?U(y,R,z):U(y,R))||z);return H>3&&z&&Object.defineProperty(y,R,z),z},v=this&&this.__param||function(L,y){return function(R,k){y(R,k,L)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ThemeService=n.DEFAULT_ANSI_COLORS=void 0;const o=d(7239),b=d(8055),x=d(8460),A=d(844),p=d(2585),a=b.css.toColor("#ffffff"),u=b.css.toColor("#000000"),f=b.css.toColor("#ffffff"),h=b.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};n.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const L=[b.css.toColor("#2e3436"),b.css.toColor("#cc0000"),b.css.toColor("#4e9a06"),b.css.toColor("#c4a000"),b.css.toColor("#3465a4"),b.css.toColor("#75507b"),b.css.toColor("#06989a"),b.css.toColor("#d3d7cf"),b.css.toColor("#555753"),b.css.toColor("#ef2929"),b.css.toColor("#8ae234"),b.css.toColor("#fce94f"),b.css.toColor("#729fcf"),b.css.toColor("#ad7fa8"),b.css.toColor("#34e2e2"),b.css.toColor("#eeeeec")],y=[0,95,135,175,215,255];for(let R=0;R<216;R++){const k=y[R/36%6|0],U=y[R/6%6|0],H=y[R%6];L.push({css:b.channels.toCss(k,U,H),rgba:b.channels.toRgba(k,U,H)})}for(let R=0;R<24;R++){const k=8+10*R;L.push({css:b.channels.toCss(k,k,k),rgba:b.channels.toRgba(k,k,k)})}return L})());let T=n.ThemeService=class extends A.Disposable{get colors(){return this._colors}constructor(L){super(),this._optionsService=L,this._contrastCache=new o.ColorContrastCache,this._halfContrastCache=new o.ColorContrastCache,this._onChangeColors=this.register(new x.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:a,background:u,cursor:f,cursorAccent:h,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:b.color.blend(u,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:b.color.blend(u,S),ansi:n.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(L={}){const y=this._colors;if(y.foreground=w(L.foreground,a),y.background=w(L.background,u),y.cursor=w(L.cursor,f),y.cursorAccent=w(L.cursorAccent,h),y.selectionBackgroundTransparent=w(L.selectionBackground,S),y.selectionBackgroundOpaque=b.color.blend(y.background,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundTransparent=w(L.selectionInactiveBackground,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundOpaque=b.color.blend(y.background,y.selectionInactiveBackgroundTransparent),y.selectionForeground=L.selectionForeground?w(L.selectionForeground,b.NULL_COLOR):void 0,y.selectionForeground===b.NULL_COLOR&&(y.selectionForeground=void 0),b.color.isOpaque(y.selectionBackgroundTransparent)&&(y.selectionBackgroundTransparent=b.color.opacity(y.selectionBackgroundTransparent,.3)),b.color.isOpaque(y.selectionInactiveBackgroundTransparent)&&(y.selectionInactiveBackgroundTransparent=b.color.opacity(y.selectionInactiveBackgroundTransparent,.3)),y.ansi=n.DEFAULT_ANSI_COLORS.slice(),y.ansi[0]=w(L.black,n.DEFAULT_ANSI_COLORS[0]),y.ansi[1]=w(L.red,n.DEFAULT_ANSI_COLORS[1]),y.ansi[2]=w(L.green,n.DEFAULT_ANSI_COLORS[2]),y.ansi[3]=w(L.yellow,n.DEFAULT_ANSI_COLORS[3]),y.ansi[4]=w(L.blue,n.DEFAULT_ANSI_COLORS[4]),y.ansi[5]=w(L.magenta,n.DEFAULT_ANSI_COLORS[5]),y.ansi[6]=w(L.cyan,n.DEFAULT_ANSI_COLORS[6]),y.ansi[7]=w(L.white,n.DEFAULT_ANSI_COLORS[7]),y.ansi[8]=w(L.brightBlack,n.DEFAULT_ANSI_COLORS[8]),y.ansi[9]=w(L.brightRed,n.DEFAULT_ANSI_COLORS[9]),y.ansi[10]=w(L.brightGreen,n.DEFAULT_ANSI_COLORS[10]),y.ansi[11]=w(L.brightYellow,n.DEFAULT_ANSI_COLORS[11]),y.ansi[12]=w(L.brightBlue,n.DEFAULT_ANSI_COLORS[12]),y.ansi[13]=w(L.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),y.ansi[14]=w(L.brightCyan,n.DEFAULT_ANSI_COLORS[14]),y.ansi[15]=w(L.brightWhite,n.DEFAULT_ANSI_COLORS[15]),L.extendedAnsi){const R=Math.min(y.ansi.length-16,L.extendedAnsi.length);for(let k=0;k<R;k++)y.ansi[k+16]=w(L.extendedAnsi[k],n.DEFAULT_ANSI_COLORS[k+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(L){this._restoreColor(L),this._onChangeColors.fire(this.colors)}_restoreColor(L){if(L!==void 0)switch(L){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[L]=this._restoreColors.ansi[L]}else for(let y=0;y<this._restoreColors.ansi.length;++y)this._colors.ansi[y]=this._restoreColors.ansi[y]}modifyColors(L){L(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 w(L,y){if(L!==void 0)try{return b.css.toColor(L)}catch{}return y}n.ThemeService=T=m([v(0,p.IOptionsService)],T)},6349:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CircularList=void 0;const m=d(8460),v=d(844);class o extends v.Disposable{constructor(x){super(),this._maxLength=x,this.onDeleteEmitter=this.register(new m.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new m.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new m.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(x){if(this._maxLength===x)return;const A=new Array(x);for(let p=0;p<Math.min(x,this.length);p++)A[p]=this._array[this._getCyclicIndex(p)];this._array=A,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let A=this._length;A<x;A++)this._array[A]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,A){this._array[this._getCyclicIndex(x)]=A}push(x){this._array[this._getCyclicIndex(this._length)]=x,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(x,A,...p){if(A){for(let a=x;a<this._length-A;a++)this._array[this._getCyclicIndex(a)]=this._array[this._getCyclicIndex(a+A)];this._length-=A,this.onDeleteEmitter.fire({index:x,amount:A})}for(let a=this._length-1;a>=x;a--)this._array[this._getCyclicIndex(a+p.length)]=this._array[this._getCyclicIndex(a)];for(let a=0;a<p.length;a++)this._array[this._getCyclicIndex(x+a)]=p[a];if(p.length&&this.onInsertEmitter.fire({index:x,amount:p.length}),this._length+p.length>this._maxLength){const a=this._length+p.length-this._maxLength;this._startIndex+=a,this._length=this._maxLength,this.onTrimEmitter.fire(a)}else this._length+=p.length}trimStart(x){x>this._length&&(x=this._length),this._startIndex+=x,this._length-=x,this.onTrimEmitter.fire(x)}shiftElements(x,A,p){if(!(A<=0)){if(x<0||x>=this._length)throw new Error("start argument out of range");if(x+p<0)throw new Error("Cannot shift elements in list beyond index 0");if(p>0){for(let u=A-1;u>=0;u--)this.set(x+u+p,this.get(x+u));const a=x+A+p-this._length;if(a>0)for(this._length+=a;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let a=0;a<A;a++)this.set(x+a+p,this.get(x+a))}}_getCyclicIndex(x){return(this._startIndex+x)%this._maxLength}}n.CircularList=o},1439:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.clone=void 0,n.clone=function d(m,v=5){if(typeof m!="object")return m;const o=Array.isArray(m)?[]:{};for(const b in m)o[b]=v<=1?m[b]:m[b]&&d(m[b],v-1);return o}},8055:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;let d=0,m=0,v=0,o=0;var b,x,A,p,a;function u(h){const S=h.toString(16);return S.length<2?"0"+S:S}function f(h,S){return h<S?(S+.05)/(h+.05):(h+.05)/(S+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},(function(h){h.toCss=function(S,T,w,L){return L!==void 0?`#${u(S)}${u(T)}${u(w)}${u(L)}`:`#${u(S)}${u(T)}${u(w)}`},h.toRgba=function(S,T,w,L=255){return(S<<24|T<<16|w<<8|L)>>>0},h.toColor=function(S,T,w,L){return{css:h.toCss(S,T,w,L),rgba:h.toRgba(S,T,w,L)}}})(b||(n.channels=b={})),(function(h){function S(T,w){return o=Math.round(255*w),[d,m,v]=a.toChannels(T.rgba),{css:b.toCss(d,m,v,o),rgba:b.toRgba(d,m,v,o)}}h.blend=function(T,w){if(o=(255&w.rgba)/255,o===1)return{css:w.css,rgba:w.rgba};const L=w.rgba>>24&255,y=w.rgba>>16&255,R=w.rgba>>8&255,k=T.rgba>>24&255,U=T.rgba>>16&255,H=T.rgba>>8&255;return d=k+Math.round((L-k)*o),m=U+Math.round((y-U)*o),v=H+Math.round((R-H)*o),{css:b.toCss(d,m,v),rgba:b.toRgba(d,m,v)}},h.isOpaque=function(T){return(255&T.rgba)==255},h.ensureContrastRatio=function(T,w,L){const y=a.ensureContrastRatio(T.rgba,w.rgba,L);if(y)return b.toColor(y>>24&255,y>>16&255,y>>8&255)},h.opaque=function(T){const w=(255|T.rgba)>>>0;return[d,m,v]=a.toChannels(w),{css:b.toCss(d,m,v),rgba:w}},h.opacity=S,h.multiplyOpacity=function(T,w){return o=255&T.rgba,S(T,o*w/255)},h.toColorRGB=function(T){return[T.rgba>>24&255,T.rgba>>16&255,T.rgba>>8&255]}})(x||(n.color=x={})),(function(h){let S,T;try{const w=document.createElement("canvas");w.width=1,w.height=1;const L=w.getContext("2d",{willReadFrequently:!0});L&&(S=L,S.globalCompositeOperation="copy",T=S.createLinearGradient(0,0,1,1))}catch{}h.toColor=function(w){if(w.match(/#[\da-f]{3,8}/i))switch(w.length){case 4:return d=parseInt(w.slice(1,2).repeat(2),16),m=parseInt(w.slice(2,3).repeat(2),16),v=parseInt(w.slice(3,4).repeat(2),16),b.toColor(d,m,v);case 5:return d=parseInt(w.slice(1,2).repeat(2),16),m=parseInt(w.slice(2,3).repeat(2),16),v=parseInt(w.slice(3,4).repeat(2),16),o=parseInt(w.slice(4,5).repeat(2),16),b.toColor(d,m,v,o);case 7:return{css:w,rgba:(parseInt(w.slice(1),16)<<8|255)>>>0};case 9:return{css:w,rgba:parseInt(w.slice(1),16)>>>0}}const L=w.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(L)return d=parseInt(L[1]),m=parseInt(L[2]),v=parseInt(L[3]),o=Math.round(255*(L[5]===void 0?1:parseFloat(L[5]))),b.toColor(d,m,v,o);if(!S||!T)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=T,S.fillStyle=w,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[d,m,v,o]=S.getImageData(0,0,1,1).data,o!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(d,m,v,o),css:w}}})(A||(n.css=A={})),(function(h){function S(T,w,L){const y=T/255,R=w/255,k=L/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))}h.relativeLuminance=function(T){return S(T>>16&255,T>>8&255,255&T)},h.relativeLuminance2=S})(p||(n.rgb=p={})),(function(h){function S(w,L,y){const R=w>>24&255,k=w>>16&255,U=w>>8&255;let H=L>>24&255,z=L>>16&255,Y=L>>8&255,re=f(p.relativeLuminance2(H,z,Y),p.relativeLuminance2(R,k,U));for(;re<y&&(H>0||z>0||Y>0);)H-=Math.max(0,Math.ceil(.1*H)),z-=Math.max(0,Math.ceil(.1*z)),Y-=Math.max(0,Math.ceil(.1*Y)),re=f(p.relativeLuminance2(H,z,Y),p.relativeLuminance2(R,k,U));return(H<<24|z<<16|Y<<8|255)>>>0}function T(w,L,y){const R=w>>24&255,k=w>>16&255,U=w>>8&255;let H=L>>24&255,z=L>>16&255,Y=L>>8&255,re=f(p.relativeLuminance2(H,z,Y),p.relativeLuminance2(R,k,U));for(;re<y&&(H<255||z<255||Y<255);)H=Math.min(255,H+Math.ceil(.1*(255-H))),z=Math.min(255,z+Math.ceil(.1*(255-z))),Y=Math.min(255,Y+Math.ceil(.1*(255-Y))),re=f(p.relativeLuminance2(H,z,Y),p.relativeLuminance2(R,k,U));return(H<<24|z<<16|Y<<8|255)>>>0}h.blend=function(w,L){if(o=(255&L)/255,o===1)return L;const y=L>>24&255,R=L>>16&255,k=L>>8&255,U=w>>24&255,H=w>>16&255,z=w>>8&255;return d=U+Math.round((y-U)*o),m=H+Math.round((R-H)*o),v=z+Math.round((k-z)*o),b.toRgba(d,m,v)},h.ensureContrastRatio=function(w,L,y){const R=p.relativeLuminance(w>>8),k=p.relativeLuminance(L>>8);if(f(R,k)<y){if(k<R){const z=S(w,L,y),Y=f(R,p.relativeLuminance(z>>8));if(Y<y){const re=T(w,L,y);return Y>f(R,p.relativeLuminance(re>>8))?z:re}return z}const U=T(w,L,y),H=f(R,p.relativeLuminance(U>>8));if(H<y){const z=S(w,L,y);return H>f(R,p.relativeLuminance(z>>8))?U:z}return U}},h.reduceLuminance=S,h.increaseLuminance=T,h.toChannels=function(w){return[w>>24&255,w>>16&255,w>>8&255,255&w]}})(a||(n.rgba=a={})),n.toPaddedHex=u,n.contrastRatio=f},8969:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreTerminal=void 0;const m=d(844),v=d(2585),o=d(4348),b=d(7866),x=d(744),A=d(7302),p=d(6975),a=d(8460),u=d(1753),f=d(1480),h=d(7994),S=d(9282),T=d(5435),w=d(5981),L=d(2660);let y=!1;class R extends m.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new a.EventEmitter),this._onScroll.event((U=>{this._onScrollApi?.fire(U.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(U){for(const H in U)this.optionsService.options[H]=U[H]}constructor(U){super(),this._windowsWrappingHeuristics=this.register(new m.MutableDisposable),this._onBinary=this.register(new a.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new a.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new a.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new a.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new a.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new a.EventEmitter),this._instantiationService=new o.InstantiationService,this.optionsService=this.register(new A.OptionsService(U)),this._instantiationService.setService(v.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(x.BufferService)),this._instantiationService.setService(v.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(b.LogService)),this._instantiationService.setService(v.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(p.CoreService)),this._instantiationService.setService(v.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(u.CoreMouseService)),this._instantiationService.setService(v.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(f.UnicodeService)),this._instantiationService.setService(v.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(h.CharsetService),this._instantiationService.setService(v.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(L.OscLinkService),this._instantiationService.setService(v.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,a.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,a.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,a.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,a.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((H=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((H=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new w.WriteBuffer(((H,z)=>this._inputHandler.parse(H,z)))),this.register((0,a.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(U,H){this._writeBuffer.write(U,H)}writeSync(U,H){this._logService.logLevel<=v.LogLevelEnum.WARN&&!y&&(this._logService.warn("writeSync is unreliable and will be removed soon."),y=!0),this._writeBuffer.writeSync(U,H)}input(U,H=!0){this.coreService.triggerDataEvent(U,H)}resize(U,H){isNaN(U)||isNaN(H)||(U=Math.max(U,x.MINIMUM_COLS),H=Math.max(H,x.MINIMUM_ROWS),this._bufferService.resize(U,H))}scroll(U,H=!1){this._bufferService.scroll(U,H)}scrollLines(U,H,z){this._bufferService.scrollLines(U,H,z)}scrollPages(U){this.scrollLines(U*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(U){const H=U-this._bufferService.buffer.ydisp;H!==0&&this.scrollLines(H)}registerEscHandler(U,H){return this._inputHandler.registerEscHandler(U,H)}registerDcsHandler(U,H){return this._inputHandler.registerDcsHandler(U,H)}registerCsiHandler(U,H){return this._inputHandler.registerCsiHandler(U,H)}registerOscHandler(U,H){return this._inputHandler.registerOscHandler(U,H)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let U=!1;const H=this.optionsService.rawOptions.windowsPty;H&&H.buildNumber!==void 0&&H.buildNumber!==void 0?U=H.backend==="conpty"&&H.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(U=!0),U?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const U=[];U.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),U.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,m.toDisposable)((()=>{for(const H of U)H.dispose()}))}}}n.CoreTerminal=R},8460:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=d=>(this._listeners.push(d),{dispose:()=>{if(!this._disposed){for(let m=0;m<this._listeners.length;m++)if(this._listeners[m]===d)return void this._listeners.splice(m,1)}}})),this._event}fire(d,m){const v=[];for(let o=0;o<this._listeners.length;o++)v.push(this._listeners[o]);for(let o=0;o<v.length;o++)v[o].call(void 0,d,m)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(d,m){return d((v=>m.fire(v)))},n.runAndSubscribe=function(d,m){return m(void 0),d((v=>m(v)))}},5435:function(P,n,d){var m=this&&this.__decorate||function(I,N,W,j){var F,ie=arguments.length,te=ie<3?N:j===null?j=Object.getOwnPropertyDescriptor(N,W):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")te=Reflect.decorate(I,N,W,j);else for(var de=I.length-1;de>=0;de--)(F=I[de])&&(te=(ie<3?F(te):ie>3?F(N,W,te):F(N,W))||te);return ie>3&&te&&Object.defineProperty(N,W,te),te},v=this&&this.__param||function(I,N){return function(W,j){N(W,j,I)}};Object.defineProperty(n,"__esModule",{value:!0}),n.InputHandler=n.WindowsOptionsReportType=void 0;const o=d(2584),b=d(7116),x=d(2015),A=d(844),p=d(482),a=d(8437),u=d(8460),f=d(643),h=d(511),S=d(3734),T=d(2585),w=d(1480),L=d(6242),y=d(6351),R=d(5941),k={"(":0,")":1,"*":2,"+":3,"-":1,".":2},U=131072;function H(I,N){if(I>24)return N.setWinLines||!1;switch(I){case 1:return!!N.restoreWin;case 2:return!!N.minimizeWin;case 3:return!!N.setWinPosition;case 4:return!!N.setWinSizePixels;case 5:return!!N.raiseWin;case 6:return!!N.lowerWin;case 7:return!!N.refreshWin;case 8:return!!N.setWinSizeChars;case 9:return!!N.maximizeWin;case 10:return!!N.fullscreenWin;case 11:return!!N.getWinState;case 13:return!!N.getWinPosition;case 14:return!!N.getWinSizePixels;case 15:return!!N.getScreenSizePixels;case 16:return!!N.getCellSizePixels;case 18:return!!N.getWinSizeChars;case 19:return!!N.getScreenSizeChars;case 20:return!!N.getIconTitle;case 21:return!!N.getWinTitle;case 22:return!!N.pushTitle;case 23:return!!N.popTitle;case 24:return!!N.setWinLines}return!1}var z;(function(I){I[I.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",I[I.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(z||(n.WindowsOptionsReportType=z={}));let Y=0;class re extends A.Disposable{getAttrData(){return this._curAttrData}constructor(N,W,j,F,ie,te,de,ge,J=new x.EscapeSequenceParser){super(),this._bufferService=N,this._charsetService=W,this._coreService=j,this._logService=F,this._optionsService=ie,this._oscLinkService=te,this._coreMouseService=de,this._unicodeService=ge,this._parser=J,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new p.StringToUtf32,this._utf8Decoder=new p.Utf8ToUtf32,this._workCell=new h.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=a.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=a.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 V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((q=>this._activeBuffer=q.activeBuffer))),this._parser.setCsiHandlerFallback(((q,ne)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(q),params:ne.toArray()})})),this._parser.setEscHandlerFallback((q=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(q)})})),this._parser.setExecuteHandlerFallback((q=>{this._logService.debug("Unknown EXECUTE code: ",{code:q})})),this._parser.setOscHandlerFallback(((q,ne,_e)=>{this._logService.debug("Unknown OSC code: ",{identifier:q,action:ne,data:_e})})),this._parser.setDcsHandlerFallback(((q,ne,_e)=>{ne==="HOOK"&&(_e=_e.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(q),action:ne,payload:_e})})),this._parser.setPrintHandler(((q,ne,_e)=>this.print(q,ne,_e))),this._parser.registerCsiHandler({final:"@"},(q=>this.insertChars(q))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(q=>this.scrollLeft(q))),this._parser.registerCsiHandler({final:"A"},(q=>this.cursorUp(q))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(q=>this.scrollRight(q))),this._parser.registerCsiHandler({final:"B"},(q=>this.cursorDown(q))),this._parser.registerCsiHandler({final:"C"},(q=>this.cursorForward(q))),this._parser.registerCsiHandler({final:"D"},(q=>this.cursorBackward(q))),this._parser.registerCsiHandler({final:"E"},(q=>this.cursorNextLine(q))),this._parser.registerCsiHandler({final:"F"},(q=>this.cursorPrecedingLine(q))),this._parser.registerCsiHandler({final:"G"},(q=>this.cursorCharAbsolute(q))),this._parser.registerCsiHandler({final:"H"},(q=>this.cursorPosition(q))),this._parser.registerCsiHandler({final:"I"},(q=>this.cursorForwardTab(q))),this._parser.registerCsiHandler({final:"J"},(q=>this.eraseInDisplay(q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(q=>this.eraseInDisplay(q,!0))),this._parser.registerCsiHandler({final:"K"},(q=>this.eraseInLine(q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(q=>this.eraseInLine(q,!0))),this._parser.registerCsiHandler({final:"L"},(q=>this.insertLines(q))),this._parser.registerCsiHandler({final:"M"},(q=>this.deleteLines(q))),this._parser.registerCsiHandler({final:"P"},(q=>this.deleteChars(q))),this._parser.registerCsiHandler({final:"S"},(q=>this.scrollUp(q))),this._parser.registerCsiHandler({final:"T"},(q=>this.scrollDown(q))),this._parser.registerCsiHandler({final:"X"},(q=>this.eraseChars(q))),this._parser.registerCsiHandler({final:"Z"},(q=>this.cursorBackwardTab(q))),this._parser.registerCsiHandler({final:"`"},(q=>this.charPosAbsolute(q))),this._parser.registerCsiHandler({final:"a"},(q=>this.hPositionRelative(q))),this._parser.registerCsiHandler({final:"b"},(q=>this.repeatPrecedingCharacter(q))),this._parser.registerCsiHandler({final:"c"},(q=>this.sendDeviceAttributesPrimary(q))),this._parser.registerCsiHandler({prefix:">",final:"c"},(q=>this.sendDeviceAttributesSecondary(q))),this._parser.registerCsiHandler({final:"d"},(q=>this.linePosAbsolute(q))),this._parser.registerCsiHandler({final:"e"},(q=>this.vPositionRelative(q))),this._parser.registerCsiHandler({final:"f"},(q=>this.hVPosition(q))),this._parser.registerCsiHandler({final:"g"},(q=>this.tabClear(q))),this._parser.registerCsiHandler({final:"h"},(q=>this.setMode(q))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(q=>this.setModePrivate(q))),this._parser.registerCsiHandler({final:"l"},(q=>this.resetMode(q))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(q=>this.resetModePrivate(q))),this._parser.registerCsiHandler({final:"m"},(q=>this.charAttributes(q))),this._parser.registerCsiHandler({final:"n"},(q=>this.deviceStatus(q))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(q=>this.deviceStatusPrivate(q))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(q=>this.softReset(q))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(q=>this.setCursorStyle(q))),this._parser.registerCsiHandler({final:"r"},(q=>this.setScrollRegion(q))),this._parser.registerCsiHandler({final:"s"},(q=>this.saveCursor(q))),this._parser.registerCsiHandler({final:"t"},(q=>this.windowOptions(q))),this._parser.registerCsiHandler({final:"u"},(q=>this.restoreCursor(q))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(q=>this.insertColumns(q))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(q=>this.deleteColumns(q))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(q=>this.selectProtected(q))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(q=>this.requestMode(q,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(q=>this.requestMode(q,!1))),this._parser.setExecuteHandler(o.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(o.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(o.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(o.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(o.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(o.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(o.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(o.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(o.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(o.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(o.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(o.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new L.OscHandler((q=>(this.setTitle(q),this.setIconName(q),!0)))),this._parser.registerOscHandler(1,new L.OscHandler((q=>this.setIconName(q)))),this._parser.registerOscHandler(2,new L.OscHandler((q=>this.setTitle(q)))),this._parser.registerOscHandler(4,new L.OscHandler((q=>this.setOrReportIndexedColor(q)))),this._parser.registerOscHandler(8,new L.OscHandler((q=>this.setHyperlink(q)))),this._parser.registerOscHandler(10,new L.OscHandler((q=>this.setOrReportFgColor(q)))),this._parser.registerOscHandler(11,new L.OscHandler((q=>this.setOrReportBgColor(q)))),this._parser.registerOscHandler(12,new L.OscHandler((q=>this.setOrReportCursorColor(q)))),this._parser.registerOscHandler(104,new L.OscHandler((q=>this.restoreIndexedColor(q)))),this._parser.registerOscHandler(110,new L.OscHandler((q=>this.restoreFgColor(q)))),this._parser.registerOscHandler(111,new L.OscHandler((q=>this.restoreBgColor(q)))),this._parser.registerOscHandler(112,new L.OscHandler((q=>this.restoreCursorColor(q)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const q in b.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:q},(()=>this.selectCharset("("+q))),this._parser.registerEscHandler({intermediates:")",final:q},(()=>this.selectCharset(")"+q))),this._parser.registerEscHandler({intermediates:"*",final:q},(()=>this.selectCharset("*"+q))),this._parser.registerEscHandler({intermediates:"+",final:q},(()=>this.selectCharset("+"+q))),this._parser.registerEscHandler({intermediates:"-",final:q},(()=>this.selectCharset("-"+q))),this._parser.registerEscHandler({intermediates:".",final:q},(()=>this.selectCharset("."+q))),this._parser.registerEscHandler({intermediates:"/",final:q},(()=>this.selectCharset("/"+q)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((q=>(this._logService.error("Parsing error: ",q),q))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new y.DcsHandler(((q,ne)=>this.requestStatusString(q,ne))))}_preserveStack(N,W,j,F){this._parseStack.paused=!0,this._parseStack.cursorStartX=N,this._parseStack.cursorStartY=W,this._parseStack.decodedLength=j,this._parseStack.position=F}_logSlowResolvingAsync(N){this._logService.logLevel<=T.LogLevelEnum.WARN&&Promise.race([N,new Promise(((W,j)=>setTimeout((()=>j("#SLOW_TIMEOUT")),5e3)))]).catch((W=>{if(W!=="#SLOW_TIMEOUT")throw W;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(N,W){let j,F=this._activeBuffer.x,ie=this._activeBuffer.y,te=0;const de=this._parseStack.paused;if(de){if(j=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,W))return this._logSlowResolvingAsync(j),j;F=this._parseStack.cursorStartX,ie=this._parseStack.cursorStartY,this._parseStack.paused=!1,N.length>U&&(te=this._parseStack.position+U)}if(this._logService.logLevel<=T.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof N=="string"?` "${N}"`:` "${Array.prototype.map.call(N,(q=>String.fromCharCode(q))).join("")}"`),typeof N=="string"?N.split("").map((q=>q.charCodeAt(0))):N),this._parseBuffer.length<N.length&&this._parseBuffer.length<U&&(this._parseBuffer=new Uint32Array(Math.min(N.length,U))),de||this._dirtyRowTracker.clearRange(),N.length>U)for(let q=te;q<N.length;q+=U){const ne=q+U<N.length?q+U:N.length,_e=typeof N=="string"?this._stringDecoder.decode(N.substring(q,ne),this._parseBuffer):this._utf8Decoder.decode(N.subarray(q,ne),this._parseBuffer);if(j=this._parser.parse(this._parseBuffer,_e))return this._preserveStack(F,ie,_e,q),this._logSlowResolvingAsync(j),j}else if(!de){const q=typeof N=="string"?this._stringDecoder.decode(N,this._parseBuffer):this._utf8Decoder.decode(N,this._parseBuffer);if(j=this._parser.parse(this._parseBuffer,q))return this._preserveStack(F,ie,q,0),this._logSlowResolvingAsync(j),j}this._activeBuffer.x===F&&this._activeBuffer.y===ie||this._onCursorMove.fire();const ge=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),J=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);J<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(J,this._bufferService.rows-1),Math.min(ge,this._bufferService.rows-1))}print(N,W,j){let F,ie;const te=this._charsetService.charset,de=this._optionsService.rawOptions.screenReaderMode,ge=this._bufferService.cols,J=this._coreService.decPrivateModes.wraparound,q=this._coreService.modes.insertMode,ne=this._curAttrData;let _e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&j-W>0&&_e.getWidth(this._activeBuffer.x-1)===2&&_e.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ne);let we=this._parser.precedingJoinState;for(let xe=W;xe<j;++xe){if(F=N[xe],F<127&&te){const et=te[String.fromCharCode(F)];et&&(F=et.charCodeAt(0))}const Ne=this._unicodeService.charProperties(F,we);ie=w.UnicodeService.extractWidth(Ne);const Ae=w.UnicodeService.extractShouldJoin(Ne),We=Ae?w.UnicodeService.extractWidth(we):0;if(we=Ne,de&&this._onA11yChar.fire((0,p.stringFromCodePoint)(F)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+ie-We>ge){if(J){const et=_e;let Te=this._activeBuffer.x-We;for(this._activeBuffer.x=We,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),_e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),We>0&&_e instanceof a.BufferLine&&_e.copyCellsFrom(et,Te,0,We,!1);Te<ge;)et.setCellFromCodepoint(Te++,0,1,ne)}else if(this._activeBuffer.x=ge-1,ie===2)continue}if(Ae&&this._activeBuffer.x){const et=_e.getWidth(this._activeBuffer.x-1)?1:2;_e.addCodepointToCell(this._activeBuffer.x-et,F,ie);for(let Te=ie-We;--Te>=0;)_e.setCellFromCodepoint(this._activeBuffer.x++,0,0,ne)}else if(q&&(_e.insertCells(this._activeBuffer.x,ie-We,this._activeBuffer.getNullCell(ne)),_e.getWidth(ge-1)===2&&_e.setCellFromCodepoint(ge-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,ne)),_e.setCellFromCodepoint(this._activeBuffer.x++,F,ie,ne),ie>0)for(;--ie;)_e.setCellFromCodepoint(this._activeBuffer.x++,0,0,ne)}this._parser.precedingJoinState=we,this._activeBuffer.x<ge&&j-W>0&&_e.getWidth(this._activeBuffer.x)===0&&!_e.hasContent(this._activeBuffer.x)&&_e.setCellFromCodepoint(this._activeBuffer.x,0,1,ne),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(N,W){return N.final!=="t"||N.prefix||N.intermediates?this._parser.registerCsiHandler(N,W):this._parser.registerCsiHandler(N,(j=>!H(j.params[0],this._optionsService.rawOptions.windowOptions)||W(j)))}registerDcsHandler(N,W){return this._parser.registerDcsHandler(N,new y.DcsHandler(W))}registerEscHandler(N,W){return this._parser.registerEscHandler(N,W)}registerOscHandler(N,W){return this._parser.registerOscHandler(N,new L.OscHandler(W))}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 N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);N.hasWidth(this._activeBuffer.x)&&!N.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const N=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-N),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(N=this._bufferService.cols-1){this._activeBuffer.x=Math.min(N,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(N,W){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=N,this._activeBuffer.y=this._activeBuffer.scrollTop+W):(this._activeBuffer.x=N,this._activeBuffer.y=W),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(N,W){this._restrictCursor(),this._setCursor(this._activeBuffer.x+N,this._activeBuffer.y+W)}cursorUp(N){const W=this._activeBuffer.y-this._activeBuffer.scrollTop;return W>=0?this._moveCursor(0,-Math.min(W,N.params[0]||1)):this._moveCursor(0,-(N.params[0]||1)),!0}cursorDown(N){const W=this._activeBuffer.scrollBottom-this._activeBuffer.y;return W>=0?this._moveCursor(0,Math.min(W,N.params[0]||1)):this._moveCursor(0,N.params[0]||1),!0}cursorForward(N){return this._moveCursor(N.params[0]||1,0),!0}cursorBackward(N){return this._moveCursor(-(N.params[0]||1),0),!0}cursorNextLine(N){return this.cursorDown(N),this._activeBuffer.x=0,!0}cursorPrecedingLine(N){return this.cursorUp(N),this._activeBuffer.x=0,!0}cursorCharAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(N){return this._setCursor(N.length>=2?(N.params[1]||1)-1:0,(N.params[0]||1)-1),!0}charPosAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(N){return this._moveCursor(N.params[0]||1,0),!0}linePosAbsolute(N){return this._setCursor(this._activeBuffer.x,(N.params[0]||1)-1),!0}vPositionRelative(N){return this._moveCursor(0,N.params[0]||1),!0}hVPosition(N){return this.cursorPosition(N),!0}tabClear(N){const W=N.params[0];return W===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:W===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let W=N.params[0]||1;for(;W--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let W=N.params[0]||1;for(;W--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(N){const W=N.params[0];return W===1&&(this._curAttrData.bg|=536870912),W!==2&&W!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(N,W,j,F=!1,ie=!1){const te=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);te.replaceCells(W,j,this._activeBuffer.getNullCell(this._eraseAttrData()),ie),F&&(te.isWrapped=!1)}_resetBufferLine(N,W=!1){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);j&&(j.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),W),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+N),j.isWrapped=!1)}eraseInDisplay(N,W=!1){let j;switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:for(j=this._activeBuffer.y,this._dirtyRowTracker.markDirty(j),this._eraseInBufferLine(j++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,W);j<this._bufferService.rows;j++)this._resetBufferLine(j,W);this._dirtyRowTracker.markDirty(j);break;case 1:for(j=this._activeBuffer.y,this._dirtyRowTracker.markDirty(j),this._eraseInBufferLine(j,0,this._activeBuffer.x+1,!0,W),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(j+1).isWrapped=!1);j--;)this._resetBufferLine(j,W);this._dirtyRowTracker.markDirty(0);break;case 2:for(j=this._bufferService.rows,this._dirtyRowTracker.markDirty(j-1);j--;)this._resetBufferLine(j,W);this._dirtyRowTracker.markDirty(0);break;case 3:const F=this._activeBuffer.lines.length-this._bufferService.rows;F>0&&(this._activeBuffer.lines.trimStart(F),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-F,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-F,0),this._onScroll.fire(0))}return!0}eraseInLine(N,W=!1){switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,W);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,W);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,W)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(N){this._restrictCursor();let W=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=this._activeBuffer.ybase+this._activeBuffer.y,F=this._bufferService.rows-1-this._activeBuffer.scrollBottom,ie=this._bufferService.rows-1+this._activeBuffer.ybase-F+1;for(;W--;)this._activeBuffer.lines.splice(ie-1,1),this._activeBuffer.lines.splice(j,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(N){this._restrictCursor();let W=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=this._activeBuffer.ybase+this._activeBuffer.y;let F;for(F=this._bufferService.rows-1-this._activeBuffer.scrollBottom,F=this._bufferService.rows-1+this._activeBuffer.ybase-F;W--;)this._activeBuffer.lines.splice(j,1),this._activeBuffer.lines.splice(F,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(N){this._restrictCursor();const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return W&&(W.insertCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(N){this._restrictCursor();const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return W&&(W.deleteCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(N){let W=N.params[0]||1;for(;W--;)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(N){let W=N.params[0]||1;for(;W--;)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(a.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const W=N.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);F.deleteCells(0,W,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const W=N.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);F.insertCells(0,W,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const W=N.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);F.insertCells(this._activeBuffer.x,W,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const W=N.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);F.deleteCells(this._activeBuffer.x,W,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(N){this._restrictCursor();const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return W&&(W.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(N.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(N){const W=this._parser.precedingJoinState;if(!W)return!0;const j=N.params[0]||1,F=w.UnicodeService.extractWidth(W),ie=this._activeBuffer.x-F,te=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(ie),de=new Uint32Array(te.length*j);let ge=0;for(let q=0;q<te.length;){const ne=te.codePointAt(q)||0;de[ge++]=ne,q+=ne>65535?2:1}let J=ge;for(let q=1;q<j;++q)de.copyWithin(J,0,ge),J+=ge;return this.print(de,0,J),!0}sendDeviceAttributesPrimary(N){return N.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(o.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(o.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(N){return N.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(o.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(o.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(N.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(o.C0.ESC+"[>83;40003;0c")),!0}_is(N){return(this._optionsService.rawOptions.termName+"").indexOf(N)===0}setMode(N){for(let W=0;W<N.length;W++)switch(N.params[W]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(N){for(let W=0;W<N.length;W++)switch(N.params[W]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,b.DEFAULT_CHARSET),this._charsetService.setgCharset(1,b.DEFAULT_CHARSET),this._charsetService.setgCharset(2,b.DEFAULT_CHARSET),this._charsetService.setgCharset(3,b.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(N){for(let W=0;W<N.length;W++)switch(N.params[W]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(N){for(let W=0;W<N.length;W++)switch(N.params[W]){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(),N.params[W]===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(N,W){const j=this._coreService.decPrivateModes,{activeProtocol:F,activeEncoding:ie}=this._coreMouseService,te=this._coreService,{buffers:de,cols:ge}=this._bufferService,{active:J,alt:q}=de,ne=this._optionsService.rawOptions,_e=Ae=>Ae?1:2,we=N.params[0];return xe=we,Ne=W?we===2?4:we===4?_e(te.modes.insertMode):we===12?3:we===20?_e(ne.convertEol):0:we===1?_e(j.applicationCursorKeys):we===3?ne.windowOptions.setWinLines?ge===80?2:ge===132?1:0:0:we===6?_e(j.origin):we===7?_e(j.wraparound):we===8?3:we===9?_e(F==="X10"):we===12?_e(ne.cursorBlink):we===25?_e(!te.isCursorHidden):we===45?_e(j.reverseWraparound):we===66?_e(j.applicationKeypad):we===67?4:we===1e3?_e(F==="VT200"):we===1002?_e(F==="DRAG"):we===1003?_e(F==="ANY"):we===1004?_e(j.sendFocus):we===1005?4:we===1006?_e(ie==="SGR"):we===1015?4:we===1016?_e(ie==="SGR_PIXELS"):we===1048?1:we===47||we===1047||we===1049?_e(J===q):we===2004?_e(j.bracketedPasteMode):0,te.triggerDataEvent(`${o.C0.ESC}[${W?"":"?"}${xe};${Ne}$y`),!0;var xe,Ne}_updateAttrColor(N,W,j,F,ie){return W===2?(N|=50331648,N&=-16777216,N|=S.AttributeData.fromColorRGB([j,F,ie])):W===5&&(N&=-50331904,N|=33554432|255&j),N}_extractColor(N,W,j){const F=[0,0,-1,0,0,0];let ie=0,te=0;do{if(F[te+ie]=N.params[W+te],N.hasSubParams(W+te)){const de=N.getSubParams(W+te);let ge=0;do F[1]===5&&(ie=1),F[te+ge+1+ie]=de[ge];while(++ge<de.length&&ge+te+1+ie<F.length);break}if(F[1]===5&&te+ie>=2||F[1]===2&&te+ie>=5)break;F[1]&&(ie=1)}while(++te+W<N.length&&te+ie<F.length);for(let de=2;de<F.length;++de)F[de]===-1&&(F[de]=0);switch(F[0]){case 38:j.fg=this._updateAttrColor(j.fg,F[1],F[3],F[4],F[5]);break;case 48:j.bg=this._updateAttrColor(j.bg,F[1],F[3],F[4],F[5]);break;case 58:j.extended=j.extended.clone(),j.extended.underlineColor=this._updateAttrColor(j.extended.underlineColor,F[1],F[3],F[4],F[5])}return te}_processUnderline(N,W){W.extended=W.extended.clone(),(!~N||N>5)&&(N=1),W.extended.underlineStyle=N,W.fg|=268435456,N===0&&(W.fg&=-268435457),W.updateExtended()}_processSGR0(N){N.fg=a.DEFAULT_ATTR_DATA.fg,N.bg=a.DEFAULT_ATTR_DATA.bg,N.extended=N.extended.clone(),N.extended.underlineStyle=0,N.extended.underlineColor&=-67108864,N.updateExtended()}charAttributes(N){if(N.length===1&&N.params[0]===0)return this._processSGR0(this._curAttrData),!0;const W=N.length;let j;const F=this._curAttrData;for(let ie=0;ie<W;ie++)j=N.params[ie],j>=30&&j<=37?(F.fg&=-50331904,F.fg|=16777216|j-30):j>=40&&j<=47?(F.bg&=-50331904,F.bg|=16777216|j-40):j>=90&&j<=97?(F.fg&=-50331904,F.fg|=16777224|j-90):j>=100&&j<=107?(F.bg&=-50331904,F.bg|=16777224|j-100):j===0?this._processSGR0(F):j===1?F.fg|=134217728:j===3?F.bg|=67108864:j===4?(F.fg|=268435456,this._processUnderline(N.hasSubParams(ie)?N.getSubParams(ie)[0]:1,F)):j===5?F.fg|=536870912:j===7?F.fg|=67108864:j===8?F.fg|=1073741824:j===9?F.fg|=2147483648:j===2?F.bg|=134217728:j===21?this._processUnderline(2,F):j===22?(F.fg&=-134217729,F.bg&=-134217729):j===23?F.bg&=-67108865:j===24?(F.fg&=-268435457,this._processUnderline(0,F)):j===25?F.fg&=-536870913:j===27?F.fg&=-67108865:j===28?F.fg&=-1073741825:j===29?F.fg&=2147483647:j===39?(F.fg&=-67108864,F.fg|=16777215&a.DEFAULT_ATTR_DATA.fg):j===49?(F.bg&=-67108864,F.bg|=16777215&a.DEFAULT_ATTR_DATA.bg):j===38||j===48||j===58?ie+=this._extractColor(N,ie,F):j===53?F.bg|=1073741824:j===55?F.bg&=-1073741825:j===59?(F.extended=F.extended.clone(),F.extended.underlineColor=-1,F.updateExtended()):j===100?(F.fg&=-67108864,F.fg|=16777215&a.DEFAULT_ATTR_DATA.fg,F.bg&=-67108864,F.bg|=16777215&a.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",j);return!0}deviceStatus(N){switch(N.params[0]){case 5:this._coreService.triggerDataEvent(`${o.C0.ESC}[0n`);break;case 6:const W=this._activeBuffer.y+1,j=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${o.C0.ESC}[${W};${j}R`)}return!0}deviceStatusPrivate(N){if(N.params[0]===6){const W=this._activeBuffer.y+1,j=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${o.C0.ESC}[?${W};${j}R`)}return!0}softReset(N){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=a.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(N){const W=N.params[0]||1;switch(W){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const j=W%2==1;return this._optionsService.options.cursorBlink=j,!0}setScrollRegion(N){const W=N.params[0]||1;let j;return(N.length<2||(j=N.params[1])>this._bufferService.rows||j===0)&&(j=this._bufferService.rows),j>W&&(this._activeBuffer.scrollTop=W-1,this._activeBuffer.scrollBottom=j-1,this._setCursor(0,0)),!0}windowOptions(N){if(!H(N.params[0],this._optionsService.rawOptions.windowOptions))return!0;const W=N.length>1?N.params[1]:0;switch(N.params[0]){case 14:W!==2&&this._onRequestWindowsOptionsReport.fire(z.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(z.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${o.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:W!==0&&W!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),W!==0&&W!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:W!==0&&W!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),W!==0&&W!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(N){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(N){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(N){return this._windowTitle=N,this._onTitleChange.fire(N),!0}setIconName(N){return this._iconName=N,!0}setOrReportIndexedColor(N){const W=[],j=N.split(";");for(;j.length>1;){const F=j.shift(),ie=j.shift();if(/^\d+$/.exec(F)){const te=parseInt(F);if(X(te))if(ie==="?")W.push({type:0,index:te});else{const de=(0,R.parseColor)(ie);de&&W.push({type:1,index:te,color:de})}}}return W.length&&this._onColor.fire(W),!0}setHyperlink(N){const W=N.split(";");return!(W.length<2)&&(W[1]?this._createHyperlink(W[0],W[1]):!W[0]&&this._finishHyperlink())}_createHyperlink(N,W){this._getCurrentLinkId()&&this._finishHyperlink();const j=N.split(":");let F;const ie=j.findIndex((te=>te.startsWith("id=")));return ie!==-1&&(F=j[ie].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:F,uri:W}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(N,W){const j=N.split(";");for(let F=0;F<j.length&&!(W>=this._specialColors.length);++F,++W)if(j[F]==="?")this._onColor.fire([{type:0,index:this._specialColors[W]}]);else{const ie=(0,R.parseColor)(j[F]);ie&&this._onColor.fire([{type:1,index:this._specialColors[W],color:ie}])}return!0}setOrReportFgColor(N){return this._setOrReportSpecialColor(N,0)}setOrReportBgColor(N){return this._setOrReportSpecialColor(N,1)}setOrReportCursorColor(N){return this._setOrReportSpecialColor(N,2)}restoreIndexedColor(N){if(!N)return this._onColor.fire([{type:2}]),!0;const W=[],j=N.split(";");for(let F=0;F<j.length;++F)if(/^\d+$/.exec(j[F])){const ie=parseInt(j[F]);X(ie)&&W.push({type:2,index:ie})}return W.length&&this._onColor.fire(W),!0}restoreFgColor(N){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(N){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(N){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,b.DEFAULT_CHARSET),!0}selectCharset(N){return N.length!==2?(this.selectDefaultCharset(),!0):(N[0]==="/"||this._charsetService.setgCharset(k[N[0]],b.CHARSETS[N[1]]||b.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 N=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,N,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=a.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=a.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(N){return this._charsetService.setgLevel(N),!0}screenAlignmentPattern(){const N=new h.CellData;N.content=4194373,N.fg=this._curAttrData.fg,N.bg=this._curAttrData.bg,this._setCursor(0,0);for(let W=0;W<this._bufferService.rows;++W){const j=this._activeBuffer.ybase+this._activeBuffer.y+W,F=this._activeBuffer.lines.get(j);F&&(F.fill(N),F.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(N,W){const j=this._bufferService.buffer,F=this._optionsService.rawOptions;return(ie=>(this._coreService.triggerDataEvent(`${o.C0.ESC}${ie}${o.C0.ESC}\\`),!0))(N==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:N==='"p'?'P1$r61;1"p':N==="r"?`P1$r${j.scrollTop+1};${j.scrollBottom+1}r`:N==="m"?"P1$r0m":N===" q"?`P1$r${{block:2,underline:4,bar:6}[F.cursorStyle]-(F.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(N,W){this._dirtyRowTracker.markRangeDirty(N,W)}}n.InputHandler=re;let V=class{constructor(I){this._bufferService=I,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(I){I<this.start?this.start=I:I>this.end&&(this.end=I)}markRangeDirty(I,N){I>N&&(Y=I,I=N,N=Y),I<this.start&&(this.start=I),N>this.end&&(this.end=N)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(I){return 0<=I&&I<256}V=m([v(0,T.IBufferService)],V)},844:(P,n)=>{function d(m){for(const v of m)v.dispose();m.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const m of this._disposables)m.dispose();this._disposables.length=0}register(m){return this._disposables.push(m),m}unregister(m){const v=this._disposables.indexOf(m);v!==-1&&this._disposables.splice(v,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(m){this._isDisposed||m===this._value||(this._value?.dispose(),this._value=m)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},n.toDisposable=function(m){return{dispose:m}},n.disposeArray=d,n.getDisposeArrayDisposable=function(m){return{dispose:()=>d(m)}}},1505:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class d{constructor(){this._data={}}set(v,o,b){this._data[v]||(this._data[v]={}),this._data[v][o]=b}get(v,o){return this._data[v]?this._data[v][o]:void 0}clear(){this._data={}}}n.TwoKeyMap=d,n.FourKeyMap=class{constructor(){this._data=new d}set(m,v,o,b,x){this._data.get(m,v)||this._data.set(m,v,new d),this._data.get(m,v).set(o,b,x)}get(m,v,o,b){return this._data.get(m,v)?.get(o,b)}clear(){this._data.clear()}}},6114:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof process<"u"&&"title"in process;const d=n.isNode?"node":navigator.userAgent,m=n.isNode?"node":navigator.platform;n.isFirefox=d.includes("Firefox"),n.isLegacyEdge=d.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(d),n.getSafariVersion=function(){if(!n.isSafari)return 0;const v=d.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(m),n.isIpad=m==="iPad",n.isIphone=m==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(m),n.isLinux=m.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(d)},6106:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SortedList=void 0;let d=0;n.SortedList=class{constructor(m){this._getKey=m,this._array=[]}clear(){this._array.length=0}insert(m){this._array.length!==0?(d=this._search(this._getKey(m)),this._array.splice(d,0,m)):this._array.push(m)}delete(m){if(this._array.length===0)return!1;const v=this._getKey(m);if(v===void 0||(d=this._search(v),d===-1)||this._getKey(this._array[d])!==v)return!1;do if(this._array[d]===m)return this._array.splice(d,1),!0;while(++d<this._array.length&&this._getKey(this._array[d])===v);return!1}*getKeyIterator(m){if(this._array.length!==0&&(d=this._search(m),!(d<0||d>=this._array.length)&&this._getKey(this._array[d])===m))do yield this._array[d];while(++d<this._array.length&&this._getKey(this._array[d])===m)}forEachByKey(m,v){if(this._array.length!==0&&(d=this._search(m),!(d<0||d>=this._array.length)&&this._getKey(this._array[d])===m))do v(this._array[d]);while(++d<this._array.length&&this._getKey(this._array[d])===m)}values(){return[...this._array].values()}_search(m){let v=0,o=this._array.length-1;for(;o>=v;){let b=v+o>>1;const x=this._getKey(this._array[b]);if(x>m)o=b-1;else{if(!(x<m)){for(;b>0&&this._getKey(this._array[b-1])===m;)b--;return b}v=b+1}}return v}}},7226:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const m=d(6114);class v{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(x){this._idleCallback=void 0;let A=0,p=0,a=x.timeRemaining(),u=0;for(;this._i<this._tasks.length;){if(A=Date.now(),this._tasks[this._i]()||this._i++,A=Math.max(1,Date.now()-A),p=Math.max(A,p),u=x.timeRemaining(),1.5*p>u)return a-A<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-A))}ms`),void this._start();a=u}this.clear()}}class o extends v{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const A=Date.now()+x;return{timeRemaining:()=>Math.max(0,A-Date.now())}}}n.PriorityTaskQueue=o,n.IdleTaskQueue=!m.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(b){return requestIdleCallback(b)}_cancelCallback(b){cancelIdleCallback(b)}}:o,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(b){this._queue.clear(),this._queue.enqueue(b)}flush(){this._queue.flush()}}},9282:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.updateWindowsModeWrappedState=void 0;const m=d(643);n.updateWindowsModeWrappedState=function(v){const o=v.buffer.lines.get(v.buffer.ybase+v.buffer.y-1),b=o?.get(v.cols-1),x=v.buffer.lines.get(v.buffer.ybase+v.buffer.y);x&&b&&(x.isWrapped=b[m.CHAR_DATA_CODE_INDEX]!==m.NULL_CELL_CODE&&b[m.CHAR_DATA_CODE_INDEX]!==m.WHITESPACE_CELL_CODE)}},3734:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class d{constructor(){this.fg=0,this.bg=0,this.extended=new m}static toColorRGB(o){return[o>>>16&255,o>>>8&255,255&o]}static fromColorRGB(o){return(255&o[0])<<16|(255&o[1])<<8|255&o[2]}clone(){const o=new d;return o.fg=this.fg,o.bg=this.bg,o.extended=this.extended.clone(),o}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}n.AttributeData=d;class m{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(o){this._ext=o}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(o){this._ext&=-469762049,this._ext|=o<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(o){this._ext&=-67108864,this._ext|=67108863&o}get urlId(){return this._urlId}set urlId(o){this._urlId=o}get underlineVariantOffset(){const o=(3758096384&this._ext)>>29;return o<0?4294967288^o:o}set underlineVariantOffset(o){this._ext&=536870911,this._ext|=o<<29&3758096384}constructor(o=0,b=0){this._ext=0,this._urlId=0,this._ext=o,this._urlId=b}clone(){return new m(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=m},9092:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Buffer=n.MAX_BUFFER_SIZE=void 0;const m=d(6349),v=d(7226),o=d(3734),b=d(8437),x=d(4634),A=d(511),p=d(643),a=d(4863),u=d(7116);n.MAX_BUFFER_SIZE=4294967295,n.Buffer=class{constructor(f,h,S){this._hasScrollback=f,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=b.DEFAULT_ATTR_DATA.clone(),this.savedCharset=u.DEFAULT_CHARSET,this.markers=[],this._nullCell=A.CellData.fromCharData([0,p.NULL_CELL_CHAR,p.NULL_CELL_WIDTH,p.NULL_CELL_CODE]),this._whitespaceCell=A.CellData.fromCharData([0,p.WHITESPACE_CELL_CHAR,p.WHITESPACE_CELL_WIDTH,p.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new v.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new m.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(f){return f?(this._nullCell.fg=f.fg,this._nullCell.bg=f.bg,this._nullCell.extended=f.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new o.ExtendedAttrs),this._nullCell}getWhitespaceCell(f){return f?(this._whitespaceCell.fg=f.fg,this._whitespaceCell.bg=f.bg,this._whitespaceCell.extended=f.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new o.ExtendedAttrs),this._whitespaceCell}getBlankLine(f,h){return new b.BufferLine(this._bufferService.cols,this.getNullCell(f),h)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const f=this.ybase+this.y-this.ydisp;return f>=0&&f<this._rows}_getCorrectBufferLength(f){if(!this._hasScrollback)return f;const h=f+this._optionsService.rawOptions.scrollback;return h>n.MAX_BUFFER_SIZE?n.MAX_BUFFER_SIZE:h}fillViewportRows(f){if(this.lines.length===0){f===void 0&&(f=b.DEFAULT_ATTR_DATA);let h=this._rows;for(;h--;)this.lines.push(this.getBlankLine(f))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new m.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(f,h){const S=this.getNullCell(b.DEFAULT_ATTR_DATA);let T=0;const w=this._getCorrectBufferLength(h);if(w>this.lines.maxLength&&(this.lines.maxLength=w),this.lines.length>0){if(this._cols<f)for(let y=0;y<this.lines.length;y++)T+=+this.lines.get(y).resize(f,S);let L=0;if(this._rows<h)for(let y=this._rows;y<h;y++)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 b.BufferLine(f,S)):this.ybase>0&&this.lines.length<=this.ybase+this.y+L+1?(this.ybase--,L++,this.ydisp>0&&this.ydisp--):this.lines.push(new b.BufferLine(f,S)));else for(let y=this._rows;y>h;y--)this.lines.length>h+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(w<this.lines.maxLength){const y=this.lines.length-w;y>0&&(this.lines.trimStart(y),this.ybase=Math.max(this.ybase-y,0),this.ydisp=Math.max(this.ydisp-y,0),this.savedY=Math.max(this.savedY-y,0)),this.lines.maxLength=w}this.x=Math.min(this.x,f-1),this.y=Math.min(this.y,h-1),L&&(this.y+=L),this.savedX=Math.min(this.savedX,f-1),this.scrollTop=0}if(this.scrollBottom=h-1,this._isReflowEnabled&&(this._reflow(f,h),this._cols>f))for(let L=0;L<this.lines.length;L++)T+=+this.lines.get(L).resize(f,S);this._cols=f,this._rows=h,this._memoryCleanupQueue.clear(),T>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let f=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,f=!1);let h=0;for(;this._memoryCleanupPosition<this.lines.length;)if(h+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),h>100)return!0;return f}get _isReflowEnabled(){const f=this._optionsService.rawOptions.windowsPty;return f&&f.buildNumber?this._hasScrollback&&f.backend==="conpty"&&f.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(f,h){this._cols!==f&&(f>this._cols?this._reflowLarger(f,h):this._reflowSmaller(f,h))}_reflowLarger(f,h){const S=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,f,this.ybase+this.y,this.getNullCell(b.DEFAULT_ATTR_DATA));if(S.length>0){const T=(0,x.reflowLargerCreateNewLayout)(this.lines,S);(0,x.reflowLargerApplyNewLayout)(this.lines,T.layout),this._reflowLargerAdjustViewport(f,h,T.countRemoved)}}_reflowLargerAdjustViewport(f,h,S){const T=this.getNullCell(b.DEFAULT_ATTR_DATA);let w=S;for(;w-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<h&&this.lines.push(new b.BufferLine(f,T))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(f,h){const S=this.getNullCell(b.DEFAULT_ATTR_DATA),T=[];let w=0;for(let L=this.lines.length-1;L>=0;L--){let y=this.lines.get(L);if(!y||!y.isWrapped&&y.getTrimmedLength()<=f)continue;const R=[y];for(;y.isWrapped&&L>0;)y=this.lines.get(--L),R.unshift(y);const k=this.ybase+this.y;if(k>=L&&k<L+R.length)continue;const U=R[R.length-1].getTrimmedLength(),H=(0,x.reflowSmallerGetNewLineLengths)(R,this._cols,f),z=H.length-R.length;let Y;Y=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+z):Math.max(0,this.lines.length-this.lines.maxLength+z);const re=[];for(let j=0;j<z;j++){const F=this.getBlankLine(b.DEFAULT_ATTR_DATA,!0);re.push(F)}re.length>0&&(T.push({start:L+R.length+w,newLines:re}),w+=re.length),R.push(...re);let V=H.length-1,X=H[V];X===0&&(V--,X=H[V]);let I=R.length-z-1,N=U;for(;I>=0;){const j=Math.min(N,X);if(R[V]===void 0)break;if(R[V].copyCellsFrom(R[I],N-j,X-j,j,!0),X-=j,X===0&&(V--,X=H[V]),N-=j,N===0){I--;const F=Math.max(I,0);N=(0,x.getWrappedLineTrimmedLength)(R,F,this._cols)}}for(let j=0;j<R.length;j++)H[j]<f&&R[j].setCell(H[j],S);let W=z-Y;for(;W-- >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+w)-h&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+z,this.ybase+h-1)}if(T.length>0){const L=[],y=[];for(let V=0;V<this.lines.length;V++)y.push(this.lines.get(V));const R=this.lines.length;let k=R-1,U=0,H=T[U];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+w);let z=0;for(let V=Math.min(this.lines.maxLength-1,R+w-1);V>=0;V--)if(H&&H.start>k+z){for(let X=H.newLines.length-1;X>=0;X--)this.lines.set(V--,H.newLines[X]);V++,L.push({index:k+1,amount:H.newLines.length}),z+=H.newLines.length,H=T[++U]}else this.lines.set(V,y[k--]);let Y=0;for(let V=L.length-1;V>=0;V--)L[V].index+=Y,this.lines.onInsertEmitter.fire(L[V]),Y+=L[V].amount;const re=Math.max(0,R+w-this.lines.maxLength);re>0&&this.lines.onTrimEmitter.fire(re)}}translateBufferLineToString(f,h,S=0,T){const w=this.lines.get(f);return w?w.translateToString(h,S,T):""}getWrappedRangeForLine(f){let h=f,S=f;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(f){for(f!=null?this.tabs[f]||(f=this.prevStop(f)):(this.tabs={},f=0);f<this._cols;f+=this._optionsService.rawOptions.tabStopWidth)this.tabs[f]=!0}prevStop(f){for(f==null&&(f=this.x);!this.tabs[--f]&&f>0;);return f>=this._cols?this._cols-1:f<0?0:f}nextStop(f){for(f==null&&(f=this.x);!this.tabs[++f]&&f<this._cols;);return f>=this._cols?this._cols-1:f<0?0:f}clearMarkers(f){this._isClearing=!0;for(let h=0;h<this.markers.length;h++)this.markers[h].line===f&&(this.markers[h].dispose(),this.markers.splice(h--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let f=0;f<this.markers.length;f++)this.markers[f].dispose(),this.markers.splice(f--,1);this._isClearing=!1}addMarker(f){const h=new a.Marker(f);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(f){this._isClearing||this.markers.splice(this.markers.indexOf(f),1)}}},8437:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLine=n.DEFAULT_ATTR_DATA=void 0;const m=d(3734),v=d(511),o=d(643),b=d(482);n.DEFAULT_ATTR_DATA=Object.freeze(new m.AttributeData);let x=0;class A{constructor(a,u,f=!1){this.isWrapped=f,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*a);const h=u||v.CellData.fromCharData([0,o.NULL_CELL_CHAR,o.NULL_CELL_WIDTH,o.NULL_CELL_CODE]);for(let S=0;S<a;++S)this.setCell(S,h);this.length=a}get(a){const u=this._data[3*a+0],f=2097151&u;return[this._data[3*a+1],2097152&u?this._combined[a]:f?(0,b.stringFromCodePoint)(f):"",u>>22,2097152&u?this._combined[a].charCodeAt(this._combined[a].length-1):f]}set(a,u){this._data[3*a+1]=u[o.CHAR_DATA_ATTR_INDEX],u[o.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[a]=u[1],this._data[3*a+0]=2097152|a|u[o.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*a+0]=u[o.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|u[o.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(a){return this._data[3*a+0]>>22}hasWidth(a){return 12582912&this._data[3*a+0]}getFg(a){return this._data[3*a+1]}getBg(a){return this._data[3*a+2]}hasContent(a){return 4194303&this._data[3*a+0]}getCodePoint(a){const u=this._data[3*a+0];return 2097152&u?this._combined[a].charCodeAt(this._combined[a].length-1):2097151&u}isCombined(a){return 2097152&this._data[3*a+0]}getString(a){const u=this._data[3*a+0];return 2097152&u?this._combined[a]:2097151&u?(0,b.stringFromCodePoint)(2097151&u):""}isProtected(a){return 536870912&this._data[3*a+2]}loadCell(a,u){return x=3*a,u.content=this._data[x+0],u.fg=this._data[x+1],u.bg=this._data[x+2],2097152&u.content&&(u.combinedData=this._combined[a]),268435456&u.bg&&(u.extended=this._extendedAttrs[a]),u}setCell(a,u){2097152&u.content&&(this._combined[a]=u.combinedData),268435456&u.bg&&(this._extendedAttrs[a]=u.extended),this._data[3*a+0]=u.content,this._data[3*a+1]=u.fg,this._data[3*a+2]=u.bg}setCellFromCodepoint(a,u,f,h){268435456&h.bg&&(this._extendedAttrs[a]=h.extended),this._data[3*a+0]=u|f<<22,this._data[3*a+1]=h.fg,this._data[3*a+2]=h.bg}addCodepointToCell(a,u,f){let h=this._data[3*a+0];2097152&h?this._combined[a]+=(0,b.stringFromCodePoint)(u):2097151&h?(this._combined[a]=(0,b.stringFromCodePoint)(2097151&h)+(0,b.stringFromCodePoint)(u),h&=-2097152,h|=2097152):h=u|4194304,f&&(h&=-12582913,h|=f<<22),this._data[3*a+0]=h}insertCells(a,u,f){if((a%=this.length)&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a-1,0,1,f),u<this.length-a){const h=new v.CellData;for(let S=this.length-a-u-1;S>=0;--S)this.setCell(a+u+S,this.loadCell(a+S,h));for(let S=0;S<u;++S)this.setCell(a+S,f)}else for(let h=a;h<this.length;++h)this.setCell(h,f);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,f)}deleteCells(a,u,f){if(a%=this.length,u<this.length-a){const h=new v.CellData;for(let S=0;S<this.length-a-u;++S)this.setCell(a+S,this.loadCell(a+u+S,h));for(let S=this.length-u;S<this.length;++S)this.setCell(S,f)}else for(let h=a;h<this.length;++h)this.setCell(h,f);a&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a-1,0,1,f),this.getWidth(a)!==0||this.hasContent(a)||this.setCellFromCodepoint(a,0,1,f)}replaceCells(a,u,f,h=!1){if(h)for(a&&this.getWidth(a-1)===2&&!this.isProtected(a-1)&&this.setCellFromCodepoint(a-1,0,1,f),u<this.length&&this.getWidth(u-1)===2&&!this.isProtected(u)&&this.setCellFromCodepoint(u,0,1,f);a<u&&a<this.length;)this.isProtected(a)||this.setCell(a,f),a++;else for(a&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a-1,0,1,f),u<this.length&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u,0,1,f);a<u&&a<this.length;)this.setCell(a++,f)}resize(a,u){if(a===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const f=3*a;if(a>this.length){if(this._data.buffer.byteLength>=4*f)this._data=new Uint32Array(this._data.buffer,0,f);else{const h=new Uint32Array(f);h.set(this._data),this._data=h}for(let h=this.length;h<a;++h)this.setCell(h,u)}else{this._data=this._data.subarray(0,f);const h=Object.keys(this._combined);for(let T=0;T<h.length;T++){const w=parseInt(h[T],10);w>=a&&delete this._combined[w]}const S=Object.keys(this._extendedAttrs);for(let T=0;T<S.length;T++){const w=parseInt(S[T],10);w>=a&&delete this._extendedAttrs[w]}}return this.length=a,4*f*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const a=new Uint32Array(this._data.length);return a.set(this._data),this._data=a,1}return 0}fill(a,u=!1){if(u)for(let f=0;f<this.length;++f)this.isProtected(f)||this.setCell(f,a);else{this._combined={},this._extendedAttrs={};for(let f=0;f<this.length;++f)this.setCell(f,a)}}copyFrom(a){this.length!==a.length?this._data=new Uint32Array(a._data):this._data.set(a._data),this.length=a.length,this._combined={};for(const u in a._combined)this._combined[u]=a._combined[u];this._extendedAttrs={};for(const u in a._extendedAttrs)this._extendedAttrs[u]=a._extendedAttrs[u];this.isWrapped=a.isWrapped}clone(){const a=new A(0);a._data=new Uint32Array(this._data),a.length=this.length;for(const u in this._combined)a._combined[u]=this._combined[u];for(const u in this._extendedAttrs)a._extendedAttrs[u]=this._extendedAttrs[u];return a.isWrapped=this.isWrapped,a}getTrimmedLength(){for(let a=this.length-1;a>=0;--a)if(4194303&this._data[3*a+0])return a+(this._data[3*a+0]>>22);return 0}getNoBgTrimmedLength(){for(let a=this.length-1;a>=0;--a)if(4194303&this._data[3*a+0]||50331648&this._data[3*a+2])return a+(this._data[3*a+0]>>22);return 0}copyCellsFrom(a,u,f,h,S){const T=a._data;if(S)for(let L=h-1;L>=0;L--){for(let y=0;y<3;y++)this._data[3*(f+L)+y]=T[3*(u+L)+y];268435456&T[3*(u+L)+2]&&(this._extendedAttrs[f+L]=a._extendedAttrs[u+L])}else for(let L=0;L<h;L++){for(let y=0;y<3;y++)this._data[3*(f+L)+y]=T[3*(u+L)+y];268435456&T[3*(u+L)+2]&&(this._extendedAttrs[f+L]=a._extendedAttrs[u+L])}const w=Object.keys(a._combined);for(let L=0;L<w.length;L++){const y=parseInt(w[L],10);y>=u&&(this._combined[y-u+f]=a._combined[y])}}translateToString(a,u,f,h){u=u??0,f=f??this.length,a&&(f=Math.min(f,this.getTrimmedLength())),h&&(h.length=0);let S="";for(;u<f;){const T=this._data[3*u+0],w=2097151&T,L=2097152&T?this._combined[u]:w?(0,b.stringFromCodePoint)(w):o.WHITESPACE_CELL_CHAR;if(S+=L,h)for(let y=0;y<L.length;++y)h.push(u);u+=T>>22||1}return h&&h.push(u),S}}n.BufferLine=A},4841:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getRangeLength=void 0,n.getRangeLength=function(d,m){if(d.start.y>d.end.y)throw new Error(`Buffer range end (${d.end.x}, ${d.end.y}) cannot be before start (${d.start.x}, ${d.start.y})`);return m*(d.end.y-d.start.y)+(d.end.x-d.start.x+1)}},4634:(P,n)=>{function d(m,v,o){if(v===m.length-1)return m[v].getTrimmedLength();const b=!m[v].hasContent(o-1)&&m[v].getWidth(o-1)===1,x=m[v+1].getWidth(0)===2;return b&&x?o-1:o}Object.defineProperty(n,"__esModule",{value:!0}),n.getWrappedLineTrimmedLength=n.reflowSmallerGetNewLineLengths=n.reflowLargerApplyNewLayout=n.reflowLargerCreateNewLayout=n.reflowLargerGetLinesToRemove=void 0,n.reflowLargerGetLinesToRemove=function(m,v,o,b,x){const A=[];for(let p=0;p<m.length-1;p++){let a=p,u=m.get(++a);if(!u.isWrapped)continue;const f=[m.get(p)];for(;a<m.length&&u.isWrapped;)f.push(u),u=m.get(++a);if(b>=p&&b<a){p+=f.length-1;continue}let h=0,S=d(f,h,v),T=1,w=0;for(;T<f.length;){const y=d(f,T,v),R=y-w,k=o-S,U=Math.min(R,k);f[h].copyCellsFrom(f[T],w,S,U,!1),S+=U,S===o&&(h++,S=0),w+=U,w===y&&(T++,w=0),S===0&&h!==0&&f[h-1].getWidth(o-1)===2&&(f[h].copyCellsFrom(f[h-1],o-1,S++,1,!1),f[h-1].setCell(o-1,x))}f[h].replaceCells(S,o,x);let L=0;for(let y=f.length-1;y>0&&(y>h||f[y].getTrimmedLength()===0);y--)L++;L>0&&(A.push(p+f.length-L),A.push(L)),p+=f.length-1}return A},n.reflowLargerCreateNewLayout=function(m,v){const o=[];let b=0,x=v[b],A=0;for(let p=0;p<m.length;p++)if(x===p){const a=v[++b];m.onDeleteEmitter.fire({index:p-A,amount:a}),p+=a-1,A+=a,x=v[++b]}else o.push(p);return{layout:o,countRemoved:A}},n.reflowLargerApplyNewLayout=function(m,v){const o=[];for(let b=0;b<v.length;b++)o.push(m.get(v[b]));for(let b=0;b<o.length;b++)m.set(b,o[b]);m.length=v.length},n.reflowSmallerGetNewLineLengths=function(m,v,o){const b=[],x=m.map(((u,f)=>d(m,f,v))).reduce(((u,f)=>u+f));let A=0,p=0,a=0;for(;a<x;){if(x-a<o){b.push(x-a);break}A+=o;const u=d(m,p,v);A>u&&(A-=u,p++);const f=m[p].getWidth(A-1)===2;f&&A--;const h=f?o-1:o;b.push(h),a+=h}return b},n.getWrappedLineTrimmedLength=d},5295:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferSet=void 0;const m=d(8460),v=d(844),o=d(9092);class b extends v.Disposable{constructor(A,p){super(),this._optionsService=A,this._bufferService=p,this._onBufferActivate=this.register(new m.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new o.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new o.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(A){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(A),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(A,p){this._normal.resize(A,p),this._alt.resize(A,p),this.setupTabStops(A)}setupTabStops(A){this._normal.setupTabStops(A),this._alt.setupTabStops(A)}}n.BufferSet=b},511:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const m=d(482),v=d(643),o=d(3734);class b extends o.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new o.ExtendedAttrs,this.combinedData=""}static fromCharData(A){const p=new b;return p.setFromCharData(A),p}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,m.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(A){this.fg=A[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let p=!1;if(A[v.CHAR_DATA_CHAR_INDEX].length>2)p=!0;else if(A[v.CHAR_DATA_CHAR_INDEX].length===2){const a=A[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=a&&a<=56319){const u=A[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=u&&u<=57343?this.content=1024*(a-55296)+u-56320+65536|A[v.CHAR_DATA_WIDTH_INDEX]<<22:p=!0}else p=!0}else this.content=A[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|A[v.CHAR_DATA_WIDTH_INDEX]<<22;p&&(this.combinedData=A[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|A[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=b},643:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},4863:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Marker=void 0;const m=d(8460),v=d(844);class o{get id(){return this._id}constructor(x){this.line=x,this.isDisposed=!1,this._disposables=[],this._id=o._nextId++,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,v.disposeArray)(this._disposables),this._disposables.length=0)}register(x){return this._disposables.push(x),x}}n.Marker=o,o._nextId=1},7116:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DEFAULT_CHARSET=n.CHARSETS=void 0,n.CHARSETS={},n.DEFAULT_CHARSET=n.CHARSETS.B,n.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:"≥","{":"π","|":"≠","}":"£","~":"·"},n.CHARSETS.A={"#":"£"},n.CHARSETS.B=void 0,n.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},n.CHARSETS.C=n.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},n.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},n.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},n.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},n.CHARSETS.E=n.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},n.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},n.CHARSETS.H=n.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(P,n)=>{var d,m,v;Object.defineProperty(n,"__esModule",{value:!0}),n.C1_ESCAPED=n.C1=n.C0=void 0,(function(o){o.NUL="\0",o.SOH="",o.STX="",o.ETX="",o.EOT="",o.ENQ="",o.ACK="",o.BEL="\x07",o.BS="\b",o.HT=" ",o.LF=`
|
|
16
|
+
`,o.VT="\v",o.FF="\f",o.CR="\r",o.SO="",o.SI="",o.DLE="",o.DC1="",o.DC2="",o.DC3="",o.DC4="",o.NAK="",o.SYN="",o.ETB="",o.CAN="",o.EM="",o.SUB="",o.ESC="\x1B",o.FS="",o.GS="",o.RS="",o.US="",o.SP=" ",o.DEL=""})(d||(n.C0=d={})),(function(o){o.PAD="",o.HOP="",o.BPH="",o.NBH="",o.IND="",o.NEL="
",o.SSA="",o.ESA="",o.HTS="",o.HTJ="",o.VTS="",o.PLD="",o.PLU="",o.RI="",o.SS2="",o.SS3="",o.DCS="",o.PU1="",o.PU2="",o.STS="",o.CCH="",o.MW="",o.SPA="",o.EPA="",o.SOS="",o.SGCI="",o.SCI="",o.CSI="",o.ST="",o.OSC="",o.PM="",o.APC=""})(m||(n.C1=m={})),(function(o){o.ST=`${d.ESC}\\`})(v||(n.C1_ESCAPED=v={}))},7399:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.evaluateKeyboardEvent=void 0;const m=d(2584),v={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};n.evaluateKeyboardEvent=function(o,b,x,A){const p={type:0,cancel:!1,key:void 0},a=(o.shiftKey?1:0)|(o.altKey?2:0)|(o.ctrlKey?4:0)|(o.metaKey?8:0);switch(o.keyCode){case 0:o.key==="UIKeyInputUpArrow"?p.key=b?m.C0.ESC+"OA":m.C0.ESC+"[A":o.key==="UIKeyInputLeftArrow"?p.key=b?m.C0.ESC+"OD":m.C0.ESC+"[D":o.key==="UIKeyInputRightArrow"?p.key=b?m.C0.ESC+"OC":m.C0.ESC+"[C":o.key==="UIKeyInputDownArrow"&&(p.key=b?m.C0.ESC+"OB":m.C0.ESC+"[B");break;case 8:p.key=o.ctrlKey?"\b":m.C0.DEL,o.altKey&&(p.key=m.C0.ESC+p.key);break;case 9:if(o.shiftKey){p.key=m.C0.ESC+"[Z";break}p.key=m.C0.HT,p.cancel=!0;break;case 13:p.key=o.altKey?m.C0.ESC+m.C0.CR:m.C0.CR,p.cancel=!0;break;case 27:p.key=m.C0.ESC,o.altKey&&(p.key=m.C0.ESC+m.C0.ESC),p.cancel=!0;break;case 37:if(o.metaKey)break;a?(p.key=m.C0.ESC+"[1;"+(a+1)+"D",p.key===m.C0.ESC+"[1;3D"&&(p.key=m.C0.ESC+(x?"b":"[1;5D"))):p.key=b?m.C0.ESC+"OD":m.C0.ESC+"[D";break;case 39:if(o.metaKey)break;a?(p.key=m.C0.ESC+"[1;"+(a+1)+"C",p.key===m.C0.ESC+"[1;3C"&&(p.key=m.C0.ESC+(x?"f":"[1;5C"))):p.key=b?m.C0.ESC+"OC":m.C0.ESC+"[C";break;case 38:if(o.metaKey)break;a?(p.key=m.C0.ESC+"[1;"+(a+1)+"A",x||p.key!==m.C0.ESC+"[1;3A"||(p.key=m.C0.ESC+"[1;5A")):p.key=b?m.C0.ESC+"OA":m.C0.ESC+"[A";break;case 40:if(o.metaKey)break;a?(p.key=m.C0.ESC+"[1;"+(a+1)+"B",x||p.key!==m.C0.ESC+"[1;3B"||(p.key=m.C0.ESC+"[1;5B")):p.key=b?m.C0.ESC+"OB":m.C0.ESC+"[B";break;case 45:o.shiftKey||o.ctrlKey||(p.key=m.C0.ESC+"[2~");break;case 46:p.key=a?m.C0.ESC+"[3;"+(a+1)+"~":m.C0.ESC+"[3~";break;case 36:p.key=a?m.C0.ESC+"[1;"+(a+1)+"H":b?m.C0.ESC+"OH":m.C0.ESC+"[H";break;case 35:p.key=a?m.C0.ESC+"[1;"+(a+1)+"F":b?m.C0.ESC+"OF":m.C0.ESC+"[F";break;case 33:o.shiftKey?p.type=2:o.ctrlKey?p.key=m.C0.ESC+"[5;"+(a+1)+"~":p.key=m.C0.ESC+"[5~";break;case 34:o.shiftKey?p.type=3:o.ctrlKey?p.key=m.C0.ESC+"[6;"+(a+1)+"~":p.key=m.C0.ESC+"[6~";break;case 112:p.key=a?m.C0.ESC+"[1;"+(a+1)+"P":m.C0.ESC+"OP";break;case 113:p.key=a?m.C0.ESC+"[1;"+(a+1)+"Q":m.C0.ESC+"OQ";break;case 114:p.key=a?m.C0.ESC+"[1;"+(a+1)+"R":m.C0.ESC+"OR";break;case 115:p.key=a?m.C0.ESC+"[1;"+(a+1)+"S":m.C0.ESC+"OS";break;case 116:p.key=a?m.C0.ESC+"[15;"+(a+1)+"~":m.C0.ESC+"[15~";break;case 117:p.key=a?m.C0.ESC+"[17;"+(a+1)+"~":m.C0.ESC+"[17~";break;case 118:p.key=a?m.C0.ESC+"[18;"+(a+1)+"~":m.C0.ESC+"[18~";break;case 119:p.key=a?m.C0.ESC+"[19;"+(a+1)+"~":m.C0.ESC+"[19~";break;case 120:p.key=a?m.C0.ESC+"[20;"+(a+1)+"~":m.C0.ESC+"[20~";break;case 121:p.key=a?m.C0.ESC+"[21;"+(a+1)+"~":m.C0.ESC+"[21~";break;case 122:p.key=a?m.C0.ESC+"[23;"+(a+1)+"~":m.C0.ESC+"[23~";break;case 123:p.key=a?m.C0.ESC+"[24;"+(a+1)+"~":m.C0.ESC+"[24~";break;default:if(!o.ctrlKey||o.shiftKey||o.altKey||o.metaKey)if(x&&!A||!o.altKey||o.metaKey)!x||o.altKey||o.ctrlKey||o.shiftKey||!o.metaKey?o.key&&!o.ctrlKey&&!o.altKey&&!o.metaKey&&o.keyCode>=48&&o.key.length===1?p.key=o.key:o.key&&o.ctrlKey&&(o.key==="_"&&(p.key=m.C0.US),o.key==="@"&&(p.key=m.C0.NUL)):o.keyCode===65&&(p.type=1);else{const u=v[o.keyCode],f=u?.[o.shiftKey?1:0];if(f)p.key=m.C0.ESC+f;else if(o.keyCode>=65&&o.keyCode<=90){const h=o.ctrlKey?o.keyCode-64:o.keyCode+32;let S=String.fromCharCode(h);o.shiftKey&&(S=S.toUpperCase()),p.key=m.C0.ESC+S}else if(o.keyCode===32)p.key=m.C0.ESC+(o.ctrlKey?m.C0.NUL:" ");else if(o.key==="Dead"&&o.code.startsWith("Key")){let h=o.code.slice(3,4);o.shiftKey||(h=h.toLowerCase()),p.key=m.C0.ESC+h,p.cancel=!0}}else o.keyCode>=65&&o.keyCode<=90?p.key=String.fromCharCode(o.keyCode-64):o.keyCode===32?p.key=m.C0.NUL:o.keyCode>=51&&o.keyCode<=55?p.key=String.fromCharCode(o.keyCode-51+27):o.keyCode===56?p.key=m.C0.DEL:o.keyCode===219?p.key=m.C0.ESC:o.keyCode===220?p.key=m.C0.FS:o.keyCode===221&&(p.key=m.C0.GS)}return p}},482:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(d){return d>65535?(d-=65536,String.fromCharCode(55296+(d>>10))+String.fromCharCode(d%1024+56320)):String.fromCharCode(d)},n.utf32ToString=function(d,m=0,v=d.length){let o="";for(let b=m;b<v;++b){let x=d[b];x>65535?(x-=65536,o+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):o+=String.fromCharCode(x)}return o},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(d,m){const v=d.length;if(!v)return 0;let o=0,b=0;if(this._interim){const x=d.charCodeAt(b++);56320<=x&&x<=57343?m[o++]=1024*(this._interim-55296)+x-56320+65536:(m[o++]=this._interim,m[o++]=x),this._interim=0}for(let x=b;x<v;++x){const A=d.charCodeAt(x);if(55296<=A&&A<=56319){if(++x>=v)return this._interim=A,o;const p=d.charCodeAt(x);56320<=p&&p<=57343?m[o++]=1024*(A-55296)+p-56320+65536:(m[o++]=A,m[o++]=p)}else A!==65279&&(m[o++]=A)}return o}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(d,m){const v=d.length;if(!v)return 0;let o,b,x,A,p=0,a=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 w,L=0;for(;(w=63&this.interim[++L])&&L<4;)T<<=6,T|=w;const y=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=y-L;for(;u<R;){if(u>=v)return 0;if(w=d[u++],(192&w)!=128){u--,S=!0;break}this.interim[L++]=w,T<<=6,T|=63&w}S||(y===2?T<128?u--:m[p++]=T:y===3?T<2048||T>=55296&&T<=57343||T===65279||(m[p++]=T):T<65536||T>1114111||(m[p++]=T)),this.interim.fill(0)}const f=v-4;let h=u;for(;h<v;){for(;!(!(h<f)||128&(o=d[h])||128&(b=d[h+1])||128&(x=d[h+2])||128&(A=d[h+3]));)m[p++]=o,m[p++]=b,m[p++]=x,m[p++]=A,h+=4;if(o=d[h++],o<128)m[p++]=o;else if((224&o)==192){if(h>=v)return this.interim[0]=o,p;if(b=d[h++],(192&b)!=128){h--;continue}if(a=(31&o)<<6|63&b,a<128){h--;continue}m[p++]=a}else if((240&o)==224){if(h>=v)return this.interim[0]=o,p;if(b=d[h++],(192&b)!=128){h--;continue}if(h>=v)return this.interim[0]=o,this.interim[1]=b,p;if(x=d[h++],(192&x)!=128){h--;continue}if(a=(15&o)<<12|(63&b)<<6|63&x,a<2048||a>=55296&&a<=57343||a===65279)continue;m[p++]=a}else if((248&o)==240){if(h>=v)return this.interim[0]=o,p;if(b=d[h++],(192&b)!=128){h--;continue}if(h>=v)return this.interim[0]=o,this.interim[1]=b,p;if(x=d[h++],(192&x)!=128){h--;continue}if(h>=v)return this.interim[0]=o,this.interim[1]=b,this.interim[2]=x,p;if(A=d[h++],(192&A)!=128){h--;continue}if(a=(7&o)<<18|(63&b)<<12|(63&x)<<6|63&A,a<65536||a>1114111)continue;m[p++]=a}}return p}}},225:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV6=void 0;const m=d(1480),v=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],o=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let b;n.UnicodeV6=class{constructor(){if(this.version="6",!b){b=new Uint8Array(65536),b.fill(1),b[0]=0,b.fill(0,1,32),b.fill(0,127,160),b.fill(2,4352,4448),b[9001]=2,b[9002]=2,b.fill(2,11904,42192),b[12351]=1,b.fill(2,44032,55204),b.fill(2,63744,64256),b.fill(2,65040,65050),b.fill(2,65072,65136),b.fill(2,65280,65377),b.fill(2,65504,65511);for(let x=0;x<v.length;++x)b.fill(0,v[x][0],v[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?b[x]:(function(A,p){let a,u=0,f=p.length-1;if(A<p[0][0]||A>p[f][1])return!1;for(;f>=u;)if(a=u+f>>1,A>p[a][1])u=a+1;else{if(!(A<p[a][0]))return!0;f=a-1}return!1})(x,o)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,A){let p=this.wcwidth(x),a=p===0&&A!==0;if(a){const u=m.UnicodeService.extractWidth(A);u===0?a=!1:u>p&&(p=u)}return m.UnicodeService.createPropertyValue(0,p,a)}}},5981:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WriteBuffer=void 0;const m=d(8460),v=d(844);class o extends v.Disposable{constructor(x){super(),this._action=x,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new m.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(x,A){if(A!==void 0&&this._syncCalls>A)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let p;for(this._isSyncWriting=!0;p=this._writeBuffer.shift();){this._action(p);const a=this._callbacks.shift();a&&a()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,A){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(A),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(A)}_innerWrite(x=0,A=!0){const p=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const a=this._writeBuffer[this._bufferOffset],u=this._action(a,A);if(u){const h=S=>Date.now()-p>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(p,S);return void u.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(h)}const f=this._callbacks[this._bufferOffset];if(f&&f(),this._bufferOffset++,this._pendingData-=a.length,Date.now()-p>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}n.WriteBuffer=o},5941:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.toRgbString=n.parseColor=void 0;const d=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,m=/^[\da-f]+$/;function v(o,b){const x=o.toString(16),A=x.length<2?"0"+x:x;switch(b){case 4:return x[0];case 8:return A;case 12:return(A+A).slice(0,3);default:return A+A}}n.parseColor=function(o){if(!o)return;let b=o.toLowerCase();if(b.indexOf("rgb:")===0){b=b.slice(4);const x=d.exec(b);if(x){const A=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/A*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/A*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/A*255)]}}else if(b.indexOf("#")===0&&(b=b.slice(1),m.exec(b)&&[3,6,9,12].includes(b.length))){const x=b.length/3,A=[0,0,0];for(let p=0;p<3;++p){const a=parseInt(b.slice(x*p,x*p+x),16);A[p]=x===1?a<<4:x===2?a:x===3?a>>4:a>>8}return A}},n.toRgbString=function(o,b=16){const[x,A,p]=o;return`rgb:${v(x,b)}/${v(A,b)}/${v(p,b)}`}},5770:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PAYLOAD_LIMIT=void 0,n.PAYLOAD_LIMIT=1e7},6351:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DcsHandler=n.DcsParser=void 0;const m=d(482),v=d(8742),o=d(5770),b=[];n.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=b,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=b}registerHandler(A,p){this._handlers[A]===void 0&&(this._handlers[A]=[]);const a=this._handlers[A];return a.push(p),{dispose:()=>{const u=a.indexOf(p);u!==-1&&a.splice(u,1)}}}clearHandler(A){this._handlers[A]&&delete this._handlers[A]}setHandlerFallback(A){this._handlerFb=A}reset(){if(this._active.length)for(let A=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;A>=0;--A)this._active[A].unhook(!1);this._stack.paused=!1,this._active=b,this._ident=0}hook(A,p){if(this.reset(),this._ident=A,this._active=this._handlers[A]||b,this._active.length)for(let a=this._active.length-1;a>=0;a--)this._active[a].hook(p);else this._handlerFb(this._ident,"HOOK",p)}put(A,p,a){if(this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].put(A,p,a);else this._handlerFb(this._ident,"PUT",(0,m.utf32ToString)(A,p,a))}unhook(A,p=!0){if(this._active.length){let a=!1,u=this._active.length-1,f=!1;if(this._stack.paused&&(u=this._stack.loopPosition-1,a=p,f=this._stack.fallThrough,this._stack.paused=!1),!f&&a===!1){for(;u>=0&&(a=this._active[u].unhook(A),a!==!0);u--)if(a instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!1,a;u--}for(;u>=0;u--)if(a=this._active[u].unhook(!1),a instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!0,a}else this._handlerFb(this._ident,"UNHOOK",A);this._active=b,this._ident=0}};const x=new v.Params;x.addParam(0),n.DcsHandler=class{constructor(A){this._handler=A,this._data="",this._params=x,this._hitLimit=!1}hook(A){this._params=A.length>1||A.params[0]?A.clone():x,this._data="",this._hitLimit=!1}put(A,p,a){this._hitLimit||(this._data+=(0,m.utf32ToString)(A,p,a),this._data.length>o.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(A){let p=!1;if(this._hitLimit)p=!1;else if(A&&(p=this._handler(this._data,this._params),p instanceof Promise))return p.then((a=>(this._params=x,this._data="",this._hitLimit=!1,a)));return this._params=x,this._data="",this._hitLimit=!1,p}}},2015:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.EscapeSequenceParser=n.VT500_TRANSITION_TABLE=n.TransitionTable=void 0;const m=d(844),v=d(8742),o=d(6242),b=d(6351);class x{constructor(u){this.table=new Uint8Array(u)}setDefault(u,f){this.table.fill(u<<4|f)}add(u,f,h,S){this.table[f<<8|u]=h<<4|S}addMany(u,f,h,S){for(let T=0;T<u.length;T++)this.table[f<<8|u[T]]=h<<4|S}}n.TransitionTable=x;const A=160;n.VT500_TRANSITION_TABLE=(function(){const a=new x(4095),u=Array.apply(null,Array(256)).map(((L,y)=>y)),f=(L,y)=>u.slice(L,y),h=f(32,127),S=f(0,24);S.push(25),S.push.apply(S,f(28,32));const T=f(0,14);let w;for(w in a.setDefault(1,0),a.addMany(h,0,2,0),T)a.addMany([24,26,153,154],w,3,0),a.addMany(f(128,144),w,3,0),a.addMany(f(144,152),w,3,0),a.add(156,w,0,0),a.add(27,w,11,1),a.add(157,w,4,8),a.addMany([152,158,159],w,0,7),a.add(155,w,11,3),a.add(144,w,11,9);return a.addMany(S,0,3,0),a.addMany(S,1,3,1),a.add(127,1,0,1),a.addMany(S,8,0,8),a.addMany(S,3,3,3),a.add(127,3,0,3),a.addMany(S,4,3,4),a.add(127,4,0,4),a.addMany(S,6,3,6),a.addMany(S,5,3,5),a.add(127,5,0,5),a.addMany(S,2,3,2),a.add(127,2,0,2),a.add(93,1,4,8),a.addMany(h,8,5,8),a.add(127,8,5,8),a.addMany([156,27,24,26,7],8,6,0),a.addMany(f(28,32),8,0,8),a.addMany([88,94,95],1,0,7),a.addMany(h,7,0,7),a.addMany(S,7,0,7),a.add(156,7,0,0),a.add(127,7,0,7),a.add(91,1,11,3),a.addMany(f(64,127),3,7,0),a.addMany(f(48,60),3,8,4),a.addMany([60,61,62,63],3,9,4),a.addMany(f(48,60),4,8,4),a.addMany(f(64,127),4,7,0),a.addMany([60,61,62,63],4,0,6),a.addMany(f(32,64),6,0,6),a.add(127,6,0,6),a.addMany(f(64,127),6,0,0),a.addMany(f(32,48),3,9,5),a.addMany(f(32,48),5,9,5),a.addMany(f(48,64),5,0,6),a.addMany(f(64,127),5,7,0),a.addMany(f(32,48),4,9,5),a.addMany(f(32,48),1,9,2),a.addMany(f(32,48),2,9,2),a.addMany(f(48,127),2,10,0),a.addMany(f(48,80),1,10,0),a.addMany(f(81,88),1,10,0),a.addMany([89,90,92],1,10,0),a.addMany(f(96,127),1,10,0),a.add(80,1,11,9),a.addMany(S,9,0,9),a.add(127,9,0,9),a.addMany(f(28,32),9,0,9),a.addMany(f(32,48),9,9,12),a.addMany(f(48,60),9,8,10),a.addMany([60,61,62,63],9,9,10),a.addMany(S,11,0,11),a.addMany(f(32,128),11,0,11),a.addMany(f(28,32),11,0,11),a.addMany(S,10,0,10),a.add(127,10,0,10),a.addMany(f(28,32),10,0,10),a.addMany(f(48,60),10,8,10),a.addMany([60,61,62,63],10,0,11),a.addMany(f(32,48),10,9,12),a.addMany(S,12,0,12),a.add(127,12,0,12),a.addMany(f(28,32),12,0,12),a.addMany(f(32,48),12,9,12),a.addMany(f(48,64),12,0,11),a.addMany(f(64,127),12,12,13),a.addMany(f(64,127),10,12,13),a.addMany(f(64,127),9,12,13),a.addMany(S,13,13,13),a.addMany(h,13,13,13),a.add(127,13,0,13),a.addMany([27,156,24,26],13,14,0),a.add(A,0,2,0),a.add(A,8,5,8),a.add(A,6,0,6),a.add(A,11,0,11),a.add(A,13,13,13),a})();class p extends m.Disposable{constructor(u=n.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 v.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(f,h,S)=>{},this._executeHandlerFb=f=>{},this._csiHandlerFb=(f,h)=>{},this._escHandlerFb=f=>{},this._errorHandlerFb=f=>f,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,m.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new o.OscParser),this._dcsParser=this.register(new b.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(u,f=[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 w=u.intermediates.charCodeAt(T);if(32>w||w>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");h<<=8,h|=w}}if(u.final.length!==1)throw new Error("final must be a single byte");const S=u.final.charCodeAt(0);if(f[0]>S||S>f[1])throw new Error(`final must be in range ${f[0]} .. ${f[1]}`);return h<<=8,h|=S,h}identToString(u){const f=[];for(;u;)f.push(String.fromCharCode(255&u)),u>>=8;return f.reverse().join("")}setPrintHandler(u){this._printHandler=u}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(u,f){const h=this._identifier(u,[48,126]);this._escHandlers[h]===void 0&&(this._escHandlers[h]=[]);const S=this._escHandlers[h];return S.push(f),{dispose:()=>{const T=S.indexOf(f);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,f){this._executeHandlers[u.charCodeAt(0)]=f}clearExecuteHandler(u){this._executeHandlers[u.charCodeAt(0)]&&delete this._executeHandlers[u.charCodeAt(0)]}setExecuteHandlerFallback(u){this._executeHandlerFb=u}registerCsiHandler(u,f){const h=this._identifier(u);this._csiHandlers[h]===void 0&&(this._csiHandlers[h]=[]);const S=this._csiHandlers[h];return S.push(f),{dispose:()=>{const T=S.indexOf(f);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,f){return this._dcsParser.registerHandler(this._identifier(u),f)}clearDcsHandler(u){this._dcsParser.clearHandler(this._identifier(u))}setDcsHandlerFallback(u){this._dcsParser.setHandlerFallback(u)}registerOscHandler(u,f){return this._oscParser.registerHandler(u,f)}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,f,h,S,T){this._parseStack.state=u,this._parseStack.handlers=f,this._parseStack.handlerPos=h,this._parseStack.transition=S,this._parseStack.chunkPos=T}parse(u,f,h){let S,T=0,w=0,L=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,L=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 y=this._parseStack.handlers;let R=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(h===!1&&R>-1){for(;R>=0&&(S=y[R](this._params),S!==!0);R--)if(S instanceof Promise)return this._parseStack.handlerPos=R,S}this._parseStack.handlers=[];break;case 4:if(h===!1&&R>-1){for(;R>=0&&(S=y[R](),S!==!0);R--)if(S instanceof Promise)return this._parseStack.handlerPos=R,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,L=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let y=L;y<f;++y){switch(T=u[y],w=this._transitions.table[this.currentState<<8|(T<160?T:A)],w>>4){case 2:for(let z=y+1;;++z){if(z>=f||(T=u[z])<32||T>126&&T<A){this._printHandler(u,y,z),y=z-1;break}if(++z>=f||(T=u[z])<32||T>126&&T<A){this._printHandler(u,y,z),y=z-1;break}if(++z>=f||(T=u[z])<32||T>126&&T<A){this._printHandler(u,y,z),y=z-1;break}if(++z>=f||(T=u[z])<32||T>126&&T<A){this._printHandler(u,y,z),y=z-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:y,code:T,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const R=this._csiHandlers[this._collect<<8|T];let k=R?R.length-1:-1;for(;k>=0&&(S=R[k](this._params),S!==!0);k--)if(S instanceof Promise)return this._preserveStack(3,R,k,w,y),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(++y<f&&(T=u[y])>47&&T<60);y--;break;case 9:this._collect<<=8,this._collect|=T;break;case 10:const U=this._escHandlers[this._collect<<8|T];let H=U?U.length-1:-1;for(;H>=0&&(S=U[H](),S!==!0);H--)if(S instanceof Promise)return this._preserveStack(4,U,H,w,y),S;H<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 z=y+1;;++z)if(z>=f||(T=u[z])===24||T===26||T===27||T>127&&T<A){this._dcsParser.put(u,y,z),y=z-1;break}break;case 14:if(S=this._dcsParser.unhook(T!==24&&T!==26),S)return this._preserveStack(6,[],0,w,y),S;T===27&&(w|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let z=y+1;;z++)if(z>=f||(T=u[z])<32||T>127&&T<A){this._oscParser.put(u,y,z),y=z-1;break}break;case 6:if(S=this._oscParser.end(T!==24&&T!==26),S)return this._preserveStack(5,[],0,w,y),S;T===27&&(w|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&w}}}n.EscapeSequenceParser=p},6242:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OscHandler=n.OscParser=void 0;const m=d(5770),v=d(482),o=[];n.OscParser=class{constructor(){this._state=0,this._active=o,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(b,x){this._handlers[b]===void 0&&(this._handlers[b]=[]);const A=this._handlers[b];return A.push(x),{dispose:()=>{const p=A.indexOf(x);p!==-1&&A.splice(p,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=o}reset(){if(this._state===2)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].end(!1);this._stack.paused=!1,this._active=o,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||o,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].start();else this._handlerFb(this._id,"START")}_put(b,x,A){if(this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].put(b,x,A);else this._handlerFb(this._id,"PUT",(0,v.utf32ToString)(b,x,A))}start(){this.reset(),this._state=1}put(b,x,A){if(this._state!==3){if(this._state===1)for(;x<A;){const p=b[x++];if(p===59){this._state=2,this._start();break}if(p<48||57<p)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+p-48}this._state===2&&A-x>0&&this._put(b,x,A)}}end(b,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let A=!1,p=this._active.length-1,a=!1;if(this._stack.paused&&(p=this._stack.loopPosition-1,A=x,a=this._stack.fallThrough,this._stack.paused=!1),!a&&A===!1){for(;p>=0&&(A=this._active[p].end(b),A!==!0);p--)if(A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!1,A;p--}for(;p>=0;p--)if(A=this._active[p].end(!1),A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!0,A}else this._handlerFb(this._id,"END",b);this._active=o,this._id=-1,this._state=0}}},n.OscHandler=class{constructor(b){this._handler=b,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(b,x,A){this._hitLimit||(this._data+=(0,v.utf32ToString)(b,x,A),this._data.length>m.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(b){let x=!1;if(this._hitLimit)x=!1;else if(b&&(x=this._handler(this._data),x instanceof Promise))return x.then((A=>(this._data="",this._hitLimit=!1,A)));return this._data="",this._hitLimit=!1,x}}},8742:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Params=void 0;const d=2147483647;class m{static fromArray(o){const b=new m;if(!o.length)return b;for(let x=Array.isArray(o[0])?1:0;x<o.length;++x){const A=o[x];if(Array.isArray(A))for(let p=0;p<A.length;++p)b.addSubParam(A[p]);else b.addParam(A)}return b}constructor(o=32,b=32){if(this.maxLength=o,this.maxSubParamsLength=b,b>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(o),this.length=0,this._subParams=new Int32Array(b),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(o),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const o=new m(this.maxLength,this.maxSubParamsLength);return o.params.set(this.params),o.length=this.length,o._subParams.set(this._subParams),o._subParamsLength=this._subParamsLength,o._subParamsIdx.set(this._subParamsIdx),o._rejectDigits=this._rejectDigits,o._rejectSubDigits=this._rejectSubDigits,o._digitIsSub=this._digitIsSub,o}toArray(){const o=[];for(let b=0;b<this.length;++b){o.push(this.params[b]);const x=this._subParamsIdx[b]>>8,A=255&this._subParamsIdx[b];A-x>0&&o.push(Array.prototype.slice.call(this._subParams,x,A))}return o}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(o){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(o<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=o>d?d:o}}addSubParam(o){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(o<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=o>d?d:o,this._subParamsIdx[this.length-1]++}}hasSubParams(o){return(255&this._subParamsIdx[o])-(this._subParamsIdx[o]>>8)>0}getSubParams(o){const b=this._subParamsIdx[o]>>8,x=255&this._subParamsIdx[o];return x-b>0?this._subParams.subarray(b,x):null}getSubParamsAll(){const o={};for(let b=0;b<this.length;++b){const x=this._subParamsIdx[b]>>8,A=255&this._subParamsIdx[b];A-x>0&&(o[b]=this._subParams.slice(x,A))}return o}addDigit(o){let b;if(this._rejectDigits||!(b=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,A=x[b-1];x[b-1]=~A?Math.min(10*A+o,d):o}}n.Params=m},5741:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.AddonManager=void 0,n.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let d=this._addons.length-1;d>=0;d--)this._addons[d].instance.dispose()}loadAddon(d,m){const v={instance:m,dispose:m.dispose,isDisposed:!1};this._addons.push(v),m.dispose=()=>this._wrappedAddonDispose(v),m.activate(d)}_wrappedAddonDispose(d){if(d.isDisposed)return;let m=-1;for(let v=0;v<this._addons.length;v++)if(this._addons[v]===d){m=v;break}if(m===-1)throw new Error("Could not dispose an addon that has not been loaded");d.isDisposed=!0,d.dispose.apply(d.instance),this._addons.splice(m,1)}}},8771:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferApiView=void 0;const m=d(3785),v=d(511);n.BufferApiView=class{constructor(o,b){this._buffer=o,this.type=b}init(o){return this._buffer=o,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(o){const b=this._buffer.lines.get(o);if(b)return new m.BufferLineApiView(b)}getNullCell(){return new v.CellData}}},3785:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLineApiView=void 0;const m=d(511);n.BufferLineApiView=class{constructor(v){this._line=v}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(v,o){if(!(v<0||v>=this._line.length))return o?(this._line.loadCell(v,o),o):this._line.loadCell(v,new m.CellData)}translateToString(v,o,b){return this._line.translateToString(v,o,b)}}},8285:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferNamespaceApi=void 0;const m=d(8771),v=d(8460),o=d(844);class b extends o.Disposable{constructor(A){super(),this._core=A,this._onBufferChange=this.register(new v.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new m.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new m.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)}}n.BufferNamespaceApi=b},7975:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ParserApi=void 0,n.ParserApi=class{constructor(d){this._core=d}registerCsiHandler(d,m){return this._core.registerCsiHandler(d,(v=>m(v.toArray())))}addCsiHandler(d,m){return this.registerCsiHandler(d,m)}registerDcsHandler(d,m){return this._core.registerDcsHandler(d,((v,o)=>m(v,o.toArray())))}addDcsHandler(d,m){return this.registerDcsHandler(d,m)}registerEscHandler(d,m){return this._core.registerEscHandler(d,m)}addEscHandler(d,m){return this.registerEscHandler(d,m)}registerOscHandler(d,m){return this._core.registerOscHandler(d,m)}addOscHandler(d,m){return this.registerOscHandler(d,m)}}},7090:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeApi=void 0,n.UnicodeApi=class{constructor(d){this._core=d}register(d){this._core.unicodeService.register(d)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(d){this._core.unicodeService.activeVersion=d}}},744:function(P,n,d){var m=this&&this.__decorate||function(a,u,f,h){var S,T=arguments.length,w=T<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,f):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(a,u,f,h);else for(var L=a.length-1;L>=0;L--)(S=a[L])&&(w=(T<3?S(w):T>3?S(u,f,w):S(u,f))||w);return T>3&&w&&Object.defineProperty(u,f,w),w},v=this&&this.__param||function(a,u){return function(f,h){u(f,h,a)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferService=n.MINIMUM_ROWS=n.MINIMUM_COLS=void 0;const o=d(8460),b=d(844),x=d(5295),A=d(2585);n.MINIMUM_COLS=2,n.MINIMUM_ROWS=1;let p=n.BufferService=class extends b.Disposable{get buffer(){return this.buffers.active}constructor(a){super(),this.isUserScrolling=!1,this._onResize=this.register(new o.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new o.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(a.rawOptions.cols||0,n.MINIMUM_COLS),this.rows=Math.max(a.rawOptions.rows||0,n.MINIMUM_ROWS),this.buffers=this.register(new x.BufferSet(a,this))}resize(a,u){this.cols=a,this.rows=u,this.buffers.resize(a,u),this._onResize.fire({cols:a,rows:u})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(a,u=!1){const f=this.buffer;let h;h=this._cachedBlankLine,h&&h.length===this.cols&&h.getFg(0)===a.fg&&h.getBg(0)===a.bg||(h=f.getBlankLine(a,u),this._cachedBlankLine=h),h.isWrapped=u;const S=f.ybase+f.scrollTop,T=f.ybase+f.scrollBottom;if(f.scrollTop===0){const w=f.lines.isFull;T===f.lines.length-1?w?f.lines.recycle().copyFrom(h):f.lines.push(h.clone()):f.lines.splice(T+1,0,h.clone()),w?this.isUserScrolling&&(f.ydisp=Math.max(f.ydisp-1,0)):(f.ybase++,this.isUserScrolling||f.ydisp++)}else{const w=T-S+1;f.lines.shiftElements(S+1,w-1,-1),f.lines.set(T,h.clone())}this.isUserScrolling||(f.ydisp=f.ybase),this._onScroll.fire(f.ydisp)}scrollLines(a,u,f){const h=this.buffer;if(a<0){if(h.ydisp===0)return;this.isUserScrolling=!0}else a+h.ydisp>=h.ybase&&(this.isUserScrolling=!1);const S=h.ydisp;h.ydisp=Math.max(Math.min(h.ydisp+a,h.ybase),0),S!==h.ydisp&&(u||this._onScroll.fire(h.ydisp))}};n.BufferService=p=m([v(0,A.IOptionsService)],p)},7994:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CharsetService=void 0,n.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(d){this.glevel=d,this.charset=this._charsets[d]}setgCharset(d,m){this._charsets[d]=m,this.glevel===d&&(this.charset=m)}}},1753:function(P,n,d){var m=this&&this.__decorate||function(h,S,T,w){var L,y=arguments.length,R=y<3?S:w===null?w=Object.getOwnPropertyDescriptor(S,T):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(h,S,T,w);else for(var k=h.length-1;k>=0;k--)(L=h[k])&&(R=(y<3?L(R):y>3?L(S,T,R):L(S,T))||R);return y>3&&R&&Object.defineProperty(S,T,R),R},v=this&&this.__param||function(h,S){return function(T,w){S(T,w,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreMouseService=void 0;const o=d(2585),b=d(8460),x=d(844),A={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 p(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 a=String.fromCharCode,u={DEFAULT:h=>{const S=[p(h,!1)+32,h.col+32,h.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${a(S[0])}${a(S[1])}${a(S[2])}`},SGR:h=>{const S=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${p(h,!0)};${h.col};${h.row}${S}`},SGR_PIXELS:h=>{const S=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${p(h,!0)};${h.x};${h.y}${S}`}};let f=n.CoreMouseService=class extends x.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 b.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const T of Object.keys(A))this.addProtocol(T,A[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}};n.CoreMouseService=f=m([v(0,o.IBufferService),v(1,o.ICoreService)],f)},6975:function(P,n,d){var m=this&&this.__decorate||function(f,h,S,T){var w,L=arguments.length,y=L<3?h:T===null?T=Object.getOwnPropertyDescriptor(h,S):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(f,h,S,T);else for(var R=f.length-1;R>=0;R--)(w=f[R])&&(y=(L<3?w(y):L>3?w(h,S,y):w(h,S))||y);return L>3&&y&&Object.defineProperty(h,S,y),y},v=this&&this.__param||function(f,h){return function(S,T){h(S,T,f)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreService=void 0;const o=d(1439),b=d(8460),x=d(844),A=d(2585),p=Object.freeze({insertMode:!1}),a=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let u=n.CoreService=class extends x.Disposable{constructor(f,h,S){super(),this._bufferService=f,this._logService=h,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new b.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new b.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new b.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new b.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,o.clone)(p),this.decPrivateModes=(0,o.clone)(a)}reset(){this.modes=(0,o.clone)(p),this.decPrivateModes=(0,o.clone)(a)}triggerDataEvent(f,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 "${f}"`,(()=>f.split("").map((T=>T.charCodeAt(0))))),this._onData.fire(f)}triggerBinaryEvent(f){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${f}"`,(()=>f.split("").map((h=>h.charCodeAt(0))))),this._onBinary.fire(f))}};n.CoreService=u=m([v(0,A.IBufferService),v(1,A.ILogService),v(2,A.IOptionsService)],u)},9074:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DecorationService=void 0;const m=d(8055),v=d(8460),o=d(844),b=d(6106);let x=0,A=0;class p extends o.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new b.SortedList((f=>f?.marker.line)),this._onDecorationRegistered=this.register(new v.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new v.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,o.toDisposable)((()=>this.reset())))}registerDecoration(f){if(f.marker.isDisposed)return;const h=new a(f);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 f of this._decorations.values())f.dispose();this._decorations.clear()}*getDecorationsAtCell(f,h,S){let T=0,w=0;for(const L of this._decorations.getKeyIterator(h))T=L.options.x??0,w=T+(L.options.width??1),f>=T&&f<w&&(!S||(L.options.layer??"bottom")===S)&&(yield L)}forEachDecorationAtCell(f,h,S,T){this._decorations.forEachByKey(h,(w=>{x=w.options.x??0,A=x+(w.options.width??1),f>=x&&f<A&&(!S||(w.options.layer??"bottom")===S)&&T(w)}))}}n.DecorationService=p;class a extends o.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=m.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=m.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(f){super(),this.options=f,this.onRenderEmitter=this.register(new v.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new v.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=f.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.InstantiationService=n.ServiceCollection=void 0;const m=d(2585),v=d(8343);class o{constructor(...x){this._entries=new Map;for(const[A,p]of x)this.set(A,p)}set(x,A){const p=this._entries.get(x);return this._entries.set(x,A),p}forEach(x){for(const[A,p]of this._entries.entries())x(A,p)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}n.ServiceCollection=o,n.InstantiationService=class{constructor(){this._services=new o,this._services.set(m.IInstantiationService,this)}setService(b,x){this._services.set(b,x)}getService(b){return this._services.get(b)}createInstance(b,...x){const A=(0,v.getServiceDependencies)(b).sort(((u,f)=>u.index-f.index)),p=[];for(const u of A){const f=this._services.get(u.id);if(!f)throw new Error(`[createInstance] ${b.name} depends on UNKNOWN service ${u.id}.`);p.push(f)}const a=A.length>0?A[0].index:x.length;if(x.length!==a)throw new Error(`[createInstance] First service dependency of ${b.name} at position ${a+1} conflicts with ${x.length} static arguments`);return new b(...x,...p)}}},7866:function(P,n,d){var m=this&&this.__decorate||function(a,u,f,h){var S,T=arguments.length,w=T<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,f):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(a,u,f,h);else for(var L=a.length-1;L>=0;L--)(S=a[L])&&(w=(T<3?S(w):T>3?S(u,f,w):S(u,f))||w);return T>3&&w&&Object.defineProperty(u,f,w),w},v=this&&this.__param||function(a,u){return function(f,h){u(f,h,a)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const o=d(844),b=d(2585),x={trace:b.LogLevelEnum.TRACE,debug:b.LogLevelEnum.DEBUG,info:b.LogLevelEnum.INFO,warn:b.LogLevelEnum.WARN,error:b.LogLevelEnum.ERROR,off:b.LogLevelEnum.OFF};let A,p=n.LogService=class extends o.Disposable{get logLevel(){return this._logLevel}constructor(a){super(),this._optionsService=a,this._logLevel=b.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),A=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(a){for(let u=0;u<a.length;u++)typeof a[u]=="function"&&(a[u]=a[u]())}_log(a,u,f){this._evalLazyOptionalParams(f),a.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+u,...f)}trace(a,...u){this._logLevel<=b.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,a,u)}debug(a,...u){this._logLevel<=b.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,a,u)}info(a,...u){this._logLevel<=b.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,a,u)}warn(a,...u){this._logLevel<=b.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,a,u)}error(a,...u){this._logLevel<=b.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,a,u)}};n.LogService=p=m([v(0,b.IOptionsService)],p),n.setTraceLogger=function(a){A=a},n.traceCall=function(a,u,f){if(typeof f.value!="function")throw new Error("not supported");const h=f.value;f.value=function(...S){if(A.logLevel!==b.LogLevelEnum.TRACE)return h.apply(this,S);A.trace(`GlyphRenderer#${h.name}(${S.map((w=>JSON.stringify(w))).join(", ")})`);const T=h.apply(this,S);return A.trace(`GlyphRenderer#${h.name} return`,T),T}}},7302:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OptionsService=n.DEFAULT_OPTIONS=void 0;const m=d(8460),v=d(844),o=d(6114);n.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:o.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const b=["normal","bold","100","200","300","400","500","600","700","800","900"];class x extends v.Disposable{constructor(p){super(),this._onOptionChange=this.register(new m.EventEmitter),this.onOptionChange=this._onOptionChange.event;const a={...n.DEFAULT_OPTIONS};for(const u in p)if(u in a)try{const f=p[u];a[u]=this._sanitizeAndValidateOption(u,f)}catch(f){console.error(f)}this.rawOptions=a,this.options={...a},this._setupOptions(),this.register((0,v.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(p,a){return this.onOptionChange((u=>{u===p&&a(this.rawOptions[p])}))}onMultipleOptionChange(p,a){return this.onOptionChange((u=>{p.indexOf(u)!==-1&&a()}))}_setupOptions(){const p=u=>{if(!(u in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);return this.rawOptions[u]},a=(u,f)=>{if(!(u in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);f=this._sanitizeAndValidateOption(u,f),this.rawOptions[u]!==f&&(this.rawOptions[u]=f,this._onOptionChange.fire(u))};for(const u in this.rawOptions){const f={get:p.bind(this,u),set:a.bind(this,u)};Object.defineProperty(this.options,u,f)}}_sanitizeAndValidateOption(p,a){switch(p){case"cursorStyle":if(a||(a=n.DEFAULT_OPTIONS[p]),!(function(u){return u==="block"||u==="underline"||u==="bar"})(a))throw new Error(`"${a}" is not a valid value for ${p}`);break;case"wordSeparator":a||(a=n.DEFAULT_OPTIONS[p]);break;case"fontWeight":case"fontWeightBold":if(typeof a=="number"&&1<=a&&a<=1e3)break;a=b.includes(a)?a:n.DEFAULT_OPTIONS[p];break;case"cursorWidth":a=Math.floor(a);case"lineHeight":case"tabStopWidth":if(a<1)throw new Error(`${p} cannot be less than 1, value: ${a}`);break;case"minimumContrastRatio":a=Math.max(1,Math.min(21,Math.round(10*a)/10));break;case"scrollback":if((a=Math.min(a,4294967295))<0)throw new Error(`${p} cannot be less than 0, value: ${a}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(a<=0)throw new Error(`${p} cannot be less than or equal to 0, value: ${a}`);break;case"rows":case"cols":if(!a&&a!==0)throw new Error(`${p} must be numeric, value: ${a}`);break;case"windowsPty":a=a??{}}return a}}n.OptionsService=x},2660:function(P,n,d){var m=this&&this.__decorate||function(x,A,p,a){var u,f=arguments.length,h=f<3?A:a===null?a=Object.getOwnPropertyDescriptor(A,p):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(x,A,p,a);else for(var S=x.length-1;S>=0;S--)(u=x[S])&&(h=(f<3?u(h):f>3?u(A,p,h):u(A,p))||h);return f>3&&h&&Object.defineProperty(A,p,h),h},v=this&&this.__param||function(x,A){return function(p,a){A(p,a,x)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkService=void 0;const o=d(2585);let b=n.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const A=this._bufferService.buffer;if(x.id===void 0){const S=A.addMarker(A.ybase+A.y),T={data:x,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(T,S))),this._dataByLinkId.set(T.id,T),T.id}const p=x,a=this._getEntryIdKey(p),u=this._entriesWithId.get(a);if(u)return this.addLineToLink(u.id,A.ybase+A.y),u.id;const f=A.addMarker(A.ybase+A.y),h={id:this._nextId++,key:this._getEntryIdKey(p),data:p,lines:[f]};return f.onDispose((()=>this._removeMarkerFromLink(h,f))),this._entriesWithId.set(h.key,h),this._dataByLinkId.set(h.id,h),h.id}addLineToLink(x,A){const p=this._dataByLinkId.get(x);if(p&&p.lines.every((a=>a.line!==A))){const a=this._bufferService.buffer.addMarker(A);p.lines.push(a),a.onDispose((()=>this._removeMarkerFromLink(p,a)))}}getLinkData(x){return this._dataByLinkId.get(x)?.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,A){const p=x.lines.indexOf(A);p!==-1&&(x.lines.splice(p,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};n.OscLinkService=b=m([v(0,o.IBufferService)],b)},8343:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const d="di$target",m="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(v){return v[m]||[]},n.createDecorator=function(v){if(n.serviceRegistry.has(v))return n.serviceRegistry.get(v);const o=function(b,x,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(p,a,u){a[d]===a?a[m].push({id:p,index:u}):(a[m]=[{id:p,index:u}],a[d]=a)})(o,b,A)};return o.toString=()=>v,n.serviceRegistry.set(v,o),o}},2585:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const m=d(8343);var v;n.IBufferService=(0,m.createDecorator)("BufferService"),n.ICoreMouseService=(0,m.createDecorator)("CoreMouseService"),n.ICoreService=(0,m.createDecorator)("CoreService"),n.ICharsetService=(0,m.createDecorator)("CharsetService"),n.IInstantiationService=(0,m.createDecorator)("InstantiationService"),(function(o){o[o.TRACE=0]="TRACE",o[o.DEBUG=1]="DEBUG",o[o.INFO=2]="INFO",o[o.WARN=3]="WARN",o[o.ERROR=4]="ERROR",o[o.OFF=5]="OFF"})(v||(n.LogLevelEnum=v={})),n.ILogService=(0,m.createDecorator)("LogService"),n.IOptionsService=(0,m.createDecorator)("OptionsService"),n.IOscLinkService=(0,m.createDecorator)("OscLinkService"),n.IUnicodeService=(0,m.createDecorator)("UnicodeService"),n.IDecorationService=(0,m.createDecorator)("DecorationService")},1480:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const m=d(8460),v=d(225);class o{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,A,p=!1){return(16777215&x)<<3|(3&A)<<1|(p?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new m.EventEmitter,this.onChange=this._onChange.event;const x=new v.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let A=0,p=0;const a=x.length;for(let u=0;u<a;++u){let f=x.charCodeAt(u);if(55296<=f&&f<=56319){if(++u>=a)return A+this.wcwidth(f);const T=x.charCodeAt(u);56320<=T&&T<=57343?f=1024*(f-55296)+T-56320+65536:A+=this.wcwidth(T)}const h=this.charProperties(f,p);let S=o.extractWidth(h);o.extractShouldJoin(h)&&(S-=o.extractWidth(p)),A+=S,p=h}return A}charProperties(x,A){return this._activeProvider.charProperties(x,A)}}n.UnicodeService=o}},M={};function O(P){var n=M[P];if(n!==void 0)return n.exports;var d=M[P]={exports:{}};return E[P].call(d.exports,d,d.exports,O),d.exports}var K={};return(()=>{var P=K;Object.defineProperty(P,"__esModule",{value:!0}),P.Terminal=void 0;const n=O(9042),d=O(3236),m=O(844),v=O(5741),o=O(8285),b=O(7975),x=O(7090),A=["cols","rows"];class p extends m.Disposable{constructor(u){super(),this._core=this.register(new d.Terminal(u)),this._addonManager=this.register(new v.AddonManager),this._publicOptions={...this._core.options};const f=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:f.bind(this,S),set:h.bind(this,S)};Object.defineProperty(this._publicOptions,S,T)}}_checkReadonlyOptions(u){if(A.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 b.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new x.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new o.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const u=this._core.coreService.decPrivateModes;let f="none";switch(this._core.coreMouseService.activeProtocol){case"X10":f="x10";break;case"VT200":f="vt200";break;case"DRAG":f="drag";break;case"ANY":f="any"}return{applicationCursorKeysMode:u.applicationCursorKeys,applicationKeypadMode:u.applicationKeypad,bracketedPasteMode:u.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:f,originMode:u.origin,reverseWraparoundMode:u.reverseWraparound,sendFocusMode:u.sendFocus,wraparoundMode:u.wraparound}}get options(){return this._publicOptions}set options(u){for(const f in u)this._publicOptions[f]=u[f]}blur(){this._core.blur()}focus(){this._core.focus()}input(u,f=!0){this._core.input(u,f)}resize(u,f){this._verifyIntegers(u,f),this._core.resize(u,f)}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,f,h){this._verifyIntegers(u,f,h),this._core.select(u,f,h)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(u,f){this._verifyIntegers(u,f),this._core.selectLines(u,f)}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,f){this._core.write(u,f)}writeln(u,f){this._core.write(u),this._core.write(`\r
|
|
17
|
+
`,f)}paste(u){this._core.paste(u)}refresh(u,f){this._verifyIntegers(u,f),this._core.refresh(u,f)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(u){this._addonManager.loadAddon(this,u)}static get strings(){return n}_verifyIntegers(...u){for(const f of u)if(f===1/0||isNaN(f)||f%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...u){for(const f of u)if(f&&(f===1/0||isNaN(f)||f%1!=0||f<0))throw new Error("This API only accepts positive integers")}}P.Terminal=p})(),K})()))})(Ru)),Ru.exports}var Zg=Xg(),Lu={exports:{}},sp;function Qg(){return sp||(sp=1,(function(r,C){(function(E,M){r.exports=M()})(self,(()=>(()=>{var E={};return(()=>{var M=E;Object.defineProperty(M,"__esModule",{value:!0}),M.FitAddon=void 0,M.FitAddon=class{activate(O){this._terminal=O}dispose(){}fit(){const O=this.proposeDimensions();if(!O||!this._terminal||isNaN(O.cols)||isNaN(O.rows))return;const K=this._terminal._core;this._terminal.rows===O.rows&&this._terminal.cols===O.cols||(K._renderService.clear(),this._terminal.resize(O.cols,O.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const O=this._terminal._core,K=O._renderService.dimensions;if(K.css.cell.width===0||K.css.cell.height===0)return;const P=this._terminal.options.scrollback===0?0:O.viewport.scrollBarWidth,n=window.getComputedStyle(this._terminal.element.parentElement),d=parseInt(n.getPropertyValue("height")),m=Math.max(0,parseInt(n.getPropertyValue("width"))),v=window.getComputedStyle(this._terminal.element),o=d-(parseInt(v.getPropertyValue("padding-top"))+parseInt(v.getPropertyValue("padding-bottom"))),b=m-(parseInt(v.getPropertyValue("padding-right"))+parseInt(v.getPropertyValue("padding-left")))-P;return{cols:Math.max(2,Math.floor(b/K.css.cell.width)),rows:Math.max(1,Math.floor(o/K.css.cell.height))}}}})(),E})()))})(Lu)),Lu.exports}var Jg=Qg(),Tu={exports:{}},rp;function ev(){return rp||(rp=1,(function(r,C){(function(E,M){r.exports=M()})(self,(()=>(()=>{var E={965:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GlyphRenderer=void 0;const m=d(374),v=d(509),o=d(855),b=d(859),x=d(381),A=11,p=A*Float32Array.BYTES_PER_ELEMENT;let a,u=0,f=0,h=0;class S extends b.Disposable{constructor(w,L,y,R){super(),this._terminal=w,this._gl=L,this._dimensions=y,this._optionsService=R,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const k=this._gl;v.TextureAtlas.maxAtlasPages===void 0&&(v.TextureAtlas.maxAtlasPages=Math.min(32,(0,m.throwIfFalsy)(k.getParameter(k.MAX_TEXTURE_IMAGE_UNITS))),v.TextureAtlas.maxTextureSize=(0,m.throwIfFalsy)(k.getParameter(k.MAX_TEXTURE_SIZE))),this._program=(0,m.throwIfFalsy)((0,x.createProgram)(k,`#version 300 es
|
|
18
|
+
layout (location = 0) in vec2 a_unitquad;
|
|
19
|
+
layout (location = 1) in vec2 a_cellpos;
|
|
20
|
+
layout (location = 2) in vec2 a_offset;
|
|
21
|
+
layout (location = 3) in vec2 a_size;
|
|
22
|
+
layout (location = 4) in float a_texpage;
|
|
23
|
+
layout (location = 5) in vec2 a_texcoord;
|
|
24
|
+
layout (location = 6) in vec2 a_texsize;
|
|
25
|
+
|
|
26
|
+
uniform mat4 u_projection;
|
|
27
|
+
uniform vec2 u_resolution;
|
|
28
|
+
|
|
29
|
+
out vec2 v_texcoord;
|
|
30
|
+
flat out int v_texpage;
|
|
31
|
+
|
|
32
|
+
void main() {
|
|
33
|
+
vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
|
|
34
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
35
|
+
v_texpage = int(a_texpage);
|
|
36
|
+
v_texcoord = a_texcoord + a_unitquad * a_texsize;
|
|
37
|
+
}`,(function(V){let X="";for(let I=1;I<V;I++)X+=` else if (v_texpage == ${I}) { outColor = texture(u_texture[${I}], v_texcoord); }`;return`#version 300 es
|
|
38
|
+
precision lowp float;
|
|
39
|
+
|
|
40
|
+
in vec2 v_texcoord;
|
|
41
|
+
flat in int v_texpage;
|
|
42
|
+
|
|
43
|
+
uniform sampler2D u_texture[${V}];
|
|
44
|
+
|
|
45
|
+
out vec4 outColor;
|
|
46
|
+
|
|
47
|
+
void main() {
|
|
48
|
+
if (v_texpage == 0) {
|
|
49
|
+
outColor = texture(u_texture[0], v_texcoord);
|
|
50
|
+
} ${X}
|
|
51
|
+
}`})(v.TextureAtlas.maxAtlasPages))),this.register((0,b.toDisposable)((()=>k.deleteProgram(this._program)))),this._projectionLocation=(0,m.throwIfFalsy)(k.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,m.throwIfFalsy)(k.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,m.throwIfFalsy)(k.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=k.createVertexArray(),k.bindVertexArray(this._vertexArrayObject);const U=new Float32Array([0,0,1,0,0,1,1,1]),H=k.createBuffer();this.register((0,b.toDisposable)((()=>k.deleteBuffer(H)))),k.bindBuffer(k.ARRAY_BUFFER,H),k.bufferData(k.ARRAY_BUFFER,U,k.STATIC_DRAW),k.enableVertexAttribArray(0),k.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const z=new Uint8Array([0,1,2,3]),Y=k.createBuffer();this.register((0,b.toDisposable)((()=>k.deleteBuffer(Y)))),k.bindBuffer(k.ELEMENT_ARRAY_BUFFER,Y),k.bufferData(k.ELEMENT_ARRAY_BUFFER,z,k.STATIC_DRAW),this._attributesBuffer=(0,m.throwIfFalsy)(k.createBuffer()),this.register((0,b.toDisposable)((()=>k.deleteBuffer(this._attributesBuffer)))),k.bindBuffer(k.ARRAY_BUFFER,this._attributesBuffer),k.enableVertexAttribArray(2),k.vertexAttribPointer(2,2,k.FLOAT,!1,p,0),k.vertexAttribDivisor(2,1),k.enableVertexAttribArray(3),k.vertexAttribPointer(3,2,k.FLOAT,!1,p,2*Float32Array.BYTES_PER_ELEMENT),k.vertexAttribDivisor(3,1),k.enableVertexAttribArray(4),k.vertexAttribPointer(4,1,k.FLOAT,!1,p,4*Float32Array.BYTES_PER_ELEMENT),k.vertexAttribDivisor(4,1),k.enableVertexAttribArray(5),k.vertexAttribPointer(5,2,k.FLOAT,!1,p,5*Float32Array.BYTES_PER_ELEMENT),k.vertexAttribDivisor(5,1),k.enableVertexAttribArray(6),k.vertexAttribPointer(6,2,k.FLOAT,!1,p,7*Float32Array.BYTES_PER_ELEMENT),k.vertexAttribDivisor(6,1),k.enableVertexAttribArray(1),k.vertexAttribPointer(1,2,k.FLOAT,!1,p,9*Float32Array.BYTES_PER_ELEMENT),k.vertexAttribDivisor(1,1),k.useProgram(this._program);const re=new Int32Array(v.TextureAtlas.maxAtlasPages);for(let V=0;V<v.TextureAtlas.maxAtlasPages;V++)re[V]=V;k.uniform1iv(this._textureLocation,re),k.uniformMatrix4fv(this._projectionLocation,!1,x.PROJECTION_MATRIX),this._atlasTextures=[];for(let V=0;V<v.TextureAtlas.maxAtlasPages;V++){const X=new x.GLTexture((0,m.throwIfFalsy)(k.createTexture()));this.register((0,b.toDisposable)((()=>k.deleteTexture(X.texture)))),k.activeTexture(k.TEXTURE0+V),k.bindTexture(k.TEXTURE_2D,X.texture),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_WRAP_S,k.CLAMP_TO_EDGE),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_WRAP_T,k.CLAMP_TO_EDGE),k.texImage2D(k.TEXTURE_2D,0,k.RGBA,1,1,0,k.RGBA,k.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[V]=X}k.enable(k.BLEND),k.blendFunc(k.SRC_ALPHA,k.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(w,L,y,R,k,U,H,z,Y){this._updateCell(this._vertices.attributes,w,L,y,R,k,U,H,z,Y)}_updateCell(w,L,y,R,k,U,H,z,Y,re){u=(y*this._terminal.cols+L)*A,R!==o.NULL_CELL_CODE&&R!==void 0?this._atlas&&(a=z&&z.length>1?this._atlas.getRasterizedGlyphCombinedChar(z,k,U,H,!1):this._atlas.getRasterizedGlyph(R,k,U,H,!1),f=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),k!==re&&a.offset.x>f?(h=a.offset.x-f,w[u]=-(a.offset.x-h)+this._dimensions.device.char.left,w[u+1]=-a.offset.y+this._dimensions.device.char.top,w[u+2]=(a.size.x-h)/this._dimensions.device.canvas.width,w[u+3]=a.size.y/this._dimensions.device.canvas.height,w[u+4]=a.texturePage,w[u+5]=a.texturePositionClipSpace.x+h/this._atlas.pages[a.texturePage].canvas.width,w[u+6]=a.texturePositionClipSpace.y,w[u+7]=a.sizeClipSpace.x-h/this._atlas.pages[a.texturePage].canvas.width,w[u+8]=a.sizeClipSpace.y):(w[u]=-a.offset.x+this._dimensions.device.char.left,w[u+1]=-a.offset.y+this._dimensions.device.char.top,w[u+2]=a.size.x/this._dimensions.device.canvas.width,w[u+3]=a.size.y/this._dimensions.device.canvas.height,w[u+4]=a.texturePage,w[u+5]=a.texturePositionClipSpace.x,w[u+6]=a.texturePositionClipSpace.y,w[u+7]=a.sizeClipSpace.x,w[u+8]=a.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,m.allowRescaling)(R,Y,a.size.x,this._dimensions.device.cell.width)&&(w[u+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):w.fill(0,u,u+A-1-2)}clear(){const w=this._terminal,L=w.cols*w.rows*A;this._vertices.count!==L?this._vertices.attributes=new Float32Array(L):this._vertices.attributes.fill(0);let y=0;for(;y<this._vertices.attributesBuffers.length;y++)this._vertices.count!==L?this._vertices.attributesBuffers[y]=new Float32Array(L):this._vertices.attributesBuffers[y].fill(0);this._vertices.count=L,y=0;for(let R=0;R<w.rows;R++)for(let k=0;k<w.cols;k++)this._vertices.attributes[y+9]=k/w.cols,this._vertices.attributes[y+10]=R/w.rows,y+=A}handleResize(){const w=this._gl;w.useProgram(this._program),w.viewport(0,0,w.canvas.width,w.canvas.height),w.uniform2f(this._resolutionLocation,w.canvas.width,w.canvas.height),this.clear()}render(w){if(!this._atlas)return;const L=this._gl;L.useProgram(this._program),L.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const y=this._vertices.attributesBuffers[this._activeBuffer];let R=0;for(let k=0;k<w.lineLengths.length;k++){const U=k*this._terminal.cols*A,H=this._vertices.attributes.subarray(U,U+w.lineLengths[k]*A);y.set(H,R),R+=H.length}L.bindBuffer(L.ARRAY_BUFFER,this._attributesBuffer),L.bufferData(L.ARRAY_BUFFER,y.subarray(0,R),L.STREAM_DRAW);for(let k=0;k<this._atlas.pages.length;k++)this._atlas.pages[k].version!==this._atlasTextures[k].version&&this._bindAtlasPageTexture(L,this._atlas,k);L.drawElementsInstanced(L.TRIANGLE_STRIP,4,L.UNSIGNED_BYTE,0,R/A)}setAtlas(w){this._atlas=w;for(const L of this._atlasTextures)L.version=-1}_bindAtlasPageTexture(w,L,y){w.activeTexture(w.TEXTURE0+y),w.bindTexture(w.TEXTURE_2D,this._atlasTextures[y].texture),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_WRAP_S,w.CLAMP_TO_EDGE),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_WRAP_T,w.CLAMP_TO_EDGE),w.texImage2D(w.TEXTURE_2D,0,w.RGBA,w.RGBA,w.UNSIGNED_BYTE,L.pages[y].canvas),w.generateMipmap(w.TEXTURE_2D),this._atlasTextures[y].version=L.pages[y].version}setDimensions(w){this._dimensions=w}}n.GlyphRenderer=S},742:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RectangleRenderer=void 0;const m=d(374),v=d(859),o=d(310),b=d(381),x=8*Float32Array.BYTES_PER_ELEMENT;class A{constructor(){this.attributes=new Float32Array(160),this.count=0}}let p=0,a=0,u=0,f=0,h=0,S=0,T=0;class w extends v.Disposable{constructor(y,R,k,U){super(),this._terminal=y,this._gl=R,this._dimensions=k,this._themeService=U,this._vertices=new A,this._verticesCursor=new A;const H=this._gl;this._program=(0,m.throwIfFalsy)((0,b.createProgram)(H,`#version 300 es
|
|
52
|
+
layout (location = 0) in vec2 a_position;
|
|
53
|
+
layout (location = 1) in vec2 a_size;
|
|
54
|
+
layout (location = 2) in vec4 a_color;
|
|
55
|
+
layout (location = 3) in vec2 a_unitquad;
|
|
56
|
+
|
|
57
|
+
uniform mat4 u_projection;
|
|
58
|
+
|
|
59
|
+
out vec4 v_color;
|
|
60
|
+
|
|
61
|
+
void main() {
|
|
62
|
+
vec2 zeroToOne = a_position + (a_unitquad * a_size);
|
|
63
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
64
|
+
v_color = a_color;
|
|
65
|
+
}`,`#version 300 es
|
|
66
|
+
precision lowp float;
|
|
67
|
+
|
|
68
|
+
in vec4 v_color;
|
|
69
|
+
|
|
70
|
+
out vec4 outColor;
|
|
71
|
+
|
|
72
|
+
void main() {
|
|
73
|
+
outColor = v_color;
|
|
74
|
+
}`)),this.register((0,v.toDisposable)((()=>H.deleteProgram(this._program)))),this._projectionLocation=(0,m.throwIfFalsy)(H.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=H.createVertexArray(),H.bindVertexArray(this._vertexArrayObject);const z=new Float32Array([0,0,1,0,0,1,1,1]),Y=H.createBuffer();this.register((0,v.toDisposable)((()=>H.deleteBuffer(Y)))),H.bindBuffer(H.ARRAY_BUFFER,Y),H.bufferData(H.ARRAY_BUFFER,z,H.STATIC_DRAW),H.enableVertexAttribArray(3),H.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const re=new Uint8Array([0,1,2,3]),V=H.createBuffer();this.register((0,v.toDisposable)((()=>H.deleteBuffer(V)))),H.bindBuffer(H.ELEMENT_ARRAY_BUFFER,V),H.bufferData(H.ELEMENT_ARRAY_BUFFER,re,H.STATIC_DRAW),this._attributesBuffer=(0,m.throwIfFalsy)(H.createBuffer()),this.register((0,v.toDisposable)((()=>H.deleteBuffer(this._attributesBuffer)))),H.bindBuffer(H.ARRAY_BUFFER,this._attributesBuffer),H.enableVertexAttribArray(0),H.vertexAttribPointer(0,2,H.FLOAT,!1,x,0),H.vertexAttribDivisor(0,1),H.enableVertexAttribArray(1),H.vertexAttribPointer(1,2,H.FLOAT,!1,x,2*Float32Array.BYTES_PER_ELEMENT),H.vertexAttribDivisor(1,1),H.enableVertexAttribArray(2),H.vertexAttribPointer(2,4,H.FLOAT,!1,x,4*Float32Array.BYTES_PER_ELEMENT),H.vertexAttribDivisor(2,1),this._updateCachedColors(U.colors),this.register(this._themeService.onChangeColors((X=>{this._updateCachedColors(X),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(y){const R=this._gl;R.useProgram(this._program),R.bindVertexArray(this._vertexArrayObject),R.uniformMatrix4fv(this._projectionLocation,!1,b.PROJECTION_MATRIX),R.bindBuffer(R.ARRAY_BUFFER,this._attributesBuffer),R.bufferData(R.ARRAY_BUFFER,y.attributes,R.DYNAMIC_DRAW),R.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,R.UNSIGNED_BYTE,0,y.count)}handleResize(){this._updateViewportRectangle()}setDimensions(y){this._dimensions=y}_updateCachedColors(y){this._bgFloat=this._colorToFloat32Array(y.background),this._cursorFloat=this._colorToFloat32Array(y.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(y){const R=this._terminal,k=this._vertices;let U,H,z,Y,re,V,X,I,N,W,j,F=1;for(U=0;U<R.rows;U++){for(z=-1,Y=0,re=0,V=!1,H=0;H<R.cols;H++)X=(U*R.cols+H)*o.RENDER_MODEL_INDICIES_PER_CELL,I=y.cells[X+o.RENDER_MODEL_BG_OFFSET],N=y.cells[X+o.RENDER_MODEL_FG_OFFSET],W=!!(67108864&N),(I!==Y||N!==re&&(V||W))&&((Y!==0||V&&re!==0)&&(j=8*F++,this._updateRectangle(k,j,re,Y,z,H,U)),z=H,Y=I,re=N,V=W);(Y!==0||V&&re!==0)&&(j=8*F++,this._updateRectangle(k,j,re,Y,z,R.cols,U))}k.count=F}updateCursor(y){const R=this._verticesCursor,k=y.cursor;if(!k||k.style==="block")return void(R.count=0);let U,H=0;k.style!=="bar"&&k.style!=="outline"||(U=8*H++,this._addRectangleFloat(R.attributes,U,k.x*this._dimensions.device.cell.width,k.y*this._dimensions.device.cell.height,k.style==="bar"?k.dpr*k.cursorWidth:k.dpr,this._dimensions.device.cell.height,this._cursorFloat)),k.style!=="underline"&&k.style!=="outline"||(U=8*H++,this._addRectangleFloat(R.attributes,U,k.x*this._dimensions.device.cell.width,(k.y+1)*this._dimensions.device.cell.height-k.dpr,k.width*this._dimensions.device.cell.width,k.dpr,this._cursorFloat)),k.style==="outline"&&(U=8*H++,this._addRectangleFloat(R.attributes,U,k.x*this._dimensions.device.cell.width,k.y*this._dimensions.device.cell.height,k.width*this._dimensions.device.cell.width,k.dpr,this._cursorFloat),U=8*H++,this._addRectangleFloat(R.attributes,U,(k.x+k.width)*this._dimensions.device.cell.width-k.dpr,k.y*this._dimensions.device.cell.height,k.dpr,this._dimensions.device.cell.height,this._cursorFloat)),R.count=H}_updateRectangle(y,R,k,U,H,z,Y){if(67108864&k)switch(50331648&k){case 16777216:case 33554432:p=this._themeService.colors.ansi[255&k].rgba;break;case 50331648:p=(16777215&k)<<8;break;default:p=this._themeService.colors.foreground.rgba}else switch(50331648&U){case 16777216:case 33554432:p=this._themeService.colors.ansi[255&U].rgba;break;case 50331648:p=(16777215&U)<<8;break;default:p=this._themeService.colors.background.rgba}y.attributes.length<R+4&&(y.attributes=(0,b.expandFloat32Array)(y.attributes,this._terminal.rows*this._terminal.cols*8)),a=H*this._dimensions.device.cell.width,u=Y*this._dimensions.device.cell.height,f=(p>>24&255)/255,h=(p>>16&255)/255,S=(p>>8&255)/255,T=1,this._addRectangle(y.attributes,R,a,u,(z-H)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,f,h,S,T)}_addRectangle(y,R,k,U,H,z,Y,re,V,X){y[R]=k/this._dimensions.device.canvas.width,y[R+1]=U/this._dimensions.device.canvas.height,y[R+2]=H/this._dimensions.device.canvas.width,y[R+3]=z/this._dimensions.device.canvas.height,y[R+4]=Y,y[R+5]=re,y[R+6]=V,y[R+7]=X}_addRectangleFloat(y,R,k,U,H,z,Y){y[R]=k/this._dimensions.device.canvas.width,y[R+1]=U/this._dimensions.device.canvas.height,y[R+2]=H/this._dimensions.device.canvas.width,y[R+3]=z/this._dimensions.device.canvas.height,y[R+4]=Y[0],y[R+5]=Y[1],y[R+6]=Y[2],y[R+7]=Y[3]}_colorToFloat32Array(y){return new Float32Array([(y.rgba>>24&255)/255,(y.rgba>>16&255)/255,(y.rgba>>8&255)/255,(255&y.rgba)/255])}}n.RectangleRenderer=w},310:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderModel=n.COMBINED_CHAR_BIT_MASK=n.RENDER_MODEL_EXT_OFFSET=n.RENDER_MODEL_FG_OFFSET=n.RENDER_MODEL_BG_OFFSET=n.RENDER_MODEL_INDICIES_PER_CELL=void 0;const m=d(296);n.RENDER_MODEL_INDICIES_PER_CELL=4,n.RENDER_MODEL_BG_OFFSET=1,n.RENDER_MODEL_FG_OFFSET=2,n.RENDER_MODEL_EXT_OFFSET=3,n.COMBINED_CHAR_BIT_MASK=2147483648,n.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,m.createSelectionRenderModel)()}resize(v,o){const b=v*o*n.RENDER_MODEL_INDICIES_PER_CELL;b!==this.cells.length&&(this.cells=new Uint32Array(b),this.lineLengths=new Uint32Array(o))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.JoinedCellData=n.WebglRenderer=void 0;const m=d(820),v=d(274),o=d(627),b=d(457),x=d(56),A=d(374),p=d(345),a=d(859),u=d(147),f=d(782),h=d(855),S=d(965),T=d(742),w=d(310),L=d(733);class y extends a.Disposable{constructor(H,z,Y,re,V,X,I,N,W){super(),this._terminal=H,this._characterJoinerService=z,this._charSizeService=Y,this._coreBrowserService=re,this._coreService=V,this._decorationService=X,this._optionsService=I,this._themeService=N,this._cursorBlinkStateManager=new a.MutableDisposable,this._charAtlasDisposable=this.register(new a.MutableDisposable),this._observerDisposable=this.register(new a.MutableDisposable),this._model=new w.RenderModel,this._workCell=new f.CellData,this._workCell2=new f.CellData,this._rectangleRenderer=this.register(new a.MutableDisposable),this._glyphRenderer=this.register(new a.MutableDisposable),this._onChangeTextureAtlas=this.register(new p.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new p.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new p.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new p.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new p.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new v.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new L.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,I,this._themeService)],this.dimensions=(0,A.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(I.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const j={antialias:!1,depth:!1,preserveDrawingBuffer:W};if(this._gl=this._canvas.getContext("webgl2",j),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,m.addDisposableDomListener)(this._canvas,"webglcontextlost",(F=>{console.log("webglcontextlost event received"),F.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(F)}),3e3)}))),this.register((0,m.addDisposableDomListener)(this._canvas,"webglcontextrestored",(F=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,o.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,x.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((F,ie)=>this._setCanvasDevicePixelDimensions(F,ie))),this.register(this._coreBrowserService.onWindowChange((F=>{this._observerDisposable.value=(0,x.observeDevicePixelDimensions)(this._canvas,F,((ie,te)=>this._setCanvasDevicePixelDimensions(ie,te)))}))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,a.toDisposable)((()=>{for(const F of this._renderLayers)F.dispose();this._canvas.parentElement?.removeChild(this._canvas),(0,o.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(H,z){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const Y of this._renderLayers)Y.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(const H of this._renderLayers)H.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(const H of this._renderLayers)H.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(H,z,Y){for(const re of this._renderLayers)re.handleSelectionChanged(this._terminal,H,z,Y);this._model.selection.update(this._core,H,z,Y),this._requestRedrawViewport()}handleCursorMove(){for(const H of this._renderLayers)H.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new T.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new S.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const H=(0,o.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==H&&(this._onChangeTextureAtlas.fire(H.pages[0].canvas),this._charAtlasDisposable.value=(0,a.getDisposeArrayDisposable)([(0,p.forwardEvent)(H.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,p.forwardEvent)(H.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=H,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(H){this._model.clear(),H&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(const H of this._renderLayers)H.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(H){return-1}deregisterCharacterJoiner(H){return!1}renderRows(H,z){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const Y of this._renderLayers)Y.handleGridChanged(this._terminal,H,z);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(H,z),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new b.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(H,z){const Y=this._core;let re,V,X,I,N,W,j,F,ie,te,de,ge,J,q,ne=this._workCell;H=k(H,Y.rows-1,0),z=k(z,Y.rows-1,0);const _e=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,we=_e-Y.buffer.ydisp,xe=Math.min(this._terminal.buffer.active.cursorX,Y.cols-1);let Ne=-1;const Ae=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let We=!1;for(V=H;V<=z;V++)for(X=V+Y.buffer.ydisp,I=Y.buffer.lines.get(X),this._model.lineLengths[V]=0,N=this._characterJoinerService.getJoinedCharacters(X),J=0;J<Y.cols;J++)if(re=this._cellColorResolver.result.bg,I.loadCell(J,ne),J===0&&(re=this._cellColorResolver.result.bg),W=!1,j=J,N.length>0&&J===N[0][0]&&(W=!0,F=N.shift(),ne=new R(ne,I.translateToString(!0,F[0],F[1]),F[1]-F[0]),j=F[1]-1),ie=ne.getChars(),te=ne.getCode(),ge=(V*Y.cols+J)*w.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(ne,J,X,this.dimensions.device.cell.width),Ae&&X===_e&&(J===xe&&(this._model.cursor={x:xe,y:we,width:ne.getWidth(),style:this._coreBrowserService.isFocused?Y.options.cursorStyle||"block":Y.options.cursorInactiveStyle,cursorWidth:Y.options.cursorWidth,dpr:this._devicePixelRatio},Ne=xe+ne.getWidth()-1),J>=xe&&J<=Ne&&(this._coreBrowserService.isFocused&&(Y.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&Y.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),te!==h.NULL_CELL_CODE&&(this._model.lineLengths[V]=J+1),(this._model.cells[ge]!==te||this._model.cells[ge+w.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[ge+w.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[ge+w.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(We=!0,ie.length>1&&(te|=w.COMBINED_CHAR_BIT_MASK),this._model.cells[ge]=te,this._model.cells[ge+w.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[ge+w.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[ge+w.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,de=ne.getWidth(),this._glyphRenderer.value.updateCell(J,V,te,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,ie,de,re),W))for(ne=this._workCell,J++;J<j;J++)q=(V*Y.cols+J)*w.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(J,V,h.NULL_CELL_CODE,0,0,0,h.NULL_CELL_CHAR,0,0),this._model.cells[q]=h.NULL_CELL_CODE,this._model.cells[q+w.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[q+w.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[q+w.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;We&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(H,z){this._canvas.width===H&&this._canvas.height===z||(this._canvas.width=H,this._canvas.height=z,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const H=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:H,end:H})}}n.WebglRenderer=y;class R extends u.AttributeData{constructor(H,z,Y){super(),this.content=0,this.combinedData="",this.fg=H.fg,this.bg=H.bg,this.combinedData=z,this._width=Y}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(H){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function k(U,H,z=0){return Math.max(Math.min(U,H),z)}n.JoinedCellData=R},381:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GLTexture=n.expandFloat32Array=n.createShader=n.createProgram=n.PROJECTION_MATRIX=void 0;const m=d(374);function v(o,b,x){const A=(0,m.throwIfFalsy)(o.createShader(b));if(o.shaderSource(A,x),o.compileShader(A),o.getShaderParameter(A,o.COMPILE_STATUS))return A;console.error(o.getShaderInfoLog(A)),o.deleteShader(A)}n.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),n.createProgram=function(o,b,x){const A=(0,m.throwIfFalsy)(o.createProgram());if(o.attachShader(A,(0,m.throwIfFalsy)(v(o,o.VERTEX_SHADER,b))),o.attachShader(A,(0,m.throwIfFalsy)(v(o,o.FRAGMENT_SHADER,x))),o.linkProgram(A),o.getProgramParameter(A,o.LINK_STATUS))return A;console.error(o.getProgramInfoLog(A)),o.deleteProgram(A)},n.createShader=v,n.expandFloat32Array=function(o,b){const x=Math.min(2*o.length,b),A=new Float32Array(x);for(let p=0;p<o.length;p++)A[p]=o[p];return A},n.GLTexture=class{constructor(o){this.texture=o,this.version=-1}}},592:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BaseRenderLayer=void 0;const m=d(627),v=d(237),o=d(374),b=d(859);class x extends b.Disposable{constructor(p,a,u,f,h,S,T,w){super(),this._container=a,this._alpha=h,this._coreBrowserService=S,this._optionsService=T,this._themeService=w,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${u}-layer`),this._canvas.style.zIndex=f.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((L=>{this._refreshCharAtlas(p,L),this.reset(p)}))),this.register((0,b.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,o.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(p){}handleFocus(p){}handleCursorMove(p){}handleGridChanged(p,a,u){}handleSelectionChanged(p,a,u,f=!1){}_setTransparency(p,a){if(a===this._alpha)return;const u=this._canvas;this._alpha=a,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,u),this._refreshCharAtlas(p,this._themeService.colors),this.handleGridChanged(p,0,p.rows-1)}_refreshCharAtlas(p,a){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,m.acquireTextureAtlas)(p,this._optionsService.rawOptions,a,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(p,a){this._deviceCellWidth=a.device.cell.width,this._deviceCellHeight=a.device.cell.height,this._deviceCharWidth=a.device.char.width,this._deviceCharHeight=a.device.char.height,this._deviceCharLeft=a.device.char.left,this._deviceCharTop=a.device.char.top,this._canvas.width=a.device.canvas.width,this._canvas.height=a.device.canvas.height,this._canvas.style.width=`${a.css.canvas.width}px`,this._canvas.style.height=`${a.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(p,this._themeService.colors)}_fillBottomLineAtCells(p,a,u=1){this._ctx.fillRect(p*this._deviceCellWidth,(a+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,u*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(p,a,u,f){this._alpha?this._ctx.clearRect(p*this._deviceCellWidth,a*this._deviceCellHeight,u*this._deviceCellWidth,f*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(p*this._deviceCellWidth,a*this._deviceCellHeight,u*this._deviceCellWidth,f*this._deviceCellHeight))}_fillCharTrueColor(p,a,u,f){this._ctx.font=this._getFont(p,!1,!1),this._ctx.textBaseline=v.TEXT_BASELINE,this._clipCell(u,f,a.getWidth()),this._ctx.fillText(a.getChars(),u*this._deviceCellWidth+this._deviceCharLeft,f*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(p,a,u){this._ctx.beginPath(),this._ctx.rect(p*this._deviceCellWidth,a*this._deviceCellHeight,u*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(p,a,u){return`${u?"italic":""} ${a?p.options.fontWeightBold:p.options.fontWeight} ${p.options.fontSize*this._coreBrowserService.dpr}px ${p.options.fontFamily}`}}n.BaseRenderLayer=x},733:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkRenderLayer=void 0;const m=d(197),v=d(237),o=d(592);class b extends o.BaseRenderLayer{constructor(A,p,a,u,f,h,S){super(a,A,"link",p,!0,f,h,S),this.register(u.onShowLinkUnderline((T=>this._handleShowLinkUnderline(T)))),this.register(u.onHideLinkUnderline((T=>this._handleHideLinkUnderline(T))))}resize(A,p){super.resize(A,p),this._state=void 0}reset(A){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const A=this._state.y2-this._state.y1-1;A>0&&this._clearCells(0,this._state.y1+1,this._state.cols,A),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(A){if(A.fg===v.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:A.fg!==void 0&&(0,m.is256Color)(A.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[A.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,A.y1===A.y2)this._fillBottomLineAtCells(A.x1,A.y1,A.x2-A.x1);else{this._fillBottomLineAtCells(A.x1,A.y1,A.cols-A.x1);for(let p=A.y1+1;p<A.y2;p++)this._fillBottomLineAtCells(0,p,A.cols);this._fillBottomLineAtCells(0,A.y2,A.x2)}this._state=A}_handleHideLinkUnderline(A){this._clearCurrentLink()}}n.LinkRenderLayer=b},820:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(d,m,v,o){d.addEventListener(m,v,o);let b=!1;return{dispose:()=>{b||(b=!0,d.removeEventListener(m,v,o))}}}},274:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellColorResolver=void 0;const m=d(855),v=d(160),o=d(374);let b,x=0,A=0,p=!1,a=!1,u=!1,f=0;n.CellColorResolver=class{constructor(h,S,T,w,L,y){this._terminal=h,this._optionService=S,this._selectionRenderModel=T,this._decorationService=w,this._coreBrowserService=L,this._themeService=y,this.result={fg:0,bg:0,ext:0}}resolve(h,S,T,w){if(this.result.bg=h.bg,this.result.fg=h.fg,this.result.ext=268435456&h.bg?h.extended.ext:0,A=0,x=0,a=!1,p=!1,u=!1,b=this._themeService.colors,f=0,h.getCode()!==m.NULL_CELL_CODE&&h.extended.underlineStyle===4){const L=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));f=S*w%(2*Math.round(L))}if(this._decorationService.forEachDecorationAtCell(S,T,"bottom",(L=>{L.backgroundColorRGB&&(A=L.backgroundColorRGB.rgba>>8&16777215,a=!0),L.foregroundColorRGB&&(x=L.foregroundColorRGB.rgba>>8&16777215,p=!0)})),u=this._selectionRenderModel.isCellSelected(this._terminal,S,T),u){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:A=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:A=(16777215&this.result.fg)<<8|255;break;default:A=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:A=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:A=(16777215&this.result.bg)<<8|255}A=v.rgba.blend(A,4294967040&(this._coreBrowserService.isFocused?b.selectionBackgroundOpaque:b.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else A=(this._coreBrowserService.isFocused?b.selectionBackgroundOpaque:b.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(a=!0,b.selectionForeground&&(x=b.selectionForeground.rgba>>8&16777215,p=!0),(0,o.treatGlyphAsBackgroundColor)(h.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)x=(this._coreBrowserService.isFocused?b.selectionBackgroundOpaque:b.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:x=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:x=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:x=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:x=(16777215&this.result.fg)<<8|255;break;default:x=this._themeService.colors.foreground.rgba}x=v.rgba.blend(x,4294967040&(this._coreBrowserService.isFocused?b.selectionBackgroundOpaque:b.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}p=!0}}this._decorationService.forEachDecorationAtCell(S,T,"top",(L=>{L.backgroundColorRGB&&(A=L.backgroundColorRGB.rgba>>8&16777215,a=!0),L.foregroundColorRGB&&(x=L.foregroundColorRGB.rgba>>8&16777215,p=!0)})),a&&(A=u?-16777216&h.bg&-134217729|A|50331648:-16777216&h.bg|A|50331648),p&&(x=-16777216&h.fg&-67108865|x|50331648),67108864&this.result.fg&&(a&&!p&&(x=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&b.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,p=!0),!a&&p&&(A=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&b.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,a=!0)),b=void 0,this.result.bg=a?A:this.result.bg,this.result.fg=p?x:this.result.fg,this.result.ext&=536870911,this.result.ext|=f<<29&3758096384}}},627:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.removeTerminalFromCache=n.acquireTextureAtlas=void 0;const m=d(509),v=d(197),o=[];n.acquireTextureAtlas=function(b,x,A,p,a,u,f,h){const S=(0,v.generateConfig)(p,a,u,f,x,A,h);for(let L=0;L<o.length;L++){const y=o[L],R=y.ownedBy.indexOf(b);if(R>=0){if((0,v.configEquals)(y.config,S))return y.atlas;y.ownedBy.length===1?(y.atlas.dispose(),o.splice(L,1)):y.ownedBy.splice(R,1);break}}for(let L=0;L<o.length;L++){const y=o[L];if((0,v.configEquals)(y.config,S))return y.ownedBy.push(b),y.atlas}const T=b._core,w={atlas:new m.TextureAtlas(document,S,T.unicodeService),config:S,ownedBy:[b]};return o.push(w),w.atlas},n.removeTerminalFromCache=function(b){for(let x=0;x<o.length;x++){const A=o[x].ownedBy.indexOf(b);if(A!==-1){o[x].ownedBy.length===1?(o[x].atlas.dispose(),o.splice(x,1)):o[x].ownedBy.splice(A,1);break}}}},197:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.is256Color=n.configEquals=n.generateConfig=void 0;const m=d(160);n.generateConfig=function(v,o,b,x,A,p,a){const u={foreground:p.foreground,background:p.background,cursor:m.NULL_COLOR,cursorAccent:m.NULL_COLOR,selectionForeground:m.NULL_COLOR,selectionBackgroundTransparent:m.NULL_COLOR,selectionBackgroundOpaque:m.NULL_COLOR,selectionInactiveBackgroundTransparent:m.NULL_COLOR,selectionInactiveBackgroundOpaque:m.NULL_COLOR,ansi:p.ansi.slice(),contrastCache:p.contrastCache,halfContrastCache:p.halfContrastCache};return{customGlyphs:A.customGlyphs,devicePixelRatio:a,letterSpacing:A.letterSpacing,lineHeight:A.lineHeight,deviceCellWidth:v,deviceCellHeight:o,deviceCharWidth:b,deviceCharHeight:x,fontFamily:A.fontFamily,fontSize:A.fontSize,fontWeight:A.fontWeight,fontWeightBold:A.fontWeightBold,allowTransparency:A.allowTransparency,drawBoldTextInBrightColors:A.drawBoldTextInBrightColors,minimumContrastRatio:A.minimumContrastRatio,colors:u}},n.configEquals=function(v,o){for(let b=0;b<v.colors.ansi.length;b++)if(v.colors.ansi[b].rgba!==o.colors.ansi[b].rgba)return!1;return v.devicePixelRatio===o.devicePixelRatio&&v.customGlyphs===o.customGlyphs&&v.lineHeight===o.lineHeight&&v.letterSpacing===o.letterSpacing&&v.fontFamily===o.fontFamily&&v.fontSize===o.fontSize&&v.fontWeight===o.fontWeight&&v.fontWeightBold===o.fontWeightBold&&v.allowTransparency===o.allowTransparency&&v.deviceCharWidth===o.deviceCharWidth&&v.deviceCharHeight===o.deviceCharHeight&&v.drawBoldTextInBrightColors===o.drawBoldTextInBrightColors&&v.minimumContrastRatio===o.minimumContrastRatio&&v.colors.foreground.rgba===o.colors.foreground.rgba&&v.colors.background.rgba===o.colors.background.rgba},n.is256Color=function(v){return(50331648&v)==16777216||(50331648&v)==33554432}},237:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const m=d(399);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=m.isFirefox||m.isLegacyEdge?"bottom":"ideographic"},457:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CursorBlinkStateManager=void 0,n.CursorBlinkStateManager=class{constructor(d,m){this._renderCallback=d,this._coreBrowserService=m,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(d=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const m=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,m>0)return void this._restartInterval(m)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const m=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(m)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),d)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tryDrawCustomChar=n.powerlineDefinitions=n.boxDrawingDefinitions=n.blockElementDefinitions=void 0;const m=d(374);n.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const v={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};n.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(p,a)=>`M0,${.5-a} L1,${.5-a} M0,${.5+a} L1,${.5+a}`},"║":{1:(p,a)=>`M${.5-p},0 L${.5-p},1 M${.5+p},0 L${.5+p},1`},"╒":{1:(p,a)=>`M.5,1 L.5,${.5-a} L1,${.5-a} M.5,${.5+a} L1,${.5+a}`},"╓":{1:(p,a)=>`M${.5-p},1 L${.5-p},.5 L1,.5 M${.5+p},.5 L${.5+p},1`},"╔":{1:(p,a)=>`M1,${.5-a} L${.5-p},${.5-a} L${.5-p},1 M1,${.5+a} L${.5+p},${.5+a} L${.5+p},1`},"╕":{1:(p,a)=>`M0,${.5-a} L.5,${.5-a} L.5,1 M0,${.5+a} L.5,${.5+a}`},"╖":{1:(p,a)=>`M${.5+p},1 L${.5+p},.5 L0,.5 M${.5-p},.5 L${.5-p},1`},"╗":{1:(p,a)=>`M0,${.5+a} L${.5-p},${.5+a} L${.5-p},1 M0,${.5-a} L${.5+p},${.5-a} L${.5+p},1`},"╘":{1:(p,a)=>`M.5,0 L.5,${.5+a} L1,${.5+a} M.5,${.5-a} L1,${.5-a}`},"╙":{1:(p,a)=>`M1,.5 L${.5-p},.5 L${.5-p},0 M${.5+p},.5 L${.5+p},0`},"╚":{1:(p,a)=>`M1,${.5-a} L${.5+p},${.5-a} L${.5+p},0 M1,${.5+a} L${.5-p},${.5+a} L${.5-p},0`},"╛":{1:(p,a)=>`M0,${.5+a} L.5,${.5+a} L.5,0 M0,${.5-a} L.5,${.5-a}`},"╜":{1:(p,a)=>`M0,.5 L${.5+p},.5 L${.5+p},0 M${.5-p},.5 L${.5-p},0`},"╝":{1:(p,a)=>`M0,${.5-a} L${.5-p},${.5-a} L${.5-p},0 M0,${.5+a} L${.5+p},${.5+a} L${.5+p},0`},"╞":{1:(p,a)=>`M.5,0 L.5,1 M.5,${.5-a} L1,${.5-a} M.5,${.5+a} L1,${.5+a}`},"╟":{1:(p,a)=>`M${.5-p},0 L${.5-p},1 M${.5+p},0 L${.5+p},1 M${.5+p},.5 L1,.5`},"╠":{1:(p,a)=>`M${.5-p},0 L${.5-p},1 M1,${.5+a} L${.5+p},${.5+a} L${.5+p},1 M1,${.5-a} L${.5+p},${.5-a} L${.5+p},0`},"╡":{1:(p,a)=>`M.5,0 L.5,1 M0,${.5-a} L.5,${.5-a} M0,${.5+a} L.5,${.5+a}`},"╢":{1:(p,a)=>`M0,.5 L${.5-p},.5 M${.5-p},0 L${.5-p},1 M${.5+p},0 L${.5+p},1`},"╣":{1:(p,a)=>`M${.5+p},0 L${.5+p},1 M0,${.5+a} L${.5-p},${.5+a} L${.5-p},1 M0,${.5-a} L${.5-p},${.5-a} L${.5-p},0`},"╤":{1:(p,a)=>`M0,${.5-a} L1,${.5-a} M0,${.5+a} L1,${.5+a} M.5,${.5+a} L.5,1`},"╥":{1:(p,a)=>`M0,.5 L1,.5 M${.5-p},.5 L${.5-p},1 M${.5+p},.5 L${.5+p},1`},"╦":{1:(p,a)=>`M0,${.5-a} L1,${.5-a} M0,${.5+a} L${.5-p},${.5+a} L${.5-p},1 M1,${.5+a} L${.5+p},${.5+a} L${.5+p},1`},"╧":{1:(p,a)=>`M.5,0 L.5,${.5-a} M0,${.5-a} L1,${.5-a} M0,${.5+a} L1,${.5+a}`},"╨":{1:(p,a)=>`M0,.5 L1,.5 M${.5-p},.5 L${.5-p},0 M${.5+p},.5 L${.5+p},0`},"╩":{1:(p,a)=>`M0,${.5+a} L1,${.5+a} M0,${.5-a} L${.5-p},${.5-a} L${.5-p},0 M1,${.5-a} L${.5+p},${.5-a} L${.5+p},0`},"╪":{1:(p,a)=>`M.5,0 L.5,1 M0,${.5-a} L1,${.5-a} M0,${.5+a} L1,${.5+a}`},"╫":{1:(p,a)=>`M0,.5 L1,.5 M${.5-p},0 L${.5-p},1 M${.5+p},0 L${.5+p},1`},"╬":{1:(p,a)=>`M0,${.5+a} L${.5-p},${.5+a} L${.5-p},1 M1,${.5+a} L${.5+p},${.5+a} L${.5+p},1 M0,${.5-a} L${.5-p},${.5-a} L${.5-p},0 M1,${.5-a} L${.5+p},${.5-a} L${.5+p},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(p,a)=>`M.5,1 L.5,${.5+a/.15*.5} C.5,${.5+a/.15*.5},.5,.5,1,.5`},"╮":{1:(p,a)=>`M.5,1 L.5,${.5+a/.15*.5} C.5,${.5+a/.15*.5},.5,.5,0,.5`},"╯":{1:(p,a)=>`M.5,0 L.5,${.5-a/.15*.5} C.5,${.5-a/.15*.5},.5,.5,0,.5`},"╰":{1:(p,a)=>`M.5,0 L.5,${.5-a/.15*.5} C.5,${.5-a/.15*.5},.5,.5,1,.5`}},n.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},n.powerlineDefinitions[""]=n.powerlineDefinitions[""],n.powerlineDefinitions[""]=n.powerlineDefinitions[""],n.tryDrawCustomChar=function(p,a,u,f,h,S,T,w){const L=n.blockElementDefinitions[a];if(L)return(function(U,H,z,Y,re,V){for(let X=0;X<H.length;X++){const I=H[X],N=re/8,W=V/8;U.fillRect(z+I.x*N,Y+I.y*W,I.w*N,I.h*W)}})(p,L,u,f,h,S),!0;const y=v[a];if(y)return(function(U,H,z,Y,re,V){let X=o.get(H);X||(X=new Map,o.set(H,X));const I=U.fillStyle;if(typeof I!="string")throw new Error(`Unexpected fillStyle type "${I}"`);let N=X.get(I);if(!N){const W=H[0].length,j=H.length,F=U.canvas.ownerDocument.createElement("canvas");F.width=W,F.height=j;const ie=(0,m.throwIfFalsy)(F.getContext("2d")),te=new ImageData(W,j);let de,ge,J,q;if(I.startsWith("#"))de=parseInt(I.slice(1,3),16),ge=parseInt(I.slice(3,5),16),J=parseInt(I.slice(5,7),16),q=I.length>7&&parseInt(I.slice(7,9),16)||1;else{if(!I.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${I}" when drawing pattern glyph`);[de,ge,J,q]=I.substring(5,I.length-1).split(",").map((ne=>parseFloat(ne)))}for(let ne=0;ne<j;ne++)for(let _e=0;_e<W;_e++)te.data[4*(ne*W+_e)]=de,te.data[4*(ne*W+_e)+1]=ge,te.data[4*(ne*W+_e)+2]=J,te.data[4*(ne*W+_e)+3]=H[ne][_e]*(255*q);ie.putImageData(te,0,0),N=(0,m.throwIfFalsy)(U.createPattern(F,null)),X.set(I,N)}U.fillStyle=N,U.fillRect(z,Y,re,V)})(p,y,u,f,h,S),!0;const R=n.boxDrawingDefinitions[a];if(R)return(function(U,H,z,Y,re,V,X){U.strokeStyle=U.fillStyle;for(const[I,N]of Object.entries(H)){let W;U.beginPath(),U.lineWidth=X*Number.parseInt(I),W=typeof N=="function"?N(.15,.15/V*re):N;for(const j of W.split(" ")){const F=j[0],ie=x[F];if(!ie){console.error(`Could not find drawing instructions for "${F}"`);continue}const te=j.substring(1).split(",");te[0]&&te[1]&&ie(U,A(te,re,V,z,Y,!0,X))}U.stroke(),U.closePath()}})(p,R,u,f,h,S,w),!0;const k=n.powerlineDefinitions[a];return!!k&&((function(U,H,z,Y,re,V,X,I){const N=new Path2D;N.rect(z,Y,re,V),U.clip(N),U.beginPath();const W=X/12;U.lineWidth=I*W;for(const j of H.d.split(" ")){const F=j[0],ie=x[F];if(!ie){console.error(`Could not find drawing instructions for "${F}"`);continue}const te=j.substring(1).split(",");te[0]&&te[1]&&ie(U,A(te,re,V,z,Y,!1,I,(H.leftPadding??0)*(W/2),(H.rightPadding??0)*(W/2)))}H.type===1?(U.strokeStyle=U.fillStyle,U.stroke()):U.fill(),U.closePath()})(p,k,u,f,h,S,T,w),!0)};const o=new Map;function b(p,a,u=0){return Math.max(Math.min(p,a),u)}const x={C:(p,a)=>p.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]),L:(p,a)=>p.lineTo(a[0],a[1]),M:(p,a)=>p.moveTo(a[0],a[1])};function A(p,a,u,f,h,S,T,w=0,L=0){const y=p.map((R=>parseFloat(R)||parseInt(R)));if(y.length<2)throw new Error("Too few arguments for instruction");for(let R=0;R<y.length;R+=2)y[R]*=a-w*T-L*T,S&&y[R]!==0&&(y[R]=b(Math.round(y[R]+.5)-.5,a,0)),y[R]+=f+w*T;for(let R=1;R<y.length;R+=2)y[R]*=u,S&&y[R]!==0&&(y[R]=b(Math.round(y[R]+.5)-.5,u,0)),y[R]+=h;return y}},56:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.observeDevicePixelDimensions=void 0;const m=d(859);n.observeDevicePixelDimensions=function(v,o,b){let x=new o.ResizeObserver((A=>{const p=A.find((f=>f.target===v));if(!p)return;if(!("devicePixelContentBoxSize"in p))return x?.disconnect(),void(x=void 0);const a=p.devicePixelContentBoxSize[0].inlineSize,u=p.devicePixelContentBoxSize[0].blockSize;a>0&&u>0&&b(a,u)}));try{x.observe(v,{box:["device-pixel-content-box"]})}catch{x.disconnect(),x=void 0}return(0,m.toDisposable)((()=>x?.disconnect()))}},374:(P,n)=>{function d(v){return 57508<=v&&v<=57558}function m(v){return v>=128512&&v<=128591||v>=127744&&v<=128511||v>=128640&&v<=128767||v>=9728&&v<=9983||v>=9984&&v<=10175||v>=65024&&v<=65039||v>=129280&&v<=129535||v>=127462&&v<=127487}Object.defineProperty(n,"__esModule",{value:!0}),n.computeNextVariantOffset=n.createRenderDimensions=n.treatGlyphAsBackgroundColor=n.allowRescaling=n.isEmoji=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(v){if(!v)throw new Error("value must not be falsy");return v},n.isPowerlineGlyph=d,n.isRestrictedPowerlineGlyph=function(v){return 57520<=v&&v<=57527},n.isEmoji=m,n.allowRescaling=function(v,o,b,x){return o===1&&b>Math.ceil(1.5*x)&&v!==void 0&&v>255&&!m(v)&&!d(v)&&!(function(A){return 57344<=A&&A<=63743})(v)},n.treatGlyphAsBackgroundColor=function(v){return d(v)||(function(o){return 9472<=o&&o<=9631})(v)},n.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}}}},n.computeNextVariantOffset=function(v,o,b=0){return(v-(2*Math.round(o)-b))%(2*Math.round(o))}},296:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createSelectionRenderModel=void 0;class d{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(v,o,b,x=!1){if(this.selectionStart=o,this.selectionEnd=b,!o||!b||o[0]===b[0]&&o[1]===b[1])return void this.clear();const A=v.buffers.active.ydisp,p=o[1]-A,a=b[1]-A,u=Math.max(p,0),f=Math.min(a,v.rows-1);u>=v.rows||f<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=p,this.viewportEndRow=a,this.viewportCappedStartRow=u,this.viewportCappedEndRow=f,this.startCol=o[0],this.endCol=b[0])}isCellSelected(v,o,b){return!!this.hasSelection&&(b-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?o>=this.startCol&&b>=this.viewportCappedStartRow&&o<this.endCol&&b<=this.viewportCappedEndRow:o<this.startCol&&b>=this.viewportCappedStartRow&&o>=this.endCol&&b<=this.viewportCappedEndRow:b>this.viewportStartRow&&b<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&b===this.viewportStartRow&&o>=this.startCol&&o<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportEndRow&&o<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportStartRow&&o>=this.startCol)}}n.createSelectionRenderModel=function(){return new d}},509:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TextureAtlas=void 0;const m=d(237),v=d(860),o=d(374),b=d(160),x=d(345),A=d(485),p=d(385),a=d(147),u=d(855),f={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let h;class S{get pages(){return this._pages}constructor(R,k,U){this._document=R,this._config=k,this._unicodeService=U,this._didWarmUp=!1,this._cacheMap=new A.FourKeyMap,this._cacheMapCombined=new A.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new a.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new x.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new x.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=L(R,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,o.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const R of this.pages)R.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const R=new p.IdleTaskQueue;for(let k=33;k<126;k++)R.enqueue((()=>{if(!this._cacheMap.get(k,u.DEFAULT_COLOR,u.DEFAULT_COLOR,u.DEFAULT_EXT)){const U=this._drawToCache(k,u.DEFAULT_COLOR,u.DEFAULT_COLOR,u.DEFAULT_EXT);this._cacheMap.set(k,u.DEFAULT_COLOR,u.DEFAULT_COLOR,u.DEFAULT_EXT,U)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const R of this._pages)R.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(S.maxAtlasPages&&this._pages.length>=Math.max(4,S.maxAtlasPages)){const k=this._pages.filter((X=>2*X.canvas.width<=(S.maxTextureSize||4096))).sort(((X,I)=>I.canvas.width!==X.canvas.width?I.canvas.width-X.canvas.width:I.percentageUsed-X.percentageUsed));let U=-1,H=0;for(let X=0;X<k.length;X++)if(k[X].canvas.width!==H)U=X,H=k[X].canvas.width;else if(X-U==3)break;const z=k.slice(U,U+4),Y=z.map((X=>X.glyphs[0].texturePage)).sort(((X,I)=>X>I?1:-1)),re=this.pages.length-z.length,V=this._mergePages(z,re);V.version++;for(let X=Y.length-1;X>=0;X--)this._deletePage(Y[X]);this.pages.push(V),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(V.canvas)}const R=new T(this._document,this._textureSize);return this._pages.push(R),this._activePages.push(R),this._onAddTextureAtlasCanvas.fire(R.canvas),R}_mergePages(R,k){const U=2*R[0].canvas.width,H=new T(this._document,U,R);for(const[z,Y]of R.entries()){const re=z*Y.canvas.width%U,V=Math.floor(z/2)*Y.canvas.height;H.ctx.drawImage(Y.canvas,re,V);for(const I of Y.glyphs)I.texturePage=k,I.sizeClipSpace.x=I.size.x/U,I.sizeClipSpace.y=I.size.y/U,I.texturePosition.x+=re,I.texturePosition.y+=V,I.texturePositionClipSpace.x=I.texturePosition.x/U,I.texturePositionClipSpace.y=I.texturePosition.y/U;this._onRemoveTextureAtlasCanvas.fire(Y.canvas);const X=this._activePages.indexOf(Y);X!==-1&&this._activePages.splice(X,1)}return H}_deletePage(R){this._pages.splice(R,1);for(let k=R;k<this._pages.length;k++){const U=this._pages[k];for(const H of U.glyphs)H.texturePage--;U.version++}}getRasterizedGlyphCombinedChar(R,k,U,H,z){return this._getFromCacheMap(this._cacheMapCombined,R,k,U,H,z)}getRasterizedGlyph(R,k,U,H,z){return this._getFromCacheMap(this._cacheMap,R,k,U,H,z)}_getFromCacheMap(R,k,U,H,z,Y=!1){return h=R.get(k,U,H,z),h||(h=this._drawToCache(k,U,H,z,Y),R.set(k,U,H,z,h)),h}_getColorFromAnsiIndex(R){if(R>=this._config.colors.ansi.length)throw new Error("No color found for idx "+R);return this._config.colors.ansi[R]}_getBackgroundColor(R,k,U,H){if(this._config.allowTransparency)return b.NULL_COLOR;let z;switch(R){case 16777216:case 33554432:z=this._getColorFromAnsiIndex(k);break;case 50331648:const Y=a.AttributeData.toColorRGB(k);z=b.channels.toColor(Y[0],Y[1],Y[2]);break;default:z=U?b.color.opaque(this._config.colors.foreground):this._config.colors.background}return z}_getForegroundColor(R,k,U,H,z,Y,re,V,X,I){const N=this._getMinimumContrastColor(R,k,U,H,z,Y,re,X,V,I);if(N)return N;let W;switch(z){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&X&&Y<8&&(Y+=8),W=this._getColorFromAnsiIndex(Y);break;case 50331648:const j=a.AttributeData.toColorRGB(Y);W=b.channels.toColor(j[0],j[1],j[2]);break;default:W=re?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(W=b.color.opaque(W)),V&&(W=b.color.multiplyOpacity(W,m.DIM_OPACITY)),W}_resolveBackgroundRgba(R,k,U){switch(R){case 16777216:case 33554432:return this._getColorFromAnsiIndex(k).rgba;case 50331648:return k<<8;default:return U?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(R,k,U,H){switch(R){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&H&&k<8&&(k+=8),this._getColorFromAnsiIndex(k).rgba;case 50331648:return k<<8;default:return U?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(R,k,U,H,z,Y,re,V,X,I){if(this._config.minimumContrastRatio===1||I)return;const N=this._getContrastCache(X),W=N.getColor(R,H);if(W!==void 0)return W||void 0;const j=this._resolveBackgroundRgba(k,U,re),F=this._resolveForegroundRgba(z,Y,re,V),ie=b.rgba.ensureContrastRatio(j,F,this._config.minimumContrastRatio/(X?2:1));if(!ie)return void N.setColor(R,H,null);const te=b.channels.toColor(ie>>24&255,ie>>16&255,ie>>8&255);return N.setColor(R,H,te),te}_getContrastCache(R){return R?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(R,k,U,H,z=!1){const Y=typeof R=="number"?String.fromCharCode(R):R,re=Math.min(this._config.deviceCellWidth*Math.max(Y.length,2)+4,this._textureSize);this._tmpCanvas.width<re&&(this._tmpCanvas.width=re);const V=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<V&&(this._tmpCanvas.height=V),this._tmpCtx.save(),this._workAttributeData.fg=U,this._workAttributeData.bg=k,this._workAttributeData.extended.ext=H,this._workAttributeData.isInvisible())return f;const X=!!this._workAttributeData.isBold(),I=!!this._workAttributeData.isInverse(),N=!!this._workAttributeData.isDim(),W=!!this._workAttributeData.isItalic(),j=!!this._workAttributeData.isUnderline(),F=!!this._workAttributeData.isStrikethrough(),ie=!!this._workAttributeData.isOverline();let te=this._workAttributeData.getFgColor(),de=this._workAttributeData.getFgColorMode(),ge=this._workAttributeData.getBgColor(),J=this._workAttributeData.getBgColorMode();if(I){const ue=te;te=ge,ge=ue;const Se=de;de=J,J=Se}const q=this._getBackgroundColor(J,ge,I,N);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=q.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const ne=X?this._config.fontWeightBold:this._config.fontWeight,_e=W?"italic":"";this._tmpCtx.font=`${_e} ${ne} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=m.TEXT_BASELINE;const we=Y.length===1&&(0,o.isPowerlineGlyph)(Y.charCodeAt(0)),xe=Y.length===1&&(0,o.isRestrictedPowerlineGlyph)(Y.charCodeAt(0)),Ne=this._getForegroundColor(k,J,ge,U,de,te,I,N,X,(0,o.treatGlyphAsBackgroundColor)(Y.charCodeAt(0)));this._tmpCtx.fillStyle=Ne.css;const Ae=xe?0:4;let We=!1;this._config.customGlyphs!==!1&&(We=(0,v.tryDrawCustomChar)(this._tmpCtx,Y,Ae,Ae,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let et,Te=!we;if(et=typeof R=="number"?this._unicodeService.wcwidth(R):this._unicodeService.getStringCellWidth(R),j){this._tmpCtx.save();const ue=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Se=ue%2==1?.5:0;if(this._tmpCtx.lineWidth=ue,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())Te=!1,this._tmpCtx.strokeStyle=`rgb(${a.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{Te=!1;let Oe=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Oe<8&&(Oe+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Oe).css}this._tmpCtx.beginPath();const De=Ae,je=Math.ceil(Ae+this._config.deviceCharHeight)-Se-(z?2*ue:0),at=je+ue,ut=je+2*ue;let Tt=this._workAttributeData.getUnderlineVariantOffset();for(let Oe=0;Oe<et;Oe++){this._tmpCtx.save();const Ue=De+Oe*this._config.deviceCellWidth,ze=De+(Oe+1)*this._config.deviceCellWidth,wt=Ue+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Ue,je),this._tmpCtx.lineTo(ze,je),this._tmpCtx.moveTo(Ue,ut),this._tmpCtx.lineTo(ze,ut);break;case 3:const bt=ue<=1?ut:Math.ceil(Ae+this._config.deviceCharHeight-ue/2)-Se,Pt=ue<=1?je:Math.ceil(Ae+this._config.deviceCharHeight+ue/2)-Se,mt=new Path2D;mt.rect(Ue,je,this._config.deviceCellWidth,ut-je),this._tmpCtx.clip(mt),this._tmpCtx.moveTo(Ue-this._config.deviceCellWidth/2,at),this._tmpCtx.bezierCurveTo(Ue-this._config.deviceCellWidth/2,Pt,Ue,Pt,Ue,at),this._tmpCtx.bezierCurveTo(Ue,bt,wt,bt,wt,at),this._tmpCtx.bezierCurveTo(wt,Pt,ze,Pt,ze,at),this._tmpCtx.bezierCurveTo(ze,bt,ze+this._config.deviceCellWidth/2,bt,ze+this._config.deviceCellWidth/2,at);break;case 4:const dt=Tt===0?0:Tt>=ue?2*ue-Tt:ue-Tt;Tt>=ue||dt===0?(this._tmpCtx.setLineDash([Math.round(ue),Math.round(ue)]),this._tmpCtx.moveTo(Ue+dt,je),this._tmpCtx.lineTo(ze,je)):(this._tmpCtx.setLineDash([Math.round(ue),Math.round(ue)]),this._tmpCtx.moveTo(Ue,je),this._tmpCtx.lineTo(Ue+dt,je),this._tmpCtx.moveTo(Ue+dt+ue,je),this._tmpCtx.lineTo(ze,je)),Tt=(0,o.computeNextVariantOffset)(ze-Ue,ue,Tt);break;case 5:const Mt=.6,Yr=.3,$t=ze-Ue,Fi=Math.floor(Mt*$t),xi=Math.floor(Yr*$t),Zi=$t-Fi-xi;this._tmpCtx.setLineDash([Fi,xi,Zi]),this._tmpCtx.moveTo(Ue,je),this._tmpCtx.lineTo(ze,je);break;default:this._tmpCtx.moveTo(Ue,je),this._tmpCtx.lineTo(ze,je)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!We&&this._config.fontSize>=12&&!this._config.allowTransparency&&Y!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Oe=this._tmpCtx.measureText(Y);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Oe&&Oe.actualBoundingBoxDescent>0){this._tmpCtx.save();const Ue=new Path2D;Ue.rect(De,je-Math.ceil(ue/2),this._config.deviceCellWidth*et,ut-je+Math.ceil(ue/2)),this._tmpCtx.clip(Ue),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=q.css,this._tmpCtx.strokeText(Y,Ae,Ae+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(ie){const ue=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Se=ue%2==1?.5:0;this._tmpCtx.lineWidth=ue,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(Ae,Ae+Se),this._tmpCtx.lineTo(Ae+this._config.deviceCharWidth*et,Ae+Se),this._tmpCtx.stroke()}if(We||this._tmpCtx.fillText(Y,Ae,Ae+this._config.deviceCharHeight),Y==="_"&&!this._config.allowTransparency){let ue=w(this._tmpCtx.getImageData(Ae,Ae,this._config.deviceCellWidth,this._config.deviceCellHeight),q,Ne,Te);if(ue)for(let Se=1;Se<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=q.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(Y,Ae,Ae+this._config.deviceCharHeight-Se),ue=w(this._tmpCtx.getImageData(Ae,Ae,this._config.deviceCellWidth,this._config.deviceCellHeight),q,Ne,Te),ue);Se++);}if(F){const ue=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),Se=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=ue,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(Ae,Ae+Math.floor(this._config.deviceCharHeight/2)-Se),this._tmpCtx.lineTo(Ae+this._config.deviceCharWidth*et,Ae+Math.floor(this._config.deviceCharHeight/2)-Se),this._tmpCtx.stroke()}this._tmpCtx.restore();const Lt=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let qt;if(qt=this._config.allowTransparency?(function(ue){for(let Se=0;Se<ue.data.length;Se+=4)if(ue.data[Se+3]>0)return!1;return!0})(Lt):w(Lt,q,Ne,Te),qt)return f;const $e=this._findGlyphBoundingBox(Lt,this._workBoundingBox,re,xe,We,Ae);let Pe,he;for(;;){if(this._activePages.length===0){const ue=this._createNewPage();Pe=ue,he=ue.currentRow,he.height=$e.size.y;break}Pe=this._activePages[this._activePages.length-1],he=Pe.currentRow;for(const ue of this._activePages)$e.size.y<=ue.currentRow.height&&(Pe=ue,he=ue.currentRow);for(let ue=this._activePages.length-1;ue>=0;ue--)for(const Se of this._activePages[ue].fixedRows)Se.height<=he.height&&$e.size.y<=Se.height&&(Pe=this._activePages[ue],he=Se);if(he.y+$e.size.y>=Pe.canvas.height||he.height>$e.size.y+2){let ue=!1;if(Pe.currentRow.y+Pe.currentRow.height+$e.size.y>=Pe.canvas.height){let Se;for(const De of this._activePages)if(De.currentRow.y+De.currentRow.height+$e.size.y<De.canvas.height){Se=De;break}if(Se)Pe=Se;else if(S.maxAtlasPages&&this._pages.length>=S.maxAtlasPages&&he.y+$e.size.y<=Pe.canvas.height&&he.height>=$e.size.y&&he.x+$e.size.x<=Pe.canvas.width)ue=!0;else{const De=this._createNewPage();Pe=De,he=De.currentRow,he.height=$e.size.y,ue=!0}}ue||(Pe.currentRow.height>0&&Pe.fixedRows.push(Pe.currentRow),he={x:0,y:Pe.currentRow.y+Pe.currentRow.height,height:$e.size.y},Pe.fixedRows.push(he),Pe.currentRow={x:0,y:he.y+he.height,height:0})}if(he.x+$e.size.x<=Pe.canvas.width)break;he===Pe.currentRow?(he.x=0,he.y+=he.height,he.height=0):Pe.fixedRows.splice(Pe.fixedRows.indexOf(he),1)}return $e.texturePage=this._pages.indexOf(Pe),$e.texturePosition.x=he.x,$e.texturePosition.y=he.y,$e.texturePositionClipSpace.x=he.x/Pe.canvas.width,$e.texturePositionClipSpace.y=he.y/Pe.canvas.height,$e.sizeClipSpace.x/=Pe.canvas.width,$e.sizeClipSpace.y/=Pe.canvas.height,he.height=Math.max(he.height,$e.size.y),he.x+=$e.size.x,Pe.ctx.putImageData(Lt,$e.texturePosition.x-this._workBoundingBox.left,$e.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,$e.size.x,$e.size.y),Pe.addGlyph($e),Pe.version++,$e}_findGlyphBoundingBox(R,k,U,H,z,Y){k.top=0;const re=H?this._config.deviceCellHeight:this._tmpCanvas.height,V=H?this._config.deviceCellWidth:U;let X=!1;for(let I=0;I<re;I++){for(let N=0;N<V;N++){const W=I*this._tmpCanvas.width*4+4*N+3;if(R.data[W]!==0){k.top=I,X=!0;break}}if(X)break}k.left=0,X=!1;for(let I=0;I<Y+V;I++){for(let N=0;N<re;N++){const W=N*this._tmpCanvas.width*4+4*I+3;if(R.data[W]!==0){k.left=I,X=!0;break}}if(X)break}k.right=V,X=!1;for(let I=Y+V-1;I>=Y;I--){for(let N=0;N<re;N++){const W=N*this._tmpCanvas.width*4+4*I+3;if(R.data[W]!==0){k.right=I,X=!0;break}}if(X)break}k.bottom=re,X=!1;for(let I=re-1;I>=0;I--){for(let N=0;N<V;N++){const W=I*this._tmpCanvas.width*4+4*N+3;if(R.data[W]!==0){k.bottom=I,X=!0;break}}if(X)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:k.right-k.left+1,y:k.bottom-k.top+1},sizeClipSpace:{x:k.right-k.left+1,y:k.bottom-k.top+1},offset:{x:-k.left+Y+(H||z?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-k.top+Y+(H||z?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}n.TextureAtlas=S;class T{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(R){this._glyphs.push(R),this._usedPixels+=R.size.x*R.size.y}constructor(R,k,U){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],U)for(const H of U)this._glyphs.push(...H.glyphs),this._usedPixels+=H._usedPixels;this.canvas=L(R,k,k),this.ctx=(0,o.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function w(y,R,k,U){const H=R.rgba>>>24,z=R.rgba>>>16&255,Y=R.rgba>>>8&255,re=k.rgba>>>24,V=k.rgba>>>16&255,X=k.rgba>>>8&255,I=Math.floor((Math.abs(H-re)+Math.abs(z-V)+Math.abs(Y-X))/12);let N=!0;for(let W=0;W<y.data.length;W+=4)y.data[W]===H&&y.data[W+1]===z&&y.data[W+2]===Y||U&&Math.abs(y.data[W]-H)+Math.abs(y.data[W+1]-z)+Math.abs(y.data[W+2]-Y)<I?y.data[W+3]=0:N=!1;return N}function L(y,R,k){const U=y.createElement("canvas");return U.width=R,U.height=k,U}},160:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;let d=0,m=0,v=0,o=0;var b,x,A,p,a;function u(h){const S=h.toString(16);return S.length<2?"0"+S:S}function f(h,S){return h<S?(S+.05)/(h+.05):(h+.05)/(S+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},(function(h){h.toCss=function(S,T,w,L){return L!==void 0?`#${u(S)}${u(T)}${u(w)}${u(L)}`:`#${u(S)}${u(T)}${u(w)}`},h.toRgba=function(S,T,w,L=255){return(S<<24|T<<16|w<<8|L)>>>0},h.toColor=function(S,T,w,L){return{css:h.toCss(S,T,w,L),rgba:h.toRgba(S,T,w,L)}}})(b||(n.channels=b={})),(function(h){function S(T,w){return o=Math.round(255*w),[d,m,v]=a.toChannels(T.rgba),{css:b.toCss(d,m,v,o),rgba:b.toRgba(d,m,v,o)}}h.blend=function(T,w){if(o=(255&w.rgba)/255,o===1)return{css:w.css,rgba:w.rgba};const L=w.rgba>>24&255,y=w.rgba>>16&255,R=w.rgba>>8&255,k=T.rgba>>24&255,U=T.rgba>>16&255,H=T.rgba>>8&255;return d=k+Math.round((L-k)*o),m=U+Math.round((y-U)*o),v=H+Math.round((R-H)*o),{css:b.toCss(d,m,v),rgba:b.toRgba(d,m,v)}},h.isOpaque=function(T){return(255&T.rgba)==255},h.ensureContrastRatio=function(T,w,L){const y=a.ensureContrastRatio(T.rgba,w.rgba,L);if(y)return b.toColor(y>>24&255,y>>16&255,y>>8&255)},h.opaque=function(T){const w=(255|T.rgba)>>>0;return[d,m,v]=a.toChannels(w),{css:b.toCss(d,m,v),rgba:w}},h.opacity=S,h.multiplyOpacity=function(T,w){return o=255&T.rgba,S(T,o*w/255)},h.toColorRGB=function(T){return[T.rgba>>24&255,T.rgba>>16&255,T.rgba>>8&255]}})(x||(n.color=x={})),(function(h){let S,T;try{const w=document.createElement("canvas");w.width=1,w.height=1;const L=w.getContext("2d",{willReadFrequently:!0});L&&(S=L,S.globalCompositeOperation="copy",T=S.createLinearGradient(0,0,1,1))}catch{}h.toColor=function(w){if(w.match(/#[\da-f]{3,8}/i))switch(w.length){case 4:return d=parseInt(w.slice(1,2).repeat(2),16),m=parseInt(w.slice(2,3).repeat(2),16),v=parseInt(w.slice(3,4).repeat(2),16),b.toColor(d,m,v);case 5:return d=parseInt(w.slice(1,2).repeat(2),16),m=parseInt(w.slice(2,3).repeat(2),16),v=parseInt(w.slice(3,4).repeat(2),16),o=parseInt(w.slice(4,5).repeat(2),16),b.toColor(d,m,v,o);case 7:return{css:w,rgba:(parseInt(w.slice(1),16)<<8|255)>>>0};case 9:return{css:w,rgba:parseInt(w.slice(1),16)>>>0}}const L=w.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(L)return d=parseInt(L[1]),m=parseInt(L[2]),v=parseInt(L[3]),o=Math.round(255*(L[5]===void 0?1:parseFloat(L[5]))),b.toColor(d,m,v,o);if(!S||!T)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=T,S.fillStyle=w,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[d,m,v,o]=S.getImageData(0,0,1,1).data,o!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(d,m,v,o),css:w}}})(A||(n.css=A={})),(function(h){function S(T,w,L){const y=T/255,R=w/255,k=L/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))}h.relativeLuminance=function(T){return S(T>>16&255,T>>8&255,255&T)},h.relativeLuminance2=S})(p||(n.rgb=p={})),(function(h){function S(w,L,y){const R=w>>24&255,k=w>>16&255,U=w>>8&255;let H=L>>24&255,z=L>>16&255,Y=L>>8&255,re=f(p.relativeLuminance2(H,z,Y),p.relativeLuminance2(R,k,U));for(;re<y&&(H>0||z>0||Y>0);)H-=Math.max(0,Math.ceil(.1*H)),z-=Math.max(0,Math.ceil(.1*z)),Y-=Math.max(0,Math.ceil(.1*Y)),re=f(p.relativeLuminance2(H,z,Y),p.relativeLuminance2(R,k,U));return(H<<24|z<<16|Y<<8|255)>>>0}function T(w,L,y){const R=w>>24&255,k=w>>16&255,U=w>>8&255;let H=L>>24&255,z=L>>16&255,Y=L>>8&255,re=f(p.relativeLuminance2(H,z,Y),p.relativeLuminance2(R,k,U));for(;re<y&&(H<255||z<255||Y<255);)H=Math.min(255,H+Math.ceil(.1*(255-H))),z=Math.min(255,z+Math.ceil(.1*(255-z))),Y=Math.min(255,Y+Math.ceil(.1*(255-Y))),re=f(p.relativeLuminance2(H,z,Y),p.relativeLuminance2(R,k,U));return(H<<24|z<<16|Y<<8|255)>>>0}h.blend=function(w,L){if(o=(255&L)/255,o===1)return L;const y=L>>24&255,R=L>>16&255,k=L>>8&255,U=w>>24&255,H=w>>16&255,z=w>>8&255;return d=U+Math.round((y-U)*o),m=H+Math.round((R-H)*o),v=z+Math.round((k-z)*o),b.toRgba(d,m,v)},h.ensureContrastRatio=function(w,L,y){const R=p.relativeLuminance(w>>8),k=p.relativeLuminance(L>>8);if(f(R,k)<y){if(k<R){const z=S(w,L,y),Y=f(R,p.relativeLuminance(z>>8));if(Y<y){const re=T(w,L,y);return Y>f(R,p.relativeLuminance(re>>8))?z:re}return z}const U=T(w,L,y),H=f(R,p.relativeLuminance(U>>8));if(H<y){const z=S(w,L,y);return H>f(R,p.relativeLuminance(z>>8))?U:z}return U}},h.reduceLuminance=S,h.increaseLuminance=T,h.toChannels=function(w){return[w>>24&255,w>>16&255,w>>8&255,255&w]}})(a||(n.rgba=a={})),n.toPaddedHex=u,n.contrastRatio=f},345:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=d=>(this._listeners.push(d),{dispose:()=>{if(!this._disposed){for(let m=0;m<this._listeners.length;m++)if(this._listeners[m]===d)return void this._listeners.splice(m,1)}}})),this._event}fire(d,m){const v=[];for(let o=0;o<this._listeners.length;o++)v.push(this._listeners[o]);for(let o=0;o<v.length;o++)v[o].call(void 0,d,m)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(d,m){return d((v=>m.fire(v)))},n.runAndSubscribe=function(d,m){return m(void 0),d((v=>m(v)))}},859:(P,n)=>{function d(m){for(const v of m)v.dispose();m.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const m of this._disposables)m.dispose();this._disposables.length=0}register(m){return this._disposables.push(m),m}unregister(m){const v=this._disposables.indexOf(m);v!==-1&&this._disposables.splice(v,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(m){this._isDisposed||m===this._value||(this._value?.dispose(),this._value=m)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},n.toDisposable=function(m){return{dispose:m}},n.disposeArray=d,n.getDisposeArrayDisposable=function(m){return{dispose:()=>d(m)}}},485:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class d{constructor(){this._data={}}set(v,o,b){this._data[v]||(this._data[v]={}),this._data[v][o]=b}get(v,o){return this._data[v]?this._data[v][o]:void 0}clear(){this._data={}}}n.TwoKeyMap=d,n.FourKeyMap=class{constructor(){this._data=new d}set(m,v,o,b,x){this._data.get(m,v)||this._data.set(m,v,new d),this._data.get(m,v).set(o,b,x)}get(m,v,o,b){return this._data.get(m,v)?.get(o,b)}clear(){this._data.clear()}}},399:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof process<"u"&&"title"in process;const d=n.isNode?"node":navigator.userAgent,m=n.isNode?"node":navigator.platform;n.isFirefox=d.includes("Firefox"),n.isLegacyEdge=d.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(d),n.getSafariVersion=function(){if(!n.isSafari)return 0;const v=d.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(m),n.isIpad=m==="iPad",n.isIphone=m==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(m),n.isLinux=m.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(d)},385:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const m=d(399);class v{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(x){this._idleCallback=void 0;let A=0,p=0,a=x.timeRemaining(),u=0;for(;this._i<this._tasks.length;){if(A=Date.now(),this._tasks[this._i]()||this._i++,A=Math.max(1,Date.now()-A),p=Math.max(A,p),u=x.timeRemaining(),1.5*p>u)return a-A<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-A))}ms`),void this._start();a=u}this.clear()}}class o extends v{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const A=Date.now()+x;return{timeRemaining:()=>Math.max(0,A-Date.now())}}}n.PriorityTaskQueue=o,n.IdleTaskQueue=!m.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(b){return requestIdleCallback(b)}_cancelCallback(b){cancelIdleCallback(b)}}:o,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(b){this._queue.clear(),this._queue.enqueue(b)}flush(){this._queue.flush()}}},147:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class d{constructor(){this.fg=0,this.bg=0,this.extended=new m}static toColorRGB(o){return[o>>>16&255,o>>>8&255,255&o]}static fromColorRGB(o){return(255&o[0])<<16|(255&o[1])<<8|255&o[2]}clone(){const o=new d;return o.fg=this.fg,o.bg=this.bg,o.extended=this.extended.clone(),o}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}n.AttributeData=d;class m{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(o){this._ext=o}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(o){this._ext&=-469762049,this._ext|=o<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(o){this._ext&=-67108864,this._ext|=67108863&o}get urlId(){return this._urlId}set urlId(o){this._urlId=o}get underlineVariantOffset(){const o=(3758096384&this._ext)>>29;return o<0?4294967288^o:o}set underlineVariantOffset(o){this._ext&=536870911,this._ext|=o<<29&3758096384}constructor(o=0,b=0){this._ext=0,this._urlId=0,this._ext=o,this._urlId=b}clone(){return new m(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=m},782:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const m=d(133),v=d(855),o=d(147);class b extends o.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new o.ExtendedAttrs,this.combinedData=""}static fromCharData(A){const p=new b;return p.setFromCharData(A),p}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,m.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(A){this.fg=A[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let p=!1;if(A[v.CHAR_DATA_CHAR_INDEX].length>2)p=!0;else if(A[v.CHAR_DATA_CHAR_INDEX].length===2){const a=A[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=a&&a<=56319){const u=A[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=u&&u<=57343?this.content=1024*(a-55296)+u-56320+65536|A[v.CHAR_DATA_WIDTH_INDEX]<<22:p=!0}else p=!0}else this.content=A[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|A[v.CHAR_DATA_WIDTH_INDEX]<<22;p&&(this.combinedData=A[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|A[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=b},855:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},133:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(d){return d>65535?(d-=65536,String.fromCharCode(55296+(d>>10))+String.fromCharCode(d%1024+56320)):String.fromCharCode(d)},n.utf32ToString=function(d,m=0,v=d.length){let o="";for(let b=m;b<v;++b){let x=d[b];x>65535?(x-=65536,o+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):o+=String.fromCharCode(x)}return o},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(d,m){const v=d.length;if(!v)return 0;let o=0,b=0;if(this._interim){const x=d.charCodeAt(b++);56320<=x&&x<=57343?m[o++]=1024*(this._interim-55296)+x-56320+65536:(m[o++]=this._interim,m[o++]=x),this._interim=0}for(let x=b;x<v;++x){const A=d.charCodeAt(x);if(55296<=A&&A<=56319){if(++x>=v)return this._interim=A,o;const p=d.charCodeAt(x);56320<=p&&p<=57343?m[o++]=1024*(A-55296)+p-56320+65536:(m[o++]=A,m[o++]=p)}else A!==65279&&(m[o++]=A)}return o}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(d,m){const v=d.length;if(!v)return 0;let o,b,x,A,p=0,a=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 w,L=0;for(;(w=63&this.interim[++L])&&L<4;)T<<=6,T|=w;const y=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=y-L;for(;u<R;){if(u>=v)return 0;if(w=d[u++],(192&w)!=128){u--,S=!0;break}this.interim[L++]=w,T<<=6,T|=63&w}S||(y===2?T<128?u--:m[p++]=T:y===3?T<2048||T>=55296&&T<=57343||T===65279||(m[p++]=T):T<65536||T>1114111||(m[p++]=T)),this.interim.fill(0)}const f=v-4;let h=u;for(;h<v;){for(;!(!(h<f)||128&(o=d[h])||128&(b=d[h+1])||128&(x=d[h+2])||128&(A=d[h+3]));)m[p++]=o,m[p++]=b,m[p++]=x,m[p++]=A,h+=4;if(o=d[h++],o<128)m[p++]=o;else if((224&o)==192){if(h>=v)return this.interim[0]=o,p;if(b=d[h++],(192&b)!=128){h--;continue}if(a=(31&o)<<6|63&b,a<128){h--;continue}m[p++]=a}else if((240&o)==224){if(h>=v)return this.interim[0]=o,p;if(b=d[h++],(192&b)!=128){h--;continue}if(h>=v)return this.interim[0]=o,this.interim[1]=b,p;if(x=d[h++],(192&x)!=128){h--;continue}if(a=(15&o)<<12|(63&b)<<6|63&x,a<2048||a>=55296&&a<=57343||a===65279)continue;m[p++]=a}else if((248&o)==240){if(h>=v)return this.interim[0]=o,p;if(b=d[h++],(192&b)!=128){h--;continue}if(h>=v)return this.interim[0]=o,this.interim[1]=b,p;if(x=d[h++],(192&x)!=128){h--;continue}if(h>=v)return this.interim[0]=o,this.interim[1]=b,this.interim[2]=x,p;if(A=d[h++],(192&A)!=128){h--;continue}if(a=(7&o)<<18|(63&b)<<12|(63&x)<<6|63&A,a<65536||a>1114111)continue;m[p++]=a}}return p}}},776:function(P,n,d){var m=this&&this.__decorate||function(a,u,f,h){var S,T=arguments.length,w=T<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,f):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(a,u,f,h);else for(var L=a.length-1;L>=0;L--)(S=a[L])&&(w=(T<3?S(w):T>3?S(u,f,w):S(u,f))||w);return T>3&&w&&Object.defineProperty(u,f,w),w},v=this&&this.__param||function(a,u){return function(f,h){u(f,h,a)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const o=d(859),b=d(97),x={trace:b.LogLevelEnum.TRACE,debug:b.LogLevelEnum.DEBUG,info:b.LogLevelEnum.INFO,warn:b.LogLevelEnum.WARN,error:b.LogLevelEnum.ERROR,off:b.LogLevelEnum.OFF};let A,p=n.LogService=class extends o.Disposable{get logLevel(){return this._logLevel}constructor(a){super(),this._optionsService=a,this._logLevel=b.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),A=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(a){for(let u=0;u<a.length;u++)typeof a[u]=="function"&&(a[u]=a[u]())}_log(a,u,f){this._evalLazyOptionalParams(f),a.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+u,...f)}trace(a,...u){this._logLevel<=b.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,a,u)}debug(a,...u){this._logLevel<=b.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,a,u)}info(a,...u){this._logLevel<=b.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,a,u)}warn(a,...u){this._logLevel<=b.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,a,u)}error(a,...u){this._logLevel<=b.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,a,u)}};n.LogService=p=m([v(0,b.IOptionsService)],p),n.setTraceLogger=function(a){A=a},n.traceCall=function(a,u,f){if(typeof f.value!="function")throw new Error("not supported");const h=f.value;f.value=function(...S){if(A.logLevel!==b.LogLevelEnum.TRACE)return h.apply(this,S);A.trace(`GlyphRenderer#${h.name}(${S.map((w=>JSON.stringify(w))).join(", ")})`);const T=h.apply(this,S);return A.trace(`GlyphRenderer#${h.name} return`,T),T}}},726:(P,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const d="di$target",m="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(v){return v[m]||[]},n.createDecorator=function(v){if(n.serviceRegistry.has(v))return n.serviceRegistry.get(v);const o=function(b,x,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(p,a,u){a[d]===a?a[m].push({id:p,index:u}):(a[m]=[{id:p,index:u}],a[d]=a)})(o,b,A)};return o.toString=()=>v,n.serviceRegistry.set(v,o),o}},97:(P,n,d)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const m=d(726);var v;n.IBufferService=(0,m.createDecorator)("BufferService"),n.ICoreMouseService=(0,m.createDecorator)("CoreMouseService"),n.ICoreService=(0,m.createDecorator)("CoreService"),n.ICharsetService=(0,m.createDecorator)("CharsetService"),n.IInstantiationService=(0,m.createDecorator)("InstantiationService"),(function(o){o[o.TRACE=0]="TRACE",o[o.DEBUG=1]="DEBUG",o[o.INFO=2]="INFO",o[o.WARN=3]="WARN",o[o.ERROR=4]="ERROR",o[o.OFF=5]="OFF"})(v||(n.LogLevelEnum=v={})),n.ILogService=(0,m.createDecorator)("LogService"),n.IOptionsService=(0,m.createDecorator)("OptionsService"),n.IOscLinkService=(0,m.createDecorator)("OscLinkService"),n.IUnicodeService=(0,m.createDecorator)("UnicodeService"),n.IDecorationService=(0,m.createDecorator)("DecorationService")}},M={};function O(P){var n=M[P];if(n!==void 0)return n.exports;var d=M[P]={exports:{}};return E[P].call(d.exports,d,d.exports,O),d.exports}var K={};return(()=>{var P=K;Object.defineProperty(P,"__esModule",{value:!0}),P.WebglAddon=void 0;const n=O(345),d=O(859),m=O(399),v=O(666),o=O(776);class b extends d.Disposable{constructor(A){if(m.isSafari&&(0,m.getSafariVersion)()<16){const p={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",p))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=A,this._onChangeTextureAtlas=this.register(new n.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new n.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new n.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new n.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(A){const p=A._core;if(!A.element)return void this.register(p.onWillOpen((()=>this.activate(A))));this._terminal=A;const a=p.coreService,u=p.optionsService,f=p,h=f._renderService,S=f._characterJoinerService,T=f._charSizeService,w=f._coreBrowserService,L=f._decorationService,y=f._logService,R=f._themeService;(0,o.setTraceLogger)(y),this._renderer=this.register(new v.WebglRenderer(A,S,T,w,a,L,u,R,this._preserveDrawingBuffer)),this.register((0,n.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,n.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,n.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,n.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),h.setRenderer(this._renderer),this.register((0,d.toDisposable)((()=>{const k=this._terminal._core._renderService;k.setRenderer(this._terminal._core._createRenderer()),k.handleResize(A.cols,A.rows)})))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}}P.WebglAddon=b})(),K})()))})(Tu)),Tu.exports}var tv=ev();const Da=16e3,iv=.004,sv=["audio/webm;codecs=opus","audio/webm","audio/mp4"];function Kp(r){if(!r.length)return 0;let C=0;for(const E of r)C+=E*E;return Math.sqrt(C/r.length)}function np(r,C=iv){return Kp(r)<C}async function rv(r){const C=new AudioContext;try{const E=await C.decodeAudioData(await r.arrayBuffer()),M=Math.max(1,Math.ceil(E.duration*Da)),O=new OfflineAudioContext(1,M,Da),K=O.createBufferSource();return K.buffer=E,K.connect(O.destination),K.start(),(await O.startRendering()).getChannelData(0)}finally{C.close()}}class ap{constructor(){this.stream=null,this.recorder=null,this.chunks=[]}async start(){this.stream=await navigator.mediaDevices.getUserMedia({audio:!0});const C=sv.find(E=>MediaRecorder.isTypeSupported(E));this.recorder=new MediaRecorder(this.stream,C?{mimeType:C}:void 0),this.chunks=[],this.recorder.ondataavailable=E=>{E.data.size&&this.chunks.push(E.data)},this.recorder.start()}stop(){return new Promise(C=>{const E=this.recorder;if(!E||E.state==="inactive"){this.dispose(),C(null);return}E.onstop=()=>{const M=new Blob(this.chunks,{type:E.mimeType||"audio/webm"});if(this.dispose(),!M.size){C(null);return}rv(M).then(C,()=>C(null))},E.stop()})}cancel(){const C=this.recorder;C&&C.state!=="inactive"&&(C.onstop=null,C.stop()),this.dispose()}dispose(){this.stream?.getTracks().forEach(C=>C.stop()),this.stream=null,this.recorder=null,this.chunks=[]}}function us(r){const C=r.replace(/^.*@/,""),E=C.replace(/:\d+$/,"");return E.includes(":")?C:E}const xc="\x1B",op="\x07",nv=new RegExp(xc+"\\][^"+op+xc+"]*(?:"+op+"|"+xc+"\\\\)","g"),av=new RegExp(xc+"\\[[0-9;?]*[A-Za-z]","g");function lp(r){return/[#$%>]\s*$/.test(r.replace(nv,"").replace(av,""))}const ov=60,lv=200;function cv(r){if(r.type!=="keydown"||!(r.ctrlKey||r.metaKey)||!r.shiftKey)return null;const C=r.key.toLowerCase();return C==="c"?"copy":C==="v"?"paste":null}function Rc(r){return r instanceof Error?r.message:String(r)}function hv(r,C,E){if(C.mark(),typeof r.terminal.paste=="function"){r.terminal.paste(E);return}r.writeToPty?.(E)}function Vp(r=()=>Date.now()){let C=Number.NEGATIVE_INFINITY;return{mark(){C=r()},isDuplicate(){return r()-C<lv}}}function uv(r,C){const E=M=>{C.isDuplicate()&&(M.preventDefault(),M.stopPropagation(),M.stopImmediatePropagation?.())};return r.addEventListener("paste",E,!0),()=>r.removeEventListener("paste",E,!0)}function dv(r,C=Vp()){return E=>{const M=cv(E);if(!M)return!0;if(E.preventDefault(),E.stopPropagation(),M==="copy"){const O=r.terminal.getSelection();return O&&r.clipboard.copyText(O).catch(K=>{r.onError(Rc(K))}),!1}return r.clipboard.readText().then(O=>{O&&hv(r,C,O)}).catch(O=>{r.onError(Rc(O))}),!1}}const fv=new Set(["c","p","s"]);function _v(r){return r?[...r].some(C=>fv.has(C)):!0}function pv(r){const C=r.replace(/\s+/g,"");if(!/^[A-Za-z0-9+/]*={0,2}$/.test(C))return null;try{const E=atob(C),M=Uint8Array.from(E,O=>O.charCodeAt(0));return new TextDecoder().decode(M)}catch{return null}}function mv(r){const C=r.indexOf(";");if(C===-1||!_v(r.slice(0,C)))return null;const E=r.slice(C+1);return E==="?"||!E?null:pv(E)}function gv(r){const C=r.terminal.parser;if(!C)return()=>{};const E=C.registerOscHandler(52,M=>{const O=mv(M);return O!==null&&r.clipboard.copyText(O).catch(K=>{r.onError(Rc(K))}),!0});return()=>{E&&typeof E.dispose=="function"&&E.dispose()}}function vv(r){const{terminal:C}=r;if(typeof C.onSelectionChange!="function")return()=>{};let E,M=null;const O=C.onSelectionChange(()=>{E&&clearTimeout(E),E=setTimeout(()=>{if(E=void 0,r.isCopyOnSelectEnabled&&!r.isCopyOnSelectEnabled())return;const K=C.getSelection();!K||K===M||(M=K,r.clipboard.copyText(K).catch(P=>{M=null,r.onError(Rc(P))}))},ov)});return()=>{E&&clearTimeout(E),O&&typeof O.dispose=="function"&&O.dispose()}}function bv(r){const C=Vp();r.terminal.attachCustomKeyEventHandler(dv(r,C));const E=[gv(r),vv(r),r.pasteEventTarget?uv(r.pasteEventTarget,C):()=>{}];return()=>{for(const M of E.reverse())M()}}function Sv(r){let C=!1;return{onMouseDown(E){C=E.target===E.currentTarget},onClick(E){const M=C&&E.target===E.currentTarget;C=!1,M&&r()}}}function Wr(r){const C=Z.useRef(r);C.current=r;const E=Z.useRef(null);return E.current||(E.current=Sv(()=>C.current())),E.current}const yv=250,Cv={setTimeout:(r,C)=>setTimeout(r,C),clearTimeout:r=>clearTimeout(r)};function wv(r){const C=r.windowMs??yv,E=r.timers??Cv;let M=null,O=null;const K=()=>{M!==null&&(E.clearTimeout(M),M=null)},P=()=>{O!==null&&E.clearTimeout(O),O=E.setTimeout(()=>{O=null},C)};return{onClick(){if(O!==null){P();return}K(),M=E.setTimeout(()=>{M=null,r.onSingleClick()},C)},onDoubleClick(){K(),P(),r.onDoubleClick()},cancel(){K(),O!==null&&(E.clearTimeout(O),O=null)}}}function Yp(r,C){const E=Z.useRef({onSingleClick:r,onDoubleClick:C});E.current={onSingleClick:r,onDoubleClick:C};const M=Z.useRef(null);M.current||(M.current=wv({onSingleClick:()=>E.current.onSingleClick(),onDoubleClick:()=>E.current.onDoubleClick()}));const O=M.current;return Z.useEffect(()=>()=>O.cancel(),[O]),O}function xv(r,C){if(!r)return;const E=us(r);if(E)return C.find(M=>us(M.hostName??"")===E||M.alias===E)}function Xp(r){return r.screenName?r.screenName:r.backend==="screen"?r.name:void 0}function Ev(r,C,E){return E.find(M=>M.screenName===r&&M.kind===C)??E.find(M=>M.screenName===r)}function Mu(r,C,E){if(r.id){const K=C.find(P=>P.id===r.id);if(K)return{kind:"attach",sessionId:K.id}}const M=Xp(r);if(M){const K=Ev(M,r.kind,C);if(K)return{kind:"attach",sessionId:K.id};if(r.kind==="local")return{kind:"unavailable",reason:`No local screen session named ${M} is running`};const P=xv(r.host,E);if(P)return{kind:"attach-remote-screen",connection:P,screenName:M,name:r.name};const n=r.sshTarget||r.host;return n?{kind:"create-ssh",target:n,name:r.name,screenCommand:`screen -x ${M}`}:{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 O=r.sshTarget||r.host;return O?{kind:"create-ssh",target:O,name:r.name}:{kind:"unavailable",reason:`No host recorded for ${r.name}`}}const Zp=25,Qp=85,Jp=60;function Du(r){return r.sessionIds.length+r.pending.length}const Av=4;function Rv(r,C,E){const M=new Map(C.map(O=>[O.id,O]));return r.flatMap(O=>O.sessionIds.map(K=>M.get(K)).filter(K=>K!==void 0).slice(0,Av).map((K,P)=>({session:K,workspaceId:O.id,index:P,dormant:O.id!==E})))}function Vo(r){return{layout:r,lastSplit:r==="stack"?"split-v":r,maximizedSessionId:null}}function cp(r,C,E=[]){return{id:`ws-${crypto.randomUUID()}`,name:r,sessionIds:E,pending:[],view:Vo(C)}}function ku(r){return r<=1?"stack":r===2?"split-v":"grid"}function hp(r,C,E){return r.map(M=>{if(M.id!==C)return M;const O={...M.view,...typeof E=="function"?E(M.view):E};return{...M,view:O}})}function Lv(r,C,E){return r.map(M=>M.id!==C?M.sessionIds.includes(E)?{...M,sessionIds:M.sessionIds.filter(O=>O!==E)}:M:M.sessionIds.includes(E)?M:{...M,sessionIds:[...M.sessionIds,E]})}function Tv(r,C){return r.map(E=>{if(!E.sessionIds.includes(C))return E;const M=E.sessionIds.filter(O=>O!==C);return{...E,sessionIds:M,view:Ku(E.view,Gu({...E,sessionIds:M}))}})}function Gu(r){return[...r.sessionIds,...r.pending.map(C=>C.sessionId)]}function Ku(r,C){const E=new Set(C),M=r.activeSessionId&&E.has(r.activeSessionId)?r.activeSessionId:void 0,O=r.focusedSessionId&&E.has(r.focusedSessionId)?r.focusedSessionId:void 0,K=r.maximizedSessionId&&E.has(r.maximizedSessionId)?r.maximizedSessionId:null,P=Dv(r.browsers,E),n=Mv(r.visiblePanes,E);return n===r.visiblePanes&&M===r.activeSessionId&&O===r.focusedSessionId&&K===(r.maximizedSessionId??null)&&P===r.browsers?r:{...r,activeSessionId:M,focusedSessionId:O,maximizedSessionId:K,browsers:P,visiblePanes:n}}function Mv(r,C){if(!r)return r;const E=r.filter(M=>C.has(M));return E.length===r.length?r:E.length?E:void 0}function Dv(r,C){if(!r)return r;const E=Object.keys(r),M=E.filter(O=>C.has(O));return M.length===E.length?r:Object.fromEntries(M.map(O=>[O,r[O]]))}function kv(r,C){const E=new Set(C.map(K=>K.id));let M=!1;const O=r.map(K=>{const P=K.sessionIds.filter(d=>E.has(d)),n=Ku(K.view,Gu({...K,sessionIds:P}));return P.length===K.sessionIds.length&&n===K.view?K:(M=!0,{...K,sessionIds:P,view:n})});return M?O:r}const Ec="[A-Za-z0-9](?:[A-Za-z0-9_.]|-| ){0,48}",Ov=new RegExp(`^(?:${Ec})$`);function Iu(r){return Ov.test(r)}function yc(r){let C=r.length+1;const E=new Set(r.map(M=>M.name.toLowerCase()));for(;E.has(`workspace ${C}`);)C+=1;return`Workspace ${C}`}function up(r,C,E){const M=E.trim();return Iu(M)?r.map(O=>O.id===C?{...O,name:M}:O):r}function Bv(r,C,E,M,O=()=>`pending-${crypto.randomUUID()}`){const K=r.findIndex(x=>x.id===C);if(K<0)return{workspaces:r,created:null,copied:0,skipped:0};const P=r[K],n=new Map(E.map(x=>[x.id,x])),d=[...P.sessionIds.map(x=>n.get(x)).filter(x=>x!==void 0).map(em),...P.pending],m=d.filter(x=>x.kind==="ssh"),v=m.map(x=>{const{screenName:A,...p}=x;return{...p,sessionId:O()}}),o={id:`ws-${crypto.randomUUID()}`,name:M,sessionIds:[],pending:v,view:{...Vo(P.view.layout),lastSplit:P.view.lastSplit,maximizedSessionId:null}},b=[...r];return b.splice(K+1,0,o),{workspaces:b,created:o,copied:v.length,skipped:d.length-m.length}}function jv(r,C){const E=C.filter(M=>r.sessionIds.includes(M.id));return E.some(M=>M.status==="connected")?"connected":E.length||r.pending.length?"detached":"empty"}function Nv(r,C,E){const M=r.findIndex(d=>d.id===C),O={workspaces:r,activeWorkspaceId:E,releasedSessionIds:[]};if(M<0||r.length<2)return O;const K=r[M],P=r.filter(d=>d.id!==C),n=E===C?(P[Math.max(0,M-1)]??P[0]).id:E;return{workspaces:P,activeWorkspaceId:n,releasedSessionIds:[...K.sessionIds]}}function dp(r,C,E){return r.map(M=>{if(M.id!==C||!M.pending.some(K=>K.sessionId===E))return M;const O={...M,pending:M.pending.filter(K=>K.sessionId!==E)};return{...O,view:Ku(O.view,Gu(O))}})}function Hv(r,C){let E=!1;const M=r.map(O=>{if(!O.pending.length)return O;const K=[],P=[...O.sessionIds];let n=O.view,d=!1;for(const m of O.pending){const v=C(m);if(!v){K.push(m);continue}P.includes(v)||P.push(v),n=zv(n,m.sessionId,v),d=!0}return d?(E=!0,{...O,sessionIds:P,pending:K,view:n}):O});return E?M:r}function zv(r,C,E){const M=r.visiblePanes?.includes(C)??!1;return r.activeSessionId!==C&&r.focusedSessionId!==C&&r.maximizedSessionId!==C&&!M?r:{...r,...M?{visiblePanes:r.visiblePanes?.map(O=>O===C?E:O)}:{},activeSessionId:r.activeSessionId===C?E:r.activeSessionId,focusedSessionId:r.focusedSessionId===C?E:r.focusedSessionId,maximizedSessionId:r.maximizedSessionId===C?E:r.maximizedSessionId}}const Uv=1,Iv=["stack","split-v","split-h","grid"],Pv=["split-v","split-h","grid"];function $v(r,C,E){const M=new Map(E.map(O=>[O.id,O]));return{version:Uv,activeWorkspaceId:C,workspaces:r.map(O=>({id:O.id,name:O.name,view:{layout:O.view.layout,lastSplit:O.view.lastSplit,activeSessionId:O.view.activeSessionId,focusedSessionId:O.view.focusedSessionId,maximizedSessionId:O.view.maximizedSessionId??null,browsers:O.view.browsers,...O.view.visiblePanes?.length?{visiblePanes:O.view.visiblePanes}:{}},members:[...O.sessionIds.map(K=>M.get(K)).filter(K=>K!==void 0).map(em),...O.pending]}))}}function em(r){const C={sessionId:r.id,kind:r.kind,name:r.name};return r.host&&(C.host=r.host),r.screenName&&(C.screenName=r.screenName),r.sshTarget&&(C.sshTarget=r.sshTarget),r.backend&&(C.backend=r.backend),C}function fp(r){if(!Array.isArray(r))return;const C=[...new Set(r.filter(E=>typeof E=="string"&&E.length>0))].slice(0,2);return C.length?C:void 0}function Fv(r){if(!r||typeof r!="object"||Array.isArray(r))return;const C={};for(const[E,M]of Object.entries(r)){if(!E||!M||typeof M!="object")continue;const O=M;if(typeof O.open!="boolean")continue;const K=typeof O.ratio=="number"&&Number.isFinite(O.ratio)&&O.ratio>=Zp&&O.ratio<=Qp?O.ratio:void 0;C[E]=K===void 0?{open:O.open}:{open:O.open,ratio:K}}return Object.keys(C).length?C:void 0}function Wv(r){return Xp(r)!==void 0}function qv(r,C){const E=r.workspaces.map(O=>{const K=Iv.find(n=>n===O.view?.layout)??C,P=Vo(K);return{id:O.id,name:O.name,sessionIds:[],pending:(O.members??[]).filter(Wv),view:{...P,lastSplit:Pv.find(n=>n===O.view?.lastSplit)??P.lastSplit,activeSessionId:O.view?.activeSessionId,focusedSessionId:O.view?.focusedSessionId,maximizedSessionId:O.view?.maximizedSessionId??null,browsers:Fv(O.view?.browsers),...fp(O.view?.visiblePanes)?{visiblePanes:fp(O.view?.visiblePanes)}:{}}}}),M=E.some(O=>O.id===r.activeWorkspaceId)?r.activeWorkspaceId:E[0]?.id;return{workspaces:E,activeWorkspaceId:M}}function ke({name:r,className:C=""}){const E={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",className:`icon-svg ${C}`.trim(),"aria-hidden":!0};switch(r){case"plus":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M12 5v14M5 12h14"})});case"panel-left":return c.jsxs("svg",{...E,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",{...E,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",{...E,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",{...E,children:c.jsx("path",{d:"M4 7h16M4 12h16M4 17h10"})});case"terminal":return c.jsxs("svg",{...E,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",{...E,children:c.jsx("path",{d:"M7 17l5-5-5-5M12 17h7"})});case"history":return c.jsxs("svg",{...E,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",{...E,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",{...E,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",{...E,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",{...E,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",{...E,children:c.jsx("rect",{x:"5",y:"5",width:"14",height:"14",rx:"1.5"})});case"maximize":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M8 4H4v4M16 4h4v4M4 16v4h4M20 16v4h-4"})});case"restore":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M8 8h12v12H8zM4 16V4h12"})});case"chevron-left":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M15 5l-7 7 7 7"})});case"chevron-right":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M9 5l7 7-7 7"})});case"split-v":return c.jsxs("svg",{...E,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",{...E,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",{...E,children:c.jsx("path",{d:"M6 6l12 12M18 6L6 18"})});case"stop":return c.jsx("svg",{...E,children:c.jsx("rect",{x:"5",y:"5",width:"14",height:"14",rx:"2"})});case"mic":return c.jsxs("svg",{...E,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",{...E,children:c.jsx("path",{d:"M5 13l4.5 4.5L19 7"})});case"bot":return c.jsxs("svg",{...E,children:[c.jsx("rect",{x:"4",y:"8",width:"16",height:"12",rx:"3"}),c.jsx("path",{d:"M12 8V5M9.5 5h5"}),c.jsx("circle",{cx:"9",cy:"14",r:"1.2",fill:"currentColor",stroke:"none"}),c.jsx("circle",{cx:"15",cy:"14",r:"1.2",fill:"currentColor",stroke:"none"}),c.jsx("path",{d:"M9 17.5h6"})]});case"transfer":return c.jsxs("svg",{...E,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",{...E,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",{...E,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",{...E,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",{...E,children:[c.jsx("path",{d:"M6 3.5h7L18 8v12.5H6z"}),c.jsx("path",{d:"M13 3.5V8h5"})]});case"link":return c.jsxs("svg",{...E,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",{...E,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",{...E,children:c.jsx("path",{d:"M4.5 7h15M9 7V4.5h6V7M6.5 7l1 13h9l1-13"})});case"pencil":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M4 20h4L20 8l-4-4L4 16z"})});case"refresh":return c.jsx("svg",{...E,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",{...E,children:c.jsx("path",{d:"M12 20V4M12 4l-6 6M12 4l6 6"})});case"arrow-down":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M12 4v16M12 20l-6-6M12 20l6-6"})});case"level-up":return c.jsxs("svg",{...E,children:[c.jsx("path",{d:"M5 12l7-7 7 7"}),c.jsx("path",{d:"M12 5v14"})]});case"help":return c.jsxs("svg",{...E,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",{...E,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",{...E,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",{...E,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 Vu(r){if(!r||r.kind!=="ssh")return null;const C=r.sshTarget||r.host;return C&&C!=="local"?C:null}function Gv(r){return r?Vu(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 Ma(r){return r.kind==="directory"||r.kind==="symlink"}function _p(r,C,E=!1){return r.filter(M=>C.has(M.name)&&(E||M.kind!=="directory"))}function pp(r,C,E="file"){return C===0?r:`${r} ${C} ${C===1?E:`${E}s`}`}function mp(r,C,E,M,O){if(M&&O){const P=O.indexOf(M),n=O.indexOf(C);if(P>=0&&n>=0){const d=E?new Set(r):new Set,m=Math.min(P,n),v=Math.max(P,n);for(const o of O.slice(m,v+1))d.add(o);return d}}if(!E)return new Set([C]);const K=new Set(r);return K.has(C)?K.delete(C):K.add(C),K}const tm=["\\\\wsl.localhost\\","\\\\wsl$\\"];function Kv(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 Yu(r){return!!(r&&r.kind==="local"&&r.backend==="wsl"&&r.wslDistribution)}function Vv(r,C){const M=C.replace(/\/+$/,"").split("/").filter(Boolean),O=M.length?M.join("\\"):".";return`${tm[0]}${r}\\${O}`}function Yv(r,C){const E=C.replace(/\//g,"\\");for(const M of tm){const O=`${M}${r}`;if(!E.toLowerCase().startsWith(O.toLowerCase()))continue;return`/${E.slice(O.length).replace(/^\\+/,"").split("\\").filter(n=>n&&n!==".").join("/")}`}return null}function gp(r){return r?r.kind==="ssh"?"posix":Yu(r)?"unc":r.backend===void 0?null:r.host==="local"&&/^[A-Za-z]:/.test(r.cwd??"")?"windows":"posix":null}function vp(r,C){if(!r)return null;const E=Zv(r.cwd,C);return E?Yu(r)?E.startsWith("/")?Vv(r.wslDistribution,E):null:E:null}function Xv(r,C){const E=vp(r,C);return E||(!r||!C?null:vp({...r,cwd:C},C))}function Ou(r,C){return r?Yu(r)?Yv(r.wslDistribution,C):C:null}function Zv(r,C){return r?r==="~"?C??null:r.startsWith("~/")?C?`${C.replace(/\/+$/,"")}/${r.slice(2)}`:null:r:null}function Qv(r,C){if(C==="posix"){const n=r.replace(/\/+$/,"");if(!n||n==="")return null;const d=n.lastIndexOf("/");return d<0?null:d===0?"/":n.slice(0,d)}if(C==="windows"){const n=r.replace(/[\\/]+$/,"");if(/^[A-Za-z]:$/.test(n))return null;const d=Math.max(n.lastIndexOf("\\"),n.lastIndexOf("/"));if(d<0)return null;const m=n.slice(0,d);return/^[A-Za-z]:$/.test(m)?`${m}\\`:m}const M=r.replace(/\//g,"\\").replace(/\\+$/,"").match(/^(\\\\[^\\]+\\[^\\]+)(?:\\(.*))?$/);if(!M)return null;const[,O,K=""]=M,P=K.split("\\").filter(n=>n&&n!==".");return P.length?(P.pop(),P.length?`${O}\\${P.join("\\")}`:`${O}\\.`):null}const Jv=new RegExp(`[
|
|
75
|
+
\r]`);function e0(r,C){return C?Jv.test(C)?{refused:"That directory name contains a line break, which cannot be typed safely."}:r==="posix"?{command:`cd '${C.split("'").join(String.raw`'\''`)}'`}:r==="powershell"?{command:`Set-Location -LiteralPath '${C.split("'").join("''")}'`}:C.includes('"')?{refused:"Command Prompt cannot quote a directory name containing a double quote."}:{command:`cd /d "${C}"`}:{refused:"That directory has no path."}}function t0(r,C,E){return E==="posix"?r==="/"?`/${C}`:`${r.replace(/\/+$/,"")}/${C}`:`${r.replace(/\\\.$/,"").replace(/[\\/]+$/,"")}\\${C}`}function im(r){return r.startsWith(".")}function qr(r,C){return C.startsWith("/")?C:r==="/"?`/${C}`:`${r.replace(/\/+$/,"")}/${C}`}function i0(r){const C=r.replace(/\/+$/,""),E=C.lastIndexOf("/");return E<=0?"/":C.slice(0,E)}function sm(r){return/^[A-Za-z]:/.test(r)||r.startsWith("\\\\")||r.includes("\\")}function Ta(r,C){const E=sm(r)?"\\":"/";return`${r.replace(/[\\/]+$/,"")}${E}${C}`}function s0(r){const C=sm(r),E=r.replace(/[\\/]+$/,""),M=Math.max(E.lastIndexOf("/"),E.lastIndexOf("\\"));if(M<0)return r;if(!C)return M===0?"/":E.slice(0,M);const O=E.slice(0,M);return/^[A-Za-z]:$/.test(O)?`${O}\\`:O||"\\"}function Ko(r){const C=r.split(/[\\/]/).filter(Boolean);return C[C.length-1]??r}function r0(r){if(r.kind==="directory")return"—";const C=["B","KB","MB","GB","TB"];let E=r.size,M=0;for(;E>=1024&&M<C.length-1;)E/=1024,M+=1;return`${M===0?E:E.toFixed(E<10?1:0)} ${C[M]}`}function n0(r){if(!r)return"";const C=r.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/);if(!C)return r;const[,E,M,O,K,P]=C;return`${E}-${M}-${O} ${K}:${P}`}function rm({session:r,path:C,unanchored:E=!1,pathKind:M,shellPath:O,list:K,question:P,onOpen:n,onBrowse:d,onClose:m,onOpenFile:v,openFile:o,defaultShowHidden:b}){const[x,A]=Z.useState({phase:"idle"}),[p,a]=Z.useState(b),u=Z.useCallback(L=>{let y=!1;return A({phase:"loading",path:L??""}),K(L??void 0).then(R=>{y||A({phase:"ready",path:L??R.path,listing:R})}).catch(R=>{y||A({phase:"failed",path:L??"",message:R instanceof Error?R.message:String(R)})}),()=>{y=!0}},[K]);Z.useEffect(()=>{if(!C&&!E){A({phase:"idle"});return}return u(C)},[C,E,u]);const f=x.phase==="ready"?x.listing.path:C,h=f?Qv(f,M):null,S=x.phase==="ready"?x.listing.entries:[],w=[...p?S:S.filter(L=>!im(L.name))].sort((L,y)=>{const R=Ma(L)?0:1,k=Ma(y)?0:1;return R===k?L.name.localeCompare(y.name):R-k});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:f??"",children:O??f??"connecting…"}),c.jsxs("span",{className:"pane-browser-actions",children:[c.jsxs("label",{className:"pane-browser-hidden-toggle",title:"Show files whose name starts with a dot",children:[c.jsx("input",{type:"checkbox",checked:p,onChange:L=>a(L.target.checked)}),"Hidden"]}),c.jsx("button",{type:"button",className:"pane-browser-icon",disabled:x.phase!=="ready"&&x.phase!=="failed",onClick:()=>u(f??C),title:"Refresh","aria-label":"Refresh",children:c.jsx(ke,{name:"refresh"})}),c.jsx("button",{type:"button",className:"pane-browser-icon",onClick:m,title:"Close the browser","aria-label":"Close the browser",children:c.jsx(ke,{name:"x"})})]})]}),c.jsx("div",{className:"pane-browser-list",children:P&&x.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."]}):x.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."}):x.phase==="failed"?c.jsx("p",{className:"pane-browser-note pane-browser-error",children:x.message}):c.jsxs(c.Fragment,{children:[h?c.jsx(bp,{label:"..",icon:"level-up",target:h,navigable:!0,className:"pane-browser-parent",onOpen:n,onBrowse:d},".."):null,w.map(L=>{const y=t0(f??"",L.name,M);return c.jsx(bp,{label:L.name,icon:Ma(L)?"folder":"file",target:y,navigable:Ma(L),link:L.kind==="symlink",onOpen:n,onBrowse:d,onFile:v,current:o===y},L.name)}),x.phase==="ready"&&!w.length?c.jsx("p",{className:"pane-browser-note",children:S.length&&!p?"Nothing here but hidden files.":"Nothing here."}):null,x.phase==="loading"?c.jsx("p",{className:"pane-browser-note",children:"Listing…"}):null]})}),v?c.jsx("div",{className:"pane-browser-foot",children:c.jsx("small",{children:"Click a file to open it."})}):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:!f,onClick:()=>f&&n(f),title:"Take the shell to this directory","aria-label":"Take the shell to this directory",children:c.jsx(ke,{name:"send-right"})})]})]})}function bp({label:r,icon:C,target:E,navigable:M,link:O,className:K="",onOpen:P,onBrowse:n,onFile:d,current:m=!1}){const v=Yp(()=>M&&n(E),()=>M&&P(E));return!M&&!!d?c.jsxs("button",{type:"button",className:`pane-browser-row pane-browser-file-choice ${m?"pane-browser-current":""} ${K}`.trim(),onClick:()=>d?.(E),title:`${r} — click to open`,"aria-current":m||void 0,children:[c.jsx(ke,{name:C}),c.jsx("span",{className:"pane-browser-name",children:r}),O?c.jsx("span",{className:"pane-browser-kind",children:"link"}):null]}):c.jsxs("button",{type:"button",className:`pane-browser-row ${M?"":"pane-browser-file"} ${K}`.trim(),disabled:!M,onClick:v.onClick,onDoubleClick:v.onDoubleClick,onKeyDown:b=>{b.key!=="Enter"||!M||(b.preventDefault(),v.cancel(),P(E))},title:M?`${r} — double-click to take the shell there`:r,children:[c.jsx(ke,{name:C}),c.jsx("span",{className:"pane-browser-name",children:r}),O?c.jsx("span",{className:"pane-browser-kind",children:"link"}):null]})}const Vr=[{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"}],Xu=[{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"}],a0=[{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"}],o0=[[/^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 l0(r){for(const[C,E]of o0){const M=C.exec(r);if(M)return E(M)}return null}function nm(r){const C=r.ctrlKey||r.metaKey,E=!!r.altKey;if(!C||!(r.shiftKey||E))return null;const M=l0(r.code);return M?["Ctrl",...E?["Alt"]:[],...r.shiftKey?["Shift"]:[],M].join("+"):null}const c0=/^([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 am(r){if(typeof r!="string"||!r||r.length>40)return!1;const C=r.split("+"),E=C.pop();if(!c0.test(E)||C[0]!=="Ctrl")return!1;const M=C.slice(1).join("+");return M==="Shift"||M==="Alt"||M==="Alt+Shift"}const Lc=Object.freeze(Object.fromEntries(Vr.map(r=>[r.action,r.chord]))),om=/^Ctrl\+Shift\+([1-9])$/;function lm(r,C,E={}){if(!am(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 M=Xu.find(K=>K.chord===r);if(M)return`${r} is reserved: ${M.reason}.`;if(om.test(r))return`${r} switches to a workspace by position.`;const O=E[r];if(O&&O!==C){const K=Vr.find(P=>P.action===O)?.description??O;return`${r} is already ${K}.`}return null}function Zu(r={}){const C={...Lc},E=[],M=new Map;for(const{action:O}of Vr){const K=r?.[O];if(typeof K!="string"||!K||K===C[O])continue;const P=lm(K,O);if(P){E.push({action:O,chord:K,reason:P});continue}M.set(O,K)}for(const[O,K]of M)C[O]=K;for(const{action:O}of[...Vr].reverse()){const K=C[O],P=Object.entries(C).find(([d,m])=>d!==O&&m===K);if(!P||!M.has(O))continue;C[O]=Lc[O];const n=Vr.find(d=>d.action===P[0])?.description??P[0];E.push({action:O,chord:K,reason:`${K} is already ${n}.`})}return{chords:C,rejected:E}}const Oc=Zu();function wi(r,C=Oc){return C.chords[r]??Lc[r]}function h0(r,C=Oc){return wi(r,C)!==Lc[r]}function u0(r,C=Oc){if(r.inTextField)return null;const E=nm(r);if(!E)return null;const M=om.exec(E);if(M)return{action:"switch-workspace",position:Number(M[1])};for(const[O,K]of Object.entries(C.chords))if(K===E)return{action:O};return null}const d0=["help","editor","transfer","settings","voiceReview","overview","suggest","modal","palette","history"];function f0(r){return d0.find(C=>r[C])??null}function _0(r=Oc){return[...Vr.map(({action:C,description:E})=>({chord:wi(C,r),description:E})),{chord:"Ctrl+Shift+1 … 9",description:"switch to a workspace by position"},...Xu.map(C=>({chord:C.chord,description:C.description})),{chord:"Esc",description:"close whatever is open, or cancel a recording"}]}const p0=40;function cm(r){if(typeof r!="string")return null;const C=r.trim();return!C||C.length>p0?null:C.startsWith("v")||C.startsWith("V")?C:`v${C}`}function hm(r){const C=cm(r);return C?`ZeroG Terminal ${C}`:"ZeroG Terminal"}const m0=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:`${wi("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."},{title:"The AI button",body:"The bot icon in a pane’s title bar runs a command you choose in Settings — “claude” by default — for launching your preferred AI CLI without typing it yourself."}];function g0({version:r,bindings:C,onClose:E}){const M=a0.filter(O=>Object.values(C.chords).includes(O.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:hm(r)})]}),c.jsx("button",{type:"button",className:"close-button",onClick:E,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:_0(C).map(O=>c.jsxs("tr",{children:[c.jsx("th",{scope:"row",children:c.jsx("kbd",{children:O.chord})}),c.jsx("td",{children:O.description})]},O.chord))})}),c.jsxs("p",{className:"help-note",children:[c.jsx(ke,{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",M.length?", and ":". ",M.map((O,K)=>c.jsxs(Tn.Fragment,{children:[K>0?"; ":"",c.jsx("kbd",{children:O.chord})," is also ",O.owner]},O.chord)),M.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:m0(C).map(O=>c.jsxs(Tn.Fragment,{children:[c.jsx("dt",{children:O.title}),c.jsx("dd",{children:O.body})]},O.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."})]})})}const Mn="\x1B",Tc="\x07",v0=new RegExp(Mn+"\\]7;([^"+Tc+Mn+"]*)(?:"+Tc+"|"+Mn+"\\\\)","g"),b0=new RegExp(Mn+"\\][^"+Tc+Mn+"]*(?:"+Tc+"|"+Mn+"\\\\)","g"),S0=new RegExp(Mn+"\\[[0-9;?]*[ -/]*[@-~]","g");function y0(r){const C=r.match(/^file:\/\/[^/]*(\/.*)$/);if(!C)return null;try{const E=decodeURIComponent(C[1]);return E.includes("\0")?null:E}catch{return null}}function C0(r){const E=r.replace(b0,"").replace(S0,"").replace(/\r/g,`
|
|
76
|
+
`).split(`
|
|
77
|
+
`).filter(P=>P.trim()),M=E[E.length-1];if(!M)return null;const O=M.match(/(?:^|[:\s])(~|~\/[^\s:]*|\/[^\s:]*)\s*[#$%>]\s*$/);return O?O[1].replace(/\/+$/,"")||"/":null}function w0(r){let C=null;for(const M of r.matchAll(v0))C=M[1];if(C){const M=y0(C);if(M)return{path:M,source:"osc7"}}const E=C0(r);return E?{path:E,source:"prompt"}:null}function um(r){return!r||r==="~"||r==="~/"?{}:r.startsWith("/")?{absolute:r}:r.startsWith("~/")?{homeRelative:r.slice(2)}:{}}const x0=/connection is closed|not connected|no such connection/i;function E0(r,C){const E=new Map,M=new Map,O=new Map;function K(){const v=r();if(!v)throw new Error("The terminal bridge is not available.");return v}async function P(v,o=!1){o&&(M.delete(v.id),O.delete(v.id));const b=M.get(v.id);if(b)return b;const x=O.get(v.id);if(x!==void 0)return x;const A=Vu(v);if(!A)throw new Error(`${v.name} has no SSH host to list.`);const p=K().sftpOpen(A).then(a=>{const u={handle:a.id,home:a.cwd};return M.set(v.id,u),C?.(v.id,a.cwd),u}).finally(()=>{O.delete(v.id)});return O.set(v.id,p),p}function n(v,o){if(!v)return;const b=um(v);return b.absolute?b.absolute:b.homeRelative?qr(o,b.homeRelative):o}async function d(v,o){const b=await P(v);try{return await o(b)}catch(x){const A=x instanceof Error?x.message:String(x);if(!x0.test(A))throw x;return await o(await P(v,!0))}}function m(v,o){return d(v,b=>K().sftpList(b.handle,n(o,b.home)))}return{listerFor(v){const o=E.get(v.id);if(o)return o;const b=x=>v.kind==="ssh"?m(v,x):Promise.resolve().then(()=>K().listLocalDirectory(x));return E.set(v.id,b),b},withHandle(v,o){return v.kind!=="ssh"?Promise.reject(new Error(`${v.name} is not an SSH pane.`)):d(v,b=>o(b.handle))},homeFor(v){return M.get(v)?.home},async learnHome(v){if(v.kind!=="ssh")return;const o=M.get(v.id);return o?o.home:(await P(v)).home},forget(v){E.delete(v),M.delete(v),O.delete(v)}}}function A0(r){const C=new Map;for(const E of r){const M=us(E.target)||E.target,O=C.get(M)??{host:M,forwards:[]};O.forwards.push(E),C.set(M,O)}return[...C.values()]}function R0(r){return r.status==="open"?"connected":r.status==="error"?"error":r.status==="connecting"?"detached":""}function Sp(r){const C=`${r.destinationHost||"localhost"}:${r.destinationPort}`;return r.direction==="local"?`${Rn(r)} → ${C}`:`${Rn(r)} → ${C} here`}function Rn(r){if(r.direction==="local")return`${r.bind==="all"?"0.0.0.0":"localhost"}:${r.listenPort}`;const C=us(r.target)||r.target;return`${r.bind==="all"?`${C} (all)`:C}:${r.listenPort}`}function L0(r){return r.bind==="all"}function T0(r,C){const E=C.find(M=>M.id===r.id||M.listenPort!==r.listenPort||M.direction!==r.direction?!1:r.direction==="local"?!0:us(M.target)===us(r.target));return E?r.direction==="local"?`Port ${r.listenPort} is already shared from ${E.target}.`:`Port ${r.listenPort} is already shared to ${E.target}.`:null}function qo(r,C){const E=r.findIndex(O=>O.id===C.id);if(E<0)return[...r,C];const M=[...r];return M[E]=C,M}function M0(r){return{version:1,forwards:r.map(({status:C,message:E,...M})=>M)}}function D0(r){return r.forwards.map(C=>({...C,status:"idle"}))}function k0({session:r,target:C,api:E,onClose:M,backdrop:O,defaultShowHidden:K}){const[P,n]=Z.useState(null),[d,m]=Z.useState(null),[v,o]=Z.useState(null),[b,x]=Z.useState({local:!0,remote:!0}),[A,p]=Z.useState({local:new Set,remote:new Set}),[a,u]=Z.useState({local:"",remote:""}),[f,h]=Z.useState("Connecting…"),[S,T]=Z.useState({}),[w,L]=Z.useState(null),[y,R]=Z.useState(null),[k,U]=Z.useState(""),[H,z]=Z.useState(null),[Y,re]=Z.useState(null),[V,X]=Z.useState(null),[I,N]=Z.useState(K),W=Z.useRef({local:null,remote:null}),j=Z.useRef(null),F=Z.useRef(void 0),ie=Z.useRef(void 0);F.current=P?.path,ie.current=d?.path;const te=Z.useRef(!0);Z.useEffect(()=>()=>{te.current=!1},[]);const de=Z.useCallback(he=>{const ue=he instanceof Error?he.message:String(he);return h(ue),ue},[]),ge=Z.useCallback(async he=>{x(ue=>({...ue,local:!0}));try{const ue=await E.listLocalDirectory(he);if(!te.current)return;n(ue),u(Se=>({...Se,local:ue.path})),p(Se=>({...Se,local:new Set})),T(Se=>({...Se,local:void 0}))}catch(ue){if(!te.current)return;T(Se=>({...Se,local:de(ue)}))}finally{te.current&&x(ue=>({...ue,local:!1}))}},[E,de]),J=Z.useCallback(async he=>{const ue=j.current;if(ue){x(Se=>({...Se,remote:!0}));try{const Se=await E.sftpList(ue,he);if(!te.current)return;m(Se),u(De=>({...De,remote:Se.path})),p(De=>({...De,remote:new Set})),T(De=>({...De,remote:void 0}))}catch(Se){if(!te.current)return;T(De=>({...De,remote:de(Se)}))}finally{te.current&&x(Se=>({...Se,remote:!1}))}}},[E,de]);Z.useEffect(()=>E.onSftpEvent?.(he=>{if(!te.current)return;const ue=j.current;if(he.type==="prompt"){if(ue&&he.prompt.sessionId!==ue)return;j.current=he.prompt.sessionId,R(he.prompt),U("");return}ue&&he.sessionId!==ue||(he.type==="progress"&&L({name:he.name,percent:he.percent,detail:he.detail}),he.type==="status"&&h(he.message),he.type==="closed"&&(j.current=null,o(null),T(Se=>({...Se,remote:he.message})),h(he.message)))}),[E]),Z.useEffect(()=>{ge();const he=um(r.cwd);let ue=!1;return(async()=>{try{const Se=await E.sftpOpen(C,he.absolute);if(ue||!te.current)return;j.current=Se.id,o(Se),R(null),h(`Connected to ${Se.target}`),await J(he.homeRelative?qr(Se.cwd,he.homeRelative):void 0)}catch(Se){if(ue||!te.current)return;R(null),x(De=>({...De,remote:!1})),T(De=>({...De,remote:de(Se)}))}})(),()=>{ue=!0}},[]);const q=Z.useCallback(he=>he==="local"?ge(F.current):J(ie.current),[ge,J]),ne=(he,ue)=>he==="local"?ge(ue):J(ue),_e=Z.useMemo(()=>_p(P?.entries??[],A.local),[P,A.local]),we=Z.useMemo(()=>_p(d?.entries??[],A.remote,!0),[d,A.remote]),xe=w!==null,Ne=async he=>{const ue=j.current;if(!ue||!P||!d)return;const Se=he==="upload"?_e:we;if(!Se.length)return;L({name:Se[0].name,percent:0,detail:"starting"});let De=0;try{for(const je of Se)h(`${he==="upload"?"Uploading":"Downloading"} ${je.name}…`),he==="upload"?await E.sftpUpload(ue,Ta(P.path,je.name),d.path):await E.sftpDownload(ue,qr(d.path,je.name),P.path,je.kind),De+=1;h(`${he==="upload"?"Uploaded":"Downloaded"} ${De} ${De===1?"file":"files"}.`)}catch(je){const at=de(je);h(`${at} (${De} of ${Se.length} transferred)`)}finally{te.current&&(L(null),await q(he==="upload"?"remote":"local"))}},Ae=async he=>{if(he.preventDefault(),!H)return;const ue=H.value.trim(),Se=H.side;if(ue)try{Se==="local"&&P?await E.createLocalDirectory(Ta(P.path,ue)):Se==="remote"&&d&&j.current&&await E.sftpMkdir(j.current,qr(d.path,ue)),z(null),h(`Created ${ue}`),await q(Se)}catch(De){de(De)}},We=async he=>{if(he.preventDefault(),!Y)return;const ue=Y.value.trim(),{side:Se,entry:De}=Y;if(!ue||ue===De.name){re(null);return}try{Se==="local"&&P?await E.renameLocalEntry(Ta(P.path,De.name),Ta(P.path,ue)):Se==="remote"&&d&&j.current&&await E.sftpRename(j.current,qr(d.path,De.name),qr(d.path,ue)),re(null),h(`Renamed to ${ue}`),await q(Se)}catch(je){de(je)}},et=async()=>{if(!V)return;const{side:he,entry:ue}=V;try{he==="local"&&P?await E.removeLocalEntry(Ta(P.path,ue.name),ue.kind):he==="remote"&&d&&j.current&&await E.sftpRemove(j.current,qr(d.path,ue.name),ue.kind),X(null),h(`Deleted ${ue.name}`),await q(he)}catch(Se){de(Se)}},Te=async he=>{he.preventDefault();const ue=j.current;if(!ue||!y)return;const Se=y.kind==="confirm"?"yes":k;R(null),U(""),h(y.kind==="confirm"?"Accepting host key…":"Authenticating…");try{await E.sftpAnswerPrompt(ue,Se)}catch(De){de(De)}},Lt=async he=>{const ue=j.current;if(R(null),U(""),h(he==="confirm"?"Host key rejected.":"Cancelled. The transfer connection was closed."),!!ue)try{he==="confirm"?await E.sftpAnswerPrompt(ue,"no"):await E.sftpClose(ue)}catch{}},qt=(he,ue)=>{if(!Ma(ue))return;const Se=he==="local"?P?.path:d?.path;Se&&ne(he,he==="local"?Ta(Se,ue.name):qr(Se,ue.name))},$e=he=>{const ue=he==="local"?A.local:A.remote,Se=(he==="local"?P?.entries:d?.entries)??[];return ue.size!==1?null:Se.find(De=>ue.has(De.name))??null},Pe=he=>{const ue=he==="local"?P:d,Se=he==="local"?A.local:A.remote,De=he==="local"?S.local:S.remote,je=he==="local"?b.local:b.remote,at=$e(he),ut=he==="remote"&&!v,Tt=ue?I?ue.entries:ue.entries.filter(Oe=>!im(Oe.name)):[];return c.jsxs("section",{className:`sftp-pane sftp-pane-${he}`,children:[c.jsxs("header",{className:"sftp-pane-head",children:[c.jsx("span",{className:"eyebrow",children:he==="local"?"THIS COMPUTER":r.host.toUpperCase()}),c.jsxs("div",{className:"sftp-pane-tools",children:[c.jsx("button",{type:"button",title:"Parent folder","aria-label":`${he} parent folder`,disabled:!ue||je,onClick:()=>ue&&void ne(he,he==="local"?s0(ue.path):i0(ue.path)),children:c.jsx(ke,{name:"level-up"})}),c.jsx("button",{type:"button",title:"Refresh","aria-label":`Refresh ${he}`,disabled:je||ut,onClick:()=>{q(he)},children:c.jsx(ke,{name:"refresh"})}),c.jsx("button",{type:"button",title:"New folder","aria-label":`New folder on ${he}`,disabled:!ue||ut,onClick:()=>z({side:he,value:""}),children:c.jsx(ke,{name:"folder-plus"})}),c.jsx("button",{type:"button",title:at?`Rename ${at.name}`:"Select one item to rename","aria-label":`Rename on ${he}`,disabled:!at||ut,onClick:()=>at&&re({side:he,entry:at,value:at.name}),children:c.jsx(ke,{name:"pencil"})}),c.jsx("button",{type:"button",className:"sftp-danger",title:at?`Delete ${at.name}`:"Select one item to delete","aria-label":`Delete on ${he}`,disabled:!at||ut,onClick:()=>at&&X({side:he,entry:at}),children:c.jsx(ke,{name:"trash"})})]})]}),c.jsx("form",{className:"sftp-path",onSubmit:Oe=>{Oe.preventDefault();const Ue=(he==="local"?a.local:a.remote).trim();Ue&&ne(he,Ue)},children:c.jsx("input",{value:he==="local"?a.local:a.remote,onChange:Oe=>{const Ue=Oe.target.value;u(ze=>he==="local"?{...ze,local:Ue}:{...ze,remote:Ue})},spellCheck:!1,"aria-label":`${he} path`,placeholder:he==="local"?"Local folder":"Remote folder",disabled:ut})}),c.jsx("div",{className:"sftp-list",role:"listbox","aria-label":`${he} files`,"aria-busy":je,children:De?c.jsxs("div",{className:"sftp-empty sftp-error",children:[c.jsx("b",{children:he==="local"?"Cannot read this folder":"No remote listing"}),c.jsx("small",{children:De})]}):je&&!ue?c.jsxs("div",{className:"sftp-empty",children:[c.jsx("b",{children:he==="remote"&&!v?"Connecting…":"Loading…"}),c.jsx("small",{children:he==="remote"?`Opening SFTP to ${r.host}`:"Reading the local folder"})]}):ue&&Tt.length?Tt.map(Oe=>c.jsxs("button",{type:"button",role:"option","aria-selected":Se.has(Oe.name),className:`sftp-row ${Se.has(Oe.name)?"selected":""} ${Oe.kind==="directory"?"is-directory":""}`,onClick:Ue=>{const ze=Ue.ctrlKey||Ue.metaKey,wt=W.current[he],bt=Ue.shiftKey&&wt?wt:void 0,Pt=Tt.map(mt=>mt.name);p(mt=>he==="local"?{...mt,local:mp(mt.local,Oe.name,ze,bt,Pt)}:{...mt,remote:mp(mt.remote,Oe.name,ze,bt,Pt)}),Ue.shiftKey||(W.current[he]=Oe.name)},onDoubleClick:()=>qt(he,Oe),onKeyDown:Ue=>{Ue.key!=="Enter"||!Ma(Oe)||(Ue.preventDefault(),qt(he,Oe))},title:Oe.linkTarget?`${Oe.name} → ${Oe.linkTarget}`:Oe.name,children:[c.jsx(ke,{name:Oe.kind==="directory"?"folder":Oe.kind==="symlink"?"link":"file"}),c.jsx("span",{className:"sftp-name",children:Oe.name}),c.jsx("span",{className:"sftp-size",children:r0(Oe)}),c.jsx("span",{className:"sftp-modified",children:n0(Oe.modified)})]},Oe.name)):ue&&ue.entries.length?c.jsxs("div",{className:"sftp-empty",children:[c.jsx("b",{children:"Nothing here but hidden files"}),c.jsx("small",{children:'Tick "Show hidden" to see them.'})]}):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:[he==="local"?c.jsxs("button",{type:"button",className:"primary-button",disabled:!_e.length||!v||xe,onClick:()=>{Ne("upload")},title:_e.length?`Copy to ${r.host}`:"Select files to upload",children:[c.jsx(ke,{name:"arrow-up"})," ",pp("Upload",_e.length)]}):c.jsxs("button",{type:"button",className:"primary-button",disabled:!we.length||!v||xe,onClick:()=>{Ne("download")},title:we.length?"Copy to this computer":"Select files to download",children:[c.jsx(ke,{name:"arrow-down"})," ",pp("Download",we.length,"item")]}),c.jsx("span",{className:"sftp-count",children:ue?`${Tt.length} items`:""})]})]})};return c.jsx("div",{className:"sftp-layer",role:"presentation",...O,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.jsxs("label",{className:"sftp-hidden-toggle",title:"Show files whose name starts with a dot, on both sides",children:[c.jsx("input",{type:"checkbox",checked:I,onChange:he=>N(he.target.checked)}),"Show hidden"]}),c.jsx("button",{type:"button",className:"close-button",onClick:M,children:"Esc"})]}),c.jsxs("div",{className:"sftp-body",children:[Pe("local"),Pe("remote")]}),y&&c.jsxs("form",{className:"sftp-prompt",onSubmit:Te,children:[c.jsx("span",{className:"eyebrow warning-text",children:y.kind==="confirm"?"HOST KEY":"AUTHENTICATION"}),c.jsx("pre",{children:y.text}),y.kind==="confirm"?c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>{Lt("confirm")},children:"Reject"}),c.jsx("button",{type:"submit",className:"primary-button",children:"Accept key"})]}):c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:[y.kind==="passphrase"?"Key passphrase":"Password",c.jsx("input",{autoFocus:!0,type:"password",value:k,onChange:he=>U(he.target.value),autoComplete:"off"})]}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>{Lt(y.kind)},children:"Cancel"}),c.jsx("button",{type:"submit",className:"primary-button",children:"Send"})]})]})]}),H&&c.jsxs("form",{className:"sftp-inline-form",onSubmit:Ae,children:[c.jsxs("label",{children:["New folder in ",H.side==="local"?P?.path:d?.path,c.jsx("input",{autoFocus:!0,value:H.value,onChange:he=>z({...H,value:he.target.value}),required:!0})]}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>z(null),children:"Cancel"}),c.jsx("button",{type:"submit",className:"primary-button",children:"Create"})]})]}),Y&&c.jsxs("form",{className:"sftp-inline-form",onSubmit:We,children:[c.jsxs("label",{children:["Rename ",Y.entry.name,c.jsx("input",{autoFocus:!0,value:Y.value,onChange:he=>re({...Y,value:he.target.value}),required:!0})]}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>re(null),children:"Cancel"}),c.jsx("button",{type:"submit",className:"primary-button",children:"Rename"})]})]}),V&&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:V.entry.name})," from ",V.side==="local"?"this computer":r.host,"?",V.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:()=>X(null),children:"Cancel"}),c.jsx("button",{type:"button",className:"primary-button sftp-danger-button",onClick:()=>{et()},children:"Delete"})]})]}),c.jsxs("footer",{className:"sftp-foot",children:[w?c.jsxs("div",{className:"sftp-progress",role:"progressbar","aria-valuenow":w.percent,"aria-valuemin":0,"aria-valuemax":100,"aria-label":`Transferring ${w.name}`,children:[c.jsx("div",{className:"sftp-progress-fill",style:{width:`${w.percent}%`}}),c.jsxs("span",{children:[Ko(w.name)," · ",w.percent,"% · ",w.detail]})]}):c.jsx("span",{className:"sftp-notice",children:f}),c.jsx("span",{className:"sftp-hint",children:"Double-click a folder to open · Ctrl-click to select several · Esc closes"})]})]})})}const yp={q4:96,q8:41,fp16:76,fp32:152},Cp={q4:142,q8:77,fp16:146,fp32:291},wp={q4:299,q8:249,fp16:485,fp32:968},Qu=[{id:"onnx-community/whisper-tiny.en",label:"Whisper tiny · English",family:"tiny",multilingual:!1,downloadMb:yp},{id:"onnx-community/whisper-base.en",label:"Whisper base · English",family:"base",multilingual:!1,downloadMb:Cp},{id:"onnx-community/whisper-small.en",label:"Whisper small · English",family:"small",multilingual:!1,downloadMb:wp},{id:"onnx-community/whisper-tiny",label:"Whisper tiny · multilingual",family:"tiny",multilingual:!0,downloadMb:yp},{id:"onnx-community/whisper-base",label:"Whisper base · multilingual",family:"base",multilingual:!0,downloadMb:Cp},{id:"onnx-community/whisper-small",label:"Whisper small · multilingual",family:"small",multilingual:!0,downloadMb:wp}],O0="onnx-community/whisper-tiny.en",xp=[{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"}],dm=[{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 Bc(r){return Qu.find(C=>C.id===r)}function B0(r){return Bc(r)?.multilingual??!1}function j0(r,C){return Bc(r)?.downloadMb[C]??null}function N0(r,C){const E=j0(r,C);return E===null?"Download size unknown":`≈${E} MB download, cached after first use`}const Mc=[{id:"dark",label:"Tokyo Night",kind:"dark",terminal:{background:"#0a0c10",foreground:"#d8dee9",cursor:"#9ece6a",selectionBackground:"#334155",green:"#9ece6a",yellow:"#e0af68",red:"#f7768e",blue:"#7aa2f7",cyan:"#7dcfff"}},{id:"light",label:"Light",kind:"light",terminal:{background:"#f7f9fc",foreground:"#253044",cursor:"#16803c",selectionBackground:"#cbdcf5",green:"#16803c",yellow:"#a15c00",red:"#c53030",blue:"#2459a6",cyan:"#087f8c"}},{id:"dracula",label:"Dracula",kind:"dark",terminal:{background:"#282a36",foreground:"#f8f8f2",cursor:"#f8f8f2",selectionBackground:"#44475a",black:"#21222c",red:"#ff5555",green:"#50fa7b",yellow:"#f1fa8c",blue:"#bd93f9",magenta:"#ff79c6",cyan:"#8be9fd",white:"#f8f8f2",brightBlack:"#6272a4",brightRed:"#ff6e6e",brightGreen:"#69ff94",brightYellow:"#ffffa5",brightBlue:"#d6acff",brightMagenta:"#ff92df",brightCyan:"#a4ffff",brightWhite:"#ffffff"}},{id:"nord",label:"Nord",kind:"dark",terminal:{background:"#2e3440",foreground:"#d8dee9",cursor:"#d8dee9",selectionBackground:"#434c5e",black:"#3b4252",red:"#bf616a",green:"#a3be8c",yellow:"#ebcb8b",blue:"#81a1c1",magenta:"#b48ead",cyan:"#88c0d0",white:"#e5e9f0",brightBlack:"#4c566a",brightRed:"#d57780",brightGreen:"#b4d19c",brightYellow:"#f0d399",brightBlue:"#8fb0d2",brightMagenta:"#c39cbd",brightCyan:"#8fbcbb",brightWhite:"#eceff4"}},{id:"solarized-dark",label:"Solarized Dark",kind:"dark",terminal:{background:"#002b36",foreground:"#93a1a1",cursor:"#93a1a1",selectionBackground:"#073642",black:"#073642",red:"#dc322f",green:"#859900",yellow:"#b58900",blue:"#268bd2",magenta:"#d33682",cyan:"#2aa198",white:"#eee8d5",brightBlack:"#586e75",brightRed:"#cb4b16",brightGreen:"#657b83",brightYellow:"#839496",brightBlue:"#93a1a1",brightMagenta:"#6c71c4",brightCyan:"#93a1a1",brightWhite:"#fdf6e3"}},{id:"monokai",label:"Monokai",kind:"dark",terminal:{background:"#272822",foreground:"#f8f8f2",cursor:"#f8f8f0",selectionBackground:"#49483e",black:"#272822",red:"#f92672",green:"#a6e22e",yellow:"#e6db74",blue:"#66d9ef",magenta:"#ae81ff",cyan:"#a1efe4",white:"#f8f8f2",brightBlack:"#75715e",brightRed:"#ff5c93",brightGreen:"#bdee5f",brightYellow:"#f0e68c",brightBlue:"#8be4f5",brightMagenta:"#c4a2ff",brightCyan:"#b9f5ec",brightWhite:"#f9f8f5"}},{id:"one-dark",label:"One Dark",kind:"dark",terminal:{background:"#282c34",foreground:"#abb2bf",cursor:"#528bff",selectionBackground:"#3e4451",black:"#3f4451",red:"#e06c75",green:"#98c379",yellow:"#e5c07b",blue:"#61afef",magenta:"#c678dd",cyan:"#56b6c2",white:"#abb2bf",brightBlack:"#5c6370",brightRed:"#ea8189",brightGreen:"#a9d08f",brightYellow:"#ecce94",brightBlue:"#7bbdf3",brightMagenta:"#d28ee6",brightCyan:"#6fc5d0",brightWhite:"#d7dae0"}},{id:"synthwave",label:"Synthwave",kind:"dark",terminal:{background:"#262335",foreground:"#f4eefc",cursor:"#ff7edb",selectionBackground:"#463a6b",black:"#34294f",red:"#fe4450",green:"#72f1b8",yellow:"#fede5d",blue:"#6d9bff",magenta:"#ff7edb",cyan:"#36f9f6",white:"#f4eefc",brightBlack:"#6f6194",brightRed:"#ff6b73",brightGreen:"#97f7cc",brightYellow:"#fee98b",brightBlue:"#94b4ff",brightMagenta:"#ff9fe5",brightCyan:"#7bfbf9",brightWhite:"#ffffff"}},{id:"high-contrast",label:"High contrast",kind:"dark",terminal:{background:"#000000",foreground:"#ffffff",cursor:"#ffffff",selectionBackground:"#3a3a3a",black:"#000000",red:"#ff6b6b",green:"#3fff6a",yellow:"#ffe14d",blue:"#6fc3ff",magenta:"#ff7be5",cyan:"#4de8ff",white:"#e6e6e6",brightBlack:"#8a8a8a",brightRed:"#ff9090",brightGreen:"#7dff98",brightYellow:"#fff08a",brightBlue:"#9fd8ff",brightMagenta:"#ffa3ee",brightCyan:"#8af0ff",brightWhite:"#ffffff"}}],Pu=Mc.map(r=>r.id),$u="dark";function fm(r){return Mc.find(C=>C.id===r)??Mc[0]}function Kr(r){return fm(r).kind==="light"}function Ep(r){return fm(r).terminal}function H0(r,C){return Kr(r)?Kr(C)?$u:C:"light"}const z0={bash:"bash",zsh:"zsh",fish:"fish",sh:"sh",powershell:"Windows PowerShell",pwsh:"PowerShell 7",cmd:"Command Prompt",wsl:"WSL"};function _m(r){return z0[r]??r}const U0=10;function pm(){return Array.from({length:U0},()=>({label:"",command:""}))}const mm="zerog-settings",gm="zerog-theme",Ie={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,showHiddenFiles:!1},ai:{requireApproval:!0,voiceInsert:"type",proceedPhrase:"OK, proceed",aiCommand:"claude",customButtons:pm(),recordCommands:!1,baseUrl:"http://127.0.0.1:11434/v1",model:"",includeOutput:!1,outputChars:2e3},speech:{engine:"builtin",model:O0,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"}},Et={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'},I0=[{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 Fu(r){return Ap[r]??Ap.system}function P0(r){const C={};for(const{action:E}of Vr){const M=r[E];am(M)&&(C[E]=M)}return C}function Gr(r){return typeof r=="object"&&r!==null}function Pi(r,C,E){return typeof r=="string"&&C.includes(r)?r:E}function Cn(r,C){return typeof r=="boolean"?r:C}function As(r,C,E){return typeof r!="number"||!Number.isFinite(r)?E:Math.min(C.max,Math.max(C.min,r))}function Go(r,C,E=512){return typeof r!="string"?C:r.slice(0,E)}function Dc(r,C,E=200){return typeof r!="string"?C:Array.from(r.slice(0,E),M=>{const O=M.codePointAt(0)??0;return O<32||O===127?" ":M}).join("")}function Rp(r){return r.proceedPhrase.trim()||Ie.ai.proceedPhrase}function Bu(r){return r.aiCommand.trim()||Ie.ai.aiCommand}function $0(r){const C=Array.isArray(r)?r:[];return pm().map((E,M)=>{const O=Gr(C[M])?C[M]:{};return{label:Dc(O.label,E.label,48),command:Dc(O.command,E.command)}})}const F0=["stack","split-v","split-h","grid"],vm=["bash","zsh","fish","sh","powershell","pwsh","cmd","wsl"],W0=["block","underline","bar"],q0=["system","jetbrains","cascadia","consolas","fira","menlo"],G0=["builtin","server"],K0=["wasm","webgpu"],V0=["q4","q8","fp16","fp32"],Y0=["transcribe","translate"],X0=["type","review"];function Ln(r,C){const E=Gr(r)?r:{},M=Gr(E.appearance)?E.appearance:{},O=Gr(E.terminal)?E.terminal:{},K=Gr(E.sessions)?E.sessions:{},P=Gr(E.ai)?E.ai:{},n=Gr(E.speech)?E.speech:{},d=Gr(E.shortcuts)?E.shortcuts:{},m=Pi(C,Pu,Ie.appearance.theme),v=Pi(n.engine,G0,Ie.speech.engine),o=Pi(n.model,Qu.map(x=>x.id),Ie.speech.model),b=v==="server"||Bc(o)?.multilingual?Pi(n.language,dm.map(x=>x.value),Ie.speech.language):"auto";return{shortcuts:P0(d),appearance:{theme:Pi(M.theme,Pu,m),font:Pi(M.font,q0,Ie.appearance.font),fontSize:Math.round(As(M.fontSize,Et.fontSize,Ie.appearance.fontSize)),lineHeight:As(M.lineHeight,Et.lineHeight,Ie.appearance.lineHeight),letterSpacing:As(M.letterSpacing,Et.letterSpacing,Ie.appearance.letterSpacing)},terminal:{scrollback:Math.round(As(O.scrollback,Et.scrollback,Ie.terminal.scrollback)),cursorStyle:Pi(O.cursorStyle,W0,Ie.terminal.cursorStyle),cursorBlink:Cn(O.cursorBlink,Ie.terminal.cursorBlink),copyOnSelect:Cn(O.copyOnSelect,Ie.terminal.copyOnSelect)},sessions:{defaultBackend:Pi(K.defaultBackend,vm,Ie.sessions.defaultBackend),defaultWslDistribution:Go(K.defaultWslDistribution,Ie.sessions.defaultWslDistribution,64),defaultLayout:Pi(K.defaultLayout,F0,Ie.sessions.defaultLayout),startSidebarCollapsed:Cn(K.startSidebarCollapsed,Ie.sessions.startSidebarCollapsed),sidebarWidth:Math.round(As(K.sidebarWidth,Et.sidebarWidth,Ie.sessions.sidebarWidth)),splitColumnRatio:As(K.splitColumnRatio,Et.splitRatio,Ie.sessions.splitColumnRatio),splitRowRatio:As(K.splitRowRatio,Et.splitRatio,Ie.sessions.splitRowRatio),showHiddenFiles:Cn(K.showHiddenFiles,Ie.sessions.showHiddenFiles)},ai:{requireApproval:Cn(P.requireApproval,Ie.ai.requireApproval),voiceInsert:Pi(P.voiceInsert,X0,Ie.ai.voiceInsert),proceedPhrase:Dc(P.proceedPhrase,Ie.ai.proceedPhrase),aiCommand:Dc(P.aiCommand,Ie.ai.aiCommand),customButtons:$0(P.customButtons),recordCommands:Cn(P.recordCommands,Ie.ai.recordCommands),baseUrl:Go(P.baseUrl,Ie.ai.baseUrl,512),model:Go(P.model,Ie.ai.model,200),includeOutput:Cn(P.includeOutput,Ie.ai.includeOutput),outputChars:Math.round(As(P.outputChars,Et.outputChars,Ie.ai.outputChars))},speech:{engine:v,model:o,precision:Pi(n.precision,V0,Ie.speech.precision),device:Pi(n.device,K0,Ie.speech.device),language:b,task:Pi(n.task,Y0,Ie.speech.task),maxUtteranceSeconds:Math.round(As(n.maxUtteranceSeconds,Et.maxUtteranceSeconds,Ie.speech.maxUtteranceSeconds)),silenceThreshold:As(n.silenceThreshold,Et.silenceThreshold,Ie.speech.silenceThreshold),serverUrl:Go(n.serverUrl,Ie.speech.serverUrl,512),serverModel:Go(n.serverModel,Ie.speech.serverModel,128)}}}function Z0(r){if(!r)return Ln(void 0);let C=null,E=null;try{C=r.getItem(mm),E=r.getItem(gm)}catch{return Ln(void 0)}if(!C)return Ln(void 0,E);try{return Ln(JSON.parse(C),E)}catch{return Ln(void 0,E)}}function Lp(r,C){if(r)try{r.setItem(mm,JSON.stringify(C)),r.setItem(gm,C.appearance.theme)}catch{}}function Tp(r,C,E){return Ln({...r,[C]:{...r[C],...E}})}function bm(r,C){if(C.some(M=>M.backend===r))return r;const E=C[0]?.backend;return E&&vm.includes(E)?E:r}function Q0(r){const C=r.engine==="builtin",E=Bc(r.model)?.multilingual??!1;return{model:C,precision:C,device:C,language:C?E:!0,task:C&&E,server:!C}}function J0(r,C){return Ln({...r,[C]:Ie[C]})}const eb=new Set(["127.0.0.1","localhost","::1","[::1]"]);function Sm(r){try{const C=new URL(r);return C.protocol!=="http:"&&C.protocol!=="https:"||!C.hostname?null:C}catch{return null}}function ym(r){const C=Sm(r);return C===null?null:C.hostname.toLowerCase()}function Ju(r){return ym(r)!==null}function jc(r){const C=ym(r);return C===null?!1:eb.has(C)||C.endsWith(".localhost")}function tb(r){const C=Sm(r);return C===null?!1:C.protocol==="http:"&&!jc(r)}const ib=12e4,Mp=300;function Cc(r,C,E){for(let M=0;M<E.length;M+=1)r.setUint8(C+M,E.charCodeAt(M))}function ed(r,C=Da){const M=r.length*2,O=new ArrayBuffer(44+M),K=new DataView(O);Cc(K,0,"RIFF"),K.setUint32(4,36+M,!0),Cc(K,8,"WAVE"),Cc(K,12,"fmt "),K.setUint32(16,16,!0),K.setUint16(20,1,!0),K.setUint16(22,1,!0),K.setUint32(24,C,!0),K.setUint32(28,C*2,!0),K.setUint16(32,2,!0),K.setUint16(34,16,!0),Cc(K,36,"data"),K.setUint32(40,M,!0);for(let P=0;P<r.length;P+=1){const n=Math.max(-1,Math.min(1,r[P]));K.setInt16(44+P*2,Math.round(n*32767),!0)}return O}function Dp(r){if(typeof r=="string"){const O=r.trim();return O||null}if(typeof r!="object"||r===null)return null;const C=r;if(typeof C.text=="string"&&C.text.trim())return C.text.trim();const E=C.segments;if(Array.isArray(E)){const O=E.map(K=>typeof K=="object"&&K!==null?K.text:null).filter(K=>typeof K=="string").join(" ").trim();if(O)return O}const M=C.choices;if(Array.isArray(M)&&M.length>0){const O=M[0];if(typeof O=="object"&&O!==null){const K=O.message;if(typeof K=="object"&&K!==null){const P=K.content;if(typeof P=="string"&&P.trim())return P.trim()}}}if(typeof C.error=="string")throw new Error(C.error);return null}function sb(r){const C=ed(r.audio,r.sampleRate??Da),E=new FormData;return E.set("file",new Blob([C],{type:"audio/wav"}),"utterance.wav"),E.set("model",r.model),E.set("response_format","json"),r.language&&r.language!=="auto"&&E.set("language",r.language),E}function rb(r){const C=new Uint8Array(ed(r.audio,r.sampleRate??Da));let E="";for(const O of C)E+=String.fromCharCode(O);const M={file:`data:audio/wav;base64,${btoa(E)}`,model:r.model,response_format:"json"};return r.language&&r.language!=="auto"&&(M.language=r.language),JSON.stringify(M)}function nb(r){const C=new Uint8Array(ed(r.audio,r.sampleRate??Da));let E="";for(const O of C)E+=String.fromCharCode(O);const M=[{type:"text",text:r.language&&r.language!=="auto"?`Transcribe this ${r.language} audio. Return only the transcript.`:"Transcribe this audio. Return only the transcript."},{type:"input_audio",input_audio:{data:btoa(E),format:"wav"}}];return JSON.stringify({model:r.model,messages:[{role:"user",content:M}],temperature:0,stream:!1})}function ab(r){try{return new URL(r).pathname.replace(/\/+$/,"")==="/v1/chat/completions"}catch{return!1}}function ob(r,C){return r.status===415&&/POST requests must use ['"]application\/json['"]/.test(C)}function kp(){return typeof AbortSignal<"u"&&typeof AbortSignal.timeout=="function"?AbortSignal.timeout(ib):void 0}async function lb(r,C=fetch){if(!Ju(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 E=r.apiKey?.trim();if(ab(r.url)){const d=await C(r.url,{method:"POST",headers:{...E?{Authorization:`Bearer ${E}`}:{},"Content-Type":"application/json"},body:nb(r),signal:kp()}),m=await d.text();if(!d.ok){const b=m.slice(0,Mp).trim();throw new Error(`Speech server returned ${d.status}${b?`: ${b}`:""}`)}let v=m;try{v=JSON.parse(m)}catch{}const o=Dp(v);if(o===null)throw new Error("Speech server returned no transcript");return o}const M={method:"POST",headers:E?{Authorization:`Bearer ${E}`}:void 0,body:sb(r),signal:kp()};let O=await C(r.url,M),K=await O.text();if(ob(O,K)&&(O=await C(r.url,{...M,headers:{...E?{Authorization:`Bearer ${E}`}:{},"Content-Type":"application/json"},body:rb(r)}),K=await O.text()),!O.ok){const d=K.slice(0,Mp).trim(),m=!E&&(O.status===401||O.status===403)?" — this server wants an API key":"";throw new Error(`Speech server returned ${O.status}${d?`: ${d}`:""}${m}`)}let P=K;try{P=JSON.parse(K)}catch{}const n=Dp(P);if(n===null)throw new Error("Speech server returned no transcript");return n}const Cm=[{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"}],cb=`# ZeroG shell integration — reports prompt and command marks (OSC 133).
|
|
78
|
+
__zerog_at_prompt=1
|
|
79
|
+
__zerog_preexec() {
|
|
80
|
+
[ -n "\${COMP_LINE-}" ] && return
|
|
81
|
+
[ -z "\${__zerog_at_prompt-}" ] && return
|
|
82
|
+
__zerog_at_prompt=
|
|
83
|
+
printf '\\033]133;C\\007'
|
|
84
|
+
}
|
|
85
|
+
__zerog_precmd() {
|
|
86
|
+
local status=$?
|
|
87
|
+
printf '\\033]133;D;%s\\007' "$status"
|
|
88
|
+
printf '\\033]7;file://%s%s\\007' "$HOSTNAME" "$PWD"
|
|
89
|
+
__zerog_at_prompt=1
|
|
90
|
+
printf '\\033]133;A\\007'
|
|
91
|
+
}
|
|
92
|
+
trap '__zerog_preexec' DEBUG
|
|
93
|
+
PROMPT_COMMAND="__zerog_precmd\${PROMPT_COMMAND:+;$PROMPT_COMMAND}"
|
|
94
|
+
PS1="\\[\\033]133;A\\007\\]$PS1\\[\\033]133;B\\007\\]"`,hb=`# ZeroG shell integration — reports prompt and command marks (OSC 133).
|
|
95
|
+
autoload -Uz add-zsh-hook
|
|
96
|
+
__zerog_preexec() { printf '\\033]133;C\\007' }
|
|
97
|
+
__zerog_precmd() {
|
|
98
|
+
printf '\\033]133;D;%s\\007' "$?"
|
|
99
|
+
printf '\\033]7;file://%s%s\\007' "$HOST" "$PWD"
|
|
100
|
+
}
|
|
101
|
+
add-zsh-hook preexec __zerog_preexec
|
|
102
|
+
add-zsh-hook precmd __zerog_precmd
|
|
103
|
+
PS1=$'%{\\033]133;A\\007%}'$PS1$'%{\\033]133;B\\007%}'`,ub=`# ZeroG shell integration — reports prompt and command marks (OSC 133).
|
|
104
|
+
# Add this at the end of config.fish, after your prompt is defined.
|
|
105
|
+
if not functions -q __zerog_inner_prompt
|
|
106
|
+
functions --copy fish_prompt __zerog_inner_prompt
|
|
107
|
+
end
|
|
108
|
+
function fish_prompt
|
|
109
|
+
printf '\\033]133;A\\007'
|
|
110
|
+
printf '\\033]7;file://%s%s\\007' (hostname) "$PWD"
|
|
111
|
+
__zerog_inner_prompt
|
|
112
|
+
printf '\\033]133;B\\007'
|
|
113
|
+
end
|
|
114
|
+
function __zerog_preexec --on-event fish_preexec
|
|
115
|
+
printf '\\033]133;C\\007'
|
|
116
|
+
end
|
|
117
|
+
function __zerog_postexec --on-event fish_postexec
|
|
118
|
+
printf '\\033]133;D;%s\\007' $status
|
|
119
|
+
end`,db=`# ZeroG shell integration — reports prompt and command marks (OSC 133).
|
|
120
|
+
$global:__zerogPrompt = $function:prompt
|
|
121
|
+
function prompt {
|
|
122
|
+
$status = if ($?) { 0 } else { 1 }
|
|
123
|
+
[Console]::Write("\`e]133;D;$status\`a")
|
|
124
|
+
[Console]::Write("\`e]7;file://$env:COMPUTERNAME$($PWD.Path)\`a")
|
|
125
|
+
[Console]::Write("\`e]133;A\`a")
|
|
126
|
+
$text = & $global:__zerogPrompt
|
|
127
|
+
[Console]::Write("\`e]133;B\`a")
|
|
128
|
+
return $text
|
|
129
|
+
}
|
|
130
|
+
try {
|
|
131
|
+
Set-PSReadLineKeyHandler -Chord Enter -ScriptBlock {
|
|
132
|
+
[Console]::Write("\`e]133;C\`a")
|
|
133
|
+
[Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine()
|
|
134
|
+
}
|
|
135
|
+
} catch {
|
|
136
|
+
# PSReadLine is absent, so the command text cannot be marked. The prompt
|
|
137
|
+
# marks and the exit status still report.
|
|
138
|
+
}`,fb={bash:cb,zsh:hb,fish:ub,powershell:db};function _b(r){return fb[r]}function pb(r){return Cm.find(C=>C.id===r)?.file??""}const ju=[{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 mb({action:r,description:C,chord:E,moved:M,taken:O,onSet:K,onReset:P}){const[n,d]=Tn.useState(!1),[m,v]=Tn.useState(null);return Tn.useEffect(()=>{if(!n)return;const o=b=>{if(b.preventDefault(),b.stopPropagation(),b.key==="Escape"){d(!1),v(null);return}if(["Control","Shift","Alt","Meta","OS"].includes(b.key))return;const x=nm({key:b.key,code:b.code,ctrlKey:b.ctrlKey,metaKey:b.metaKey,shiftKey:b.shiftKey,altKey:b.altKey}),A=x?lm(x,r,O):"A shortcut needs Ctrl and at least one of Shift or Alt, so a shell keeps Ctrl+C and Ctrl+R for itself.";if(!x||A){v(A);return}K(x),v(null),d(!1)};return window.addEventListener("keydown",o,!0),()=>window.removeEventListener("keydown",o,!0)},[n,r,O,K]),c.jsxs("div",{className:m?"shortcut-row invalid":"shortcut-row",children:[c.jsx("span",{className:"shortcut-what",children:C}),c.jsx("button",{type:"button",className:n?"shortcut-chord capturing":"shortcut-chord",onClick:()=>{v(null),d(o=>!o)},"aria-label":n?`Press a new shortcut for ${C}`:`Change the shortcut for ${C}`,children:n?c.jsx("span",{className:"shortcut-prompt",children:"press a chord · Esc"}):c.jsx("kbd",{children:E})}),c.jsx("button",{type:"button",className:"shortcut-reset",onClick:()=>{v(null),d(!1),P()},disabled:!M,title:M?"Back to the shortcut this shipped with":"This is the shortcut it shipped with",children:"Reset"}),m?c.jsx("small",{className:"shortcut-problem",children:m}):null]})}function $i({label:r,hint:C,children:E}){return c.jsxs("label",{className:"settings-field",children:[c.jsx("span",{className:"settings-field-label",children:r}),E,C?c.jsx("small",{children:C}):null]})}function gb(r){const C="OpenAI-compatible: POST to {base}/chat/completions. Ollama, LM Studio, llama.cpp, vLLM and OpenRouter all serve this.";return Ju(r)?jc(r)?`On this machine, so nothing leaves it. ${C}`:`Off this machine. ${C}`:`Any http:// or https:// address ending in /v1. ${C}`}function vb(r){const C="OpenAI-compatible: POST multipart audio to /v1/audio/transcriptions.";return Ju(r)?jc(r)?`On this machine. ${C}`:`Off this machine — recorded audio is sent to this host. ${C}`:`Any http:// or https:// address. ${C}`}function Op({label:r="Server API key",state:C,url:E,onSave:M,onClear:O}){const[K,P]=Z.useState(""),n=C.status==="saving",d=K.trim(),m=C.encryptionAvailable?tb(E)?"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($i,{label:r,hint:m,children:[c.jsxs("div",{className:"settings-key-row",children:[c.jsx("input",{type:"password",value:K,placeholder:C.stored||C.sessionOnly?"•••••••• (a key is set)":"Leave empty if the server needs none",autoComplete:"off",spellCheck:!1,onChange:v=>P(v.target.value),onKeyDown:v=>{v.key!=="Enter"||!d||n||(v.preventDefault(),M(d),P(""))}}),c.jsx("button",{type:"button",disabled:!d||n,onClick:()=>{M(d),P("")},children:n?"Saving…":"Save"}),C.stored||C.sessionOnly?c.jsx("button",{type:"button",disabled:n,onClick:O,children:"Clear"}):null]}),C.error?c.jsx("small",{className:"settings-key-error",children:C.error}):null,!C.error&&C.notice?c.jsx("small",{className:"settings-key-notice",children:C.notice}):null]})}function bb({enabled:r,state:C,bindings:E,onToggle:M,onCopySnippet:O,onClear:K}){const[P,n]=Z.useState("bash"),d=_b(P),m=wi("history-palette",E);return c.jsxs(c.Fragment,{children:[c.jsx(En,{label:"Remember commands for the history palette",hint:r?`Commands you run are stored on this machine, with their directory and exit status, so ${m} 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:M}),r?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"settings-note",children:C.panesOpen===0?"No panes open, so nothing is reporting yet.":C.panesReporting===0?`None of your ${C.panesOpen} open pane${C.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.`:`${C.panesReporting} of ${C.panesOpen} open pane${C.panesOpen===1?"":"s"} reporting prompt marks. ${C.entries} command${C.entries===1?"":"s"} remembered.`}),c.jsx($i,{label:"Shell integration",hint:`Paste this into ${pb(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:v=>n(v.target.value),children:Cm.map(v=>c.jsx("option",{value:v.id,children:v.label},v.id))}),c.jsx("button",{type:"button",onClick:()=>O(d),children:"Copy snippet"})]})}),c.jsx("pre",{className:"settings-snippet",children:d}),c.jsxs("div",{className:"settings-test",children:[c.jsx("button",{type:"button",onClick:K,children:"Forget all remembered commands"}),c.jsx("small",{className:"settings-hint",children:"Removes the stored history and the file it lives in."})]})]}):null]})}function Sb({state:r,onRun:C}){const E=r.status==="testing";return c.jsxs("div",{className:"settings-test",children:[c.jsx("button",{type:"button",className:"primary-button",disabled:E,onClick:C,children:E?"Testing…":"Test connection"}),r.message?c.jsx("small",{className:r.ok?"settings-key-notice":"settings-key-error",children:r.message}):null]})}function hs({label:r,hint:C,value:E,options:M,onChange:O}){return c.jsx($i,{label:r,hint:C,children:c.jsx("select",{value:E,onChange:K=>O(K.target.value),children:M.map(K=>c.jsx("option",{value:K.value,children:K.label},K.value))})})}function wn({label:r,hint:C,value:E,min:M,max:O,step:K,format:P,onChange:n}){return c.jsx($i,{label:r,hint:C,children:c.jsxs("span",{className:"settings-range",children:[c.jsx("input",{type:"range",min:M,max:O,step:K,value:E,onChange:d=>n(Number(d.target.value)),"aria-label":r}),c.jsx("output",{children:P(E)})]})})}function En({label:r,hint:C,checked:E,disabled:M=!1,onChange:O}){return c.jsxs("label",{className:`settings-toggle ${M?"settings-toggle-fixed":""}`,children:[c.jsx("input",{type:"checkbox",checked:E,disabled:M,onChange:K=>O(K.target.checked)}),c.jsxs("span",{children:[c.jsx("b",{children:r}),C?c.jsx("small",{children:C}):null]})]})}function yb({value:r,onChange:C}){const E=[{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:E.map(M=>c.jsxs("button",{type:"button",role:"radio","aria-checked":r===M.id,className:`settings-engine ${r===M.id?"active":""}`,onClick:()=>C(M.id),children:[c.jsx("b",{children:M.title}),c.jsx("small",{children:M.detail})]},M.id))})}function Cb({state:r,onRun:C}){const E=r.status!=="idle",M=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:C,disabled:r.status==="transcribing",children:M})]}),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,!E&&(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 wb({status:r,info:C,onStart:E,onStop:M,onCopyToken:O}){const K=r.state==="listening"||r.state==="connected";return c.jsxs("section",{className:"settings-group mcp-settings",children:[c.jsxs("div",{className:"settings-group-head",children:[c.jsxs("div",{children:[c.jsx("span",{className:"eyebrow",children:"ZERO G CONTROL"}),c.jsx("h3",{children:"Local MCP connection"})]}),c.jsx("span",{className:`mcp-state-dot ${r.state}`,title:r.state})]}),c.jsx("p",{className:"settings-hint",children:"Allow a local agent such as Hermes to inspect and restore ZeroG workspaces. Terminal command execution is not enabled."}),c.jsx("div",{className:"settings-actions",children:K?c.jsx("button",{type:"button",onClick:M,children:"Disable MCP"}):c.jsx("button",{type:"button",className:"primary-button",onClick:E,children:"Enable MCP"})}),C&&K?c.jsxs(c.Fragment,{children:[c.jsx($i,{label:"Endpoint",hint:"Give this URL to the local MCP client.",children:c.jsx("code",{className:"settings-value",children:C.endpoint})}),c.jsx($i,{label:"Bearer token",hint:"Held only for this app run. Copy it into the local client configuration.",children:c.jsxs("div",{className:"settings-key-row",children:[c.jsx("code",{className:"settings-value token-value",children:C.token}),c.jsx("button",{type:"button",onClick:O,children:"Copy"})]})})]}):null]})}function xb({settings:r,onChange:C,onReset:E,onClose:M,backdrop:O,backends:K,wslDistributions:P,speechTest:n,onSpeechTest:d,speechKey:m,onSpeechKeySave:v,onSpeechKeyClear:o,commandHistory:b,onCopySnippet:x,onClearCommandHistory:A,aiKey:p,onAiKeySave:a,onAiKeyClear:u,aiModels:f,onAiModelsRefresh:h,aiTest:S,onAiTest:T,mcpStatus:w,mcpInfo:L,onMcpStart:y,onMcpStop:R,onMcpCopyToken:k}){const[U,H]=Z.useState("appearance"),z=Z.useMemo(()=>Zu(r.shortcuts),[r.shortcuts]),Y=Z.useMemo(()=>Object.fromEntries(Object.entries(z.chords).map(([I,N])=>[N,I])),[z]),re=ju.find(I=>I.id===U)??ju[0],V=Q0(r.speech),X=K.length?K.map(I=>({value:I.backend,label:I.label})):[{value:r.sessions.defaultBackend,label:r.sessions.defaultBackend}];return c.jsx("div",{className:"modal-layer settings-layer",role:"presentation",...O,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:re.label})]}),c.jsx("button",{type:"button",className:"close-button",onClick:M,children:"Esc"})]}),c.jsxs("div",{className:"settings-body",children:[c.jsx("nav",{className:"settings-nav","aria-label":"Settings pages",children:ju.map(I=>c.jsxs("button",{type:"button",className:`settings-nav-item ${I.id===U?"active":""}`,"aria-current":I.id===U,onClick:()=>H(I.id),children:[c.jsx("b",{children:I.label}),c.jsx("small",{children:I.hint})]},I.id))}),c.jsxs("div",{className:"settings-page",children:[c.jsx("p",{className:"settings-blurb",children:re.blurb}),U==="shortcuts"&&c.jsxs(c.Fragment,{children:[z.rejected.length?c.jsxs("p",{className:"settings-warning",children:[z.rejected.map(I=>I.reason).join(" ")," The default is in use instead."]}):null,c.jsx("div",{className:"shortcut-list",children:Vr.map(I=>c.jsx(mb,{action:I.action,description:I.description,chord:wi(I.action,z),moved:h0(I.action,z),taken:Y,onSet:N=>C("shortcuts",{[I.action]:N}),onReset:()=>C("shortcuts",{[I.action]:void 0})},I.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",Xu.map((I,N)=>c.jsxs(Tn.Fragment,{children:[N?" and ":" ",c.jsx("kbd",{children:I.chord})]},I.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."})]}),U==="appearance"&&c.jsxs(c.Fragment,{children:[c.jsx(hs,{label:"Theme",value:r.appearance.theme,options:Mc.map(I=>({value:I.id,label:I.label})),onChange:I=>C("appearance",{theme:I})}),c.jsx(hs,{label:"Terminal font",hint:"Falls back to another monospace face when the font is not installed.",value:r.appearance.font,options:I0,onChange:I=>C("appearance",{font:I})}),c.jsx(wn,{label:"Font size",value:r.appearance.fontSize,min:Et.fontSize.min,max:Et.fontSize.max,step:1,format:I=>`${I} px`,onChange:I=>C("appearance",{fontSize:I})}),c.jsx(wn,{label:"Line height",value:r.appearance.lineHeight,min:Et.lineHeight.min,max:Et.lineHeight.max,step:.05,format:I=>I.toFixed(2),onChange:I=>C("appearance",{lineHeight:I})}),c.jsx(wn,{label:"Letter spacing",value:r.appearance.letterSpacing,min:Et.letterSpacing.min,max:Et.letterSpacing.max,step:.1,format:I=>`${I.toFixed(1)} px`,onChange:I=>C("appearance",{letterSpacing:I})}),c.jsxs("div",{className:"settings-preview",style:{fontFamily:Fu(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"})]})]}),U==="terminal"&&c.jsxs(c.Fragment,{children:[c.jsx(wn,{label:"Scrollback",hint:"Lines kept per pane. Larger scrollback costs memory in every open pane.",value:r.terminal.scrollback,min:Et.scrollback.min,max:5e4,step:200,format:I=>`${I.toLocaleString()} lines`,onChange:I=>C("terminal",{scrollback:I})}),c.jsx(hs,{label:"Cursor",value:r.terminal.cursorStyle,options:[{value:"block",label:"Block"},{value:"underline",label:"Underline"},{value:"bar",label:"Bar"}],onChange:I=>C("terminal",{cursorStyle:I})}),c.jsx(En,{label:"Blink the cursor",checked:r.terminal.cursorBlink,onChange:I=>C("terminal",{cursorBlink:I})}),c.jsx(En,{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:I=>C("terminal",{copyOnSelect:I})})]}),U==="sessions"&&c.jsxs(c.Fragment,{children:[c.jsx(hs,{label:"Default shell",hint:"Pre-selected when opening a new local terminal.",value:bm(r.sessions.defaultBackend,K),options:X,onChange:I=>C("sessions",{defaultBackend:I})}),c.jsxs($i,{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:I=>C("sessions",{defaultWslDistribution:I.target.value})}),c.jsx("datalist",{id:"settings-wsl-distributions",children:P.map(I=>c.jsx("option",{value:I},I))})]}),c.jsx(hs,{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:I=>C("sessions",{defaultLayout:I})}),c.jsx(En,{label:"Start with the sidebar collapsed",checked:r.sessions.startSidebarCollapsed,onChange:I=>C("sessions",{startSidebarCollapsed:I})}),c.jsx(En,{label:"Show hidden files",hint:"Default for the directory browser and the transfer panel. Files whose name starts with a dot are hidden unless this is on; either panel can also override it just for itself.",checked:r.sessions.showHiddenFiles,onChange:I=>C("sessions",{showHiddenFiles:I})})]}),U==="ai"&&c.jsxs(c.Fragment,{children:[c.jsx($i,{label:"Endpoint",hint:gb(r.ai.baseUrl),children:c.jsx("input",{value:r.ai.baseUrl,placeholder:Ie.ai.baseUrl,spellCheck:!1,onChange:I=>C("ai",{baseUrl:I.target.value})})}),c.jsx($i,{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:I=>C("ai",{model:I.target.value})}),c.jsx("datalist",{id:"ai-models",children:f.map(I=>c.jsx("option",{value:I},I))}),c.jsx("button",{type:"button",onClick:h,children:"Refresh"})]})}),c.jsx(Op,{label:"Endpoint API key",state:p,url:r.ai.baseUrl,onSave:a,onClear:u}),c.jsx(Sb,{state:S,onRun:T}),c.jsx(wb,{status:w,info:L,onStart:y,onStop:R,onCopyToken:k}),c.jsx(En,{label:"Send recent terminal output",hint:r.ai.includeOutput?jc(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:I=>C("ai",{includeOutput:I})}),r.ai.includeOutput?c.jsx(wn,{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:Et.outputChars.min,max:Et.outputChars.max,step:200,format:I=>`${I} characters`,onChange:I=>C("ai",{outputChars:I})}):null,c.jsx(En,{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:I=>C("ai",{requireApproval:I})}),c.jsx(hs,{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:I=>C("ai",{voiceInsert:I})}),c.jsx($i,{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:Ie.ai.proceedPhrase,onChange:I=>C("ai",{proceedPhrase:I.target.value})})}),c.jsx($i,{label:"AI command",hint:`What a pane's bot button types and runs, Enter included — your preferred CLI agent, e.g. "claude" or "aider".`,children:c.jsx("input",{value:r.ai.aiCommand,placeholder:Ie.ai.aiCommand,onChange:I=>C("ai",{aiCommand:I.target.value})})}),c.jsxs("div",{className:"settings-field",children:[c.jsx("span",{className:"settings-field-label",children:"Custom pane buttons"}),r.ai.customButtons.map((I,N)=>{const W=j=>C("ai",{customButtons:r.ai.customButtons.map((F,ie)=>ie===N?{...F,...j}:F)});return c.jsxs("div",{className:"custom-button-row",children:[c.jsx("span",{className:"custom-button-slot","aria-hidden":"true",children:N}),c.jsx("input",{value:I.label,placeholder:"Label","aria-label":`Button ${N} label`,onChange:j=>W({label:j.target.value})}),c.jsx("input",{value:I.command,placeholder:"Text to send","aria-label":`Button ${N} text to send`,onChange:j=>W({command:j.target.value})})]},N)}),c.jsx("small",{children:"Each button with text to send appears on every pane's top bar, showing its number, and types that text and presses Enter. A button with no text is not shown. The label is only the tooltip."})]}),c.jsx(bb,{enabled:r.ai.recordCommands,state:b,bindings:z,onToggle:I=>C("ai",{recordCommands:I}),onCopySnippet:x,onClear:A})]}),U==="speech"&&c.jsxs(c.Fragment,{children:[c.jsx(yb,{value:r.speech.engine,onChange:I=>C("speech",{engine:I})}),V.model?c.jsx(hs,{label:"Model",hint:N0(r.speech.model,r.speech.precision),value:r.speech.model,options:Qu.map(I=>({value:I.id,label:I.label})),onChange:I=>C("speech",{model:I})}):null,V.precision?c.jsx(hs,{label:"Precision",hint:xp.find(I=>I.value===r.speech.precision)?.detail,value:r.speech.precision,options:xp.map(I=>({value:I.value,label:I.label})),onChange:I=>C("speech",{precision:I})}):null,V.device?c.jsx(hs,{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:I=>C("speech",{device:I})}):null,V.language?c.jsx(hs,{label:"Language",value:r.speech.language,options:dm,onChange:I=>C("speech",{language:I})}):null,V.task?c.jsx(hs,{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:I=>C("speech",{task:I})}):null,V.server?c.jsxs(c.Fragment,{children:[c.jsx($i,{label:"Server URL",hint:vb(r.speech.serverUrl),children:c.jsx("input",{value:r.speech.serverUrl,placeholder:"http://127.0.0.1:8080/v1/audio/transcriptions",onChange:I=>C("speech",{serverUrl:I.target.value})})}),c.jsx($i,{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:I=>C("speech",{serverModel:I.target.value})})}),c.jsx(Op,{state:m,url:r.speech.serverUrl,onSave:v,onClear:o})]}):null,c.jsx(wn,{label:"Maximum utterance",hint:"Recording stops itself at this length so a stuck microphone cannot queue forever.",value:r.speech.maxUtteranceSeconds,min:Et.maxUtteranceSeconds.min,max:Et.maxUtteranceSeconds.max,step:5,format:I=>`${I} s`,onChange:I=>C("speech",{maxUtteranceSeconds:I})}),c.jsx(wn,{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:Et.silenceThreshold.min,max:Et.silenceThreshold.max,step:5e-4,format:I=>I.toFixed(4),onChange:I=>C("speech",{silenceThreshold:I})}),c.jsx(Cb,{state:n,onRun:d})]}),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:()=>E(U),children:["Reset ",re.label.toLowerCase()]})]})]})]})]})})}function ii(r){return(r instanceof Error?r.message:String(r)).replace(/^Error invoking remote method '[^']*':\s*/,"").replace(/^(?:Error|TypeError):\s*/,"")}var Eb=qp();const Ab=1024*1024,Bp="This file changed on disk after it was opened.";function jp(r){const C=(r.match(/\r\n/g)??[]).length,E=(r.match(/\n/g)??[]).length-C;return C>E?"crlf":"lf"}function Np(r){return r.replaceAll(`\r
|
|
139
|
+
`,`
|
|
140
|
+
`)}function Rb(r,C){return C==="crlf"?r.replaceAll(`
|
|
141
|
+
`,`\r
|
|
142
|
+
`):r}function Lb(r,C){return r!==C}function Tb(r,C){const E=r.slice(0,Math.max(0,Math.min(C,r.length)));return{line:E.split(`
|
|
143
|
+
`).length,column:E.length-(E.lastIndexOf(`
|
|
144
|
+
`)+1)+1}}function Mb(r,C,E){return{text:`${r.slice(0,C)} ${r.slice(E)}`,caret:C+1}}function Db(r){return new TextEncoder().encode(r).length>Ab}function kb({session:r,mode:C,dock:E,onModeChange:M,startPath:O,pathKind:K,shellPathFor:P,list:n,backend:d,unanchored:m,question:v,onClose:o,register:b}){const[x,A]=Z.useState(!0),[p,a]=Z.useState(O),[u,f]=Z.useState(null),[h,S]=Z.useState(""),[T,w]=Z.useState(0),[L,y]=Z.useState(null),[R,k]=Z.useState(null),[U,H]=Z.useState(!1),z=Z.useRef(null),Y=Z.useRef(null),re=u?Lb(u.saved,h):!1,V=Z.useCallback(ne=>!re||window.confirm(`You have unsaved changes to ${Ko(u?.path??"")}. ${ne}`),[re,u]),X=Z.useCallback(()=>V("Close the editor and lose them?")?(o(),!0):!1,[V,o]);Z.useEffect(()=>(b(X),()=>b(null)),[b,X]),Z.useLayoutEffect(()=>{Y.current===null||!z.current||(z.current.setSelectionRange(Y.current,Y.current),Y.current=null)},[h]);const I=Z.useCallback(ne=>{ne!==u?.path&&V("Open another file and lose them?")&&(y("opening"),k(null),H(!1),d.read(ne).then(_e=>{const we=Np(_e.text);f({path:_e.path,saved:we,ending:jp(_e.text),version:_e.version}),S(we),w(0),C==="docked"&&A(!1),requestAnimationFrame(()=>z.current?.focus())}).catch(_e=>k(ii(_e))).finally(()=>y(null)))},[d,V,u?.path,C]),N=Z.useCallback((ne=!1)=>{if(!(!u||L)){if(Db(h)){k("That is too large for the editor to save.");return}y("saving"),k(null),d.write(u.path,Rb(h,u.ending),u.version,ne).then(_e=>{f({...u,saved:h,version:_e}),H(!1),k(`Saved ${Ko(u.path)}`)}).catch(_e=>{const we=ii(_e);we.includes(Bp)?H(!0):k(we)}).finally(()=>y(null))}},[d,L,u,h]),W=()=>{u&&window.confirm(`Discard your changes to ${Ko(u.path)} and load what is on disk?`)&&(y("opening"),d.read(u.path).then(ne=>{const _e=Np(ne.text);f({path:ne.path,saved:_e,ending:jp(ne.text),version:ne.version}),S(_e),H(!1),k(null)}).catch(ne=>k(ii(ne))).finally(()=>y(null)))},j=Tb(h,T),F=u?Ko(u.path):null,ie=C==="docked",te=c.jsx("button",{type:"button",className:"primary-button",disabled:!u||!re||L!==null,onClick:()=>N(),children:L==="saving"?"Saving…":"Save"}),de=re?c.jsx("span",{className:"editor-dirty",title:"Unsaved changes","aria-label":"Unsaved changes",children:" ●"}):null,ge=c.jsx(rm,{session:r,path:p,unanchored:m,question:v,pathKind:K,shellPath:p?P(p):null,list:n,onOpen:a,onBrowse:a,onClose:ie?()=>A(!1):X,onOpenFile:I,openFile:u?.path??null,defaultShowHidden:!0}),J=c.jsxs("div",{className:"editor-main",children:[U?c.jsxs("div",{className:"editor-banner",role:"alert",children:[c.jsxs("span",{children:[Bp," Saving now would replace those changes."]}),c.jsx("button",{type:"button",onClick:()=>N(!0),children:"Overwrite"}),c.jsx("button",{type:"button",onClick:W,children:"Reload from disk"}),c.jsx("button",{type:"button",onClick:()=>H(!1),children:"Keep editing"})]}):null,u?c.jsx("textarea",{ref:z,className:"editor-text",value:h,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off",wrap:"off","aria-label":`Contents of ${F}`,onChange:ne=>{S(ne.target.value),w(ne.target.selectionStart),k(null)},onSelect:ne=>w(ne.currentTarget.selectionStart),onKeyDown:ne=>{if((ne.ctrlKey||ne.metaKey)&&ne.key.toLowerCase()==="s"){ne.preventDefault(),re&&N();return}if(ne.key==="Tab"&&!ne.shiftKey&&!ne.ctrlKey&&!ne.metaKey&&!ne.altKey){ne.preventDefault();const _e=ne.currentTarget,we=Mb(h,_e.selectionStart,_e.selectionEnd);Y.current=we.caret,S(we.text),w(we.caret)}}}):c.jsxs("div",{className:"editor-empty",children:[c.jsx(ke,{name:"file"}),c.jsx("p",{children:L==="opening"?"Opening…":"Pick a file to edit it. The terminal keeps running."})]})]}),q=c.jsxs("footer",{className:"editor-foot",children:[c.jsx("span",{className:"editor-status",role:"status",children:R??(u?u.path:"")}),u?c.jsxs("span",{className:"editor-position",children:["Ln ",j.line,", Col ",j.column," · ",u.ending==="crlf"?"CRLF":"LF"," · UTF-8"]}):null]});return ie?E?Eb.createPortal(c.jsxs("section",{className:"editor-docked","aria-label":`Editor for ${r.name}`,children:[c.jsxs("header",{className:"editor-dock-head",children:[c.jsxs("span",{className:"editor-dock-name",title:u?.path??"",children:[F??"Editor",de]}),c.jsxs("span",{className:"editor-dock-actions",children:[te,c.jsx("button",{type:"button",className:"pane-nav",onClick:()=>A(ne=>!ne),"aria-pressed":x,title:"Show or hide the file list",children:c.jsx(ke,{name:"folder"})}),c.jsx("button",{type:"button",className:"pane-nav",onClick:()=>M("overlay"),title:"Pop out over the panes",children:c.jsx(ke,{name:"maximize"})}),c.jsx("button",{type:"button",className:"pane-nav",onClick:()=>X(),title:"Close the editor","aria-label":"Close the editor",children:c.jsx(ke,{name:"x"})})]})]}),x||!u?c.jsx("div",{className:"editor-files editor-files-docked",children:ge}):null,J,q]}),E):null:c.jsx("div",{className:"modal-layer editor-layer",role:"presentation",onKeyDown:ne=>{ne.key==="Escape"&&(ne.preventDefault(),ne.stopPropagation(),X())},children:c.jsxs("section",{className:"editor-card",role:"dialog","aria-modal":"true","aria-label":`Edit files from ${r.name}`,children:[c.jsxs("header",{className:"editor-head",children:[c.jsxs("div",{className:"editor-title",children:[c.jsxs("span",{className:"eyebrow",children:["Editor · ",r.name]}),c.jsxs("h2",{children:[F??"Choose a file",de]})]}),c.jsxs("div",{className:"editor-actions",children:[te,c.jsx("button",{type:"button",onClick:()=>M("docked"),title:"Keep the editor beside this terminal instead of over it",children:"Dock"}),c.jsx("button",{type:"button",className:"close-button",onClick:()=>X(),title:"Close the editor",children:"Esc"})]})]}),c.jsxs("div",{className:"editor-body",children:[c.jsx("div",{className:"editor-files",children:ge}),J]}),q]})})}function Ob(r){return{async read(C){const E=await r.readLocalFile(C);return{path:E.path,text:E.text,version:E.mtimeMs}},async write(C,E,M,O){if(typeof M!="number")throw new Error("That file was not opened from this machine.");return(await r.writeLocalFile(C,E,M,O)).mtimeMs}}}function Bb(r,C){return{async read(E){const M=await C(O=>r.sftpReadFile(O,E));return{path:M.path,text:M.text,version:M.text}},async write(E,M,O,K){if(typeof O!="string")throw new Error("That file was not opened from this host.");return await C(P=>r.sftpWriteFile(P,E,M,O,K)),M}}}const kc=2;function jb(r,C,E=kc){const M=new Set(r),O=[];for(const K of C??[]){if(O.length>=E)break;M.has(K)&&!O.includes(K)&&O.push(K)}for(const K of r){if(O.length>=E)break;O.includes(K)||O.push(K)}return O}function Nb(r,C=kc){return r.length>C}function Hb(r,C,E,M){const O=C[E];if(O===void 0||!r.includes(O))return[...C];const K=new Set(C.filter((m,v)=>v!==E)),P=r.filter(m=>!K.has(m));if(P.length<2)return[...C];const n=P.indexOf(O),d=P[(n+M+P.length)%P.length];return C.map((m,v)=>v===E?d:m)}function zb(r){const C=[];return r.forEach((E,M)=>{const O=E.command.trim();O&&C.push({slot:M,label:E.label.trim(),command:O})}),C}function Ub(r){return r.label||`Button ${r.slot}`}function Ib(r){const C=`Send "${r.command}" and press Enter`;return r.label?`${r.label} — ${C}`:C}function wm(r){return us(r.trim()).toLowerCase()}function Wu(r,C){const E=wm(C);if(E)return r.hosts.find(M=>M.host===E)?.label}function Pb(r,C,E){const M=wm(C),O=E.trim();return!M||!O||Wu(r,C)===O&&r.hosts.at(-1)?.host===M?r:{version:r.version,hosts:[...r.hosts.filter(K=>K.host!==M),{host:M,label:O}]}}const $b={version:1,hosts:[]},An=[{kind:"local",label:"Local terminal",hint:"Shell on this machine"},{kind:"ssh",label:"SSH",hint:"Remote host"}];function Hp(r){return r==="local"||r==="ssh"}const Fb={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 Nu(r){return Fb[r]}function Wb(r,C){const E=An.findIndex(O=>O.kind===r);if(E===-1)return null;const M=An.length;switch(C){case"ArrowRight":case"ArrowDown":return An[(E+1)%M].kind;case"ArrowLeft":case"ArrowUp":return An[(E-1+M)%M].kind;case"Home":return An[0].kind;case"End":return An[M-1].kind;default:return null}}const xm={"split-v":"Vertical split","split-h":"Horizontal split",grid:"Four-pane grid"},qb=[{layout:"split-v",icon:"split-v"},{layout:"split-h",icon:"split-h"},{layout:"grid",icon:"grid"}];function Em(r){return r==="split-v"?["column"]:r==="split-h"?["row"]:r==="grid"?["column","row"]:[]}function Am(r,C){return Em(r).some(E=>{const M=E==="column"?C.columnRatio:C.rowRatio,O=E==="column"?Ie.sessions.splitColumnRatio:Ie.sessions.splitRowRatio;return Math.abs(M-O)>.005})}function Gb(r){const C=Em(r);return{...C.includes("column")?{splitColumnRatio:Ie.sessions.splitColumnRatio}:{},...C.includes("row")?{splitRowRatio:Ie.sessions.splitRowRatio}:{}}}function Rm(r){return r.maximized?{kind:"restore"}:r.layout==="stack"?{kind:"show",layout:r.lastSplit}:r.sessionCount>1?{kind:"maximize"}:{kind:"show",layout:"stack"}}function Kb(r,C){return C.layout!==r||C.maximized?{kind:"show",layout:r}:Am(r,C)?{kind:"reset-splits",ratios:Gb(r)}:Rm(C)}function Vb(r,C){return C.layout!==r||C.maximized?xm[r]:Am(r,C)?"Reset pane sizes":C.sessionCount>1?"Maximize focused pane":"Single pane"}function Yb(r){return r.maximized||r.layout==="stack"?`Back to ${xm[r.lastSplit].toLowerCase()}`:r.sessionCount>1?"Maximize focused pane":"Single pane"}function zp(r){return typeof r=="object"&&r!==null}class Xb{constructor(C){this.options=C,this.worker=null,this.pending=new Map,this.nextId=1}async transcribe(C,E,M){if(E.engine==="server"){const K=this.options.now??(()=>Date.now()),P=K(),n=await this.options.resolveApiKey?.().catch(()=>null)??void 0;return{text:await lb({url:E.serverUrl,model:E.serverModel,language:E.language,audio:C,apiKey:n},this.options.fetchImpl),elapsedMs:K()-P,engine:"server"}}return{...await this.transcribeInWorker(C,E,M),engine:"builtin"}}transcribeInWorker(C,E,M){const O=this.ensureWorker(),K=this.nextId++;return new Promise((P,n)=>{this.pending.set(K,{resolve:P,reject:n,onProgress:M}),O.postMessage({type:"transcribe",id:K,audio:C,config:{model:E.model,precision:E.precision,device:E.device,language:E.language,task:E.task,multilingual:B0(E.model)}},[C.buffer])})}ensureWorker(){if(this.worker)return this.worker;const C=this.options.createWorker();return C.onmessage=E=>this.handleMessage(E.data),C.onerror=E=>{const M=zp(E)&&typeof E.message=="string"?E.message:"Speech worker failed";this.failAll(new Error(M)),this.worker=null},this.worker=C,C}handleMessage(C){if(!zp(C)||typeof C.id!="number")return;const E=this.pending.get(C.id);if(E){if(C.type==="loading"){E.onProgress?.({kind:"loading",progress:typeof C.progress=="number"?C.progress:null});return}if(C.type==="notice"){E.onProgress?.({kind:"notice",message:String(C.message)});return}if(C.type==="result"){this.pending.delete(C.id),E.resolve({text:typeof C.text=="string"?C.text:"",elapsedMs:typeof C.elapsedMs=="number"?C.elapsedMs:0});return}C.type==="error"&&(this.pending.delete(C.id),E.reject(new Error(typeof C.message=="string"?C.message:"Transcription failed")))}}failAll(C){for(const E of this.pending.values())E.reject(C);this.pending.clear()}dispose(){this.failAll(new Error("Speech client disposed")),this.worker?.terminate(),this.worker=null}}const Zb=5;function Qb(r,C,E=Zb){return Math.abs(C-r)>=E}function Jb(r,C){if(!r.length)return 0;for(let E=0;E<r.length;E+=1){const M=r[E];if(C<M.left+M.width/2)return E}return r.length-1}function Up(r,C,E){if(C===E||C<0||C>=r.length)return r;const M=Math.min(Math.max(E,0),r.length-1);if(M===C)return r;const O=[...r],[K]=O.splice(C,1);return O.splice(M,0,K),O}function Hu(r,C){return C?r.findIndex(E=>E.id===C):-1}const eS=6;function tS(r,C,E,M=eS){return{x:Ip(r.x,C.width,E.width,M),y:Ip(r.y,C.height,E.height,M)}}function Ip(r,C,E,M){return r+C+M<=E?Math.max(M,r):r-C-M>=0?r-C:Math.max(M,E-C-M)}function iS({at:r,items:C,label:E,onClose:M}){const O=Z.useRef(null),[K,P]=Z.useState(r);return Z.useLayoutEffect(()=>{const n=O.current?.getBoundingClientRect();n&&P(tS(r,{width:n.width,height:n.height},{width:window.innerWidth,height:window.innerHeight}))},[r,C.length]),Z.useEffect(()=>{const n=v=>{v.key==="Escape"&&(v.preventDefault(),v.stopPropagation(),M())},d=()=>M(),m=v=>{v.target instanceof Node&&O.current?.contains(v.target)||M()};return window.addEventListener("keydown",n,!0),window.addEventListener("pointerdown",m,!0),window.addEventListener("blur",d),window.addEventListener("wheel",d,{passive:!0}),()=>{window.removeEventListener("keydown",n,!0),window.removeEventListener("pointerdown",m,!0),window.removeEventListener("blur",d),window.removeEventListener("wheel",d)}},[M]),c.jsx("div",{className:"context-menu",role:"menu","aria-label":E,ref:O,style:{left:K.x,top:K.y},children:C.map(n=>c.jsxs("button",{type:"button",role:"menuitem",className:`context-menu-item ${n.danger?"danger":""}`.trim(),disabled:n.disabled||!n.onSelect,title:n.hint??"",onClick:()=>{M(),n.onSelect?.()},children:[n.icon?c.jsx(ke,{name:n.icon}):c.jsx("span",{className:"context-menu-gap"}),c.jsx("span",{children:n.label})]},n.label))})}function sS(r,C){let E=null,M=null,O=!1;return{handle(K){const P=K.charAt(0);if(O=!0,P==="A")return E=null,!0;if(P==="B")return E=r.cursor(),!0;if(P==="C"){if(!E)return!0;const n=r.read(E,r.cursor()).trim();return E=null,n&&(M={command:n,startedAt:r.now()}),!0}if(P==="D"){const n=M;if(M=null,!n)return!0;const d=rS(K);return C({command:n.command,...d===void 0?{}:{exitCode:d},durationMs:Math.max(0,r.now()-n.startedAt)}),!0}return!0},hasMarks(){return O},atPrompt(){return E!==null&&M===null},reset(){E=null,M=null}}}function rS(r){const C=r.split(";");if(C.length<2)return;const E=C[1].trim();if(!/^\d+$/.test(E))return;const M=Number(E);return M<=255?M:void 0}function nS(r,C,E){if(E.row<C.row||E.row===C.row&&E.col<=C.col)return"";const M=[];for(let O=C.row;O<=E.row;O+=1){const K=r(O)??"",P=O===C.row?C.col:0,n=O===E.row?E.col:K.length;M.push(K.slice(P,n))}return M.join("").replace(/\s+$/,"")}const Pp="TOKEN|KEY|SECRET|PASSWORD|PASSWD|PASSPHRASE|CREDENTIAL|AUTH|APIKEY|ACCESS_KEY|PRIVATE",aS=[{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_]*(?:${Pp})[A-Za-z0-9_]*\s*=\s*\S`,"i")},{reason:"secret-assignment",pattern:new RegExp(String.raw`(?:${Pp})[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}],oS=24;function lS(r){return r.length<oS||/[/\\]/.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 cS(r){const C=r.trim();if(!C)return null;for(const{reason:E,pattern:M}of aS)if(M.test(C))return E;for(const E of C.split(/[\s=:,'"`]+/))if(lS(E))return"high-entropy";return null}const hS=4320*60*1e3,xn={cwd:50,host:12,recency:30,frequency:10,pick:25,failed:-20,match:40};function uS(r,C){if(!C)return[];const E=r.toLowerCase(),M=C.toLowerCase(),O=[];let K=0;for(const P of M){if(P===" ")continue;const n=E.indexOf(P,K);if(n<0)return null;O.push(n),K=n+1}return O}function dS(r,C){if(!C.length)return .5;const E=C[0],O=C[C.length-1]-E+1,K=C.length/O,P=1/(1+E),n=E===0||/\s/.test(r.charAt(E-1))?1:0;return .45*K+.35*P+.2*n}function fS(r,C){const E=C-Date.parse(r);return Number.isFinite(E)?E<=0?1:Math.pow(.5,E/hS):0}function _S(r,C,E){let M=xn.match*dS(r.command,C);return E.cwd&&r.cwd===E.cwd&&(M+=xn.cwd),E.host&&r.host===E.host&&(M+=xn.host),M+=xn.recency*fS(r.lastRun,E.now),M+=xn.frequency*Math.log1p(r.runs),M+=xn.pick*Math.log1p(r.picks),r.exitCode!==void 0&&r.exitCode!==0&&(M+=xn.failed),M}function pS(r,C){const E=new Map;for(const O of r){const K=uS(O.command,C.query);if(K===null)continue;const P={entry:O,score:_S(O,K,C),matched:K},n=E.get(O.command);(!n||P.score>n.score)&&E.set(O.command,P)}const M=[...E.values()].sort((O,K)=>K.score!==O.score?K.score-O.score:K.entry.lastRun.localeCompare(O.entry.lastRun));return C.limit===void 0?M:M.slice(0,C.limit)}function zu(r){return{phase:"asking",sessionId:r,prompt:""}}function mS(r,C,E){return!E.trim()||C||r.includeOutput?!1:!r.requireApproval}function $p(r){return!!(r.baseUrl.trim()&&r.model.trim())}function gS(r,C){const E=r.replace(/\s+$/,"");if(C<=0)return"";if(E.length<=C)return E;const M=E.slice(-C),O=M.indexOf(`
|
|
145
|
+
`);return O>=0&&O<M.length-1?M.slice(O+1):M}const vS=150,bS=3e3,Fp=400;function Wp(r){return{id:r.sessionId,name:r.name,kind:r.kind,host:r.host,screenName:r.screenName,sshTarget:r.sshTarget,backend:r.backend}}const Ee=()=>window.zerog;function Uu(){try{return window.localStorage}catch{return null}}function wc({session:r,active:C=!1,ghosted:E=!1,onClick:M}){const O=r.kind==="ssh"?`SSH · ${r.host}`:r.backend==="wsl"?`WSL${r.wslDistribution?` · ${r.wslDistribution}`:""} · ${r.cwd}`:r.backend&&r.backend!=="screen"?`${_m(r.backend)} · ${r.cwd}`:r.persistence==="screen"?`screen · ${r.cwd}`:`local · process only · ${r.cwd}`;return c.jsxs("button",{type:"button",className:`session-row ${C?"active":""} ${E?"session-ghosted":""}`,onClick:M,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:O})]}),c.jsx("span",{className:"session-state",children:E?"↗":r.status==="connected"?"●":"○"})]})}function SS({member:r,onClick:C}){const E=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:C,children:[c.jsx("span",{className:"status-dot"}),c.jsxs("span",{className:"session-copy",children:[c.jsx("b",{children:r.name}),c.jsxs("small",{children:[E," · not connected"]})]}),c.jsx("span",{className:"session-state",children:"↻"})]})}function yS({connection:r,onConfigure:C,onConnect:E}){const M=Yp(C,E),O=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:M.onClick,onDoubleClick:M.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:O})]}),c.jsx("span",{className:"session-state",children:"→"})]})}function CS(r,C=200){if(!r)return"";const E=r.buffer.active,M=E.length,O=Math.max(0,M-C),K=[];for(let P=O;P<M;P+=1)K.push(E.getLine(P)?.translateToString(!0)??"");return K.join(`
|
|
146
|
+
`)}const wS=120,xS=1e4,ES=200;function AS(){if(!(typeof PerformanceObserver>"u"))try{new PerformanceObserver(C=>{for(const E of C.getEntries())E.duration>=ES&&console.warn(`[zerog] renderer blocked for ${Math.round(E.duration)}ms`)}).observe({entryTypes:["longtask"]})}catch{}}AS();function RS({sessionId:r,focused:C,dormant:E=!1,onStatus:M,appearance:O,terminalSettings:K,registerFocus:P,registerCapture:n,onCommand:d,registerRead:m}){const v=Z.useRef(null),o=Z.useRef(null),b=Z.useRef(M);b.current=M;const x=Z.useRef(O);x.current=O;const A=Z.useRef(K);A.current=K;const p=Z.useRef(null),a=Z.useRef(null),u=Z.useRef({}),f=Z.useRef(d);return f.current=d,Z.useEffect(()=>{if(!v.current)return;const h=v.current,S=new Zg.Terminal({cursorBlink:A.current.cursorBlink,cursorStyle:A.current.cursorStyle,fontFamily:Fu(x.current.font),fontSize:x.current.fontSize,lineHeight:x.current.lineHeight,letterSpacing:x.current.letterSpacing,scrollback:A.current.scrollback,allowProposedApi:!0,theme:Ep(x.current.theme),linkHandler:{activate:(te,de)=>{const ge=Ee();ge?.openExternal&&(b.current(`Opening ${de}`),ge.openExternal(de).catch(J=>{b.current(J instanceof Error?J.message:String(J))}))},hover:(te,de)=>b.current(`Link: ${de}`),leave:()=>b.current("Ready")}});u.current={theme:x.current.theme,font:x.current.font,fontSize:x.current.fontSize,lineHeight:x.current.lineHeight,letterSpacing:x.current.letterSpacing,scrollback:A.current.scrollback,cursorStyle:A.current.cursorStyle,cursorBlink:A.current.cursorBlink};const T=new Jg.FitAddon;S.loadAddon(T),S.open(h),o.current=S;const w=Ee();let L=!1,y=0,R=0,k=0,U=!1,H=0;const z=()=>{if(L||!h.isConnected||h.clientWidth<20||h.clientHeight<20)return!1;try{T.fit()}catch{return!1}return S.cols>0&&S.rows>0},Y=()=>{!U||!w||!r||S.cols===R&&S.rows===k||(window.clearTimeout(H),H=window.setTimeout(()=>{L||!r||S.cols===R&&S.rows===k||(R=S.cols,k=S.rows,w.resize(r,R,k))},wS))},re=()=>{z()&&Y()},V=()=>{cancelAnimationFrame(y),y=requestAnimationFrame(()=>{re(),y=requestAnimationFrame(re)})};if(p.current=V,!w)return V(),S.writeln("\x1B[90mZeroG Terminal\x1B[0m"),S.writeln("\x1B[31mPreload API unavailable. Rebuild the app.\x1B[0m"),b.current("Preload API unavailable"),()=>{L=!0,cancelAnimationFrame(y),o.current=null,a.current=null,S.dispose()};const X=w.onData((te,de)=>{te===r&&S.write(de)}),I=w.onStatus((te,de)=>{te===r&&(b.current(de),V())}),N=S.onData(te=>{r&&w.write(r,te)}),W=bv({terminal:S,clipboard:w,onError:te=>b.current(te),writeToPty:te=>{r&&w.write(r,te)},pasteEventTarget:h,isCopyOnSelectEnabled:()=>A.current.copyOnSelect}),j=sS({cursor:()=>({row:S.buffer.active.baseY+S.buffer.active.cursorY,col:S.buffer.active.cursorX}),read:(te,de)=>nS(ge=>S.buffer.active.getLine(ge)?.translateToString(!0),te,de),now:()=>Date.now()},te=>{r&&f.current?.(r,te)}),F=S.parser.registerOscHandler(133,te=>j.handle(te));r&&n?.(r,j);const ie=new ResizeObserver(()=>V());if(ie.observe(h),window.addEventListener("resize",V),document.fonts?.ready?.then(()=>{L||V()}).catch(()=>{}),V(),!r)S.writeln("\x1B[90mZeroG Terminal\x1B[0m"),S.writeln("\x1B[90mSelect a session or create a local/SSH connection.\x1B[0m");else{const te=z()?{cols:S.cols,rows:S.rows}:void 0;te&&(R=te.cols,k=te.rows),w.attachSession(r,te).then(de=>{U=!0,de.persistence==="process"?b.current(`${de.host} · ${de.name} · process only (install screen for persistence)`):b.current(`${de.host} · ${de.name}`),V()}).catch(de=>{b.current(de instanceof Error?de.message:String(de))})}return()=>{L=!0,cancelAnimationFrame(y),window.clearTimeout(H),W(),N.dispose(),X(),I(),ie.disconnect(),F.dispose(),r&&n?.(r,null),window.removeEventListener("resize",V),p.current=null,o.current=null,a.current=null,S.dispose()}},[r]),Z.useEffect(()=>{const h=o.current;if(!h)return;if(E){const w=window.setTimeout(()=>{const L=a.current;a.current=null,L?.dispose()},xS);return()=>window.clearTimeout(w)}if(a.current)return;let S;try{S=new tv.WebglAddon}catch(w){console.warn("[zerog] pane fell back to the DOM renderer",w);return}const T=S.onContextLoss(()=>{a.current===S&&(a.current=null),S.dispose()});try{h.loadAddon(S)}catch{S.dispose();return}return a.current=S,()=>T.dispose()},[r,E]),Z.useEffect(()=>{if(E)return;const h=o.current;if(!h)return;p.current?.();const S=requestAnimationFrame(()=>{h.rows>0&&h.refresh(0,h.rows-1)});return()=>cancelAnimationFrame(S)},[E]),Z.useEffect(()=>{const h=o.current;if(!h||E)return;const S=u.current;let T=!1;S.theme!==O.theme&&(S.theme=O.theme,h.options.theme=Ep(O.theme)),S.font!==O.font&&(S.font=O.font,h.options.fontFamily=Fu(O.font),T=!0),S.fontSize!==O.fontSize&&(S.fontSize=O.fontSize,h.options.fontSize=O.fontSize,T=!0),S.lineHeight!==O.lineHeight&&(S.lineHeight=O.lineHeight,h.options.lineHeight=O.lineHeight,T=!0),S.letterSpacing!==O.letterSpacing&&(S.letterSpacing=O.letterSpacing,h.options.letterSpacing=O.letterSpacing,T=!0),S.scrollback!==K.scrollback&&(S.scrollback=K.scrollback,h.options.scrollback=K.scrollback),S.cursorStyle!==K.cursorStyle&&(S.cursorStyle=K.cursorStyle,h.options.cursorStyle=K.cursorStyle),S.cursorBlink!==K.cursorBlink&&(S.cursorBlink=K.cursorBlink,h.options.cursorBlink=K.cursorBlink),T&&p.current?.()},[O,K,E]),Z.useEffect(()=>{C&&o.current?.focus()},[C]),Z.useEffect(()=>{if(!(!r||!P))return P(r,()=>o.current?.focus()),()=>P(r,null)},[r,P]),Z.useEffect(()=>{if(!(!r||!m))return m(r,()=>CS(o.current)),()=>m(r,null)},[r,m]),c.jsx("div",{className:"terminal",ref:v,onMouseDownCapture:h=>h.preventDefault()})}function LS({open:r,ratio:C,browser:E,dock:M,onRatio:O,children:K}){const P=Z.useRef(null),[n,d]=Z.useState(null),m=n??C,v=o=>Math.min(Qp,Math.max(Zp,Math.round(o)));return c.jsxs("div",{className:r?"pane-body pane-body-split":"pane-body",ref:P,style:r?{gridTemplateColumns:`${m}fr ${100-m}fr`}:void 0,children:[K,r?c.jsxs(c.Fragment,{children:[c.jsx(Ac,{orientation:"vertical",className:"pane-resizer pane-browser-resizer",label:M?"Editor split":"Directory browser split",valuePercent:m,style:{left:`calc((100% - 1px) * ${m/100} + 0.5px)`},onDrag:o=>{const b=P.current?.getBoundingClientRect();!b||b.width<=0||d(v((o.clientX-b.left)/b.width*100))},onCommit:()=>{n!==null&&O(n),d(null)},onNudge:o=>O(v(m+o*2)),onReset:()=>O(Jp)}),M?c.jsx("div",{className:"pane-dock",ref:M}):E]}):null]})}function Ac({orientation:r,className:C,label:E,valuePercent:M,style:O,onDrag:K,onCommit:P,onNudge:n,onReset:d}){const[m,v]=Z.useState(!1),o=r==="vertical"?"ArrowLeft":"ArrowUp",b=r==="vertical"?"ArrowRight":"ArrowDown";return c.jsx("div",{role:"separator","aria-orientation":r,"aria-label":E,"aria-valuenow":Math.round(M),"aria-valuemin":0,"aria-valuemax":100,tabIndex:0,className:`${C} ${m?"dragging":""}`.trim(),style:O,title:`${E} — drag, arrow keys, or double-click to reset`,onPointerDown:x=>{x.button===0&&(x.preventDefault(),x.currentTarget.setPointerCapture(x.pointerId),v(!0))},onPointerMove:x=>{x.currentTarget.hasPointerCapture(x.pointerId)&&K(x)},onPointerUp:x=>{x.currentTarget.hasPointerCapture(x.pointerId)&&(x.currentTarget.releasePointerCapture(x.pointerId),v(!1),P())},onPointerCancel:()=>v(!1),onDoubleClick:d,onKeyDown:x=>{x.key===o?(x.preventDefault(),n(-1)):x.key===b?(x.preventDefault(),n(1)):(x.key==="Enter"||x.key==="Home")&&(x.preventDefault(),d())}})}function TS({index:r,onCreate:C}){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:C,children:"Choose session"})]})]})}const Lm="zerog-last-dark-theme";function MS(){try{const r=window.localStorage.getItem(Lm);return Pu.find(C=>C===r&&!Kr(C))??$u}catch{return $u}}function DS(){const[r,C]=Z.useState(()=>Z0(Uu())),E=r.appearance.theme,M=Z.useRef(MS()),[O,K]=Z.useState([]),[P,n]=Z.useState(()=>[cp("Workspace",r.sessions.defaultLayout)]),[d,m]=Z.useState(()=>P[0]?.id??""),[v,o]=Z.useState("Ready"),[b,x]=Z.useState({agents:[],links:[]}),[A,p]=Z.useState(null),[a,u]=Z.useState({state:"disabled",capabilities:[]}),[f,h]=Z.useState([]),[S,T]=Z.useState(null),[w,L]=Z.useState(!1),[y,R]=Z.useState(r.sessions.startSidebarCollapsed),[k,U]=Z.useState("terminals"),[H,z]=Z.useState("sessions"),[Y,re]=Z.useState([]),[V,X]=Z.useState(!1),[I,N]=Z.useState(null),[W,j]=Z.useState(""),[F,ie]=Z.useState("local"),[te,de]=Z.useState("loopback"),[ge,J]=Z.useState(""),[q,ne]=Z.useState(""),[_e,we]=Z.useState(""),[xe,Ne]=Z.useState(!1),[Ae,We]=Z.useState(!1),[et,Te]=Z.useState(!1),[Lt,qt]=Z.useState(!1),[$e,Pe]=Z.useState({}),he=Z.useRef(new Map),[ue,Se]=Z.useState({}),De=Object.keys($e).find(g=>$e[g]==="overlay"),je=Z.useMemo(()=>Zu(r.shortcuts),[r.shortcuts]),[at,ut]=Z.useState(""),[Tt,Oe]=Z.useState(0),[Ue,ze]=Z.useState([]),[wt,bt]=Z.useState(!0),[Pt,mt]=Z.useState(null),[dt,Mt]=Z.useState(null),[Yr,$t]=Z.useState(!1),[Fi,xi]=Z.useState("Workspace"),[Zi,ds]=Z.useState(!1),[nr,Yo]=Z.useState(""),[Rs,Dn]=Z.useState(!1),[ar,Nc]=Z.useState([]),[ka,Oa]=Z.useState("term"),[kn,Xr]=Z.useState(""),[or,Ba]=Z.useState($b),On=Z.useRef(!1),[Wi,Nt]=Z.useState(""),[Ke,Dt]=Z.useState(null),[ja,lr]=Z.useState({status:"idle",stored:!1,encryptionAvailable:!0,sessionOnly:!1}),[Hc,Na]=Z.useState([]),[Zr,Bn]=Z.useState({status:"idle"}),[Vt,Ei]=Z.useState({status:"idle",sessionId:null}),[ci,Ls]=Z.useState(null),St=Z.useRef(null),jn=Z.useRef(null),fs=Z.useRef(null),Ai=Z.useRef(void 0),[Ri,_s]=Z.useState(!1),[Ts,cr]=Z.useState(!1),[Nn,Li]=Z.useState({status:"idle"}),Ms=Z.useRef(null),hi=Z.useRef(void 0),[ui,ps]=Z.useState({status:"idle",stored:!1,encryptionAvailable:!0,sessionOnly:!1}),Hn=Z.useRef(null),[hr,Ha]=Z.useState([]),[Qi,Xo]=Z.useState(r.sessions.defaultBackend),[si,Qr]=Z.useState(r.sessions.defaultWslDistribution),[Zo,Jr]=Z.useState([]),[Ds,en]=Z.useState([]),[Ti,ks]=Z.useState([]),[Qo,zn]=Z.useState([]),[zc,Un]=Z.useState(!1),za=Z.useRef(new Map),Uc=Z.useCallback((g,B)=>{B?za.current.set(g,B):za.current.delete(g)},[]),Os=Z.useRef(new Map),Ji=Z.useCallback((g,B)=>{B?Os.current.set(g,B):Os.current.delete(g)},[]),ur=Z.useRef(new Map),Ua=Z.useCallback((g,B)=>{B?ur.current.set(g,B):ur.current.delete(g)},[]),[dr,es]=Z.useState({}),[In,Ia]=Z.useState({}),fr=Z.useRef(E0(Ee,(g,B)=>Pn(G=>G[g]===B?G:{...G,[g]:B}))).current,_r=fr.listerFor,[Mi,Pn]=Z.useState({}),[pr,ts]=Z.useState(null),[mr,$n]=Z.useState(null);Z.useEffect(()=>{Ee()?.appVersion?.().then(g=>$n(cm(g))).catch(()=>{})},[]),Z.useEffect(()=>{const g=Ee();return g?.listPaneLinks?.().then(x).catch(()=>{}),g?.onPaneLinks?.(x)},[]),Z.useEffect(()=>{const g=Ee();return g?.mcpStatus?.().then(u).catch(()=>{}),g?.onMcpStatus?.(u)},[]),Z.useEffect(()=>{const g=Ee();return g?.listMcpExecutions?.().then(B=>h(B.filter(G=>"command"in G&&G.state==="pending"))).catch(()=>{}),g?.onMcpExecution?.(B=>{if(!("command"in B)){h(G=>G.filter(Q=>Q.requestId!==B.requestId));return}h(G=>B.state==="pending"?[...G.filter(Q=>Q.requestId!==B.requestId),B]:G.filter(Q=>Q.requestId!==B.requestId))})},[]),Z.useEffect(()=>{const g=Ee();if(g?.onMcpWorkspaceRestored)return g.onMcpWorkspaceRestored(B=>{const G=B.restored.map(Q=>Q.session);K(Q=>{const me=new Map(Q.map(ye=>[ye.id,ye]));for(const ye of G)me.set(ye.id,ye);return[...me.values()]}),n(Q=>{const me=new Set(G.map(Re=>Re.id)),ye=B.restored.map(Re=>Re.member);return Q.find(Re=>Re.id===B.workspaceId)?Q.map(Re=>{if(Re.id!==B.workspaceId)return Re;const Ze=Re.pending.filter(ot=>!ye.some(mi=>ot.sessionId===mi.sessionId||ot.sshTarget&&ot.sshTarget===mi.sshTarget||ot.name===mi.name&&ot.kind===mi.kind));return{...Re,sessionIds:Array.from(new Set([...Re.sessionIds,...me])),pending:Ze}}):[...Q,{id:B.workspaceId,name:B.workspaceName??"Restored workspace",sessionIds:Array.from(me),pending:[],view:Vo("grid")}]}),m(B.workspaceId),o(`Restored ${G.length} session${G.length===1?"":"s"}`),g.listSessions().then(K).catch(()=>{})})},[]),Z.useEffect(()=>{const g=Ee();if(g?.onMcpSshSessionCreated)return g.onMcpSshSessionCreated(({session:B})=>{K(G=>[...G.filter(Q=>Q.id!==B.id),B]),n(G=>G.map(Q=>Q.id===d?{...Q,sessionIds:Array.from(new Set([...Q.sessionIds,B.id]))}:Q)),o(`Opened SSH session to ${B.host}`)})},[d]),Z.useEffect(()=>Ee()?.onSftpEvent?.(B=>{B.type==="prompt"?ts(B.prompt.text.trim().split(`
|
|
147
|
+
`).pop()??null):ts(null)}),[]);const Pa=Z.useRef(new Set),tn=Z.useCallback(g=>{Pa.current.has(g.id)||(Pa.current.add(g.id),fr.learnHome(g).then(B=>{B&&Pn(G=>({...G,[g.id]:B}))}).catch(()=>{}))},[fr]),sn=Z.useRef(new Set),$a=Z.useCallback(g=>{if(sn.current.has(g))return;sn.current.add(g);const B=Ee();B&&B.wslHome(g).then(G=>{G&&Ia(Q=>({...Q,[g]:G}))}).catch(()=>{})},[]),st=Z.useCallback(g=>{g&&(gr(g),requestAnimationFrame(()=>za.current.get(g)?.()))},[]),Bs=Wr(()=>Mt(null)),Fn=Wr(()=>{Ee()?.cancelAiRequest?.(),Dt(null)}),rn=Wr(()=>$t(!1)),Ic=Wr(()=>We(!1)),Fa=Wr(()=>Te(!1)),Wa=Wr(()=>_s(!1)),nn=Wr(()=>$s()),Wn=Wr(()=>cr(!1)),Di=Z.useCallback((g,B)=>{C(G=>{const Q=Tp(G,g,B);return Lp(Uu(),Q),Q})},[]),Jo=Z.useCallback((g,B)=>{C(G=>Tp(G,g,B))},[]),Pc=Z.useCallback(g=>{C(B=>{const G=J0(B,g);return Lp(Uu(),G),G})},[]);Z.useEffect(()=>{if(document.documentElement.dataset.theme=E,!Kr(E)){M.current=E;try{window.localStorage.setItem(Lm,E)}catch{}}},[E]);const lt=Z.useMemo(()=>P.find(g=>g.id===d)??P[0]??null,[P,d]),di=lt?.view??Vo(r.sessions.defaultLayout),At=di.layout,fi=di.focusedSessionId,el=di.maximizedSessionId??null,rt=Z.useMemo(()=>di.activeSessionId?O.find(g=>g.id===di.activeSessionId)??null:null,[di.activeSessionId,O]),Qt=Z.useCallback((g,B)=>{n(G=>hp(G,B??d,g))},[d]),ms=Z.useCallback(g=>Qt({activeSessionId:g?.id}),[Qt]),qn=Z.useCallback(g=>Qt(B=>({layout:typeof g=="function"?g(B.layout):g})),[Qt]),gr=Z.useCallback(g=>Qt({focusedSessionId:g}),[Qt]),js=Z.useCallback(g=>Qt({maximizedSessionId:g}),[Qt]),yt=Z.useMemo(()=>{if(!lt)return O;const g=new Set(lt.sessionIds);return O.filter(B=>g.has(B.id))},[lt,O]),Gn=lt?.pending??[],vr=Z.useCallback(async()=>{const g=Ee();if(bt(!0),mt(null),!g){mt("Preload API unavailable"),o("Preload API unavailable"),bt(!1);return}try{const B=await g.listSessions();K(B),o(B.length?`${B.length} session${B.length===1?"":"s"}`:"No sessions")}catch(B){const G=B instanceof Error?B.message:String(B);mt(G),o(G)}finally{bt(!1)}},[]);Z.useEffect(()=>{vr()},[vr]),Z.useEffect(()=>{const g=Ee();g&&g.listBackends?.().then(Ha).catch(()=>Ha([]))},[]),Z.useEffect(()=>{if(Qi!=="wsl"){Jr([]),Qr("");return}const g=Ee();g&&g.listWslDistributions?.().then(Jr).catch(()=>Jr([]))},[Qi]),Z.useEffect(()=>{if(!Ae){en([]);return}const g=Ee();g&&g.listHistory?.().then(en).catch(()=>en([]))},[Ae]),Z.useEffect(()=>{const g=Ee(),B=us((rt?.kind==="ssh"?rt.host:"")||(fi?O.find(Q=>Q.id===fi)?.host:"")||""),G=B?Ti.filter(Q=>us(Q.hostName??"")===B||Q.alias===B):[];if(G.length===0){zn([]);return}g?.discoverRemoteScreens&&(Un(!0),Promise.allSettled(G.map(Q=>g.discoverRemoteScreens(Q))).then(Q=>{const me=[];Q.forEach((ye,Ce)=>{ye.status==="fulfilled"&&Array.isArray(ye.value)&&ye.value.forEach(Re=>{me.push({session:Re,connection:G[Ce]})})}),zn(me)}).catch(()=>zn([])).finally(()=>Un(!1)))},[Ti,rt?.host,O,fi]),Z.useEffect(()=>{const g=Ee();g&&g.listKnownConnections?.().then(ks).catch(()=>ks([]))},[]),Z.useEffect(()=>{r.ai.recordCommands&&Ee()?.listCommandHistory?.().then(ze).catch(()=>{})},[r.ai.recordCommands]),Z.useEffect(()=>{const g=Ee();g?.speechApiKeyStatus&&g.speechApiKeyStatus().then(B=>ps(G=>({...G,stored:B.stored,encryptionAvailable:B.encryptionAvailable}))).catch(()=>{})},[]),Z.useEffect(()=>{const g=Ee();g?.aiApiKeyStatus&&g.aiApiKeyStatus().then(B=>lr(G=>({...G,stored:B.stored,encryptionAvailable:B.encryptionAvailable}))).catch(()=>{})},[]),Z.useEffect(()=>{wt||!Rs||n(g=>kv(g,O))},[O,wt,Rs]),Z.useEffect(()=>{wt||Pe(g=>{const B=Object.keys(g).filter(G=>O.some(Q=>Q.id===G));return B.length===Object.keys(g).length?g:Object.fromEntries(B.map(G=>[G,g[G]]))})},[O,wt]),Z.useEffect(()=>{const g=Ee();if(!g?.loadWorkspaces){Dn(!0);return}let B=!1;return g.loadWorkspaces().then(G=>{if(B)return;const Q=qv(G,r.sessions.defaultLayout);Q.workspaces.length&&(n(Q.workspaces),Q.activeWorkspaceId&&m(Q.activeWorkspaceId))}).catch(()=>{}).finally(()=>{B||Dn(!0)}),()=>{B=!0}},[]),Z.useEffect(()=>{wt||!Rs||n(g=>Hv(g,B=>{const G=Mu(Wp(B),O,Ti);return G.kind==="attach"?G.sessionId:void 0}))},[O,wt,Rs,Ti]),Z.useEffect(()=>{const g=Ee();if(g?.onForwardEvent)return g.onForwardEvent(B=>{if(B.type==="status"){re(G=>qo(G,B.forward));return}if(B.type==="prompt"){N({forwardId:B.forwardId,kind:B.prompt.kind,text:B.prompt.text});return}re(G=>G.map(Q=>Q.id===B.forwardId&&Q.status!=="error"?{...Q,status:"idle"}:Q))})},[]),Z.useEffect(()=>{const g=Ee();if(!g?.loadForwards){X(!0);return}let B=!1;return Promise.all([g.loadForwards(),g.listForwards?.()??[]]).then(([G,Q])=>{if(B)return;const me=D0(G);re(Q.reduce((ye,Ce)=>qo(ye,Ce),me))}).catch(()=>{}).finally(()=>{B||X(!0)}),()=>{B=!0}},[]),Z.useEffect(()=>{Ee()?.loadHostLabels?.().then(Ba).catch(()=>{})},[]),Z.useEffect(()=>{if(!V)return;const g=Ee();if(!g?.saveForwards)return;const B=setTimeout(()=>{g.saveForwards(M0(Y)).catch(()=>{})},Fp);return()=>clearTimeout(B)},[Y,V]),Z.useEffect(()=>{if(!Rs||wt)return;const g=Ee();if(!g?.saveWorkspaces)return;const B=setTimeout(()=>{g.saveWorkspaces($v(P,d,O)).catch(()=>{})},Fp);return()=>clearTimeout(B)},[P,d,O,Rs,wt]),Z.useEffect(()=>{d&&Nc(g=>g.includes(d)?g:[...g,d])},[d]),Z.useEffect(()=>{!rt&&yt.length&&ms(yt[0])},[rt,yt,ms]),Z.useEffect(()=>Ee()?.onLinkRefused?.(B=>o(B)),[]);const tl=Z.useRef(new Map);Z.useEffect(()=>{const g=Ee();if(g)return g.onData((B,G)=>{const Q=((tl.current.get(B)??"")+G).slice(-2048);tl.current.set(B,Q);const me=w0(Q);me&&K(ye=>{const Ce=ye.find(Re=>Re.id===B);return!Ce||Ce.cwd===me.path?ye:ye.map(Re=>Re.id===B?{...Re,cwd:me.path}:Re)})})},[]),Z.useEffect(()=>{const g=B=>{if(B.key==="Escape"){if(Ns.current){B.preventDefault(),hn();return}const Q=f0({help:Lt,editor:!!De,transfer:Ts,settings:Ri,voiceReview:!!ci,overview:Yr,suggest:!!Ke,modal:!!dt,palette:et,history:Ae});if(!Q)return;B.preventDefault(),Q==="help"&&qt(!1),Q==="editor"&&De&&he.current.get(De)?.(),Q==="transfer"&&cr(!1),Q==="settings"&&_s(!1),Q==="voiceReview"&&$s(),Q==="overview"&&$t(!1),Q==="suggest"&&(Ee()?.cancelAiRequest?.(),Dt(null)),Q==="modal"&&Mt(null),Q==="palette"&&Te(!1),Q==="history"&&We(!1);return}const G=u0({key:B.key,code:B.code,ctrlKey:B.ctrlKey,metaKey:B.metaKey,shiftKey:B.shiftKey,altKey:B.altKey,inTextField:B.target instanceof HTMLInputElement},je);if(G){if(B.preventDefault(),G.action==="switch-workspace"){const Q=P[G.position-1];Q&&yl(Q.id);return}G.action==="toggle-help"&&qt(Q=>!Q),G.action==="toggle-overview"&&$t(Q=>!Q),G.action==="new-workspace"&&(xi(yc(P)),Mt("workspace")),G.action==="new-terminal"&&zs("local"),G.action==="ask-ai"&&eo(),G.action==="toggle-layout"&&Qt(Q=>({maximizedSessionId:null,layout:Q.layout==="stack"?Q.lastSplit:"stack"})),G.action==="toggle-sidebar"&&R(Q=>!Q),G.action==="toggle-settings"&&_s(Q=>!Q),G.action==="history-palette"&&Yc()}};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[Yr,Ke,dt,et,Ae,Ri,Ts,Lt,De,ci,Vt.status,P,d,lt,yt,O]);const il=Rp(r.ai),Kn=Bu(r.ai),$c=zb(r.ai.customButtons),Vn=Vu(rt),sl=Gv(rt),qa=At==="stack"?1:At==="grid"?4:2,rl=Z.useMemo(()=>new Set([...ar,d]),[ar,d]),Ga=Z.useMemo(()=>Rv(P.filter(g=>rl.has(g.id)),O,d),[P,O,d,rl]),is=Z.useMemo(()=>Ga.filter(g=>g.workspaceId===d).map(g=>g.session),[Ga,d]),Fc=Math.max(qa,is.length),Gt=is.some(g=>g.id===el)?el:null,Ka=is.find(g=>g.id===rt?.id)?.id??is[0]?.id,an=g=>{const B=Ee();return g.kind==="ssh"?Bb(B,G=>fr.withHandle(g,G)):Ob(B)},Wc=g=>Pe(B=>({...B,[g.id]:"overlay"})),nl=(g,B)=>Pe(G=>G[g]?{...G,[g]:B}:G),al=g=>{Pe(B=>{const{[g]:G,...Q}=B;return Q}),st(g)},ol=Z.useCallback((g,B)=>{Se(G=>G[g]===B?G:{...G,[g]:B})},[]),Va=Z.useRef(new Map),ll=g=>{let B=Va.current.get(g);return B||(B=G=>ol(g,G),Va.current.set(g,B)),B},br=Z.useCallback((g,B)=>{B?he.current.set(g,B):he.current.delete(g)},[]),qc=At==="split-v"||At==="split-h",Ya=is.map(g=>g.id),gs=qc?jb(Ya,di.visiblePanes,kc):null,Xa=(g,B)=>At==="stack"?g.id===Ka:gs?gs.includes(g.id):B<qa,Za=(g,B)=>{if(!gs)return;const G=Hb(Ya,gs,gs.indexOf(g),B);Qt({visiblePanes:G});const Q=is.find(me=>me.id===G[gs.indexOf(g)]);Q&&(ms(Q),st(Q.id))};Z.useEffect(()=>{Ts&&!Vn&&cr(!1)},[Ts,Vn]),Z.useEffect(()=>{At==="stack"||di.lastSplit===At||Qt({lastSplit:At})},[At,di.lastSplit,Qt]);const ri=async g=>{ms(g),gr(g.id);const B=is.findIndex(G=>G.id===g.id);Gt?js(g.id):B>=0&&At!=="stack"&&!Xa(g,B)&&qn("grid"),o(g.persistence==="process"?`${g.host} · ${g.name} · process only (install screen for persistence)`:`${g.host} · ${g.name}`),$t(!1)},ki=(g,B=d)=>{n(G=>Lv(G,B,g.id))},Gc=async g=>{g.preventDefault();const B=Fi.trim()||yc(P),G=cp(B,r.sessions.defaultLayout);n(Q=>[...Q,G]),m(G.id),ms(null),Mt(null),o(`Workspace “${B}” ready`)},Yn=async g=>{g.preventDefault();const B=Ee();if(B){if((lt?Du(lt):yt.length)>=4){o("This workspace supports up to 4 sessions."),Mt(null);return}L(!0);try{const G=await B.createLocalSession({name:ka,backend:Qi,wslDistribution:Qi==="wsl"?si:void 0});K(Q=>[...Q.filter(me=>me.id!==G.id),G]),ki(G),gr(G.id),js(null),qn(ku(yt.length+1)),Mt(null),await ri(G)}catch(G){o(G instanceof Error?G.message:String(G))}finally{L(!1)}}},Xn=async(g,B,G)=>{const Q=Ee();if(!Q||w)return null;const me=lt?Du(lt):yt.length;if(!G?.replacingPane&&me>=4)return o("This workspace supports up to 4 sessions."),Mt(null),null;L(!0);try{const ye=await Q.createSshSession({name:B||void 0,target:g});return K(Ce=>[...Ce.filter(Re=>Re.id!==ye.id),ye]),ki(ye),gr(ye.id),js(null),qn(ku(G?.replacingPane?Math.max(me,1):me+1)),Mt(null),await ri(ye),ye}catch(ye){return o(ye instanceof Error?ye.message:String(ye)),null}finally{L(!1)}},cl=async g=>{if(g.preventDefault(),!await Xn(Wi,kn))return;const G=Pb(or,Wi,kn);G!==or&&(Ba(G),Ee()?.saveHostLabels?.(G).catch(()=>{}))},Qa=g=>{Nt(g),On.current||Xr(Wu(or,g)??"")},Zn=async(g,B)=>{const G=Ee();if(!G)return null;if(g.kind==="unavailable")return o(g.reason),null;if(g.kind==="attach"){const me=O.find(ye=>ye.id===g.sessionId);return me?(ki(me),await ri(me),me):null}if(g.kind==="attach-remote-screen")return dl(g.name,g.screenName,g.connection);const Q=await Xn(g.target,g.name,B);return!Q||!g.screenCommand||(await G.attachSession(Q.id),await Ja(G,Q.id),G.write(Q.id,`${g.screenCommand}\r`)),Q},hl=async g=>{const B=Mu(Wp(g),O,Ti);if(B.kind==="unavailable"){n(Q=>dp(Q,d,g.sessionId)),o(B.reason);return}o(`Reconnecting ${g.name}…`),await Zn(B,{replacingPane:!0})&&n(Q=>dp(Q,d,g.sessionId))},ul=g=>{o(`Connecting to ${g.alias}…`),Xn(g.hostName??g.alias,g.alias.slice(0,48))},dl=async(g,B,G)=>{try{const Q=Ee();if(!Q)return null;o(`Attaching to ${g} on ${G.alias}…`);const ye=(await Q.buildRemoteScreenAttach?.(G,B))?.args,Ce=Array.isArray(ye)?ye.indexOf("--"):-1,Re=Ce>0?ye[Ce-1]:G.hostName??G.alias,ot={...await Q.createSshSession({target:Re,name:g}),screenName:B,persistence:"screen",backend:"screen"};K(Rt=>Rt.some(oi=>oi.id===ot.id)?Rt.map(oi=>oi.id===ot.id?ot:oi):[...Rt,ot]),ki(ot),await ri(ot),await Q.attachSession(ot.id);const mi=ye&&Ce>0?ye.slice(Ce+1).join(" "):`screen -x ${B}`;return await Ja(Q,ot.id),Q.write(ot.id,`${mi}\r`),await vr(),o(`Connected to ${g} on ${G.alias}`),ot}catch(Q){return o(Q instanceof Error?Q.message:String(Q)),null}},Ja=(g,B)=>new Promise(G=>{let Q=!1,me="",ye,Ce;const Re=()=>{Q||(Q=!0,clearTimeout(ye),clearTimeout(Ze),Ce?.(),G())},Ze=setTimeout(Re,bS);Ce=g.onData((ot,mi)=>{if(ot===B){if(me=(me+mi).slice(-512),lp(me)){Re();return}clearTimeout(ye),ye=setTimeout(Re,vS)}})}),Kc=Z.useCallback((g,B)=>{if(!r.ai.recordCommands)return;const G=cS(B.command);if(G){o(`Command not remembered — it looks like it carries a credential (${G}).`);return}const Q=Ee();if(!Q?.recordCommand)return;const me=O.find(ye=>ye.id===g);Q.recordCommand({command:B.command,...me?.cwd?{cwd:me.cwd}:{},...me?.host?{host:me.host}:{},...me?.kind?{kind:me.kind}:{},...B.exitCode===void 0?{}:{exitCode:B.exitCode}}).then(ye=>{ye&&ze(Ce=>[...Ce.filter(Re=>Re.id!==ye.id),ye])}).catch(()=>{})},[r.ai.recordCommands,O]),Vc=Z.useMemo(()=>{const g=[...Os.current.values()];return{entries:Ue.length,panesReporting:g.filter(B=>B.hasMarks()).length,panesOpen:g.length}},[Ue,Ri,O]),Yc=()=>{ut(""),Oe(0),Te(!0),Ee()?.listCommandHistory?.().then(ze).catch(()=>{})},Qn=Z.useMemo(()=>{if(!et)return[];const g=O.find(B=>B.id===(fi??rt?.id));return pS(Ue,{query:at,...g?.cwd?{cwd:g.cwd}:{},...g?.host?{host:g.host}:{},now:Date.now(),limit:40})},[et,Ue,at,O,fi,rt?.id]),Jt=g=>{const B=fi??rt?.id;if(Te(!1),!B){o("No terminal selected for the command");return}Ee()?.write(B,g.entry.command),Ee()?.pickCommand?.(g.entry.id).catch(()=>{}),o(`On the prompt: ${g.entry.command}`),st(B)},on=async()=>{await Ee()?.clearCommandHistory?.().catch(()=>{}),ze([]),o("Remembered commands forgotten.")},eo=()=>{if(!$p(r.ai)){_s(!0),o("Set an AI endpoint and model in Settings first.");return}Dt(zu(rt?.id??fi))},fl=async g=>{const B=Ee(),G=Ke;if(!B?.requestAiCommand||!G)return;const Q=G.sessionId,me=Q?O.find(Re=>Re.id===Q):void 0,ye=r.ai.includeOutput&&!!Q,Ce=ye&&Q?gS(ur.current.get(Q)?.()??"",r.ai.outputChars):"";Dt({phase:"thinking",sessionId:Q,prompt:g,usedOutput:ye&&!!Ce});try{const Re=await B.requestAiCommand({baseUrl:r.ai.baseUrl,model:r.ai.model},{prompt:g,...Q?{sessionId:Q}:{},context:{...me?.backend?{shell:_m(me.backend)}:{},...me?.cwd?{cwd:me.cwd}:{},...me?.host?{host:me.host}:{},...me?.kind?{kind:me.kind}:{},...Ce?{output:Ce}:{}}}),Ze=ye&&!!Ce;if(mS(r.ai,Ze,Re.command)&&Q){B.write(Q,`${Re.command}\r`),Dt(null),o(`Ran suggestion: ${Re.command}`);return}Dt({phase:"reviewing",sessionId:Q,prompt:g,usedOutput:Ze,suggestion:Re})}catch(Re){Dt({phase:"failed",sessionId:Q,prompt:g,message:ii(Re)})}},_l=()=>{if(Ke?.phase!=="reviewing")return;const{sessionId:g,suggestion:B}=Ke;Dt(null),!(!g||!B.command)&&(Ee()?.write(g,`${B.command}\r`),o(`Sent: ${B.command}`),st(g))},pl=async()=>{const g=Ee();if(g?.listAiModels)try{Na(await g.listAiModels(r.ai.baseUrl))}catch(B){Na([]),o(ii(B))}},to=async()=>{const g=Ee();if(!g?.testAiEndpoint)return;Bn({status:"testing",message:null});const B=await g.testAiEndpoint({baseUrl:r.ai.baseUrl,model:r.ai.model});Bn({status:"idle",ok:B.ok,message:B.message})},ml=Z.useMemo(()=>{const g=new Set;for(const B of O)B.kind==="ssh"&&B.host&&g.add(B.host);for(const B of Ti)g.add(B.hostName??B.alias);return[...g]},[O,Ti]),vs=()=>{j(g=>g||(rt?.kind==="ssh"?rt.host:ml[0])||""),Ne(!1),Mt("forward")},Jn=async g=>{const B=Ee();if(!B?.openForward)return;const G=T0(g,Y);if(G){o(G);return}z("ports"),re(Q=>qo(Q,{...g,status:"connecting"}));try{const Q=await B.openForward(g);re(me=>qo(me,Q)),o(`Sharing ${Sp(Q)}`)}catch(Q){const me=ii(Q);re(ye=>qo(ye,{...g,status:"error",message:me})),o(me)}},ln=async g=>{g.preventDefault();const B=Number(ge),G=Number(q||ge);if([B,G].some(me=>!Number.isInteger(me)||me<1||me>65535)){o("A port must be a whole number between 1 and 65535.");return}Mt(null),await Jn({id:`forward:${crypto.randomUUID()}`,target:W.trim(),direction:F,bind:te,listenPort:B,destinationPort:G,..._e.trim()?{destinationHost:_e.trim()}:{}})},io=async g=>{const B=Ee();re(G=>G.filter(Q=>Q.id!==g.id)),o(`Stopped sharing ${Rn(g)}`);try{await B?.closeForward?.(g.id)}catch{}},so=g=>lt?.view.browsers?.[g],ss=g=>!!so(g)?.open,Sr=g=>so(g)?.ratio??Jp,ea=(g,B)=>{Qt(G=>({browsers:{...G.browsers,[g]:{open:!1,...G.browsers?.[g],...B}}}))},ro=g=>{const B=!ss(g);ea(g,{open:B}),B||es(G=>({...G,[g]:""}))},bs=g=>dr[g.id]||Xv(g,gl(g)),gl=g=>g.kind==="ssh"?Mi[g.id]:g.wslDistribution?In[g.wslDistribution]:void 0,vl=(g,B)=>{const G=Ee();if(!G)return;const Q=Kv(g);if(!Q){o(`ZeroG does not know how ${g.name} quotes a path, so it will not type one.`);return}const me=Ou(g,B);if(!me){o(`That directory is outside what ${g.name} can reach.`);return}if(!bl(g)){o(`${g.name} is running something, so its directory was left alone.`);return}const ye=e0(Q,me);if("refused"in ye){o(ye.refused);return}G.write(g.id,ye.command+"\r"),es(Ce=>({...Ce,[g.id]:B})),o(`${g.name}: ${ye.command}`),st(g.id)},bl=g=>{const B=Os.current.get(g.id);if(B?.hasMarks())return B.atPrompt();const G=ur.current.get(g.id);if(!G)return!1;const Q=G().trimEnd().split(`
|
|
148
|
+
`);return lp(Q[Q.length-1]??"")},no=Z.useRef(new Map);Z.useEffect(()=>{const g=[];for(const B of O)no.current.has(B.id)&&no.current.get(B.id)!==B.cwd&&g.push(B.id),no.current.set(B.id,B.cwd);g.length&&es(B=>{const G={...B};let Q=!1;for(const me of g)G[me]&&(delete G[me],Q=!0);return Q?G:B})},[O]),Z.useEffect(()=>{for(const g of O){if(!ss(g.id))continue;const B=!g.cwd||g.cwd.startsWith("~");if(g.kind==="ssh"){Mi[g.id]||tn(g);continue}!g.wslDistribution||!B||In[g.wslDistribution]||$a(g.wslDistribution)}},[O,lt?.view.browsers,In,Mi,$a,tn]);const Ns=Z.useRef(null),[Xc,ta]=Z.useState(null),[ia,sa]=Z.useState(null),[Oi,cn]=Z.useState(null),Yt=Z.useRef(!1),yr=()=>[...document.querySelectorAll(".workspace-tab-slot")].map(g=>{const B=g.getBoundingClientRect();return{id:g.dataset.workspaceId??"",left:B.left,width:B.width}}),ao=(g,B)=>{B.button===0&&(B.target.closest(".workspace-tab-close")||(Ns.current={id:g.id,pointerId:B.pointerId,startX:B.clientX,dragging:!1,original:P},B.currentTarget.setPointerCapture?.(B.pointerId)))},ra=g=>{const B=Ns.current;if(!B||B.pointerId!==g.pointerId)return;if(!B.dragging){if(!Qb(B.startX,g.clientX))return;B.dragging=!0,Yt.current=!0,ta(B.id)}const G=yr();if(G.findIndex(ye=>ye.id===B.id)<0)return;const me=Jb(G,g.clientX);n(ye=>{const Ce=Hu(ye,B.id);return Ce<0?ye:Up(ye,Ce,me)})},na=g=>{const B=Ns.current;!B||B.pointerId!==g.pointerId||(g.currentTarget.releasePointerCapture?.(g.pointerId),Ns.current=null,ta(null),B.dragging&&window.setTimeout(()=>{Yt.current=!1},0))},hn=()=>{const g=Ns.current;g&&(Ns.current=null,ta(null),g.dragging&&n(g.original),Yt.current=!1)},Hs=g=>{const B=Hu(P,g.id),G=P.length-1,Q=me=>n(ye=>Up(ye,Hu(ye,g.id),me));return[{label:"Rename…",icon:"pencil",onSelect:()=>{cn(g.id),xi(g.name),Mt("rename")}},{label:"Duplicate",icon:"copy",hint:"Copies the layout, and each SSH pane as one to reconnect",onSelect:()=>Sl(g)},{label:"Move left",icon:"chevron-left",disabled:B<=0,onSelect:()=>Q(B-1)},{label:"Move right",icon:"chevron-right",disabled:B<0||B>=G,onSelect:()=>Q(B+1)},{label:"Close workspace",icon:"x",danger:!0,disabled:P.length<2,hint:P.length<2?"The last workspace cannot be closed":"Its terminals keep running",onSelect:()=>ei(g.id)}]},Sl=g=>{const B=yc(P),G=Bv(P,g.id,O,B);if(!G.created)return;n(G.workspaces),m(G.created.id),ms(null);const Q=[`Workspace “${B}” copies ${g.name}`];G.copied&&Q.push(`${G.copied} SSH ${G.copied===1?"pane":"panes"} to reconnect`),G.skipped&&Q.push(`${G.skipped} local ${G.skipped===1?"pane":"panes"} not copied`),o(Q.join(" · "))},aa=async g=>{g.preventDefault();const B=Oi,G=Fi.trim();if(Mt(null),cn(null),!B||!Iu(G))return;const Q=P.find(me=>me.id===B)?.name;G!==Q&&(n(me=>up(me,B,G)),o(`Workspace “${Q}” is now “${G}”`))},Ss=()=>{xi(yc(P)),Mt("workspace")},yl=g=>{if(g===d)return;const B=P.find(G=>G.id===g);B&&(ds(!1),m(g),o(`Workspace “${B.name}”`))},ei=g=>{const B=P.find(me=>me.id===g),G=Nv(P,g,d);if(G.workspaces===P)return;ds(!1),n(G.workspaces),m(G.activeWorkspaceId);const Q=G.releasedSessionIds.length;o(Q?`Closed workspace “${B?.name}” · ${Q} session${Q===1?"":"s"} still running`:`Closed workspace “${B?.name}”`)},oo=()=>{lt&&(Yo(lt.name),ds(!0))},qi=()=>{if(ds(!1),!lt)return;const g=nr.trim();!Iu(g)||g===lt.name||(n(B=>up(B,lt.id,g)),o(`Workspace renamed to “${g}”`))},zs=(g,B)=>{Oa(OS(lt?.name??"term",yt)),Xo(bm(r.sessions.defaultBackend,hr)),Qr(r.sessions.defaultWslDistribution),On.current=!1,B?.sshTarget!==void 0&&(Nt(B.sshTarget),Xr(Wu(or,B.sshTarget)??"")),Mt(g)},Us=()=>zs("local"),Is=()=>Y.length?c.jsx("div",{className:"session-list",children:A0(Y).map(g=>c.jsxs(Tn.Fragment,{children:[c.jsx("div",{className:"session-group-label",children:g.host}),g.forwards.map(B=>c.jsxs("div",{className:`session-row forward-row ${B.status==="idle"?"session-ghosted":""}`,children:[c.jsx("span",{className:`status-dot ${R0(B)}`}),c.jsx("button",{type:"button",className:"forward-open",onClick:()=>B.status==="idle"||B.status==="error"?void Jn(B):void 0,title:B.status==="idle"||B.status==="error"?`Reconnect ${Rn(B)}`:Sp(B),children:c.jsxs("span",{className:"session-copy",children:[c.jsx("b",{children:Rn(B)}),c.jsxs("small",{children:[B.direction==="local"?"←":"→"," ",B.destinationHost||"localhost",":",B.destinationPort,B.status==="connecting"?" · connecting…":"",B.status==="idle"?" · not connected":"",B.status==="error"?` · ${B.message??"failed"}`:""]})]})}),L0(B)&&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:()=>{io(B)},title:`Stop sharing ${Rn(B)}`,"aria-label":`Stop sharing ${Rn(B)}`,children:"×"})]},B.id))]},g.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:vs,children:"Share a port"})]})}),lo=()=>{const g=us((rt?.kind==="ssh"?rt.host:"")||(fi?O.find(Ce=>Ce.id===fi)?.host:"")||""),B=g?Qo.filter(Ce=>us(Ce.connection.hostName??"")===g||Ce.connection.alias===g).reduce((Ce,Re)=>{const Ze=Re.connection.hostName||Re.connection.alias;return(Ce[Ze]=Ce[Ze]||[]).push(Re),Ce},{}):{},G=O.filter(Ce=>Ce.persistence==="screen"&&!yt.some(Re=>Re.id===Ce.id)),Q=Object.keys(B).length>0,me=G.length>0;if(!Q&&!me)return c.jsxs("div",{className:"session-empty",children:[c.jsx("b",{children:"No screens"}),c.jsx("small",{children:g?"No remote screens found for this host.":"Open a remote session to discover screens, or start a local screen."})]});const ye=[];if(Q)for(const[Ce,Re]of Object.entries(B)){const Ze=Re,ot=c.jsx("div",{className:"session-group-label",children:Ce},`${Ce}-label`),mi=Ze.map(({session:Rt})=>{const Ki=Ze.find(oi=>oi.session.id===Rt.id)?.connection;return c.jsx(wc,{session:Rt,ghosted:!0,onClick:async()=>{if(!Ki)return;o(`Attaching ${Rt.name}…`);const oi=Ee();if(oi)try{const fn=(await oi.buildRemoteScreenAttach?.(Ki,Rt.screenName??Rt.name))?.args,_n=Array.isArray(fn)?fn.indexOf("--"):-1,Ks=_n>0?fn[_n-1]:Ki.hostName??Ki.alias,gi={...await oi.createSshSession({target:Ks,name:Rt.name}),screenName:Rt.screenName??Rt.name,persistence:"screen",backend:"screen"};K(ws=>ws.some(Er=>Er.id===gi.id)?ws.map(Er=>Er.id===gi.id?gi:Er):[...ws,gi]),ki(gi),await ri(gi),await oi.attachSession(gi.id);const Rl=fn&&_n>0?fn.slice(_n+1).join(" "):`screen -x ${Rt.screenName??Rt.name}`;await Ja(oi,gi.id),oi.write(gi.id,`${Rl}\r`),await vr(),o(`Connected to ${Rt.name}`)}catch(dn){o(dn instanceof Error?dn.message:String(dn))}}},Rt.id)});ye.push(ot,...mi)}return me&&!Q&&(ye.push(c.jsx("div",{className:"session-group-label",children:"local"},"local-label")),G.forEach(Ce=>{ye.push(c.jsx(wc,{session:Ce,ghosted:!0,onClick:()=>{ki(Ce),ri(Ce),o(`Reconnecting to ${Ce.name}…`)}},Ce.id))})),c.jsx(c.Fragment,{children:ye})},Cl=At==="split-v"?"pane-grid split-v":At==="split-h"?"pane-grid split-h":At==="grid"?"pane-grid grid":"pane-grid",oa=!Gt&&(At==="split-v"||At==="grid"),co=!Gt&&(At==="split-h"||At==="grid"),Ht=r.sessions.splitColumnRatio,_i=r.sessions.splitRowRatio,Ps=Z.useRef(null),la=Gt?void 0:{...oa?{gridTemplateColumns:`${Ht}fr ${1-Ht}fr`}:{},...co?{gridTemplateRows:`${_i}fr ${1-_i}fr`}:{}},Cr=(g,B)=>{const G=Ps.current?.getBoundingClientRect();if(!G)return;const Q=g==="column"?(B.clientX-G.left)/G.width:(B.clientY-G.top)/G.height;Number.isFinite(Q)&&Jo("sessions",g==="column"?{splitColumnRatio:Q}:{splitRowRatio:Q})},ni=(g,B)=>{const Q=(g==="column"?Ht:_i)+B*.02;Di("sessions",g==="column"?{splitColumnRatio:Q}:{splitRowRatio:Q})},ai=g=>{Di("sessions",g==="column"?{splitColumnRatio:Ie.sessions.splitColumnRatio}:{splitRowRatio:Ie.sessions.splitRowRatio})},Bi={layout:At,maximized:!!Gt,columnRatio:Ht,rowRatio:_i,sessionCount:yt.length,lastSplit:di.lastSplit},ji=Z.useRef(null),Gi=g=>{const B=ji.current?.getBoundingClientRect();B&&Jo("sessions",{sidebarWidth:Math.round(g.clientX-B.left)})},rs=g=>{Qt(B=>({focusedSessionId:g,maximizedSessionId:B.maximizedSessionId===g?null:g}))},ho=g=>{if(g.kind==="restore"){js(null);return}if(g.kind==="show"){js(null),qn(g.layout);return}if(g.kind==="reset-splits"){Di("sessions",g.ratios);return}const B=fi??rt?.id??yt[0]?.id;B&&js(B)},ca=g=>{if(!Gt||yt.length<2)return;const G=(yt.findIndex(me=>me.id===Gt)+g+yt.length)%yt.length,Q=yt[G];gr(Q.id),ms(Q),js(Q.id)},ha=()=>(jn.current??=new Xb({createWorker:()=>new Worker(new URL(""+new URL("voice-worker-DvImI8sL.js",import.meta.url).href,import.meta.url),{type:"module"}),resolveApiKey:async()=>Hn.current??await window.zerog?.readSpeechApiKey()??null}),jn.current),wl=async g=>{const B=Ee();if(B?.saveSpeechApiKey){ps(G=>({...G,status:"saving",error:null,notice:null}));try{const G=await B.saveSpeechApiKey(g);Hn.current=null,ps({status:"idle",stored:G.stored,encryptionAvailable:G.encryptionAvailable,sessionOnly:!1,notice:G.stored?"Key saved, encrypted by this system.":"Key cleared."})}catch(G){Hn.current=g,ps(Q=>({...Q,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})),o(G instanceof Error?G.message:String(G))}}},Ft=async()=>{const g=Ee();if(Hn.current=null,!g?.clearSpeechApiKey){ps(B=>({...B,stored:!1,sessionOnly:!1,notice:"Key cleared.",error:null}));return}try{const B=await g.clearSpeechApiKey();ps(G=>({...G,status:"idle",stored:B.stored,sessionOnly:!1,notice:"Key cleared.",error:null}))}catch(B){ps(G=>({...G,status:"idle",sessionOnly:!1,error:B instanceof Error?B.message:String(B)}))}},gt=async g=>{const B=Ee();if(B?.saveAiApiKey){lr(G=>({...G,status:"saving",error:null,notice:null}));try{const G=await B.saveAiApiKey(g);lr({status:"idle",stored:G.stored,encryptionAvailable:G.encryptionAvailable,sessionOnly:!1,notice:G.stored?"Key saved, encrypted by this system.":"Key cleared."})}catch(G){lr(Q=>({...Q,status:"idle",error:ii(G)}))}}},Ve=async()=>{const g=Ee();if(g?.clearAiApiKey)try{const B=await g.clearAiApiKey();lr(G=>({...G,status:"idle",stored:B.stored,notice:"Key cleared.",error:null}))}catch(B){lr(G=>({...G,status:"idle",error:ii(B)}))}},ys=g=>{if(g.kind==="notice"){o(g.message);return}g.progress!==null&&o(`Loading speech model… ${Math.round(g.progress)}%`)},pi=()=>{const g=fs.current;window.clearTimeout(Ai.current),St.current?.cancel(),St.current=null,fs.current=null,Ei({status:"idle",sessionId:null}),st(g)},$s=()=>{const g=ci?.sessionId;Ls(null),st(g)},ns=async()=>{const g=St.current,B=fs.current;if(!g||!B)return;window.clearTimeout(Ai.current),St.current=null,Ei({status:"transcribing",sessionId:B}),o("Transcribing…");const G=await g.stop();if(!G||np(G,r.speech.silenceThreshold)){fs.current=null,Ei({status:"idle",sessionId:null}),o("Voice: no speech detected — lower the silence threshold in Settings if this is wrong"),st(B);return}try{const Q=await ha().transcribe(G,r.speech,ys);if(fs.current=null,Ei({status:"idle",sessionId:null}),!Q.text){o("Voice: nothing transcribed"),st(B);return}if(r.ai.voiceInsert==="review"){Ls({sessionId:B,text:Q.text}),o(`Voice: review "${Q.text}"`);return}Ee()?.write(B,Q.text),o(`Voice: "${Q.text}"`),st(B)}catch(Q){fs.current=null,Ei({status:"idle",sessionId:null}),o(`Voice error: ${Q instanceof Error?Q.message:String(Q)}`),st(B)}},xl=async g=>{if(Vt.status==="listening"&&Vt.sessionId===g.id){await ns();return}if(Vt.status!=="idle")return;if(Nn.status!=="idle"){o("The speech test in Settings is using the microphone");return}const B=new ap;try{await B.start()}catch(G){o(`Microphone unavailable: ${G instanceof Error?G.message:String(G)}`);return}St.current=B,fs.current=g.id,Ei({status:"listening",sessionId:g.id}),st(g.id),window.clearTimeout(Ai.current),Ai.current=window.setTimeout(()=>{ns()},r.speech.maxUtteranceSeconds*1e3),o(`Listening on ${g.name}… click the mic again to transcribe, Esc to discard`)},El=g=>{const B=Ee();if(!B)return;const G=Rp(r.ai);B.write(g.id,`${G}\r`),o(`Sent "${G}" to ${g.name}`),st(g.id)},wr=g=>{const B=Ee();if(!B)return;const G=Bu(r.ai);B.write(g.id,`${G}\r`),o(`Sent "${G}" to ${g.name}`),st(g.id)},Fs=(g,B)=>{const G=Ee();G&&(G.write(g.id,`${B.command}
|
|
149
|
+
`),o(`Sent "${B.command}" to ${g.name}`),st(g.id))},un=g=>b.agents.find(B=>B.sessionId===g),xr=g=>{const B=b.links.filter(G=>G.a===g||G.b===g);return B.find(G=>G.status!=="broken")??B[0]},uo=async g=>{const B=Ee();if(B)try{await B.launchLinkedAgent(g.id,Bu(r.ai)),o(`Started a linked agent in ${g.name}`),st(g.id)}catch(G){o(ii(G))}},Ws=async(g,B)=>{p(null);try{await Ee()?.linkPanes(g.id,B.id),o(`Linked ${g.name} with ${B.name}. Prompt either agent; its reply goes to the other.`)}catch(G){o(ii(G))}},as=(g,B)=>{Ee()?.relayLastReply(g.id,B).then(()=>o("Relayed the last reply")).catch(G=>o(ii(G)))},Cs=g=>{Ee()?.unlinkPanes(g.id).then(()=>o("Link removed")).catch(B=>o(ii(B)))},os=g=>{Ee()?.resumePaneLink(g.id).then(()=>o("Link resumed")).catch(B=>o(ii(B)))},fo=g=>{const B=un(g.id),G=xr(g.id),Q=!!(G&&G.status!=="broken"),me=g.kind==="local"&&g.backend!=="wsl",ye=b.agents.filter(Re=>Re.sessionId!==g.id&&!Re.linkId);let Ce=me?`Start a linked agent: runs "${Kn}" with ZeroG hooks so its replies can be relayed to another pane`:"Linked agents run in local panes only (not SSH or WSL)";return B&&!Q&&(Ce="Link this agent with another linked agent"),Q&&(Ce="This pane is linked"),c.jsxs("span",{className:"pane-link-wrap",children:[c.jsx("button",{type:"button",className:Q?"pane-link active":B?"pane-link ready":"pane-link",onClick:()=>{B?p(A===g.id?null:g.id):uo(g)},disabled:Q||!B&&!me,title:Ce,"aria-label":B?`Link ${g.name} with another agent`:`Start a linked agent in ${g.name}`,"aria-haspopup":B?"menu":void 0,"aria-expanded":B?A===g.id:void 0,children:c.jsx(ke,{name:"link"})}),A===g.id&&B&&!Q&&c.jsxs("div",{className:"pane-link-menu",role:"menu",children:[ye.length===0&&c.jsx("div",{className:"pane-link-empty",children:"Start a linked agent in another pane first."}),ye.map(Re=>{const Ze=O.find(ot=>ot.id===Re.sessionId);return c.jsxs("button",{type:"button",role:"menuitem",disabled:!Ze,onClick:()=>Ze&&void Ws(g,Ze),children:["Link with ",Re.label]},Re.sessionId)})]})]})},_o=g=>{const B=xr(g.id);if(!B)return null;const G=B.a===g.id?B.b:B.a,Q=O.find(Re=>Re.id===G)?.name??"another pane",me=un(g.id)?.needsAttention,ye=B.waitingOn?O.find(Re=>Re.id===B.waitingOn)?.name??"the other pane":null;let Ce=`Linked with ${Q} · ${B.turns}/${B.cap} relays`;return B.status==="active"&&(Ce+=ye?` · waiting for ${ye} to reply`:" · relays start when either agent finishes a reply"),B.status==="paused"&&(Ce=`Link paused: ${B.reason??"stopped"}`),B.status==="broken"&&(Ce=`Link ended: ${B.reason??"stopped"}`),me&&B.status==="active"&&(Ce+=" · waiting for you"),c.jsxs("div",{className:`pane-link-bar ${B.status}`,role:"status",children:[c.jsx(ke,{name:"link"}),c.jsx("span",{className:"pane-link-text",children:Ce}),B.status!=="broken"&&!B.waitingOn&&un(g.id)?.hasReply&&c.jsx("button",{type:"button",onClick:()=>as(B,g.id),title:"Send this agent's most recent reply to the other pane now",children:"Send last reply"}),B.status==="paused"&&c.jsx("button",{type:"button",onClick:()=>os(B),children:"Resume"}),c.jsx("button",{type:"button",onClick:()=>Cs(B),children:B.status==="broken"?"Dismiss":"Break link"})]})},qs=async()=>{const g=Ms.current;if(!g)return;window.clearTimeout(hi.current),Ms.current=null,Li({status:"transcribing",message:"Transcribing…",transcript:null,error:null});const B=await g.stop();if(!B){Li({status:"idle",error:"Nothing was recorded."});return}const G=Kp(B),Q=np(B,r.speech.silenceThreshold);try{const me=await ha().transcribe(B,r.speech,ye=>{Li(Ce=>({...Ce,message:ye.kind==="notice"?ye.message:ye.progress!==null?`Loading speech model… ${Math.round(ye.progress)}%`:"Loading speech model…"}))});Li({status:"idle",transcript:me.text,elapsedMs:me.elapsedMs,level:G,message:Q?"Below the silence threshold — a real recording at this level would have been discarded.":me.engine==="server"?"Transcribed by the server.":"Transcribed by the built-in engine.",error:null})}catch(me){Li({status:"idle",level:G,error:me instanceof Error?me.message:String(me)})}},ua=async()=>{if(Nn.status==="recording"){await qs();return}if(Nn.status==="transcribing")return;if(Vt.status!=="idle"){Li({status:"idle",error:"A terminal pane is recording — stop that first."});return}const g=new ap;try{await g.start()}catch(B){Li({status:"idle",error:`Microphone unavailable: ${B instanceof Error?B.message:String(B)}`});return}Ms.current=g,Li({status:"recording",message:"Listening… say a command, then stop.",transcript:null,error:null}),window.clearTimeout(hi.current),hi.current=window.setTimeout(()=>{qs()},r.speech.maxUtteranceSeconds*1e3)};Z.useEffect(()=>()=>{window.clearTimeout(Ai.current),window.clearTimeout(hi.current),St.current?.cancel(),Ms.current?.cancel(),jn.current?.dispose()},[]);const Gs=async g=>{const B=he.current.get(g.id);if(B&&!B())return;Vt.sessionId===g.id&&pi(),fr.forget(g.id);const G=yt.filter(me=>me.id!==g.id);n(me=>{const ye=Tv(me,g.id);return hp(ye,d,Ce=>({activeSessionId:Ce.activeSessionId??G[0]?.id,focusedSessionId:Ce.focusedSessionId??G[0]?.id,layout:ku(G.length)}))});const Q=Ee();if(Q)try{await Q.closeSession(g.id)}catch(me){o(me instanceof Error?me.message:String(me));return}o(g.persistence==="screen"?`Closed ${g.name} · screen session survives`:g.kind==="ssh"?`Closed ${g.name} · SSH connection ended`:`Closed ${g.name} · process ended`),vr()};return c.jsxs("main",{className:`app-shell ${y?"drawer-collapsed":""}`,children:[c.jsxs("header",{className:"window-bar",children:[c.jsxs("div",{className:"window-brand",title:hm(mr),children:[c.jsx("span",{className:"brand-mark",children:"ZG"}),c.jsx("span",{className:"brand-name",children:"ZeroG"}),mr&&c.jsx("span",{className:"brand-version",children:mr})]}),c.jsx("div",{className:"workspace-tabs",children:P.map((g,B)=>{const G=P.length>1,Q=jv(g,O);return c.jsxs("span",{className:`workspace-tab-slot ${G?"closable":""} ${Xc===g.id?"dragging":""}`,"data-workspace-id":g.id,children:[c.jsxs("button",{type:"button",className:`workspace-tab ${g.id===lt?.id?"active":""}`,title:`Switch to ${g.name}${B<9?` (Ctrl+Shift+${B+1})`:""} · drag to reorder`,onPointerDown:me=>ao(g,me),onContextMenu:me=>{me.preventDefault(),hn(),sa({id:g.id,at:{x:me.clientX,y:me.clientY}})},onPointerMove:ra,onPointerUp:na,onPointerCancel:hn,onClick:()=>{Yt.current||yl(g.id)},children:[c.jsx("span",{className:`status-dot ${Q==="empty"?"":Q}`}),g.name,c.jsx("span",{className:"tab-meta",children:Du(g)})]}),G&&c.jsx("button",{type:"button",className:"workspace-tab-close",title:`Close ${g.name} · its terminals keep running`,"aria-label":`Close workspace ${g.name}`,onClick:()=>ei(g.id),children:"×"})]},g.id)})}),c.jsxs("div",{className:"window-actions",children:[a.state==="connected"&&c.jsxs("button",{type:"button",className:"bar-button mcp-stop-button",onClick:()=>{Ee()?.revokeMcpControl?.(),o("AI control revoked · panes remain available manually")},title:"Stop AI control and take over manually","aria-label":"Stop AI control and take over manually",children:[c.jsx(ke,{name:"stop"}),c.jsx("span",{children:"Take over"})]}),f.length>0&&c.jsx("span",{className:"mcp-pending-count",title:"Commands waiting for explicit approval",children:f.map(g=>c.jsxs("span",{className:"mcp-pending-request",children:[c.jsx("span",{title:g.displayCommand,children:g.displayCommand}),c.jsx("button",{type:"button",className:"bar-button",onClick:()=>{Ee()?.approveMcpExecution?.(g.requestId)},"aria-label":`Approve command ${g.displayCommand}`,children:"Approve"}),c.jsx("button",{type:"button",className:"bar-button",onClick:()=>{Ee()?.rejectMcpExecution?.(g.requestId)},"aria-label":`Reject command ${g.displayCommand}`,children:"Reject"})]},g.requestId))}),c.jsxs("button",{type:"button",className:"bar-button",onClick:()=>$t(g=>!g),title:`Session overview (${wi("toggle-overview",je)})`,children:[c.jsx(ke,{name:"grid"}),c.jsx("span",{children:"Overview"})]}),c.jsxs("button",{type:"button",className:"bar-button",onClick:Ss,title:`New workspace (${wi("new-workspace",je)})`,children:[c.jsx(ke,{name:"plus"}),c.jsx("span",{children:"Workspace"})]}),c.jsxs("button",{type:"button",className:"bar-button",onClick:eo,title:$p(r.ai)?`Ask for a command (${wi("ask-ai",je)})`:"Set an AI endpoint in Settings first",children:[c.jsx(ke,{name:"spark"}),c.jsx("span",{children:"Suggest"})]}),c.jsx("button",{type:"button",className:"bar-button theme-button",onClick:()=>Di("appearance",{theme:H0(E,M.current)}),title:`Switch to ${Kr(E)?"a dark":"the light"} theme`,"aria-label":`Switch to ${Kr(E)?"a dark":"the light"} theme`,"aria-pressed":Kr(E),children:c.jsx(ke,{name:Kr(E)?"moon":"sun"})}),c.jsx("button",{type:"button",className:Lt?"bar-button active":"bar-button",onClick:()=>qt(g=>!g),title:`Features and keyboard shortcuts (${wi("toggle-help",je)})`,"aria-label":"Help","aria-pressed":Lt,children:c.jsx(ke,{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:`${y?"Show":"Hide"} sessions sidebar (${wi("toggle-sidebar",je)})`,onClick:()=>R(g=>!g),children:c.jsx(ke,{name:y?"panel-left-open":"panel-left"})}),c.jsx("button",{type:"button",className:`rail-button ${!y&&H==="sessions"?"active":""}`,title:"Sessions",onClick:()=>{z("sessions"),R(!1)},children:c.jsx(ke,{name:"sessions"})}),c.jsx("button",{type:"button",className:"rail-button",onClick:()=>$t(!0),title:"Overview",children:c.jsx(ke,{name:"grid"})}),c.jsx("button",{type:"button",className:`rail-button ${!y&&H==="ports"?"active":""}`,title:"Shared ports","aria-label":"Shared ports",onClick:()=>{z("ports"),R(!1)},children:c.jsx(ke,{name:"ports"})}),c.jsx("span",{className:"rail-spacer"}),c.jsx("button",{type:"button",className:"rail-button",onClick:vs,title:"Share a port over SSH","aria-label":"Share a port",children:c.jsx(ke,{name:"port-plus"})}),c.jsx("button",{type:"button",className:"rail-button",onClick:Us,title:`New local terminal (${wi("new-terminal",je)})`,"aria-label":"New local terminal",children:c.jsx(ke,{name:"terminal"})}),c.jsx("button",{type:"button",className:"rail-button",onClick:()=>zs("ssh"),title:"Connect SSH",children:c.jsx(ke,{name:"ssh"})}),c.jsx("button",{type:"button",className:`rail-button ${Ri?"active":""}`,title:`Settings (${wi("toggle-settings",je)})`,"aria-label":"Settings","aria-expanded":Ri,onClick:()=>_s(g=>!g),children:c.jsx(ke,{name:"settings"})})]}),!y&&c.jsxs("aside",{className:"session-drawer",ref:ji,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:H==="ports"?"SHARED PORTS":"WORKSPACE"}),H==="ports"?c.jsx("h1",{children:"Ports"}):Zi&<?c.jsx("input",{className:"workspace-rename",autoFocus:!0,"aria-label":"Workspace name",value:nr,pattern:Ec,onChange:g=>Yo(g.target.value),onBlur:qi,onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),g.stopPropagation(),qi()),g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),ds(!1))}}):c.jsx("h1",{onDoubleClick:oo,title:lt?"Double-click to rename this workspace":void 0,children:lt?.name??"Sessions"})]}),c.jsxs("div",{className:"drawer-head-actions",children:[c.jsx("button",{type:"button",className:"square-button",onClick:()=>R(!0),title:"Hide sessions sidebar",children:c.jsx(ke,{name:"panel-left"})}),c.jsx("button",{type:"button",className:"square-button history-button",onClick:()=>We(g=>!g),title:"Session history","aria-label":"Open session history","aria-expanded":Ae,children:c.jsx(ke,{name:"history"})}),c.jsx("button",{type:"button",className:"square-button",onClick:Ss,title:`New workspace (${wi("new-workspace",je)})`,"aria-label":"New workspace",children:c.jsx(ke,{name:"plus"})})]})]}),H==="ports"?Is():c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"drawer-tools",role:"tablist","aria-label":"Session inventory",children:["terminals","screens","connections"].map(g=>{const B={terminals:"Terminals",screens:"Screens",connections:"Connections"},G=g==="terminals"?yt.length:g==="screens"?O.filter(Q=>(Q.persistence==="screen"||Q.screenName)&&!yt.some(me=>me.id===Q.id)).length+Qo.length:O.filter(Q=>Q.kind==="ssh").length;return c.jsxs("button",{type:"button",role:"tab","aria-selected":k===g,className:`drawer-tool ${k===g?"active":""}`,onClick:()=>U(g),children:[B[g]," ",c.jsx("span",{children:G})]},g)})}),c.jsx("div",{className:"session-list",role:"tabpanel",children:wt?c.jsxs("div",{className:"session-empty",children:[c.jsx("b",{children:"Loading sessions…"}),c.jsx("small",{children:"Checking available terminals and durable sessions."})]}):Pt?c.jsxs("div",{className:"session-empty session-error",children:[c.jsx("b",{children:"Session inventory unavailable"}),c.jsx("small",{children:Pt}),c.jsx("button",{type:"button",onClick:()=>{vr()},children:"Retry"})]}):k==="terminals"?yt.length||Gn.length?c.jsxs(c.Fragment,{children:[yt.map(g=>c.jsx(wc,{session:g,active:rt?.id===g.id,onClick:()=>{ri(g)}},g.id)),Gn.map(g=>c.jsx(SS,{member:g,onClick:()=>{hl(g)}},g.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."})]}):k==="screens"?lo():k==="connections"?Ti.length?Ti.map(g=>c.jsx(yS,{connection:g,onConfigure:()=>zs("ssh",{sshTarget:g.hostName??g.alias}),onConnect:()=>ul(g)},g.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."})]}):O.filter(g=>g.kind==="ssh"&&g.scope==="remote"&&g.source==="discovered").length?O.filter(g=>g.kind==="ssh"&&g.scope==="remote"&&g.source==="discovered").map(g=>c.jsx(wc,{session:g,ghosted:!0,onClick:async()=>{o(`Attaching remote screen ${g.name}…`);const B=Ee();if(B)try{const Q=(await B.buildRemoteScreenAttach?.({alias:g.host,hostName:g.host},g.screenName??g.name))?.args?.find(ye=>ye.includes("@")||!ye.startsWith("-"))??g.host,me=await B.createSshSession({target:Q,name:g.name});K(ye=>ye.map(Ce=>Ce.id===g.id?me:Ce)),ki(me),await ri(me)}catch(G){o(G instanceof Error?G.message:String(G))}}},g.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:vs,children:[c.jsx(ke,{name:"port-plus"})," Share port"]}),c.jsxs("button",{type:"button",className:"drawer-action",onClick:Us,children:[c.jsx(ke,{name:"plus"})," Local terminal ",c.jsx("kbd",{children:"⌘⇧T"})]}),c.jsxs("button",{type:"button",className:"drawer-action",onClick:()=>zs("ssh"),children:[c.jsx(ke,{name:"ssh"})," Connect SSH"]}),c.jsxs("div",{className:"drawer-status",children:[c.jsx("span",{className:"status-dot connected"}),v]})]})]}),!y&&c.jsx(Ac,{orientation:"vertical",className:"sidebar-resizer",label:"Sidebar width",valuePercent:r.sessions.sidebarWidth/Et.sidebarWidth.max*100,onDrag:Gi,onCommit:()=>Di("sessions",{sidebarWidth:r.sessions.sidebarWidth}),onNudge:g=>Di("sessions",{sidebarWidth:r.sessions.sidebarWidth+g*16}),onReset:()=>Di("sessions",{sidebarWidth:Ie.sessions.sidebarWidth})}),c.jsxs("section",{className:"workspace",children:[c.jsxs("div",{className:"workspace-head",children:[c.jsxs("div",{className:"location",children:[y&&c.jsx("button",{type:"button",className:"inline-restore",onClick:()=>R(!1),title:"Show sessions sidebar",children:c.jsx(ke,{name:"panel-left-open"})}),c.jsx("span",{className:"connection-dot"}),c.jsx("span",{children:rt?.host??"local"}),c.jsx("span",{className:"slash",children:"/"}),c.jsx("span",{children:rt?.cwd??"~"}),c.jsx("span",{className:"slash",children:"/"}),c.jsx("span",{className:"muted-text",children:rt?.name??lt?.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:Ts?"layout-button active":"layout-button",onClick:()=>cr(g=>!g),disabled:!sl.available||!Ee()?.sftpOpen,title:sl.reason,"aria-label":"Transfer files over SFTP",children:c.jsx(ke,{name:"transfer"})})]}),c.jsxs("div",{className:"layout-controls",children:[c.jsx("span",{className:"control-label",children:"LAYOUT"}),c.jsx("button",{type:"button",className:At==="stack"||Gt?"layout-button active":"layout-button",onClick:()=>ho(Rm(Bi)),title:`${Yb(Bi)} (${wi("toggle-layout",je)})`,children:c.jsx(ke,{name:"stack"})}),qb.map(({layout:g,icon:B})=>c.jsx("button",{type:"button",className:At===g&&!Gt?"layout-button active":"layout-button",onClick:()=>ho(Kb(g,Bi)),title:Vb(g,Bi),children:c.jsx(ke,{name:B})},g))]})]})]}),c.jsxs("div",{className:`${Cl} ${Gt?"maximized-pane-grid":""}`,ref:Ps,style:la,children:[oa&&c.jsx(Ac,{orientation:"vertical",className:"pane-resizer pane-resizer-column",label:"Pane column split",valuePercent:Ht*100,style:{left:`calc((100% - 1px) * ${Ht} + 0.5px)`},onDrag:g=>Cr("column",g),onCommit:()=>Di("sessions",{splitColumnRatio:Ht}),onNudge:g=>ni("column",g),onReset:()=>ai("column")}),co&&c.jsx(Ac,{orientation:"horizontal",className:"pane-resizer pane-resizer-row",label:"Pane row split",valuePercent:_i*100,style:{top:`calc((100% - 1px) * ${_i} + 0.5px)`},onDrag:g=>Cr("row",g),onCommit:()=>Di("sessions",{splitRowRatio:_i}),onNudge:g=>ni("row",g),onReset:()=>ai("row")}),Ga.map(({session:g,index:B,dormant:G})=>{const Q=Vt.sessionId===g.id&&Vt.status!=="idle"?Vt.status:null,me=gs?.indexOf(g.id)??-1,ye=gp(g),Ce=!!ye&&ss(g.id),Re=Ce?bs(g):null;return c.jsxs("article",{className:`pane terminal-pane ${G?"dormant-pane":""} ${!G&&fi===g.id?"focused":""} ${!G&&Gt===g.id?"maximized-pane":""} ${G||Xa(g,B)?"":"overflow-pane"}`,style:me>=0?{order:me}:void 0,onMouseDown:()=>gr(g.id),children:[c.jsxs("div",{className:"pane-title",children:[c.jsxs("span",{children:[c.jsx("span",{className:"pane-live"})," ",g.name]}),c.jsxs("span",{className:"pane-actions",children:[Gt&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"pane-nav",onClick:()=>ca(-1),title:"Previous session",children:c.jsx(ke,{name:"chevron-left"})}),c.jsx("button",{type:"button",className:"pane-nav",onClick:()=>ca(1),title:"Next session",children:c.jsx(ke,{name:"chevron-right"})})]}),gs&&!Gt&&Nb(Ya,kc)&&!G&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"pane-nav",onClick:()=>Za(g.id,-1),title:"Show the previous pane here","aria-label":`Show the previous pane in place of ${g.name}`,children:c.jsx(ke,{name:"chevron-left"})}),c.jsx("button",{type:"button",className:"pane-nav",onClick:()=>Za(g.id,1),title:"Show the next pane here","aria-label":`Show the next pane in place of ${g.name}`,children:c.jsx(ke,{name:"chevron-right"})})]}),w?"connecting…":Q?`${Q}…`:g.kind==="ssh"?"ssh":"bash",c.jsx("button",{type:"button",className:Ce?"pane-browse active":"pane-browse",onClick:()=>ro(g.id),disabled:!ye||$e[g.id]==="docked",title:$e[g.id]==="docked"?"The editor is docked here; close it to browse directories":ye?Ce?"Hide the directory browser":"Browse directories":"ZeroG cannot tell what kind of paths this pane uses","aria-label":`${Ce?"Hide":"Show"} the directory browser for ${g.name}`,"aria-pressed":Ce,children:c.jsx(ke,{name:"folder"})}),c.jsx("button",{type:"button",className:"pane-proceed",onClick:()=>El(g),title:`Send "${il}" and press Enter`,"aria-label":`Send "${il}" to ${g.name}`,children:c.jsx(ke,{name:"check"})}),c.jsx("button",{type:"button",className:"pane-ai",onClick:()=>wr(g),title:`Run "${Kn}" and press Enter`,"aria-label":`Run "${Kn}" in ${g.name}`,children:c.jsx(ke,{name:"bot"})}),c.jsx("button",{type:"button",className:"pane-edit",onClick:()=>Wc(g),disabled:!ye,title:ye?g.kind==="ssh"?`Edit a file on ${g.host}`:"Edit a file":"ZeroG cannot tell what kind of paths this pane uses","aria-label":`Edit a file from ${g.name}`,children:c.jsx(ke,{name:"file"})}),fo(g),$c.map(Ze=>c.jsx("button",{type:"button",className:"pane-custom",onClick:()=>Fs(g,Ze),title:Ib(Ze),"aria-label":`${Ub(Ze)}: send "${Ze.command}" to ${g.name}`,children:Ze.slot},Ze.slot)),c.jsx("button",{type:"button",className:Q?`pane-mic ${Q}`:"pane-mic",onClick:()=>{xl(g)},disabled:Vt.status!=="idle"&&!Q,title:Q==="listening"?"Stop and transcribe":Q==="transcribing"?"Transcribing…":"Voice input","aria-label":Q==="listening"?`Stop recording ${g.name}`:`Voice input for ${g.name}`,children:c.jsx(ke,{name:"mic"})}),c.jsx("button",{type:"button",className:"pane-maximize",onClick:()=>rs(g.id),title:Gt?"Restore pane":"Maximize pane",children:c.jsx(ke,{name:Gt?"restore":"maximize"})}),c.jsx("button",{type:"button",className:"pane-close",onClick:()=>{Gs(g)},title:"Close pane","aria-label":`Close ${g.name}`,children:c.jsx(ke,{name:"x"})})]})]}),_o(g),c.jsx(LS,{open:Ce||$e[g.id]==="docked",dock:$e[g.id]==="docked"?ll(g.id):null,ratio:Sr(g.id),onRatio:Ze=>ea(g.id,{ratio:Ze}),browser:ye?c.jsx(rm,{session:g,path:Re,unanchored:g.kind==="ssh",pathKind:ye,shellPath:Re?Ou(g,Re):null,list:_r(g),question:g.kind==="ssh"?pr:null,onOpen:Ze=>vl(g,Ze),onBrowse:Ze=>es(ot=>({...ot,[g.id]:Ze})),defaultShowHidden:r.sessions.showHiddenFiles,onClose:()=>ro(g.id)}):null,children:c.jsx(RS,{sessionId:g.id,focused:!G&&fi===g.id,dormant:G,onStatus:o,appearance:r.appearance,terminalSettings:r.terminal,registerFocus:Uc,registerCapture:Ji,onCommand:Kc,registerRead:Ua})})]},g.id)}),Array.from({length:Math.max(0,Fc-is.length)},(g,B)=>c.jsx(TS,{index:is.length+B+1,onCreate:Us},`placeholder-${B}`))]}),c.jsxs("footer",{className:"status-bar",children:[c.jsx("span",{children:"ZeroG"}),c.jsx("span",{className:"status-separator"}),c.jsx("span",{children:lt?.name??"Workspace"}),c.jsx("span",{className:"status-separator"}),c.jsx("span",{children:Gt?"maximized pane":At==="stack"?"1 pane":`${qa} 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:rt?`${rt.kind==="ssh"?"SSH":rt.persistence==="process"?"PROCESS":"SCREEN"} · ${rt.persistence==="process"?"non-persistent":"persistent"}`:"no connection"})]})]})]}),ia&&(()=>{const g=P.find(B=>B.id===ia.id);return g?c.jsx(iS,{at:ia.at,label:`${g.name} options`,items:Hs(g),onClose:()=>sa(null)}):null})(),Lt&&c.jsx(g0,{version:mr,bindings:je,onClose:()=>qt(!1)}),Object.entries($e).map(([g,B])=>{const G=O.find(me=>me.id===g),Q=G?gp(G):null;return!G||!Q||!Ee()?null:c.jsx(kb,{session:G,mode:B,dock:ue[g]??null,onModeChange:me=>nl(g,me),startPath:bs(G),pathKind:Q,shellPathFor:me=>Ou(G,me)??me,list:_r(G),unanchored:G.kind==="ssh",question:G.kind==="ssh"?pr:null,backend:an(G),register:me=>br(g,me),onClose:()=>al(g)},g)}),Yr&&c.jsx("div",{className:"overview-layer",role:"presentation",...rn,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:lt?.name??"Choose a session"})]}),c.jsx("button",{type:"button",className:"close-button",onClick:()=>$t(!1),children:"Esc"})]}),c.jsx("div",{className:"thumbnail-grid",children:yt.length?yt.map(g=>c.jsxs("button",{type:"button",className:`thumbnail ${rt?.id===g.id?"active":""}`,onClick:()=>{ri(g)},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:g.name}),c.jsxs("small",{children:[g.kind==="ssh"?g.host:"local screen"," · ",g.status]})]})]},g.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:()=>{$t(!1),Us()},children:"+ Local terminal"}),c.jsx("button",{type:"button",onClick:()=>{$t(!1),zs("ssh")},children:"Connect SSH"}),c.jsx("button",{type:"button",onClick:()=>{$t(!1),Ss()},children:"+ Workspace"}),c.jsx("span",{className:"overview-hint",children:"Press Esc to close"})]})]})}),et&&c.jsx("div",{className:"palette-layer",role:"presentation",...Fa,children:c.jsxs("div",{className:"palette",role:"dialog","aria-label":"Command history",children:[c.jsx("input",{autoFocus:!0,className:"palette-query",value:at,placeholder:"Search commands you have run","aria-label":"Search commands you have run",onChange:g=>{ut(g.target.value),Oe(0)},onKeyDown:g=>{if(g.key==="ArrowDown")g.preventDefault(),Oe(B=>Math.min(B+1,Math.max(0,Qn.length-1)));else if(g.key==="ArrowUp")g.preventDefault(),Oe(B=>Math.max(0,B-1));else if(g.key==="Enter"){g.preventDefault();const B=Qn[Tt];B&&Jt(B)}}}),r.ai.recordCommands?Ue.length?Qn.length?c.jsx("div",{className:"palette-list",children:Qn.map((g,B)=>c.jsxs("button",{type:"button",className:`palette-row ${B===Tt?"active":""}`,onMouseEnter:()=>Oe(B),onClick:()=>Jt(g),children:[c.jsx("span",{className:"palette-command",children:kS(g.entry.command,g.matched)}),c.jsxs("span",{className:"palette-meta",children:[g.entry.exitCode!==void 0&&g.entry.exitCode!==0?c.jsx("span",{className:"palette-failed",title:`Exited ${g.entry.exitCode}`,children:"failed"}):null,g.entry.cwd?c.jsx("span",{className:"palette-cwd",children:g.entry.cwd}):null]})]},g.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:()=>{Te(!1),_s(!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:()=>{Te(!1),_s(!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."})]})}),Ae&&c.jsx("div",{className:"history-layer",role:"presentation",...Ic,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:()=>We(!1),"aria-label":"Close history",children:"×"})]}),Ds.length?Ds.slice().sort((g,B)=>B.timestamp.localeCompare(g.timestamp)).map(g=>c.jsxs("button",{type:"button",className:"history-item",onClick:async()=>{We(!1);const B=Mu(g.session,O,Ti);U(g.session.screenName||g.session.backend==="screen"?"screens":"terminals");const G=await Zn(B);G&&o(`Reconnected ${G.name}`)},children:[c.jsxs("span",{className:"history-main",children:[c.jsx("span",{className:"history-kind",children:g.event.toUpperCase()}),c.jsxs("span",{className:"history-text",children:[c.jsx("b",{children:g.session.name}),c.jsxs("small",{children:[g.session.host," · ",g.available?"available":"unavailable"]})]})]}),c.jsx("button",{type:"button",className:"history-remove","aria-label":"Remove history entry",onClick:B=>{B.stopPropagation(),Ee()?.removeHistory(g.id).then(()=>en(G=>G.filter(Q=>Q.id!==g.id))).catch(()=>{})},children:"×"})]},g.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."})]})}),dt&&c.jsx("div",{className:"modal-layer",role:"presentation",...Bs,children:c.jsxs("form",{className:"modal-card",onSubmit:dt==="workspace"?Gc:dt==="rename"?aa:dt==="forward"?ln:dt==="local"?Yn:cl,children:[c.jsxs("div",{className:"modal-head",children:[c.jsxs("div",{children:[c.jsx("span",{className:"eyebrow",children:Nu(dt).eyebrow}),c.jsx("h2",{children:Nu(dt).title})]}),c.jsx("button",{type:"button",className:"close-button",onClick:()=>Mt(null),children:"Esc"})]}),Hp(dt)&&c.jsx("div",{className:"dialog-tabs",role:"tablist","aria-label":"Session type",children:An.map(g=>c.jsxs("button",{type:"button",id:`session-tab-${g.kind}`,role:"tab","aria-selected":dt===g.kind,"aria-controls":"session-dialog-panel",tabIndex:dt===g.kind?0:-1,disabled:w,className:`dialog-tab ${dt===g.kind?"active":""}`,onClick:()=>Mt(g.kind),onKeyDown:B=>{const G=Wb(g.kind,B.key);G&&(B.preventDefault(),Mt(G),document.getElementById(`session-tab-${G}`)?.focus())},children:[c.jsx("b",{children:g.label}),c.jsx("small",{children:g.hint})]},g.kind))}),dt==="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:Fi,pattern:Ec,onChange:g=>xi(g.target.value)})]})]}),dt==="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:Fi,onChange:g=>xi(g.target.value),pattern:Ec,required:!0})]})]}),dt==="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:W,onChange:g=>j(g.target.value),placeholder:"user@server",required:!0}),c.jsx("datalist",{id:"forward-hosts",children:ml.map(g=>c.jsx("option",{value:g},g))})]}),c.jsxs("label",{children:["Port",c.jsx("input",{value:ge,onChange:g=>J(g.target.value),inputMode:"numeric",pattern:"[0-9]{1,5}",placeholder:"3000",required:!0})]}),c.jsx("button",{type:"button",className:"dialog-disclosure",onClick:()=>Ne(g=>!g),"aria-expanded":xe,children:xe?"Fewer options":"More options"}),xe&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["Direction",c.jsxs("select",{value:F,onChange:g=>ie(g.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:_e,onChange:g=>we(g.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:q,onChange:g=>ne(g.target.value),inputMode:"numeric",pattern:"[0-9]{1,5}",placeholder:ge||"3000"})]}),c.jsxs("label",{className:"dialog-check",children:[c.jsx("input",{type:"checkbox",checked:te==="all",onChange:g=>de(g.target.checked?"all":"loopback")}),"Share on my network, not just this machine"]}),te==="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","."]})]})]}),Hp(dt)&&c.jsxs("div",{id:"session-dialog-panel",role:"tabpanel","aria-labelledby":`session-tab-${dt}`,children:[dt==="local"&&c.jsxs(c.Fragment,{children:[c.jsxs("p",{children:["Start a local session inside “",lt?.name??"this workspace","”."]}),c.jsxs("label",{children:["Terminal name",c.jsx("input",{autoFocus:!0,value:ka,onChange:g=>Oa(g.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:Qi,onChange:g=>{const B=g.target.value;Xo(B)},children:hr.length?hr.map(g=>c.jsx("option",{value:g.backend,children:g.label},g.backend)):c.jsx("option",{value:"bash",children:"bash"})})]}),Qi==="wsl"&&c.jsxs("label",{children:["WSL distribution",c.jsx("input",{value:si,onChange:g=>Qr(g.target.value),placeholder:"Ubuntu"})]})]}),dt==="ssh"&&c.jsxs(c.Fragment,{children:[c.jsxs("p",{children:["Connect a remote host into “",lt?.name??"this workspace","”."]}),c.jsxs("label",{children:["SSH target",c.jsx("input",{autoFocus:!0,value:Wi,onChange:g=>Qa(g.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:kn,onChange:g=>{On.current=!0,Xr(g.target.value)},placeholder:"server"})]})]})]}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>Mt(null),children:"Cancel"}),c.jsx("button",{className:"primary-button",disabled:w,type:"submit",children:w?"Working…":Nu(dt).submit})]})]})}),Ts&&rt&&Vn&&Ee()&&c.jsx(k0,{session:rt,target:Vn,api:Ee(),onClose:()=>cr(!1),backdrop:Wn,defaultShowHidden:r.sessions.showHiddenFiles},rt.id),Ri&&c.jsx(xb,{settings:r,onChange:Di,onReset:Pc,onClose:()=>_s(!1),backdrop:Wa,backends:hr,wslDistributions:Zo,speechTest:Nn,onSpeechTest:()=>{ua()},speechKey:ui,onSpeechKeySave:g=>{wl(g)},onSpeechKeyClear:()=>{Ft()},commandHistory:Vc,onCopySnippet:g=>{Ee()?.copyText?.(g).then(()=>o("Shell integration snippet copied.")).catch(()=>{})},onClearCommandHistory:()=>{on()},aiKey:ja,onAiKeySave:g=>{gt(g)},onAiKeyClear:()=>{Ve()},aiModels:Hc,onAiModelsRefresh:()=>{pl()},aiTest:Zr,onAiTest:()=>{to()},mcpStatus:a,mcpInfo:S,onMcpStart:()=>{Ee()?.startMcp?.().then(g=>{T(g),o("MCP enabled")}).catch(g=>o(ii(g)))},onMcpStop:()=>{Ee()?.stopMcp?.().then(()=>{T(null),o("MCP disabled")}).catch(g=>o(ii(g)))},onMcpCopyToken:()=>{S&&Ee()?.copyText?.(S.token).then(()=>o("MCP bearer token copied."))}}),ci&&c.jsx("div",{className:"modal-layer",role:"presentation",...nn,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:()=>$s(),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:ci.text}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>$s(),children:"Discard"}),c.jsx("button",{type:"button",className:"primary-button",onClick:()=>{Ee()?.write(ci.sessionId,ci.text),o(`Voice: "${ci.text}"`),$s()},children:"Insert"})]})]})}),I&&c.jsx("div",{className:"modal-layer",role:"presentation",children:c.jsxs("form",{className:"modal-card approval-card",onSubmit:g=>{g.preventDefault();const B=new FormData(g.currentTarget).get("answer"),G=Ee();N(null),G?.answerForwardPrompt?.(I.forwardId,String(B??"")).catch(Q=>{o(ii(Q))})},children:[c.jsx("div",{className:"modal-head",children:c.jsxs("div",{children:[c.jsx("span",{className:"eyebrow",children:"SHARED PORT"}),c.jsx("h2",{children:I.kind==="confirm"?"Accept this host key?":"The host is asking"})]})}),c.jsx("code",{children:I.text}),c.jsxs("label",{children:[I.kind==="confirm"?"Type yes, no, or the fingerprint":"Answer",c.jsx("input",{autoFocus:!0,name:"answer",type:I.kind==="confirm"?"text":"password",autoComplete:"off"})]}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>{const g=I.forwardId;N(null),Ee()?.closeForward?.(g).catch(()=>{}),re(B=>B.map(G=>G.id===g?{...G,status:"idle"}:G))},children:"Cancel"}),c.jsx("button",{className:"primary-button",type:"submit",children:"Send"})]})]})}),Ke&&c.jsx("div",{className:"modal-layer",role:"presentation",...Fn,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:Ke.phase==="reviewing"?"eyebrow warning-text":"eyebrow",children:Ke.phase==="reviewing"?"APPROVAL REQUIRED":"AI SUGGESTION"}),c.jsx("h2",{children:Ke.phase==="asking"?"What would you like to do?":Ke.phase==="thinking"?"Asking the model…":Ke.phase==="failed"?"No suggestion":"Run this command?"})]}),c.jsx("button",{type:"button",className:"close-button",onClick:()=>{Ee()?.cancelAiRequest?.(),Dt(null)},children:"Esc"})]}),Ke.phase==="asking"&&c.jsxs("form",{onSubmit:g=>{g.preventDefault();const B=String(new FormData(g.currentTarget).get("prompt")??"").trim();B&&fl(B)},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"})]})]}),Ke.phase==="thinking"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{children:Ke.prompt}),c.jsx("p",{className:"muted-text",children:Ke.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:()=>{Ee()?.cancelAiRequest?.(),Dt(null)},children:"Cancel"})})]}),Ke.phase==="reviewing"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{children:Ke.suggestion.explanation}),Ke.suggestion.command?c.jsx("code",{children:Ke.suggestion.command}):null,Ke.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"}),Ke.suggestion.command?c.jsx("button",{type:"button",className:"primary-button",onClick:_l,children:"Run"}):c.jsx("button",{type:"button",onClick:()=>Dt(zu(Ke.sessionId)),children:"Ask again"})]})]}),Ke.phase==="failed"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{children:Ke.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(zu(Ke.sessionId)),children:"Try again"})]})]})]})})]})}function kS(r,C){if(!C.length)return r;const E=new Set(C),M=[];let O="",K=E.has(0);for(let P=0;P<r.length;P+=1){const n=E.has(P);n!==K&&O&&(M.push(K?c.jsx("b",{children:O},P):O),O=""),K=n,O+=r.charAt(P)}return O&&M.push(K?c.jsx("b",{children:O},"tail"):O),M}function OS(r,C){const E=r.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,24)||"term",M=new Set(C.map(K=>K.name.toLowerCase()));if(!M.has(E))return E;let O=2;for(;M.has(`${E}-${O}`);)O+=1;return`${E}-${O}`}Yg.createRoot(document.getElementById("root")).render(c.jsx(DS,{}));
|